/* eslint react/no-multi-comp:off */
import React, { Component, PureComponent } from 'react';
import { Link } from 'react-router';
import { Grid, Cell, List, ListItem, ListItemContent, Textfield, Icon } from 'react-mdl';
import { HeaderTitle } from '../common';
class StatefulTextfield extends Component {
constructor (props) {
super(props);
this.state = { value: props.value };
this.setValue = function setValue (e) {
this.setState({ value: e.target.value });
}.bind(this);
}
render () {
return (
);
}
}
class ClientStrategies extends PureComponent {
componentDidMount () {
this.props.fetchApplication(this.props.appName);
}
render () {
if (!this.props.application) {
return
Loading application info...
;
}
const {
application,
storeApplicationMetaData,
} = this.props;
const {
appName,
instances,
strategies,
seenToggles,
url,
description,
icon = 'apps',
color,
} = application;
return (
{appName}} subtitle={description} />
Toggles
{seenToggles.map((name, i) =>
{name}
)}
|
Implemented strategies
{strategies.map((name, i) => (
{name}
))}
|
{instances.length} Instances connected
{instances.map(({ instanceId, clientIp, lastSeen }, i) => (
{clientIp} last seen at {new Date(lastSeen).toLocaleString('nb-NO')}
}>
{instanceId}
))}
|
Edit app meta data
|
storeApplicationMetaData(appName, 'url', e.target.value)} />
storeApplicationMetaData(appName, 'description', e.target.value)} />
|
storeApplicationMetaData(appName, 'icon', e.target.value)} />
storeApplicationMetaData(appName, 'color', e.target.value)} />
|
);
}
}
export default ClientStrategies;