2 * Copyright 2016 RIFT.IO Inc
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 import React from 'react';
23 import AppHeader from '../../components/header/header.jsx';
24 import ConfigAgentAccount from './configAgentAccount.jsx';
25 import ConfigAgentAccountStore from './configAgentAccountStore';
26 import AccountSidebar from '../account_sidebar/accountSidebar.jsx';
28 export default class LaunchpadConfigAgentAccount extends React.Component {
31 this.state = ConfigAgentAccountStore.getState();
32 ConfigAgentAccountStore.getCatalog();
33 ConfigAgentAccountStore.listen(this.updateState);
35 ConfigAgentAccountStore.getConfigAgentAccount(window.location.hash.split('/')[4])
37 this.state.isLoading = false;
40 updateState = (state) => {
43 loadComposer = () => {
44 let API_SERVER = rw.getSearchParams(window.location).api_server;
45 let auth = window.sessionStorage.getItem("auth");
46 let mgmtDomainName = window.location.hash.split('/')[2];
47 window.location.replace('//' + window.location.hostname + ':9000/index.html?api_server=' + API_SERVER + '&upload_server=' + window.location.protocol + '//' + window.location.hostname + '&clearLocalStorage' + '&mgmt_domain_name=' + mgmtDomainName + '&auth=' + auth);
52 let title = "Launchpad: Add Config Agent Account";
53 let mgmtDomainName = window.location.hash.split('/')[2];
54 if (this.props.edit) {
55 title = "Launchpad: Edit Config Agent Account";
59 href: '#/launchpad/' + mgmtDomainName
61 name: 'CATALOG(' + this.state.descriptorCount + ')',
62 'onClick': this.loadComposer
68 if (this.props.isDashboard) {
69 body = (<div>Edit or Create New Accounts</div>);
71 body = <ConfigAgentAccount {...this.props} />
74 <AppHeader title={title} nav={navItems} isLoading={this.state.isLoading} />
75 <div className="flex">