1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +02: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('/history', 'Event history', 'history')}
{createListItem('/archive', 'Archived toggles', 'archive')} {createListItem('/archive', 'Archived toggles', 'archive')}
{createListItem('/applications', 'Applications', 'apps')} {createListItem('/applications', 'Applications', 'apps')}
{/*createListItem('/metrics', 'Client metrics')*/} {/* createListItem('/metrics', 'Client metrics')*/}
{/*createListItem('/client-strategies', 'Client strategies')*/} {/* createListItem('/client-strategies', 'Client strategies')*/}
{/*createListItem('/client-instances', 'Client instances')*/} {/* createListItem('/client-instances', 'Client instances')*/}
</Navigation> </Navigation>
</Drawer> </Drawer>
<Content> <Content>
@ -139,9 +139,9 @@ export default class App extends Component {
<FooterDropDownSection title="Metrics"> <FooterDropDownSection title="Metrics">
<FooterLinkList> <FooterLinkList>
{createListItem('/applications', 'Applications')} {createListItem('/applications', 'Applications')}
{/*createListItem('/metrics', 'Client metrics')*/} {/* createListItem('/metrics', 'Client metrics')*/}
{/*createListItem('/client-strategies', 'Client strategies')*/} {/* createListItem('/client-strategies', 'Client strategies')*/}
{/*createListItem('/client-instances', 'Client instances')*/} {/* createListItem('/client-instances', 'Client instances')*/}
</FooterLinkList> </FooterLinkList>
</FooterDropDownSection> </FooterDropDownSection>
<FooterDropDownSection title="Clients"> <FooterDropDownSection title="Clients">

View File

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

View File

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

View File

@ -30,7 +30,9 @@ const Feature = ({
<div style={{ width: '40px', textAlign: 'center' }}> <div style={{ width: '40px', textAlign: 'center' }}>
{ {
isStale ? 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> <div>
<Progress strokeWidth={15} percentage={percent} width="50" /> <Progress strokeWidth={15} percentage={percent} width="50" />
</div> </div>

View File

@ -154,7 +154,12 @@ class StrategyConfigure extends React.Component {
} }
<CardMenu style={{ color: '#fff' }}> <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} /> <IconButton title="Remove strategy from toggle" name="delete" onClick={this.handleRemove} />
</CardMenu> </CardMenu>
</Card> </Card>

View File

@ -66,7 +66,6 @@ const MetricTab = ({ metrics, featureToggle, toggleFeature }) => {
</Cell> </Cell>
</Grid> </Grid>
</div>); </div>);
}; };
class EditFeatureToggleWrapper extends React.Component { class EditFeatureToggleWrapper extends React.Component {
@ -144,7 +143,11 @@ class EditFeatureToggleWrapper extends React.Component {
return ( return (
<div> <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> <div>{featureToggle.description}</div>
<Tabs activeTab={this.state.activeTab} <Tabs activeTab={this.state.activeTab}
onChange={(tabId) => this.setState({ activeTab: tabId })} onChange={(tabId) => this.setState({ activeTab: tabId })}

View File

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

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import HistoryItemDiff from './history-item-diff'; import HistoryItemDiff from './history-item-diff';
import HistoryItemJson from './history-item-json'; 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 { HeaderTitle, SwitchWithLabel } from '../common';
import style from './history.scss'; import style from './history.scss';

View File

@ -22,7 +22,11 @@ class HistoryListToggle extends Component {
return ( return (
<ListComponent <ListComponent
history={history} 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 ( return (
<div> <div>
<HeaderTitle title="Strategies" <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> <List>
{strategies.length > 0 ? strategies.map((strategy, i) => { {strategies.length > 0 ? strategies.map((strategy, i) => (
return (
<ListItem key={i} twoLine> <ListItem key={i} twoLine>
<ListItemContent icon="extension" subtitle={strategy.description}> <ListItemContent icon="extension" subtitle={strategy.description}>
<Link to={`/strategies/view/${strategy.name}`}> <Link to={`/strategies/view/${strategy.name}`}>
@ -32,8 +35,7 @@ class StrategiesListComponent extends Component {
</ListItemContent> </ListItemContent>
<IconButton name="delete" onClick={() => removeStrategy(strategy)} /> <IconButton name="delete" onClick={() => removeStrategy(strategy)} />
</ListItem> </ListItem>
); )) : <ListItem>No entries</ListItem>}
}) : <ListItem>No entries</ListItem>}
</List> </List>
</div> </div>
); );

View File

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