Nice and red and blinky ui label for broken plugins

This commit is contained in:
Simon Howe
2016-04-13 10:26:48 +02:00
parent f211d48cda
commit 7e5302afbb
3 changed files with 19 additions and 4 deletions

View File

@@ -1,10 +1,20 @@
import React from 'react';
import classNames from 'classnames';
export default class Plugins extends React.Component {
renderPlugin(plugin) {
renderPlugin({id, label, description, status}) {
const error = status !== 'ok';
const className = classNames({ error });
const title = error ?
`Status: ${status}. (Plugin description: ${description})` :
description;
// Inner span to hold styling so we don't effect the "before:content"
return (
<span className="plugins-plugin" key={plugin.id} title={plugin.description}>
{plugin.label || plugin.id}
<span className="plugins-plugin" key={id}>
<span className={className} title={title}>
{label || id}
</span>
</span>
);
}

View File

@@ -46,7 +46,7 @@ let highlightedEdgeIds = makeSet();
let highlightedNodeIds = makeSet();
let hostname = '...';
let version = '...';
let plugins = null;
let plugins = [];
let mouseOverEdgeId = null;
let mouseOverNodeId = null;
let nodeDetails = makeOrderedMap(); // nodeId -> details

View File

@@ -1007,6 +1007,11 @@ h2 {
content: ', ';
}
.error {
animation: blinking 2.0s 30 @base-ease; // blink for 1 minute;
color: darkred;
}
&-empty {
opacity: @text-secondary-color;
}