1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
This commit is contained in:
sveisvei 2016-12-14 12:50:23 +01:00
parent 1195cd84ca
commit 4530f37a14
11 changed files with 42 additions and 27 deletions

View File

@ -114,9 +114,9 @@ export default class App extends Component {
{createListItem('/history', 'Event history', 'history')}
{createListItem('/archive', 'Archived toggles', 'archive')}
{createListItem('/applications', 'Applications', 'apps')}
{/*createListItem('/metrics', 'Client metrics')*/}
{/*createListItem('/client-strategies', 'Client strategies')*/}
{/*createListItem('/client-instances', 'Client instances')*/}
{/* createListItem('/metrics', 'Client metrics')*/}
{/* createListItem('/client-strategies', 'Client strategies')*/}
{/* createListItem('/client-instances', 'Client instances')*/}
</Navigation>
</Drawer>
<Content>
@ -139,9 +139,9 @@ export default class App extends Component {
<FooterDropDownSection title="Metrics">
<FooterLinkList>
{createListItem('/applications', 'Applications')}
{/*createListItem('/metrics', 'Client metrics')*/}
{/*createListItem('/client-strategies', 'Client strategies')*/}
{/*createListItem('/client-instances', 'Client instances')*/}
{/* createListItem('/metrics', 'Client metrics')*/}
{/* createListItem('/client-strategies', 'Client strategies')*/}
{/* createListItem('/client-instances', 'Client instances')*/}
</FooterLinkList>
</FooterDropDownSection>
<FooterDropDownSection title="Clients">

View File

@ -69,7 +69,7 @@ class ClientApplications extends PureComponent {
<hr />
<List>
{seenToggles.map(({ name, description, enabled, notFound }, i) =>
notFound ?
(notFound ?
<ListItem twoLine key={i}>
<ListItemContent icon={'report'} subtitle={'Missing, want to create?'}>
<Link to={`/features/create?name=${name}`}>
@ -84,7 +84,8 @@ class ClientApplications extends PureComponent {
{name}
</Link>
</ListItemContent>
</ListItem>)}
</ListItem>)
)}
</List>
</Cell>
<Cell col={3}>
@ -148,7 +149,6 @@ class ClientApplications extends PureComponent {
</Grid>);
return (
<div>
<HeaderTitle title={<span><Icon name={icon} /> {appName}</span>} subtitle={description}

View File

@ -22,14 +22,14 @@ class ClientStrategies extends Component {
rows={source}
selectable={false}
>
<TableHeader name="instanceId">Instance ID</TableHeader>
<TableHeader name="appName">Application name</TableHeader>
<TableHeader name="clientIp">IP</TableHeader>
<TableHeader name="createdAt">Created</TableHeader>
<TableHeader name="lastSeen">Last Seen</TableHeader>
</DataTable>
);
}

View File

@ -30,7 +30,9 @@ const Feature = ({
<div style={{ width: '40px', textAlign: 'center' }}>
{
isStale ?
<Icon style={{ width: '25px', marginTop: '4px', fontSize: '25px', color: '#ccc' }} name="report problem" title="No metrics avaiable" /> :
<Icon
style={{ width: '25px', marginTop: '4px', fontSize: '25px', color: '#ccc' }}
name="report problem" title="No metrics avaiable" /> :
<div>
<Progress strokeWidth={15} percentage={percent} width="50" />
</div>

View File

@ -154,7 +154,12 @@ class StrategyConfigure extends React.Component {
}
<CardMenu style={{ color: '#fff' }}>
<Link title="View / Edit stratgy" to={`/strategies/view/${name}`} style={{ color: '#fff', display: 'inline-block', verticalAlign: 'bottom', marginRight: '5px' }}><Icon name="edit" /></Link>
<Link
title="View / Edit stratgy"
to={`/strategies/view/${name}`}
style={{ color: '#fff', display: 'inline-block', verticalAlign: 'bottom', marginRight: '5px' }}>
<Icon name="edit" />
</Link>
<IconButton title="Remove strategy from toggle" name="delete" onClick={this.handleRemove} />
</CardMenu>
</Card>

View File

@ -66,7 +66,6 @@ const MetricTab = ({ metrics, featureToggle, toggleFeature }) => {
</Cell>
</Grid>
</div>);
};
class EditFeatureToggleWrapper extends React.Component {
@ -144,7 +143,11 @@ class EditFeatureToggleWrapper extends React.Component {
return (
<div>
<h4>{featureToggle.name} <small>{featureToggle.enabled ? 'is enabled' : 'is disabled'}</small> <small style={{ float: 'right', lineHeight: '38px' }}>Created {(new Date(featureToggle.createdAt)).toLocaleString('nb-NO')}</small></h4>
<h4>{featureToggle.name} <small>{featureToggle.enabled ? 'is enabled' : 'is disabled'}</small>
<small style={{ float: 'right', lineHeight: '38px' }}>
Created {(new Date(featureToggle.createdAt)).toLocaleString('nb-NO')}
</small>
</h4>
<div>{featureToggle.description}</div>
<Tabs activeTab={this.state.activeTab}
onChange={(tabId) => this.setState({ activeTab: tabId })}

View File

@ -1,5 +1,4 @@
import React, { PropTypes, PureComponent } from 'react';
import { Icon } from 'react-mdl';
import style from './history.scss';

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import HistoryItemDiff from './history-item-diff';
import HistoryItemJson from './history-item-json';
import { Table, TableHeader, Icon } from 'react-mdl';
import { Table, TableHeader } from 'react-mdl';
import { HeaderTitle, SwitchWithLabel } from '../common';
import style from './history.scss';

View File

@ -22,7 +22,11 @@ class HistoryListToggle extends Component {
return (
<ListComponent
history={history}
title={<span>Showing history for toggle: <Link to={`/features/edit/${toggleName}`}><strong>{toggleName}</strong></Link></span>}/>
title={
<span>Showing history for toggle: <Link to={`/features/edit/${toggleName}`}>
<strong>{toggleName}</strong>
</Link>
</span>}/>
);
}
}

View File

@ -20,10 +20,13 @@ class StrategiesListComponent extends Component {
return (
<div>
<HeaderTitle title="Strategies"
actions={<IconButton raised name="add" onClick={() => this.context.router.push('/strategies/create')} title="Add new strategy" />} />
actions={
<IconButton raised
name="add"
onClick={() => this.context.router.push('/strategies/create')}
title="Add new strategy" />} />
<List>
{strategies.length > 0 ? strategies.map((strategy, i) => {
return (
{strategies.length > 0 ? strategies.map((strategy, i) => (
<ListItem key={i} twoLine>
<ListItemContent icon="extension" subtitle={strategy.description}>
<Link to={`/strategies/view/${strategy.name}`}>
@ -32,8 +35,7 @@ class StrategiesListComponent extends Component {
</ListItemContent>
<IconButton name="delete" onClick={() => removeStrategy(strategy)} />
</ListItem>
);
}) : <ListItem>No entries</ListItem>}
)) : <ListItem>No entries</ListItem>}
</List>
</div>
);

View File

@ -41,13 +41,13 @@ ReactDOM.render(
<Route pageTitle="New" path="/features/create" component={CreateFeatureToggle} />
<Route pageTitle=":name" path="/features/edit/:name" component={EditFeatureToggle} />
</Route>
<Route pageTitle="Strategies" link="/strategies">
<Route pageTitle="Strategies" path="/strategies" component={Strategies} />
<Route pageTitle="New" path="/strategies/create" component={CreateStrategies} />
<Route pageTitle=":strategyName" path="/strategies/view/:strategyName" component={StrategyView} />
</Route>
<Route pageTitle="History" link="/history">
<Route pageTitle="History" path="/history" component={HistoryPage} />
<Route pageTitle=":toggleName" path="/history/:toggleName" component={HistoryTogglePage} />
@ -58,7 +58,7 @@ ReactDOM.render(
<Route pageTitle="Applications" path="/applications" component={Applications} />
<Route pageTitle=":name" path="/applications/:name" component={ApplicationView} />
</Route>
</Route>
</Router>
</Provider>, document.getElementById('app'));