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 fossInfoComponent = (
66 <div className="table-container">
72 <a target="_blank" href='https://open.riftio.com/open-source-software-usage/'>
73 Click here for FOSS Info (requires Internet connection)
82 var uptimeComponent = (
83 <div className="table-container">
84 <h2> Uptime Info </h2>
92 <UpTime initialTime={uptime} run={true} />
102 for (let i = 0; this.state && this.state.list && i < this.state.list.vcs.components.component_info.length; i++) {
103 var node = this.state.list.vcs.components.component_info[i];
107 {node.component_name}
110 {node.component_type}
120 if (this.state != null) {
122 <div className="table-container-wrapper">
125 <div className="table-container">
126 <h2> Version Info </h2>
144 {this.state.list ? this.state.list.version.build_sha : null}
147 {this.state.list ? this.state.list.version.version : null}
150 {this.state.list ? this.state.list.version.build_date : null}
156 <div className="table-container">
157 <h2> Component Info </h2>
183 <div className="about-container">
189 export default About;