From 087a97e12355fdeac6ddf8afbbb89cea6021deea Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Tue, 10 Nov 2020 16:13:23 +0100 Subject: [PATCH] #1637 Refind the alert list: - Remove useless columns - Display tags in a dedicated row - Display custom fields in a dedicated row --- frontend/app/index.html | 2 + .../common/custom-field-labels.component.js | 21 +++++ frontend/app/styles/case.css | 5 ++ frontend/app/styles/label.css | 53 ++++++++++++ frontend/app/styles/main.css | 24 ++++++ .../common/custom-field-labels.component.html | 14 ++++ frontend/app/views/partials/alert/list.html | 81 +++++++++++-------- 7 files changed, 168 insertions(+), 32 deletions(-) create mode 100644 frontend/app/scripts/components/common/custom-field-labels.component.js create mode 100644 frontend/app/styles/label.css create mode 100644 frontend/app/views/components/common/custom-field-labels.component.html diff --git a/frontend/app/index.html b/frontend/app/index.html index ecd05d8261..b6a370d2b7 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -42,6 +42,7 @@ + @@ -133,6 +134,7 @@ + diff --git a/frontend/app/scripts/components/common/custom-field-labels.component.js b/frontend/app/scripts/components/common/custom-field-labels.component.js new file mode 100644 index 0000000000..4f987c97f9 --- /dev/null +++ b/frontend/app/scripts/components/common/custom-field-labels.component.js @@ -0,0 +1,21 @@ +(function() { + 'use strict'; + + angular.module('theHiveComponents') + .component('customFieldLabels', { + controller: function() { + this.fieldClicked = function(fieldName, newValue) { + this.onFieldClick({ + name: fieldName, + value: newValue + }); + }; + }, + controllerAs: '$cmp', + templateUrl: 'views/components/common/custom-field-labels.component.html', + bindings: { + customFields: '<', + onFieldClick: '&' + } + }); +})(); diff --git a/frontend/app/styles/case.css b/frontend/app/styles/case.css index ba05d2c643..839531f7eb 100644 --- a/frontend/app/styles/case.css +++ b/frontend/app/styles/case.css @@ -81,6 +81,11 @@ table.case-list .case-tags .label, font-weight: normal; } +table.case-list .btn-icon { + padding: 6px; + padding-top: 0; +} + pre.error-trace { color: #a94442; border: none; diff --git a/frontend/app/styles/label.css b/frontend/app/styles/label.css new file mode 100644 index 0000000000..2b2f98d50d --- /dev/null +++ b/frontend/app/styles/label.css @@ -0,0 +1,53 @@ +.double-val-label { + display: table; + /* margin: .2em .6em .3em; */ + margin-top: 0; + margin-left: 0; +} +.double-val-label>span { + color: #ffffff; + display: table-cell; + /* font-size: 0.9em; */ + font-weight: 400; + line-height: 1; + padding: .3em .6em; + text-align: center; + vertical-align: baseline; + white-space: nowrap; +} +.double-val-label>span:first-child { + border-bottom-left-radius: 0.25em; + border-top-left-radius: .25em; + border-left-color: #3c8dbc; + border-left-width: 3px; + border-left-style: solid; +} +.double-val-label>span:nth-child(2) { + border-bottom-right-radius: 0.25em; + border-top-right-radius: .25em; + /* border-left: 1px dashed #777; */ + border-left: 1px dashed #3c8dbc; + /* background-color: #d2d6de; + color: #444; */ +} +.double-val-label>span.primary { + background-color: #3c8dbc; + color: #fff; +} +.double-val-label>span.default { + background-color: #d2d6de; + color: #444; +} +/* +.double-val-label>span.success { + background-color: #5cb85c; +} +.double-val-label>span.info { + background-color: #5bc0de; +} +.double-val-label>span.warning { + background-color: #f0ad4e; +} +.double-val-label>span.danger { + background-color: #d9534f; +} */ diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index be89ac44a3..7ab87b3d11 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -737,3 +737,27 @@ table tr td.task-actions span.action-button { .icon-bar { background-color: #FFF; } + + +table.tbody-stripped > tbody:nth-child(2n+1) > tr > td, +table.tbody-stripped > tbody:nth-child(2n+1) > tr > th { + background-color: #f9f9f9; +} + +table.tbody-stripped > tbody > tr:first-child > td { + padding-bottom:0; +} + +/* table.tbody-stripped > tbody > tr:nth-child(2n) > td { */ +table.tbody-stripped > tbody > tr:not(:first-child) > td { + padding-top:0; + border-top: none; +} + +table.tbody-stripped>tbody+tbody { + border: none; +} + +table.tbody-stripped > tbody > tr > td { + +} diff --git a/frontend/app/views/components/common/custom-field-labels.component.html b/frontend/app/views/components/common/custom-field-labels.component.html new file mode 100644 index 0000000000..4224a712e8 --- /dev/null +++ b/frontend/app/views/components/common/custom-field-labels.component.html @@ -0,0 +1,14 @@ +
+ + + None + + + + {{cf.name}} + {{cf.value}} + +
diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index f1e90b81c8..b8067b385f 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -29,7 +29,7 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList
- +
- - - - + + @@ -134,11 +126,6 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList -
- - None - {{tag}} -

- + + + + + + + + + +
@@ -79,7 +79,7 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList

Observables + Date @@ -87,20 +87,12 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList

- - By - - - - -
{{event.source}} @@ -150,36 +137,66 @@

List of alerts ({{$vm.list.total || 0}} of {{$vm.alertList

{{event.date | shortDate}} - -
+
+ + None + {{tag}} +
+
+ + + +