4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 import React from 'react';
21 import Loader from 'widgets/loading-indicator/loadingIndicator.jsx';
22 import LaunchpadFleetStore from '../launchpadFleetStore.js';
25 export default class managementInterfaces extends React.Component {
29 componentWillReceiveProps(nextProps) {
33 openConsole = (url, event) => {
34 event.preventDefault();
35 LaunchpadFleetStore.getVDUConsoleLink(url);
41 let isDisplayed = this.props.display;
44 let applicationDashboards = this.props.interfaces.sort(function(a,b) {
46 if ((a["short-name"] + '-' + a.id.substr(0,4)) > (b["short-name"] + '-' + b.id.substr(0,4))) {
55 if(applicationDashboards.length > 0){
56 status = applicationDashboards.map(function(i, index) {
57 let mgmtLink = i["dashboard-url"] ? i["dashboard-url"] : 'None';
59 <li key={index}><h3>{i["short-name"] + '-' + i.id.substr(0,4)}</h3><a href={i["dashboard-url"]} target="_blank">{mgmtLink}</a></li>
63 status = <li>No Application Dashboard Links have been specified.</li>
71 let consoleLinks = this.props.consoleUrls && this.props.consoleUrls.sort(function(a,b) {
73 if ((a["name"] + '-' + a.id.substr(0,4)) > (b["name"] + '-' + b.id.substr(0,4))) {
82 if(consoleLinks && consoleLinks.length > 0){
83 status = consoleLinks.map(function(i, index) {
84 let consoleLink = i["console-url"] ? 'Obtain Token And Open VM Console' : 'None';
86 <li key={index}><h3>{i["name"] + '-' + i.id.substr(0,4)}</h3><span className='consoleLink' onClick={self.openConsole.bind(self, i["console-url"])}>{consoleLink} *</span></li>
89 notice = <li className='notice'>* If a separate browser window does not open, please check if the popup was blocked and allow it.</li>
91 status = <li>No VDU Console Links have been specified.</li>
101 <div className={this.props.className + (isDisplayed ? '_open':'_close')}>
103 Application Dashboard Links
114 managementInterfaces.defaultProps = {