Build plugin with grafana toolkit (#1539)

* Use grafana toolkit template for building plugin

* Fix linter and type errors

* Update styles building

* Fix sass deprecation warning

* Remove empty js files produced by webpack building sass

* Fix signing script

* Replace classnames with cx

* Fix data source config page

* Use custom webpack config instead of overriding original one

* Use gpx_ prefix for plugin executable

* Remove unused configs

* Roll back react hooks dependencies usage

* Move plugin-specific ts config to root config file

* Temporary do not use rst2html for function description tooltip

* Remove unused code

* remove unused dependencies

* update react table dependency

* Migrate tests to typescript

* remove unused dependencies

* Remove old webpack configs

* Add sign target to makefile

* Add magefile

* Update CI test job

* Update go packages

* Update build instructions

* Downgrade go version to 1.18

* Fix go version in ci

* Fix metric picker

* Add comment to webpack config

* remove angular mocks

* update bra config

* Rename datasource-zabbix to datasource (fix mage build)

* Add instructions for building backend with mage

* Fix webpack targets

* Fix ci backend tests

* Add initial e2e tests

* Fix e2e ci tests

* Update docker compose for cypress tests

* build grafana docker image

* Fix docker stop task

* CI: add Grafana compatibility check
This commit is contained in:
Alexander Zobnin
2022-12-09 14:14:34 +03:00
committed by GitHub
parent 26ed740945
commit e3e896742b
136 changed files with 5765 additions and 4636 deletions

View File

@@ -0,0 +1,406 @@
// Global values
// --------------------------------------------------
$theme-name: dark;
// Grays
// -------------------------
$black: #000;
// -------------------------
$black: #000;
$dark-1: #141414;
$dark-2: #1f1f20;
$dark-3: #262628;
$dark-4: #333333;
$dark-5: #444444;
$gray-1: #555555;
$gray-2: #8e8e8e;
$gray-3: #b3b3b3;
$gray-4: #d8d9da;
$gray-5: #ececec;
$gray-6: #f4f5f8;
$gray-7: #fbfbfb;
$gray-blue: #212327;
$input-black: #09090b;
$white: #fff;
// Accent colors
// -------------------------
$blue: #33b5e5;
$blue-dark: #005f81;
$green: #299c46;
$red: #d44a3a;
$yellow: #ecbb13;
$pink: #ff4444;
$purple: #9933cc;
$variable: #32d1df;
$orange: #eb7b18;
$brand-primary: $orange;
$brand-success: $green;
$brand-warning: $brand-primary;
$brand-danger: $red;
$query-red: #e24d42;
$query-green: #74e680;
$query-purple: #fe85fc;
$query-keyword: #66d9ef;
$query-orange: $orange;
// Status colors
// -------------------------
$online: #10a345;
$warn: #f79520;
$critical: #ed2e18;
// Scaffolding
// -------------------------
$body-bg: rgb(23, 24, 25);
$page-bg: rgb(22, 23, 25);
$body-color: $gray-4;
$text-color: $gray-4;
$text-color-strong: $white;
$text-color-weak: $gray-2;
$text-color-faint: $dark-5;
$text-color-emphasis: $gray-5;
$text-shadow-strong: 1px 1px 4px $black;
$text-shadow-faint: 1px 1px 4px rgb(45, 45, 45);
// gradients
$brand-gradient: linear-gradient(
to right,
rgba(255, 213, 0, 0.7) 0%,
rgba(255, 68, 0, 0.7) 99%,
rgba(255, 68, 0, 0.7) 100%
);
$page-gradient: linear-gradient(180deg, #222426 10px, rgb(22, 23, 25) 100px);
$edit-gradient: linear-gradient(180deg, rgb(22, 23, 25) 50%, #090909);
// Links
// -------------------------
$link-color: darken($white, 11%);
$link-color-disabled: darken($link-color, 30%);
$link-hover-color: $white;
$external-link-color: $blue;
// Typography
// -------------------------
$headings-color: darken($white, 11%);
$abbr-border-color: $gray-3 !default;
$text-muted: $text-color-weak;
$hr-border-color: $dark-4;
// Panel
// -------------------------
$panel-bg: #212124;
$panel-border-color: $dark-1;
$panel-border: solid 1px $panel-border-color;
$panel-header-hover-bg: $dark-4;
// page header
$page-header-bg: linear-gradient(90deg, #292a2d, black);
$page-header-shadow: inset 0px -4px 14px $dark-2;
$page-header-border-color: $dark-4;
$divider-border-color: #555;
// Graphite Target Editor
$tight-form-bg: $dark-3;
$tight-form-func-bg: #333334;
$tight-form-func-highlight-bg: #444445;
$modal-backdrop-bg: #353c42;
$code-tag-bg: $dark-1;
$code-tag-border: $dark-4;
// cards
$card-background: linear-gradient(135deg, #2f2f32, #262628);
$card-background-hover: linear-gradient(135deg, #343436, #262628);
$card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.3);
// Lists
$list-item-bg: $card-background;
$list-item-hover-bg: lighten($gray-blue, 2%);
$list-item-link-color: $text-color;
$list-item-shadow: $card-shadow;
$empty-list-cta-bg: $gray-blue;
// Scrollbars
$scrollbarBackground: #404357;
$scrollbarBackground2: #3a3a3a;
$scrollbarBorder: black;
// Tables
// -------------------------
$table-bg: transparent; // overall background-color
$table-bg-accent: $dark-3; // for striping
$table-bg-hover: $dark-4; // for hover
$table-border: $dark-3; // table and cell border
$table-bg-odd: $dark-2;
$table-bg-hover: $dark-3;
// Buttons
// -------------------------
$btn-primary-bg: #ff6600;
$btn-primary-bg-hl: #bc3e06;
$btn-secondary-bg-hl: lighten($blue-dark, 5%);
$btn-secondary-bg: $blue-dark;
$btn-success-bg: $green;
$btn-success-bg-hl: darken($green, 6%);
$btn-warning-bg: $brand-warning;
$btn-warning-bg-hl: lighten($brand-warning, 8%);
$btn-danger-bg: $red;
$btn-danger-bg-hl: darken($red, 8%);
$btn-inverse-bg: $dark-3;
$btn-inverse-bg-hl: lighten($dark-3, 4%);
$btn-inverse-text-color: $link-color;
$btn-inverse-text-shadow: 0px 1px 0 rgba(0, 0, 0, 0.1);
$btn-active-bg: $gray-4;
$btn-active-text-color: $blue-dark;
$btn-link-color: $gray-3;
$iconContainerBackground: $black;
$btn-divider-left: $dark-4;
$btn-divider-right: $dark-2;
$btn-drag-image: '../img/grab_dark.svg';
// Forms
// -------------------------
$input-bg: $input-black;
$input-bg-disabled: $dark-3;
$input-color: $gray-4;
$input-border-color: $dark-3;
$input-box-shadow: inset 1px 0px 0.3rem 0px rgba(150, 150, 150, 0.1);
$input-border-focus: $input-border-color;
$input-box-shadow-focus: rgba(102, 175, 233, 0.6);
$input-color-placeholder: $gray-1 !default;
$input-label-bg: $gray-blue;
$input-label-border-color: $dark-3;
$input-color-select-arrow: $white;
// Search
$search-shadow: 0 0 30px 0 $black;
$search-filter-box-bg: $gray-blue;
// Typeahead
$typeahead-shadow: 0 5px 10px 0 $black;
$typeahead-selected-bg: $dark-4;
$typeahead-selected-color: $yellow;
// Dropdowns
// -------------------------
$dropdownBackground: $dark-3;
$dropdownBorder: rgba(0, 0, 0, 0.2);
$dropdownDividerTop: transparent;
$dropdownDividerBottom: #444;
$dropdownDivider: $dropdownDividerBottom;
$dropdownLinkColor: $text-color;
$dropdownLinkColorHover: $white;
$dropdownLinkColorActive: $white;
$dropdownLinkBackgroundActive: $dark-4;
$dropdownLinkBackgroundHover: $dark-4;
// COMPONENT VARIABLES
// --------------------------------------------------
// -------------------------
$placeholderText: darken($text-color, 25%);
// Horizontal forms & lists
// -------------------------
$horizontalComponentOffset: 180px;
// Wells
// -------------------------
$navbarHeight: 55px;
$navbarBackground: $panel-bg;
$navbarBorder: 1px solid $dark-3;
$navbarShadow: 0 0 20px black;
$navbarLinkColor: $gray-4;
$navbarButtonBackground: $navbarBackground;
$navbarButtonBackgroundHighlight: $body-bg;
$navbar-button-border: #2f2f32;
// Sidemenu
// -------------------------
$side-menu-bg: $black;
$side-menu-bg-mobile: $side-menu-bg;
$side-menu-item-hover-bg: $dark-2;
$side-menu-shadow: 0 0 20px black;
$side-menu-link-color: $link-color;
// Menu dropdowns
// -------------------------
$menu-dropdown-bg: $body-bg;
$menu-dropdown-hover-bg: $dark-2;
$menu-dropdown-shadow: 5px 5px 20px -5px $black;
// Breadcrumb
// -------------------------
// Tabs
// -------------------------
$tab-border-color: $dark-4;
// Toolbar
$toolbar-bg: $input-black;
// Pagination
// -------------------------
// Form states and alerts
// -------------------------
$warning-text-color: $warn;
$error-text-color: #e84d4d;
$success-text-color: #12d95a;
$info-text-color: $blue-dark;
$alert-error-bg: linear-gradient(90deg, #d44939, #e0603d);
$alert-success-bg: linear-gradient(90deg, #3aa655, #47b274);
$alert-warning-bg: linear-gradient(90deg, #d44939, #e0603d);
$alert-info-bg: linear-gradient(100deg, #1a4552, #00374a);
// popover
$popover-bg: $page-bg;
$popover-color: $text-color;
$popover-border-color: $dark-4;
$popover-shadow: 0 0 20px black;
$popover-help-bg: $btn-secondary-bg;
$popover-help-color: $text-color;
$popover-error-bg: $btn-danger-bg;
// Tooltips and popovers
// -------------------------
$tooltipColor: $popover-help-color;
$tooltipBackground: $popover-help-bg;
$tooltipArrowWidth: 5px;
$tooltipArrowColor: $tooltipBackground;
$tooltipLinkColor: $link-color;
$graph-tooltip-bg: $dark-1;
// images
$checkboxImageUrl: '../img/checkbox.png';
// info box
$info-box-border-color: darken($blue, 12%);
// footer
$footer-link-color: $gray-2;
$footer-link-hover: $gray-4;
// json-explorer
$json-explorer-default-color: $text-color;
$json-explorer-string-color: #23d662;
$json-explorer-number-color: $variable;
$json-explorer-boolean-color: $variable;
$json-explorer-null-color: #eec97d;
$json-explorer-undefined-color: rgb(239, 143, 190);
$json-explorer-function-color: #fd48cb;
$json-explorer-rotate-time: 100ms;
$json-explorer-toggler-opacity: 0.6;
$json-explorer-bracket-color: #9494ff;
$json-explorer-key-color: #23a0db;
$json-explorer-url-color: #027bff;
// Changelog and diff
// -------------------------
$diff-label-bg: $dark-2;
$diff-label-fg: $white;
$diff-group-bg: $dark-4;
$diff-arrow-color: $white;
$diff-json-bg: $dark-4;
$diff-json-fg: $gray-5;
$diff-json-added: #457740;
$diff-json-deleted: #a04338;
$diff-json-old: #a04338;
$diff-json-new: #457740;
$diff-json-changed-fg: $gray-5;
$diff-json-changed-num: $text-color;
$diff-json-icon: $gray-7;
//Submenu
$variable-option-bg: $blue-dark;
//Switch Slider
// -------------------------
$switch-bg: $input-bg;
$switch-slider-color: $dark-2;
$switch-slider-off-bg: $gray-1;
$switch-slider-on-bg: linear-gradient(90deg, $orange, $red);
$switch-slider-shadow: 0 0 3px black;
//Checkbox
// -------------------------
$checkbox-bg: $dark-1;
$checkbox-border: 1px solid $gray-1;
$checkbox-checked-bg: linear-gradient(0deg, $orange, $red);
$checkbox-color: $dark-1;
//Panel Edit
// -------------------------
$panel-editor-shadow: 0 0 20px black;
$panel-editor-border: 1px solid $dark-3;
$panel-editor-side-menu-shadow: drop-shadow(0 0 10px $black);
$panel-editor-toolbar-view-bg: $input-black;
$panel-editor-viz-item-shadow: 0 0 8px $dark-5;
$panel-editor-viz-item-border: 1px solid $dark-5;
$panel-editor-viz-item-shadow-hover: 0 0 4px $blue;
$panel-editor-viz-item-border-hover: 1px solid $blue;
$panel-editor-viz-item-bg: $input-black;
$panel-editor-tabs-line-color: #e3e3e3;
$panel-editor-viz-item-bg-hover: darken($blue, 47%);
$panel-editor-viz-item-bg-hover-active: darken($orange, 45%);
$panel-option-section-border: 1px solid $dark-3;
$panel-option-section-header-bg: linear-gradient(0deg, $gray-blue, $dark-1);
$panel-grid-placeholder-bg: darken($blue, 47%);
$panel-grid-placeholder-shadow: 0 0 4px $blue;
// logs
$logs-color-unkown: $gray-2;
// toggle-group
$button-toggle-group-btn-active-bg: linear-gradient(90deg, $orange, $red);
$button-toggle-group-btn-active-shadow: inset 0 0 4px $black;
$button-toggle-group-btn-seperator-border: 1px solid $page-bg;
$vertical-resize-handle-bg: $dark-5;
$vertical-resize-handle-dots: $gray-1;
$vertical-resize-handle-dots-hover: $gray-2;

View File

@@ -0,0 +1,415 @@
// Cosmo 2.3.2
// Variables
// --------------------------------------------------
// Global values
// --------------------------------------------------
$theme-name: light;
// Grays
// -------------------------
$black: #000;
// -------------------------
$black: #000;
$dark-1: #13161d;
$dark-2: #1e2028;
$dark-3: #303133;
$dark-4: #35373f;
$dark-5: #41444b;
$gray-1: #52545c;
$gray-2: #767980;
$gray-3: #acb6bf;
$gray-4: #c7d0d9;
$gray-5: #dde4ed;
$gray-6: #e9edf2;
$gray-7: #f7f8fa;
$white: #fff;
// Accent colors
// -------------------------
$blue: #0083b3;
$blue-dark: #005f81;
$blue-light: #00a8e6;
$green: #3aa655;
$red: #d44939;
$yellow: #ff851b;
$orange: #ff7941;
$pink: #e671b8;
$purple: #9954bb;
$variable: $blue;
$brand-primary: $orange;
$brand-success: $green;
$brand-warning: $orange;
$brand-danger: $red;
$query-red: $red;
$query-green: $green;
$query-purple: $purple;
$query-orange: $orange;
$query-keyword: $blue;
// Status colors
// -------------------------
$online: #01a64f;
$warn: #f79520;
$critical: #ec2128;
// Scaffolding
// -------------------------
$body-bg: $gray-7;
$page-bg: $gray-7;
$body-color: $gray-1;
$text-color: $gray-1;
$text-color-strong: $dark-2;
$text-color-weak: $gray-2;
$text-color-faint: $gray-4;
$text-color-emphasis: $dark-5;
$text-shadow-strong: none;
$text-shadow-faint: none;
$textShadow: none;
// gradients
$brand-gradient: linear-gradient(to right, rgba(255, 213, 0, 1) 0%, rgba(255, 68, 0, 1) 99%, rgba(255, 68, 0, 1) 100%);
$page-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%);
//$page-gradient: linear-gradient(180deg, $white 10px, $gray-7 100px);
$edit-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%);
// Links
// -------------------------
$link-color: $gray-1;
$link-color-disabled: lighten($link-color, 30%);
$link-hover-color: darken($link-color, 20%);
$external-link-color: $blue-light;
// Typography
// -------------------------
$headings-color: $text-color;
$abbr-border-color: $gray-2 !default;
$text-muted: $text-color-weak;
$hr-border-color: $dark-3 !default;
// Panel
// -------------------------
$panel-bg: $white;
$panel-border-color: $gray-5;
$panel-border: solid 1px $panel-border-color;
$panel-header-hover-bg: $gray-6;
// Page header
$page-header-bg: linear-gradient(90deg, $white, $gray-7);
$page-header-shadow: inset 0px -3px 10px $gray-6;
$page-header-border-color: $gray-4;
$divider-border-color: $gray-2;
// Graphite Target Editor
$tight-form-bg: #eaebee;
$tight-form-func-bg: $gray-5;
$tight-form-func-highlight-bg: $gray-6;
$modal-backdrop-bg: $body-bg;
$code-tag-bg: $gray-6;
$code-tag-border: darken($code-tag-bg, 3%);
// cards
$card-background: linear-gradient(135deg, $gray-6, $gray-5);
$card-background-hover: linear-gradient(135deg, $gray-5, $gray-6);
$card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.1);
// Lists
$list-item-bg: linear-gradient(135deg, $gray-5, $gray-6); //$card-background;
$list-item-hover-bg: darken($gray-5, 5%);
$list-item-link-color: $text-color;
$list-item-shadow: $card-shadow;
$empty-list-cta-bg: $gray-6;
// Tables
// -------------------------
$table-bg: transparent; // overall background-color
$table-bg-accent: $gray-5; // for striping
$table-bg-hover: $gray-5; // for hover
$table-bg-active: $table-bg-hover !default;
$table-border: $gray-3; // table and cell border
$table-bg-odd: $gray-6;
$table-bg-hover: $gray-5;
// Scrollbars
$scrollbarBackground: $gray-5;
$scrollbarBackground2: $gray-5;
$scrollbarBorder: $gray-4;
// Buttons
// -------------------------
$btn-primary-bg: $brand-primary;
$btn-primary-bg-hl: lighten($brand-primary, 8%);
$btn-secondary-bg: $blue;
$btn-secondary-bg-hl: lighten($blue, 4%);
$btn-success-bg: lighten($green, 3%);
$btn-success-bg-hl: darken($green, 3%);
$btn-warning-bg: lighten($orange, 3%);
$btn-warning-bg-hl: darken($orange, 3%);
$btn-danger-bg: lighten($red, 3%);
$btn-danger-bg-hl: darken($red, 3%);
$btn-inverse-bg: $gray-6;
$btn-inverse-bg-hl: darken($gray-6, 5%);
$btn-inverse-text-color: $gray-1;
$btn-inverse-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
$btn-active-bg: $white;
$btn-active-text-color: $blue;
$btn-link-color: $gray-1;
$btn-divider-left: $gray-4;
$btn-divider-right: $gray-7;
$btn-drag-image: '../img/grab_light.svg';
$iconContainerBackground: $white;
// Forms
// -------------------------
$input-bg: $white;
$input-bg-disabled: $gray-5;
$input-color: $dark-3;
$input-border-color: $gray-5;
$input-box-shadow: none;
$input-border-focus: $blue !default;
$input-box-shadow-focus: $blue !default;
$input-color-placeholder: $gray-4 !default;
$input-label-bg: $gray-5;
$input-label-border-color: $gray-5;
$input-color-select-arrow: $gray-1;
// Sidemenu
// -------------------------
$side-menu-bg: $dark-2;
$side-menu-bg-mobile: rgba(0, 0, 0, 0); //$gray-6;
$side-menu-item-hover-bg: $gray-1;
$side-menu-shadow: 5px 0px 10px -5px $gray-1;
$side-menu-link-color: $gray-6;
// Menu dropdowns
// -------------------------
$menu-dropdown-bg: $gray-7;
$menu-dropdown-hover-bg: $gray-6;
$menu-dropdown-shadow: 5px 5px 10px -5px $gray-1;
// Breadcrumb
// -------------------------
// Tabs
// -------------------------
$tab-border-color: $gray-5;
// Toolbar
$toolbar-bg: white;
// search
$search-shadow: 0 5px 30px 0 $gray-4;
$search-filter-box-bg: $gray-7;
// Typeahead
$typeahead-shadow: 0 5px 10px 0 $gray-5;
$typeahead-selected-bg: $gray-6;
$typeahead-selected-color: $yellow;
// Dropdowns
// -------------------------
$dropdownBackground: $white;
$dropdownBorder: $gray-4;
$dropdownDividerTop: $gray-6;
$dropdownDividerBottom: $white;
$dropdownDivider: $dropdownDividerTop;
$dropdownLinkColor: $dark-3;
$dropdownLinkColorHover: $link-color;
$dropdownLinkColorActive: $link-color;
$dropdownLinkBackgroundActive: $gray-6;
$dropdownLinkBackgroundHover: $gray-6;
// COMPONENT VARIABLES
// --------------------------------------------------
// Input placeholder text color
// -------------------------
$placeholderText: $gray-2;
// Hr border color
// -------------------------
$hrBorder: $gray-3;
// Horizontal forms & lists
// -------------------------
$horizontalComponentOffset: 180px;
// Wells
// -------------------------
// Navbar
// -------------------------
$navbarHeight: 52px;
$navbarBackground: $white;
$navbarBorder: 1px solid $gray-4;
$navbarShadow: 0 0 3px #c1c1c1;
$navbarLinkColor: #444;
$navbarBrandColor: $navbarLinkColor;
$navbarButtonBackground: lighten($navbarBackground, 3%);
$navbarButtonBackgroundHighlight: lighten($navbarBackground, 5%);
$navbar-button-border: $gray-4;
// Pagination
// -------------------------
// Form states and alerts
// -------------------------
$warning-text-color: lighten($orange, 10%);
$error-text-color: lighten($red, 10%);
$success-text-color: lighten($green, 10%);
$info-text-color: $blue;
$alert-error-bg: linear-gradient(90deg, #d44939, #e04d3d);
$alert-success-bg: linear-gradient(90deg, #3aa655, #47b274);
$alert-warning-bg: linear-gradient(90deg, #d44939, #e04d3d);
$alert-info-bg: $blue;
// popover
$popover-bg: $page-bg;
$popover-color: $text-color;
$popover-border-color: $gray-5;
$popover-shadow: 0 0 20px $white;
$popover-help-bg: $blue;
$popover-help-color: $gray-6;
$popover-error-bg: $btn-danger-bg;
// Tooltips and popovers
// -------------------------
$tooltipColor: $popover-help-color;
$tooltipBackground: $popover-help-bg;
$tooltipArrowWidth: 5px;
$tooltipArrowColor: $tooltipBackground;
$tooltipLinkColor: lighten($popover-help-color, 5%);
$graph-tooltip-bg: $gray-5;
// images
$checkboxImageUrl: '../img/checkbox_white.png';
// info box
$info-box-border-color: lighten($blue, 20%);
// footer
$footer-link-color: $gray-3;
$footer-link-hover: $dark-5;
// collapse box
// json explorer
$json-explorer-default-color: black;
$json-explorer-string-color: green;
$json-explorer-number-color: blue;
$json-explorer-boolean-color: red;
$json-explorer-null-color: #855a00;
$json-explorer-undefined-color: rgb(202, 11, 105);
$json-explorer-function-color: #ff20ed;
$json-explorer-rotate-time: 100ms;
$json-explorer-toggler-opacity: 0.6;
$json-explorer-bracket-color: blue;
$json-explorer-key-color: #00008b;
$json-explorer-url-color: blue;
// Changelog and diff
// -------------------------
$diff-label-bg: $gray-5;
$diff-label-fg: $gray-2;
$diff-switch-bg: $gray-7;
$diff-switch-disabled: $gray-5;
$diff-arrow-color: $dark-3;
$diff-group-bg: $gray-7;
$diff-json-bg: $gray-5;
$diff-json-fg: $gray-2;
$diff-json-added: lighten(desaturate($green, 30%), 10%);
$diff-json-deleted: desaturate($red, 35%);
$diff-json-old: #5a372a;
$diff-json-new: #664e33;
$diff-json-changed-fg: $gray-6;
$diff-json-changed-num: $gray-4;
$diff-json-icon: $gray-4;
//Submenu
$variable-option-bg: $blue-light;
//Switch Slider
// -------------------------
$switch-bg: $white;
$switch-slider-color: $gray-7;
$switch-slider-off-bg: $gray-5;
$switch-slider-on-bg: linear-gradient(90deg, $yellow, $red);
$switch-slider-shadow: 0 0 3px $dark-5;
//Checkbox
// -------------------------
$checkbox-bg: $gray-6;
$checkbox-border: 1px solid $gray-3;
$checkbox-checked-bg: linear-gradient(0deg, $yellow, $red);
$checkbox-color: $gray-7;
//Panel Edit
// -------------------------
$panel-editor-shadow: 0px 0px 8px $gray-3;
$panel-editor-border: 1px solid $dark-4;
$panel-editor-side-menu-shadow: drop-shadow(0 0 2px $gray-3);
$panel-editor-toolbar-view-bg: $white;
$panel-editor-viz-item-shadow: 0 0 4px $gray-3;
$panel-editor-viz-item-border: 1px solid $gray-3;
$panel-editor-viz-item-shadow-hover: 0 0 4px $blue-light;
$panel-editor-viz-item-border-hover: 1px solid $blue-light;
$panel-editor-viz-item-bg: $white;
$panel-editor-tabs-line-color: $dark-5;
$panel-editor-viz-item-bg-hover: lighten($blue, 62%);
$panel-editor-viz-item-bg-hover-active: lighten($orange, 34%);
$panel-option-section-border: 1px solid $gray-6;
$panel-option-section-header-bg: linear-gradient(0deg, $gray-6, $gray-7);
$panel-grid-placeholder-bg: lighten($blue, 62%);
$panel-grid-placeholder-shadow: 0 0 4px $blue-light;
// logs
$logs-color-unkown: $gray-5;
// toggle-group
$button-toggle-group-btn-active-bg: $brand-primary;
$button-toggle-group-btn-active-shadow: inset 0 0 4px $white;
$button-toggle-group-btn-seperator-border: 1px solid $gray-6;
$vertical-resize-handle-bg: $gray-4;
$vertical-resize-handle-dots: $gray-3;
$vertical-resize-handle-dots-hover: $gray-2;

View File

@@ -0,0 +1,681 @@
.panel-problems {
height: 100%;
.fa-icon-container {
padding-right: 0.4rem;
color: $gray-2;
i {
width: 1rem;
}
&.fired {
color: $problem-statusbar-fired;
text-shadow: 0px 0px 10px rgba($problem-statusbar-fired, 0.5);
}
}
// <ReactTable /> styles
.ReactTable {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
.rt-table {
height: 100%;
}
.rt-thead {
&.-header {
height: 2.4em;
}
.rt-th {
&.-sort-desc {
box-shadow: inset 0 -3px 0 0 $blue;
}
&.-sort-asc {
box-shadow: inset 0 3px 0 0 $blue;
}
}
}
.rt-tr-group {
flex: 0 0 auto;
border-bottom: solid 1px $problems-border-color;
// border-left: solid 2px transparent;
&:last-child {
border-bottom: solid 1px $problems-border-color;
}
&:hover {
.rt-tr {
background: $problems-table-row-hovered;
z-index: 1;
}
.rt-tr.-even {
background: $problems-table-row-hovered;
}
}
.rt-tr {
.rt-td {
border: 0;
transition: 0s;
}
&.-even {
background: $problems-table-stripe;
}
}
}
.rt-noData {
z-index: 2;
background: unset;
color: $text-muted;
}
.pagination-bottom {
margin-top: auto;
flex: 1 0 auto;
display: flex;
flex-direction: column;
align-items: center;
$footer-height: 30px;
padding-top: 4px;
margin-left: -10px;
margin-right: -10px;
box-shadow: 0px -2px 5px $problems-footer-shadow;
z-index: 1;
.-pagination {
margin-top: auto;
align-items: center;
padding: 0px;
.-previous {
flex: 1;
height: $footer-height;
}
.-center {
flex: 3;
width: 32rem;
.-pageJump {
margin: 0px 0.4rem;
input {
height: $footer-height;
}
}
.select-wrap.-pageSizeOptions select {
width: 8rem;
height: $footer-height;
}
}
.-next {
flex: 1;
height: $footer-height;
}
}
}
.problem-severity {
&.rt-td {
padding: 0px;
}
.severity-cell {
width: 100%;
height: 100%;
padding: 0.45em 0 0.45em 1.1em;
color: $white;
font-weight: 500;
}
}
.problem-status--new {
animation: blink-opacity 2s ease-in-out infinite;
}
.rt-tr .rt-td {
&.custom-expander {
text-align: center;
padding: 0.6em 0 0 0;
i {
color: #676767;
font-size: 1.2rem;
}
& .expanded {
i {
color: $problem-expander-expanded-color;
}
}
}
&.custom-expander:hover {
background-color: $problem-expander-highlighted-background;
i {
color: $problem-expander-highlighted-color;
}
}
&.last-change {
text-align: left;
}
&.problem-status-icon {
padding: 0;
margin-top: 0;
font-size: 1.5em;
i {
width: 100%;
padding-left: 0.6em;
text-align: center;
&.zbx-problem {
color: $problem-icon-problem-color;
}
&.zbx-ok {
color: $problem-icon-ok-color;
}
}
}
}
.comments-icon {
float: right;
padding-right: 0.6rem;
i {
color: $gray-2;
}
}
.problem-tags {
&.rt-td {
padding-left: 0.6rem;
}
.label-tag, .zbx-tag {
cursor: pointer;
margin-right: 0.6rem;
&.highlighted {
box-shadow: 0 0 10px $orange;
}
}
}
.problem-details-container {
display: flex;
flex-direction: column;
padding-top: 4px;
background-color: $problem-details-background;
border-bottom-width: 0px;
max-height: 0px;
opacity: 0;
overflow: hidden;
transition-duration: 0.3s;
transition-timing-function: ease-out;
transition-property: opacity, max-height;
&.show {
max-height: 32rem;
opacity: 1;
box-shadow: inset -3px 3px 10px $problem-container-shadow;
}
.problem-details-row {
display: flex;
margin-bottom: 0.6rem;
min-height: 3rem;
.problem-value-container {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
}
.problem-details-head {
display: flex;
}
.problem-details-body {
display: flex;
}
.problem-details {
position: relative;
flex: 10 1 auto;
padding: 0.5rem 1rem 0.5rem 1.2rem;
display: flex;
flex-direction: column;
}
.problem-description-row {
.problem-description {
position: relative;
max-height: 4.5rem;
min-height: 3rem;
overflow: hidden;
&:after {
content: "";
text-align: right;
position: absolute;
bottom: 0;
right: 0;
width: 70%;
height: 1.5rem;
background: linear-gradient(to right, rgba($problem-details-background, 0), rgba($problem-details-background, 1) 50%);
}
}
.description-label {
font-weight: 500;
font-style: italic;
color: $text-muted;
cursor: pointer;
}
}
.problem-age {
font-weight: 500;
}
.problem-tags {
padding-top: 0.8rem;
padding-bottom: 0.8rem;
margin-top: auto;
}
.problem-items-row {
position: relative;
height: 1.5rem;
overflow: hidden;
&:after {
content: "";
text-align: right;
position: absolute;
bottom: 0;
right: 0;
width: 70%;
height: 1.5rem;
background: linear-gradient(to right, rgba($problem-details-background, 0), rgba($problem-details-background, 1) 50%);
}
}
.problem-item {
display: flex;
.problem-item-name {
color: $text-muted;
}
.problem-item-value {
font-weight: 500;
}
}
.problem-statusbar {
margin-bottom: 0.6rem;
display: flex;
flex-direction: row;
&.compact .problem-statusbar-item {
width: 2.5rem;
padding: 0.4rem 0.4rem 0.4rem 0.8rem;
}
.problem-statusbar-item {
width: 3rem;
height: 2rem;
padding: 0.4rem 0.4rem 0.4rem 1rem;
background: $problem-statusbar-background;
margin-right: 2px;
border-radius: 2px;
&:hover {
background: darken($problem-statusbar-background, 2%);
}
&.muted {
.fa-icon-container {
color: $problem-statusbar-muted;
}
}
&.fired {
box-shadow: $problem-statusbar-glow;
.fa-icon-container {
color: $problem-statusbar-fired;
text-shadow: 0px 0px 10px rgba($problem-statusbar-fired, 0.5);
}
}
}
}
.problem-actions {
display: flex;
margin-right: 1.6rem;
}
.problem-action-button {
margin-right: 0.2rem;
}
.problem-actions-left {
margin-right: 1.6rem;
}
.problem-details-middle {
flex: 1 0 auto;
overflow: auto;
.problem-ack-container {
margin: 0.5rem 0.4rem;
padding: 0.6rem 0.6rem;
}
}
.problem-ack-container {
max-height: 8rem;
margin-top: 0.6rem;
margin-left: -0.6rem;
padding: 1.2rem 0.6rem;
overflow: auto;
box-shadow: $porblem-ack-shadow;
}
.problem-ack-list {
display: flex;
overflow: auto;
.problem-ack-col {
display: flex;
flex-direction: column;
padding-right: 0.8rem;
}
.problem-ack-time,
.problem-ack-user {
color: $text-muted;
}
}
.problem-details-right {
flex: 0 0 auto;
padding: 0.5rem 2rem;
color: $text-muted;
&.compact {
padding: 0.5rem 1rem;
}
.problem-details-right-item {
margin-bottom: 0.2rem;
&:hover {
color: $text-color-emphasis;
.fa-icon-container {
color: $text-color-emphasis;
}
}
}
}
.problem-maintenance {
.fa-icon-container {
color: $orange;
}
}
.problem-multi-event-type {
i {
color: $orange;
text-shadow: 0px 0px 10px $orange;
animation: blink-shadow 2s ease-out infinite;
}
}
.event-timeline {
position: relative;
margin: 0.2rem 0;
padding-top: 2.6rem;
.timeline-info-container {
position: absolute;
top: 0;
left: 0;
transition: all 0.2s ease-out;
.event-timestamp {
font-weight: 500;
.event-timestamp-label {
color: $text-muted;
}
.event-timestamp-value {
float: right;
}
}
}
.problem-event-region {
&.problem-event {
&--ok {
fill: $problem-event-ok-color;
}
&--problem {
fill: $problem-event-problem-color;
}
}
&:hover,
&.highlighted {
stroke: $problem-event-highlighted;
filter: url(#glowShadow);
}
}
.problem-event-item {
circle {
transition: all 0.2s ease-out;
}
&.problem-event {
&--ok .point-border {
fill: $problem-event-ok-color;
}
&--problem .point-border {
fill: $problem-event-problem-color;
}
}
.point-core {
fill: $problem-event-core;
}
&:hover,
&.highlighted {
circle.point-border {
stroke: $problem-event-highlighted;
stroke-width: 1;
filter: url(#glowShadow);
}
.point-core {
fill: $problem-event-core-highlighted;
}
}
}
.problem-event-ack {
circle {
transition: all 0.2s ease-out;
}
.point-border {
fill: $blue;
}
.point-core {
fill: $problem-event-core;
}
&:hover,
&.highlighted {
circle.point-border {
stroke: $problem-event-highlighted;
stroke-width: 1;
filter: url(#glowShadow);
}
.point-core {
fill: $problem-event-core-highlighted;
}
}
}
}
}
}
@for $i from 8 through 9 {
.item-#{$i} {
width: 2em * $i;
}
&.font-size--#{$i * 10} .rt-table {
font-size: 1% * $i * 10;
& .rt-tr .rt-td.custom-expander i {
font-size: calc(1.2rem * $i / 10);
}
.problem-details-container.show {
font-size: 13px;
}
}
}
@for $i from 11 through 25 {
.item-#{$i} {
width: 2em * $i;
}
&.font-size--#{$i * 10} {
.rt-table {
font-size: 1% * $i * 10;
& .rt-tr .rt-td.custom-expander i {
font-size: calc(1.2rem * $i / 10);
}
.problem-details-container.show {
font-size: 13px;
}
}
.rt-noData {
top: 4.5em;
font-size: 1% * $i * 10;
}
}
}
}
.zbx-ack-modal {
.zbx-ack-error {
border-color: $btn-danger-bg;
// box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 5px $btn-danger-bg;
outline-offset: 2px;
box-shadow: 0 0 0 2px #141619, 0 0 0px 4px $btn-danger-bg;
}
.ack-request-error {
padding-top: 1.2rem;
}
.ack-error-message {
color: $error-text-color;
}
.gf-form .gf-form-hint {
.gf-form-hint-text {
display: inherit;
float: right;
&.ack-error-message {
float: left;
}
}
}
}
.panel-options-button {
text-align: left;
}
@keyframes blink-opacity {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fade-in {
0% {
color: $dark-3;
text-shadow: unset;
}
100% {
color: $orange;
text-shadow: 0px 0px 10px rgba($orange, 0.5);
}
}
@keyframes blink-shadow {
0% {
opacity: 1;
text-shadow: 0px 0px 3px $orange;
}
50% {
opacity: 0.3;
text-shadow: 0px 0px 10px $orange;
}
100% {
opacity: 1;
text-shadow: 0px 0px 2px $orange;
}
}

View File

@@ -0,0 +1,283 @@
.triggers-panel-scroll {
overflow: auto;
}
.triggers-panel-container {
position: relative;
display: flex;
flex-direction: column;
height: 100%;
.card-section {
padding: 2px;
margin-bottom: 0.4rem;
overflow: auto;
.alert-rule-list {
.alert-rule-item {
.alert-rule-item__text {
display: flex;
max-height: 1.6em;
overflow: hidden;
align-items: center;
padding-right: 1em;
&.zbx-description--newline {
max-height: unset;
.zbx-description {
margin-left: 0px;
}
}
.zbx-description {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
span {
padding-right: 0.4em;
}
}
}
@for $i from 8 through 9 {
&.font-size--#{$i * 10} {
&,
.alert-rule-item__name {
font-size: 1% * $i * 10;
}
.alert-rule-item__icon {
width: unset;
font-size: 1% * $i * 10;
}
.alert-rule-item__time,
.alert-rule-item__text,
.zabbix-hostname {
font-size: 1% * $i * 10 * 0.8;
}
.zbx-trigger-tags .label-tag {
font-size: 1% * $i * 10 * 0.6;
padding: 0.3em 0.3em;
}
}
}
@for $i from 11 through 25 {
&.font-size--#{$i * 10} {
&,
.alert-rule-item__name {
font-size: 1% * $i * 10;
}
.alert-rule-item__icon {
width: unset;
font-size: 1% * $i * 10;
}
.alert-rule-item__time,
.alert-rule-item__text,
.zabbix-hostname {
font-size: 1% * $i * 10 * 0.8;
}
.zbx-trigger-tags .label-tag {
font-size: 1% * $i * 10 * 0.6;
padding: 0.3em 0.3em;
}
}
}
}
}
.zabbix-trigger-name {
font-weight: bold;
}
.zabbix-hostname {
color: $gray-2;
margin-left: 1em;
font-weight: 500;
i {
padding-right: 0.2em;
}
}
.zbx-description {
color: $gray-3;
font-weight: normal;
margin-left: 0.6em;
&--newline {
margin-left: 0rem;
}
}
.zbx-trigger-tags {
margin-left: 0.6rem;
.zbx-tag {
color: $zbx-tag-color;
font-weight: 500;
font-size: 12px;
margin-right: 4px;
padding: 1px 6px;
cursor: pointer;
}
}
.trigger-info-block {
display: flex;
i, a {
margin-right: 0.3rem;
color: $gray-2;
}
}
.zabbix-trigger-source {
margin-right: 1.5rem;
margin-left: 1rem;
font-weight: 500;
i {
padding-right: 0.4em;
}
}
.alert-rule-item__icon .icon-gf {
right: 0.4rem;
}
}
.zbx-trigger-card {
position: relative;
padding: 0.5rem 1rem;
}
.zabbix-trigger {
&--blinked {
opacity: 0.4;
animation: zabbix-triggers-icon 0.8s cubic-bezier(0.46, 0.03, 0.52, 0.96) 0s infinite alternate;
}
}
.zbx-maintenance-icon {
color: $orange;
}
.zbx-trigger-highlighted {
color: $zbx-text-highlighted;
background: linear-gradient(135deg, $zbx-card-background-start, $zbx-card-background-stop);
.alert-rule-item__body,
.alert-rule-item__header,
.alert-rule-item__time,
.zabbix-hostname,
.zbx-description {
color: $zbx-text-highlighted;
}
.alert-rule-item__text {
.zbx-trigger-state,
.zbx-trigger-severity {
color: $zbx-text-highlighted;
}
}
.zbx-trigger-lastchange .trigger-info-block.zbx-status-icons {
a, i {
color: $zbx-text-highlighted;
}
}
}
@keyframes zabbix-triggers-icon {
100% {
opacity: 1;
}
}
.triggers-panel-footer {
margin-top: auto;
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;
}
}
}
.ack-tooltip {
&.popper {
max-width: 800px;
}
.ack-comments {
width: 60%;
}
.ack-add-button {
padding-top: 0.4rem;
text-align: left;
}
table td, th {
padding-right: 1rem;
text-align: left;
}
}
.triggers-severity-config {
&.gf-form-label {
padding-top: 5px;
padding-bottom: 5px;
border-radius: 0px;
}
.icon-gf {
font-size: 200%;
}
}
// fix for phantomjs (it has troubles with flex blocks rendering)
.body--phantomjs {
.triggers-panel-container {
.alert-rule-list {
display: block;
}
.alert-rule-item__body,
.alert-rule-item__icon {
display: block;
}
}
}

View File

@@ -0,0 +1,7 @@
.zbx-regex {
color: $regex;
}
.zbx-variable {
color: $variable;
}

View File

@@ -0,0 +1,67 @@
// ReactTable basic overrides (does not include pivot/groups/filters)
.ReactTable {
border: none;
}
.ReactTable .rt-table {
// Allow some space for the no-data text
min-height: 90px;
}
.ReactTable .rt-thead.-header {
box-shadow: none;
background: $list-item-bg;
border-top: 2px solid $body-bg;
border-bottom: 2px solid $body-bg;
height: 2em;
}
.ReactTable .rt-thead.-header .rt-th {
text-align: left;
color: $blue;
font-weight: 500;
}
.ReactTable .rt-thead .rt-td,
.ReactTable .rt-thead .rt-th {
padding: 0.45em 0 0.45em 1.1em;
border-right: none;
box-shadow: none;
}
.ReactTable .rt-tbody .rt-td {
padding: 0.45em 0 0.45em 1.1em;
border-bottom: 2px solid $body-bg;
border-right: 2px solid $body-bg;
}
.ReactTable .rt-tbody .rt-td:last-child {
border-right: none;
}
.ReactTable .-pagination {
border-top: none;
box-shadow: none;
margin-top: $panel-margin;
}
.ReactTable .-pagination .-btn {
color: $blue;
background: $list-item-bg;
}
.ReactTable .-pagination input,
.ReactTable .-pagination select {
color: $input-color;
background-color: $input-bg;
}
.ReactTable .-loading {
background: $input-bg;
}
.ReactTable .-loading.-active {
opacity: 0.8;
}
.ReactTable .-loading > div {
color: $input-color;
}
.ReactTable .rt-tr .rt-td:last-child {
text-align: right;
}
.ReactTable .rt-noData {
top: 60px;
z-index: inherit;
}

View File

@@ -0,0 +1,40 @@
$regex: #d69e2e;
$zbx-tag-color: $gray-5;
$zbx-text-highlighted: $white;
$zbx-text-color-disabled: $gray-1;
$zbx-card-background-start: rgba(46, 46, 49, 0.1);
$zbx-card-background-stop: rgba(38, 38, 40, 0.8);
$action-button-color: $blue-dark;
$action-button-text-color: $gray-4;
$problems-border-color: #353535;
$problems-table-stripe: $dark-3;
$problems-table-row-hovered: lighten($problems-table-stripe, 4%);
$problems-table-row-hovered-shadow-color: rgba($blue, 0.5);
$problems-table-row-hovered-shadow: 0px 0px 8px $problems-table-row-hovered-shadow-color;
$problem-details-background: $dark-3;
$problem-expander-highlighted-background: #393939;
$problem-expander-highlighted-color: $blue;
$problem-expander-expanded-color: $blue;
$problem-statusbar-background: $dark-2;
$problem-statusbar-muted: $dark-3;
$problem-statusbar-fired: $orange;
$problem-statusbar-glow: 0px 0px 10px rgba($problem-statusbar-fired, 0.1);
$problem-event-highlighted: rgba($white, 0.7);
$problem-event-core-highlighted: $white;
$problem-event-core: #000000;
$problem-event-ok-color: #38bd71;
$problem-event-problem-color: #d70000;
$problem-icon-problem-color: rgb(163, 16, 0);
$problem-icon-ok-color: #629e51;
$problem-container-shadow: $dark-1;
$porblem-ack-shadow: -2px 2px 10px 1px $problem-container-shadow;
$problems-footer-shadow: $problem-container-shadow;

View File

@@ -0,0 +1,40 @@
$regex: #d69e2e;
$zbx-tag-color: $gray-6;
$zbx-text-highlighted: $black;
$zbx-text-color-disabled: $gray-3;
$zbx-card-background-start: rgba(233, 237, 242, 0.35);
$zbx-card-background-stop: rgba(221, 228, 237, 1);
$action-button-color: #497dc0;
$action-button-text-color: $gray-6;
$problems-border-color: #9d9d9d;
$problems-table-stripe: $gray-6;
$problems-table-row-hovered: #a2e0ef;
$problems-table-row-hovered-shadow-color: $blue;
$problems-table-row-hovered-shadow: 0px 1px 8px 1px $problems-table-row-hovered-shadow-color;
$problem-details-background: $gray-6;
$problem-expander-highlighted-background: #424755;
$problem-expander-highlighted-color: #8ad9f5;
$problem-expander-expanded-color: $blue;
$problem-statusbar-background: $gray-4;
$problem-statusbar-muted: $gray-5;
$problem-statusbar-fired: #ca4c17;
$problem-statusbar-glow: inset 0px 0px 10px rgba($problem-statusbar-fired, 0.5);
$problem-event-highlighted: $white;
$problem-event-core-highlighted: $white;
$problem-event-core: $gray-6;
$problem-event-ok-color: #2baf63;
$problem-event-problem-color: #d70000;
$problem-icon-problem-color: rgb(163, 16, 0);
$problem-icon-ok-color: #629e51;
$problem-container-shadow: $gray-3;
$porblem-ack-shadow: -2px 2px 10px 0px $problem-container-shadow;
$problems-footer-shadow: rgba($problem-container-shadow, 0.5);

View File

@@ -0,0 +1 @@
$panel-margin: 10px;

3
src/styles/dark.scss Normal file
View File

@@ -0,0 +1,3 @@
@import 'grafana_variables.dark';
@import 'variables.dark';
@import 'grafana-zabbix';

View File

@@ -0,0 +1,8 @@
// DEPENDENCIES
@import '../../node_modules/react-table-6/react-table.css';
@import 'variables';
@import 'panel-triggers';
@import 'panel-problems';
@import 'query_editor';
@import 'react-table';

3
src/styles/light.scss Normal file
View File

@@ -0,0 +1,3 @@
@import 'grafana_variables.light';
@import 'variables.light';
@import 'grafana-zabbix';