import React from 'react';
import { Link } from 'react-router';
import DashboardCard from 'widgets/dashboard_card/dashboard_card.jsx';
import LaunchpadFleetActions from'../launchpadFleetActions';
import LaunchpadFleetStore from '../launchpadFleetStore';
import UpTime from 'widgets/uptime/uptime.jsx';
/*
* TODO: Handle when page is loading. See recordView for ref
*/
/*
* key - NSR property name
* label - Text to display for the header column label
* colClass - class to add for rendering this column
* transform: function to call to display the value for the property
*/
const FIELD_KEYS = [
{
// was using 'short-name'
key: 'name',
label: 'NS Name',
colClass: 'nsColNsName',
transform: function(nsr, key) {
let val = nsr[key];
let title = '"' + val + '" Click to open the viewport dashboard.';
let sdnpresent = nsr['sdn-account'] ? true: false;
return (
{val}
)
}
},
{
key: 'nsd_name',
label: 'nsd',
colClass: 'nsColNsdName',
transform: function(nsr, key) {
let val=nsr[key];
return (
{val}
);
}
},
{
key: 'operational-status',
label: 'Status',
colClass: 'nsColStatus',
transform: function(nsr, key, isLoading) {
let val = null;
if(isLoading) {
if (nsr['operational-status'] == 'running') {
if(nsr['config-status'] == 'configuring') {
val = 'Configuring'
} else {
val = 'Configuration Failed'
}
} else {
val = nsr['operational-status'];
}
} else {
val = 'Active'
}
return (
{val});
}
},
{
key: 'create-time',
label: 'Uptime',
colClass: 'nsColUptime',
transform: function(nsr, key) {
let val = nsr[key];
return ();
}
}
];
/*
* Render the network service grid header row
*/
class NsListHeader extends React.Component {
render() {
const {fieldKeys, ...props} = this.props;
return (