/* 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, ProgressBar, Tabs, Tab, Switch, } from 'react-mdl'; import { HeaderTitle, ExternalIconLink } 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 ClientApplications extends PureComponent { constructor (props) { super(props); this.state = { activeTab: 0 }; } componentDidMount () { this.props.fetchApplication(this.props.appName); } render () { if (!this.props.application) { return ; } const { application, storeApplicationMetaData, } = this.props; const { appName, instances, strategies, seenToggles, url, description, icon = 'apps', color, } = application; const content = this.state.activeTab === 0 ? (
Toggles

{seenToggles.map(({ name, description, enabled, notFound }, i) => notFound ? {name} : } subtitle={description}> {name} )}
Implemented strategies

{strategies.map(({ name, description, notFound }, i) => ( notFound ? {name} : {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)} />
); return (
{appName}} subtitle={description} actions={url && Visit site} /> this.setState({ activeTab: tabId })} ripple> Metrics Edit {content}
); } } export default ClientApplications;