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';
23 export default class managementInterfaces extends React.Component {
27 componentWillReceiveProps(nextProps) {
33 let isDisplayed = this.props.display;
35 let applicationDashboards = this.props.interfaces.sort(function(a,b) {
37 if ((a["short-name"] + '-' + a.id.substr(0,4)) > (b["short-name"] + '-' + b.id.substr(0,4))) {
46 if(applicationDashboards.length > 0){
47 status = applicationDashboards.map(function(i, index) {
48 let mgmtLink = i["dashboard-url"] ? i["dashboard-url"] : 'None';
50 <li key={index}><h3>{i["short-name"] + '-' + i.id.substr(0,4)}</h3><a href={i["dashboard-url"]} target="_blank">{mgmtLink}</a></li>
54 status = <li>No Application Dashboard Links have been specified.</li>
62 let consoleLinks = this.props.consoleUrls && this.props.consoleUrls.sort(function(a,b) {
64 if ((a["name"] + '-' + a.id.substr(0,4)) > (b["name"] + '-' + b.id.substr(0,4))) {
73 if(consoleLinks && consoleLinks.length > 0){
74 status = consoleLinks.map(function(i, index) {
75 let consoleLink = i["console-url"] ? 'Open VM Console' : 'None';
77 <li key={index}><h3>{i["name"] + '-' + i.id.substr(0,4)}</h3><a href={i["console-url"]} target="_blank">{consoleLink}</a></li>
81 status = <li>No VDU Console Links have been specified.</li>
90 <div className={this.props.className + (isDisplayed ? '_open':'_close')}>
92 Application Dashboard Links
103 managementInterfaces.defaultProps = {