6 import React from 'react';
7 import AppHeader from '../../components/header/header.jsx';
8 import ConfigAgentAccount from './configAgentAccount.jsx';
9 import ConfigAgentAccountStore from './configAgentAccountStore';
10 import AccountSidebar from '../account_sidebar/accountSidebar.jsx';
12 export default class LaunchpadConfigAgentAccount extends React.Component {
15 this.state = ConfigAgentAccountStore.getState();
16 ConfigAgentAccountStore.getCatalog();
17 ConfigAgentAccountStore.listen(this.updateState);
19 ConfigAgentAccountStore.getConfigAgentAccount(window.location.hash.split('/')[4])
21 this.state.isLoading = false;
24 updateState = (state) => {
27 loadComposer = () => {
28 let API_SERVER = rw.getSearchParams(window.location).api_server;
29 let auth = window.sessionStorage.getItem("auth");
30 let mgmtDomainName = window.location.hash.split('/')[2];
31 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);
36 let title = "Launchpad: Add Config Agent Account";
37 let mgmtDomainName = window.location.hash.split('/')[2];
38 if (this.props.edit) {
39 title = "Launchpad: Edit Config Agent Account";
43 href: '#/launchpad/' + mgmtDomainName
45 name: 'CATALOG(' + this.state.descriptorCount + ')',
46 'onClick': this.loadComposer
52 if (this.props.isDashboard) {
53 body = (<div>Edit or Create New Accounts</div>);
55 body = <ConfigAgentAccount {...this.props} />
58 <AppHeader title={title} nav={navItems} isLoading={this.state.isLoading} />
59 <div className="flex">