X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Fssh_keys%2FsshKeys.jsx;fp=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Fssh_keys%2FsshKeys.jsx;h=1676cff9143b86d1d33bdcde97b7eb7d6cc15624;hp=0000000000000000000000000000000000000000;hb=e29efc315df33d546237e270470916e26df391d6;hpb=9c5e457509ba5a1822c316635c6308874e61b4b9 diff --git a/skyquake/plugins/launchpad/src/ssh_keys/sshKeys.jsx b/skyquake/plugins/launchpad/src/ssh_keys/sshKeys.jsx new file mode 100644 index 000000000..1676cff91 --- /dev/null +++ b/skyquake/plugins/launchpad/src/ssh_keys/sshKeys.jsx @@ -0,0 +1,75 @@ +/* + * + * Copyright 2016 RIFT.IO Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +import React, {Component} from 'react'; +import DashboardCard from 'widgets/dashboard_card/dashboard_card.jsx' +import SshKeyCard from './sshKeyCard.jsx'; +import SshKeyStore from './sshKeyStore.js'; +import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; +import '../../node_modules/open-iconic/font/css/open-iconic.css'; +import 'style/base.scss'; + + +class SshKeys extends Component { + constructor(props) { + super(props); + this.Store = this.props.flux.stores.hasOwnProperty('SshKeyStore') ? this.props.flux.stores.SshKeyStore : this.props.flux.createStore(SshKeyStore); + this.state = this.Store.getState(); + this.Store.listen(this.handleUpdate); + } + componentWillMount() { + this.Store.getSshKey(); + } + componentWillUnmount() { + this.Store.unlisten(this.handleUpdate); + } + handleUpdate = (state) => { + this.setState(state) + } + render() { + let self = this; + let Store = self.Store; + // return
test
+ return ( +
+ { + self.state.data && self.state.data.keys.map(function(k, i) { + let sshKey = self.state.data.entities[k]; + return ( + + ) + }) + } + +
+ ) + } +} + +export default SkyquakeComponent(SshKeys);