3 * Copyright 2016 RIFT.IO Inc
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 import React from 'react';
19 import './about.scss';
20 import UpTime from 'widgets/uptime/uptime.jsx';
21 import AppHeader from 'widgets/header/header.jsx';
22 var aboutActions = require('./aboutActions.js');
23 var aboutStore = require('./aboutStore.js');
24 //var MissionControlStore = require('./missionControlStore.js');
25 class About extends React.Component {
29 this.state = aboutStore.getState();
30 aboutStore.listen(this.listenerUpdate);
32 aboutStore.createTime();
34 componentWillUnmount() {
35 aboutStore.listen(this.listenerUpdate);
37 listenerUpdate = (data) => {
43 if (data.createTime) {
44 // Required cause backend won't provide a create-time
45 let createTime = (data.createTime) ? Math.floor((new Date() / 1000)) - parseInt(data.createTime) : null;
47 createTime: createTime
50 if (data.descriptorCount) {
52 descriptorCount: data.descriptorCount
58 let refPage = window.sessionStorage.getItem('refPage') || '{}';
59 refPage = JSON.parse(refPage);
61 let mgmtDomainName = window.location.hash.split('/')[2];
62 // If in the mission control, create an uptime table;
63 var uptime = this.state.createTime && this.state.createTime;
65 var uptimeComponent = (
66 <div className="table-container">
67 <h2> Uptime Info </h2>
75 <UpTime initialTime={uptime} run={true} />
85 for (let i = 0; this.state && this.state.list && i < this.state.list.vcs.components.component_info.length; i++) {
86 var node = this.state.list.vcs.components.component_info[i];
103 if (this.state != null) {
105 <div className="table-container-wrapper">
107 <div className="table-container">
108 <h2> Version Info </h2>
126 {this.state.list ? this.state.list.version.build_sha : null}
129 {this.state.list ? this.state.list.version.version : null}
132 {this.state.list ? this.state.list.version.build_date : null}
138 <div className="table-container">
139 <h2> Component Info </h2>
165 <div className="about-container">
171 export default About;