diff --git a/Gruntfile.js b/Gruntfile.js index 1211d9d..3e7ff36 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -55,7 +55,24 @@ module.exports = function(grunt) { }, }, + sass: { + options: { + sourceMap: true + }, + dist: { + files: { + 'dist/panel-triggers/css/panel_triggers.css' : 'src/panel-triggers/sass/panel_triggers.scss', + } + } + } + }); - grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel']); + grunt.registerTask('default', [ + 'clean', + 'copy:src_to_dist', + 'copy:pluginDef', + 'babel', + 'sass' + ]); }; diff --git a/package.json b/package.json index 64cde5b..b4b96f1 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "grunt": "~0.4.5", "babel": "~6.5.1", "grunt-babel": "~6.0.0", + "grunt-sass": "^1.1.0", "grunt-contrib-copy": "~0.8.2", "grunt-contrib-watch": "^0.6.1", "grunt-contrib-uglify": "~0.11.0", diff --git a/src/panel-triggers/module.html b/src/panel-triggers/module.html index b8d2eb3..4aad09a 100644 --- a/src/panel-triggers/module.html +++ b/src/panel-triggers/module.html @@ -1,31 +1,31 @@ -
-
-
- +
+
+
+
@@ -133,4 +133,4 @@
-
+
Host
-
Status
+
Status
-
Severity
+
Severity
-
Issue
+
Issue
-
Last change
+
Last change
-
Age
+
Age
-
Info
+
Info
- + diff --git a/src/panel-triggers/module.js b/src/panel-triggers/module.js index b263c7a..72cfdc9 100644 --- a/src/panel-triggers/module.js +++ b/src/panel-triggers/module.js @@ -15,6 +15,7 @@ import _ from 'lodash'; import moment from 'moment'; import {PanelCtrl} from 'app/plugins/sdk'; import {triggerPanelEditor} from './editor'; +import './css/panel_triggers.css!'; var defaultSeverity = [ { priority: 0, severity: 'Not classified', color: '#B7DBAB', show: true }, diff --git a/src/panel-triggers/sass/panel_triggers.scss b/src/panel-triggers/sass/panel_triggers.scss new file mode 100644 index 0000000..478f7dd --- /dev/null +++ b/src/panel-triggers/sass/panel_triggers.scss @@ -0,0 +1,108 @@ +$tight-form-func-bg: #333; +$blue: #33B5E5; +$dark-2: #1f1d1d; +$body-bg: rgb(20,20,20); + +$grafanaListAccent: lighten($dark-2, 2%); + +.triggers-panel-wrapper { + .panel-content { + padding: 0; + } + .panel-title-container { + padding-bottom: 4px; + } +} + +.triggers-panel-scroll { + overflow: auto; +} + +.triggers-panel-container { + padding-top: 2.2em; + position: relative; +} + +.triggers-panel-footer { + text-align: center; + font-size: 90%; + line-height: 2px; + + ul { + position: relative; + display: inline-block; + margin-left: 0; + margin-bottom: 0; + } + ul > li { + display: inline; // Remove list-style and block-level defaults + } + ul > li > a { + float: left; // Collapse white-space + padding: 4px 12px; + text-decoration: none; + border-left-width: 0; + + &:hover { + background-color: $tight-form-func-bg; + } + + &.active { + font-weight: bold; + color: $blue; + } + } +} + +.triggers-panel-table { + width: 100%; + border-collapse: collapse; + + th { + padding: 0; + + &:first-child { + .triggers-panel-table-header-inner { + padding-left: 15px; + } + } + } + + td { + padding: 0.45em 0 0.45em 1.1em; + border-bottom: 2px solid $body-bg; + border-right: 2px solid $body-bg; + + &:first-child { + padding-left: 15px; + } + &:last-child { + border-right: none; + } + } +} + +.triggers-panel-header-bg { + background: $grafanaListAccent; + border-top: 2px solid $body-bg; + border-bottom: 2px solid $body-bg; + height: 2.0em; + position: absolute; + top: 0; + right: 0; + left: 0; +} + +.triggers-panel-table-header-inner { + padding: 0.45em 0 0.45em 1.1em; + text-align: left; + color: $blue; + position: absolute; + top: 0; +} + +.triggers-panel-width-hack { + visibility: hidden; + height: 0px; + line-height: 0px; +}