Skip to content

Commit

Permalink
Merge pull request #1280 from weaveworks/1271-broken-plugin-status
Browse files Browse the repository at this point in the history
Nice and red and blinky ui label for broken plugins
  • Loading branch information
foot committed Apr 13, 2016
2 parents 151567e + 948459f commit 412fdd1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
15 changes: 12 additions & 3 deletions client/app/scripts/components/plugins.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
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 = `Status: ${status} | Plugin 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}>
{error && <span className="plugins-plugin-icon fa fa-exclamation-circle" />}
{label || id}
</span>
</span>
);
}
Expand Down
2 changes: 1 addition & 1 deletion client/app/scripts/stores/app-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions client/app/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,18 @@ h2 {
content: ', ';
}

&-plugin-icon {
top: 1px;
position: relative;
font-size: 120%;
margin-right: 2px;
}

.error {
animation: blinking 2.0s 60 @base-ease; // blink for 2 minute;
color: @text-secondary-color;
}

&-empty {
opacity: @text-secondary-color;
}
Expand Down

0 comments on commit 412fdd1

Please sign in to comment.