mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 08:47:40 -05:00
cleaned up systems listing
This commit is contained in:
@@ -19,13 +19,43 @@ class SystemCard extends Component {
|
|||||||
description = description.substring(0, 96) + "...";
|
description = description.substring(0, 96) + "...";
|
||||||
}
|
}
|
||||||
if (system.callAvg) {
|
if (system.callAvg) {
|
||||||
callAvg = Math.round(system.callAvg * 10) / 10 + " call/min"
|
callAvg = Math.round(system.callAvg * 10) / 10 + "/min"
|
||||||
}
|
}
|
||||||
if (system.clientCount === 1) {
|
if (system.clientCount === 1) {
|
||||||
clientCount = "1 listener";
|
clientCount = "1 listener";
|
||||||
} else if (system.clientCount > 1) {
|
} else if (system.clientCount > 1) {
|
||||||
clientCount = system.clientCount + " listeners"
|
clientCount = system.clientCount + " listeners"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let status = (<></>)
|
||||||
|
|
||||||
|
if (system.active) {
|
||||||
|
status = (
|
||||||
|
<Grid >
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column width="8">
|
||||||
|
{clientCount && <div><Icon name='headphones' />{clientCount}</div>}
|
||||||
|
</Grid.Column>
|
||||||
|
<Grid.Column width="8">
|
||||||
|
{callAvg && <div><Icon name='file audio outline' />{callAvg}</div>}
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
const lastActive = new Date(system.lastActive);
|
||||||
|
status = (
|
||||||
|
<Grid >
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column>
|
||||||
|
<Icon name="calendar times outline"/> Last Active {lastActive.toLocaleDateString()}
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (system) {
|
if (system) {
|
||||||
switch (system.systemType) {
|
switch (system.systemType) {
|
||||||
case "state":
|
case "state":
|
||||||
@@ -48,20 +78,24 @@ class SystemCard extends Component {
|
|||||||
<Card link onClick={this.props.onClick} raised={true} centered={true} >
|
<Card link onClick={this.props.onClick} raised={true} centered={true} >
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Card.Header >{system.name}</Card.Header>
|
<Card.Header >{system.name}</Card.Header>
|
||||||
<Card.Meta>{system.screenName && <Label size="mini"><Icon name='user' /> {system.screenName}</Label>}</Card.Meta>
|
<Card.Meta>{location} </Card.Meta>
|
||||||
|
<Card.Description>
|
||||||
|
<Grid >
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column >
|
||||||
|
{system.screenName && <Label size="mini"><Icon name='user' /> {system.screenName}</Label>}
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column>
|
||||||
|
{description}
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
</Grid>
|
||||||
|
</Card.Description>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
<Card.Content description={description} />
|
|
||||||
<Card.Content extra>
|
<Card.Content extra>
|
||||||
<Icon name='marker' />
|
{status}
|
||||||
{location}
|
|
||||||
<Grid columns={2}>
|
|
||||||
<Grid.Column>
|
|
||||||
{clientCount && <div><Icon name='headphones' />{clientCount}</div>}
|
|
||||||
</Grid.Column>
|
|
||||||
<Grid.Column>
|
|
||||||
{callAvg && <div><Icon name='file audio outline' />{callAvg}</div>}
|
|
||||||
</Grid.Column>
|
|
||||||
</Grid>
|
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user