2021-03-11 18:24:24 +03:00
|
|
|
'use strict';
|
2021-12-05 19:18:32 +03:00
|
|
|
'require baseclass';
|
2021-03-11 18:24:24 +03:00
|
|
|
'require ui';
|
2021-12-05 19:18:32 +03:00
|
|
|
'require view';
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2021-03-26 23:49:38 +03:00
|
|
|
document.head.append(E('style', {'type': 'text/css'},
|
|
|
|
|
`
|
2021-10-05 20:48:58 +03:00
|
|
|
:root {
|
|
|
|
|
--app-log-dark-font-color: #2e2e2e;
|
|
|
|
|
--app-log-light-font-color: #fff;
|
|
|
|
|
--app-log-debug-font-color: #737373;
|
2022-09-20 16:33:28 +03:00
|
|
|
--app-log-emerg-color: #a93734;
|
|
|
|
|
--app-log-alert: #ff7968;
|
|
|
|
|
--app-log-crit: #fcc3bf;
|
|
|
|
|
--app-log-err: #ffe9e8;
|
|
|
|
|
--app-log-warn: #fff7e2;
|
|
|
|
|
--app-log-notice: #e3ffec;
|
|
|
|
|
--app-log-info: rgba(0,0,0,0);
|
|
|
|
|
--app-log-debug: #ebf6ff;
|
2023-11-10 02:39:58 +03:00
|
|
|
--app-log-entries-count-border: #ccc;
|
2022-09-20 16:33:28 +03:00
|
|
|
}
|
|
|
|
|
:root[data-darkmode="true"] {
|
|
|
|
|
--app-log-dark-font-color: #fff;
|
|
|
|
|
--app-log-light-font-color: #fff;
|
|
|
|
|
--app-log-debug-font-color: #e7e7e7;
|
|
|
|
|
--app-log-emerg-color: #a93734;
|
|
|
|
|
--app-log-alert: #eb5050;
|
|
|
|
|
--app-log-crit: #dc7f79;
|
|
|
|
|
--app-log-err: #c89593;
|
|
|
|
|
--app-log-warn: #8d7000;
|
|
|
|
|
--app-log-notice: #007627;
|
|
|
|
|
--app-log-info: rgba(0,0,0,0);
|
|
|
|
|
--app-log-debug: #5986b1;
|
2023-11-10 02:39:58 +03:00
|
|
|
--app-log-entries-count-border: #555;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-empty {
|
|
|
|
|
}
|
|
|
|
|
.log-emerg {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-emerg-color) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color);
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
log-emerg .td {
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
log-emerg td {
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-alert {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-alert) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color);
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-alert .td {
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-alert td {
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-light-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-crit {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-crit) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-crit .td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-crit td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-err {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-err) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-err .td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-err td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-warn {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-warn) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-warn .td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-warn td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-notice {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-notice) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-notice .td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-notice td {
|
|
|
|
|
color: var(--app-log-dark-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-info {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-info) !important;
|
2023-11-10 02:39:58 +03:00
|
|
|
/*color: var(--app-log-dark-font-color) !important;*/
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-debug {
|
2022-09-20 16:33:28 +03:00
|
|
|
background-color: var(--app-log-debug) !important;
|
2021-10-05 20:48:58 +03:00
|
|
|
color: var(--app-log-debug-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-debug .td {
|
|
|
|
|
color: var(--app-log-debug-font-color) !important;
|
|
|
|
|
}
|
|
|
|
|
.log-debug td {
|
|
|
|
|
color: var(--app-log-debug-font-color) !important;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-highlight-item {
|
|
|
|
|
background-color: #ffef00;
|
2022-09-20 16:33:28 +03:00
|
|
|
color: #2e2e2e;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-entries-count {
|
|
|
|
|
margin: 0 0 5px 5px;
|
|
|
|
|
font-weight: bold;
|
2021-10-05 20:48:58 +03:00
|
|
|
opacity: 0.7;
|
2021-03-26 23:49:38 +03:00
|
|
|
}
|
|
|
|
|
.log-entries-count-level {
|
|
|
|
|
display: inline-block !important;
|
|
|
|
|
margin: 0 0 0 5px;
|
|
|
|
|
padding: 0 4px;
|
|
|
|
|
-webkit-border-radius: 3px;
|
|
|
|
|
-moz-border-radius: 3px;
|
|
|
|
|
border-radius: 3px;
|
2023-11-10 02:39:58 +03:00
|
|
|
border: 1px solid var(--app-log-entries-count-border);
|
2021-03-26 23:49:38 +03:00
|
|
|
font-weight: normal;
|
|
|
|
|
}
|
|
|
|
|
.log-host-dropdown-item {
|
|
|
|
|
}
|
2023-11-01 19:48:59 +03:00
|
|
|
.log-facility-dropdown-item {
|
|
|
|
|
}
|
2023-11-21 18:16:55 +03:00
|
|
|
.log-side-block {
|
2023-11-10 02:39:58 +03:00
|
|
|
position: fixed;
|
|
|
|
|
z-index: 1 !important;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
2023-11-21 18:16:55 +03:00
|
|
|
.log-side-btn {
|
2023-11-10 02:39:58 +03:00
|
|
|
position: relative;
|
|
|
|
|
display: block;
|
|
|
|
|
left: 1px;
|
|
|
|
|
top: 1px;
|
2023-11-21 18:16:55 +03:00
|
|
|
margin: 0 !important;
|
|
|
|
|
min-width: 3.2em;
|
2023-11-10 02:39:58 +03:00
|
|
|
}
|
2021-03-26 23:49:38 +03:00
|
|
|
`));
|
|
|
|
|
|
2021-12-05 19:18:32 +03:00
|
|
|
return baseclass.extend({
|
|
|
|
|
view: view.extend({
|
2021-03-27 18:35:35 +03:00
|
|
|
/**
|
2021-04-09 18:10:55 +03:00
|
|
|
* View name (for local storage and downloads).
|
2021-03-27 18:35:35 +03:00
|
|
|
* Must be overridden by a subclass!
|
|
|
|
|
*/
|
2021-11-04 18:57:08 +03:00
|
|
|
viewName : null,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2021-03-27 18:35:35 +03:00
|
|
|
/**
|
|
|
|
|
* Page title.
|
|
|
|
|
* Must be overridden by a subclass!
|
|
|
|
|
*/
|
2021-11-04 18:57:08 +03:00
|
|
|
title : null,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logFacilities : {
|
|
|
|
|
'kern' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'kern')),
|
|
|
|
|
'user' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'user')),
|
|
|
|
|
'mail' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'mail')),
|
|
|
|
|
'daemon' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'daemon')),
|
|
|
|
|
'auth' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'auth')),
|
|
|
|
|
'syslog' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'syslog')),
|
|
|
|
|
'lpr' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'lpr')),
|
|
|
|
|
'news' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'news')),
|
|
|
|
|
'uucp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'uucp')),
|
|
|
|
|
'authpriv': E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'authpriv')),
|
|
|
|
|
'ftp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'ftp')),
|
|
|
|
|
'ntp' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'ntp')),
|
|
|
|
|
'log' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'log')),
|
|
|
|
|
'clock' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'clock')),
|
|
|
|
|
'local0' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local0')),
|
|
|
|
|
'local1' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local1')),
|
|
|
|
|
'local2' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local2')),
|
|
|
|
|
'local3' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local3')),
|
|
|
|
|
'local4' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local4')),
|
|
|
|
|
'local5' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local5')),
|
|
|
|
|
'local6' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local6')),
|
|
|
|
|
'local7' : E('span', { 'class': 'zonebadge log-facility-dropdown-item' }, E('strong', 'local7')),
|
|
|
|
|
},
|
|
|
|
|
|
2021-11-04 18:57:08 +03:00
|
|
|
logLevels : {
|
2021-12-05 19:18:32 +03:00
|
|
|
'emerg' : E('span', { 'class': 'zonebadge log-emerg' }, E('strong', _('Emergency'))),
|
|
|
|
|
'alert' : E('span', { 'class': 'zonebadge log-alert' }, E('strong', _('Alert'))),
|
|
|
|
|
'crit' : E('span', { 'class': 'zonebadge log-crit' }, E('strong', _('Critical'))),
|
|
|
|
|
'err' : E('span', { 'class': 'zonebadge log-err' }, E('strong', _('Error'))),
|
|
|
|
|
'warn' : E('span', { 'class': 'zonebadge log-warn' }, E('strong', _('Warning'))),
|
|
|
|
|
'notice': E('span', { 'class': 'zonebadge log-notice' }, E('strong', _('Notice'))),
|
|
|
|
|
'info' : E('span', { 'class': 'zonebadge log-info' }, E('strong', _('Info'))),
|
|
|
|
|
'debug' : E('span', { 'class': 'zonebadge log-debug' }, E('strong', _('Debug'))),
|
2021-03-11 18:24:24 +03:00
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
tailValue : 25,
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
fastTailIncrement : 50,
|
|
|
|
|
|
|
|
|
|
fastTailValue : null,
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logSortingValue : 'asc',
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
isHosts : false,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
isFacilities : false,
|
2021-03-27 18:35:35 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
isLevels : false,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logHosts : {},
|
2021-03-26 23:49:38 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logLevelsStat : {},
|
2021-03-27 18:35:35 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logHostsDropdown : null,
|
2021-03-26 23:49:38 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logFacilitiesDropdown: null,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
logLevelsDropdown : null,
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
totalLogLines : 0,
|
|
|
|
|
|
|
|
|
|
htmlEntities(str) {
|
2021-03-11 18:24:24 +03:00
|
|
|
return String(str).replace(
|
|
|
|
|
/&/g, '&').replace(
|
|
|
|
|
/</g, '<').replace(
|
|
|
|
|
/>/g, '>').replace(
|
2021-03-15 21:02:38 +03:00
|
|
|
/"/g, '"').replace(
|
|
|
|
|
/'/g, ''');
|
2021-03-11 18:24:24 +03:00
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
makeLogHostsDropdownItem(host) {
|
2021-03-26 23:49:38 +03:00
|
|
|
return E(
|
|
|
|
|
'span',
|
|
|
|
|
{ 'class': 'zonebadge log-host-dropdown-item' },
|
|
|
|
|
E('strong', host)
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
makeLogHostsDropdownSection() {
|
2021-03-27 18:35:35 +03:00
|
|
|
this.logHostsDropdown = new ui.Dropdown(
|
|
|
|
|
null,
|
|
|
|
|
this.logHosts,
|
|
|
|
|
{
|
2021-12-05 19:18:32 +03:00
|
|
|
id : 'logHostsDropdown',
|
|
|
|
|
multiple : true,
|
2021-03-27 18:35:35 +03:00
|
|
|
select_placeholder: _('All'),
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
return E(
|
|
|
|
|
'div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
2021-12-05 19:18:32 +03:00
|
|
|
'for' : 'logHostsDropdown',
|
2021-03-27 18:35:35 +03:00
|
|
|
}, _('Hosts')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' },
|
|
|
|
|
this.logHostsDropdown.render()
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
makeLogFacilitiesDropdownSection(){
|
|
|
|
|
this.logFacilitiesDropdown = new ui.Dropdown(
|
|
|
|
|
null,
|
|
|
|
|
this.logFacilities,
|
|
|
|
|
{
|
|
|
|
|
id : 'logFacilitiesDropdown',
|
|
|
|
|
sort : Object.keys(this.logFacilities),
|
|
|
|
|
multiple : true,
|
|
|
|
|
select_placeholder: _('All'),
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
return E(
|
|
|
|
|
'div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
|
|
|
|
'for' : 'logFacilitiesDropdown',
|
|
|
|
|
}, _('Facilities')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' },
|
|
|
|
|
this.logFacilitiesDropdown.render()
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
makeLogLevelsDropdownSection(){
|
2021-03-27 18:35:35 +03:00
|
|
|
this.logLevelsDropdown = new ui.Dropdown(
|
|
|
|
|
null,
|
|
|
|
|
this.logLevels,
|
|
|
|
|
{
|
2021-12-05 19:18:32 +03:00
|
|
|
id : 'logLevelsDropdown',
|
|
|
|
|
sort : Object.keys(this.logLevels),
|
|
|
|
|
multiple : true,
|
2021-03-27 18:35:35 +03:00
|
|
|
select_placeholder: _('All'),
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
return E(
|
|
|
|
|
'div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
2021-12-05 19:18:32 +03:00
|
|
|
'for' : 'logLevelsDropdown',
|
2021-03-27 18:35:35 +03:00
|
|
|
}, _('Logging levels')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' },
|
|
|
|
|
this.logLevelsDropdown.render()
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
2021-03-11 18:24:24 +03:00
|
|
|
/**
|
2021-03-27 18:35:35 +03:00
|
|
|
* Receives raw log data.
|
|
|
|
|
* Abstract method, must be overridden by a subclass!
|
2021-03-11 18:24:24 +03:00
|
|
|
*
|
|
|
|
|
* @param {number} tail
|
|
|
|
|
* @returns {string}
|
2023-11-10 02:39:58 +03:00
|
|
|
* Returns the raw content of the log.
|
2021-03-11 18:24:24 +03:00
|
|
|
*/
|
2023-11-01 19:48:59 +03:00
|
|
|
getLogData(tail) {
|
2021-03-26 23:49:38 +03:00
|
|
|
throw new Error('getLogData must be overridden by a subclass');
|
2021-03-11 18:24:24 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
2021-03-27 18:35:35 +03:00
|
|
|
* Parses log data.
|
|
|
|
|
* Abstract method, must be overridden by a subclass!
|
2021-03-11 18:24:24 +03:00
|
|
|
*
|
|
|
|
|
* @param {string} logdata
|
|
|
|
|
* @param {number} tail
|
2021-03-26 23:49:38 +03:00
|
|
|
* @returns {Array<number, string|null, string|null, string|null, string|null, string|null>}
|
2023-11-10 02:39:58 +03:00
|
|
|
* Returns an array of values: [ #, Timestamp, Host, Level, Facility, Message ].
|
2021-03-11 18:24:24 +03:00
|
|
|
*/
|
2023-11-01 19:48:59 +03:00
|
|
|
parseLogData(logdata, tail) {
|
2021-03-26 23:49:38 +03:00
|
|
|
throw new Error('parseLogData must be overridden by a subclass');
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-10 02:39:58 +03:00
|
|
|
/**
|
|
|
|
|
* Highlight the result of a regular expression.
|
|
|
|
|
* Abstract method, must be overridden by a subclass!
|
|
|
|
|
*
|
|
|
|
|
* @param {string} logdata
|
|
|
|
|
* @returns {string}
|
|
|
|
|
* Returns a string with the highlighted part.
|
|
|
|
|
*/
|
|
|
|
|
regexpFilterHighlightFunc(match) {
|
2023-11-11 19:42:54 +03:00
|
|
|
throw new Error('regexpFilterHighlightFunc must be overridden by a subclass');
|
2023-11-10 02:39:58 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setRegexpFilter(entriesArray, fieldNum, pattern) {
|
|
|
|
|
let fArr = [];
|
|
|
|
|
try {
|
|
|
|
|
let regExp = new RegExp(pattern, 'giu');
|
|
|
|
|
entriesArray.forEach((e, i) => {
|
|
|
|
|
if(e[fieldNum] !== null && regExp.test(e[fieldNum])) {
|
|
|
|
|
if(this.regexpFilterHighlightFunc) {
|
|
|
|
|
e[fieldNum] = e[fieldNum].replace(regExp, this.regexpFilterHighlightFunc);
|
|
|
|
|
};
|
|
|
|
|
fArr.push(e);
|
|
|
|
|
};
|
|
|
|
|
regExp.lastIndex = 0;
|
|
|
|
|
});
|
|
|
|
|
} catch(err) {
|
|
|
|
|
if(err.name === 'SyntaxError') {
|
|
|
|
|
ui.addNotification(null,
|
|
|
|
|
E('p', {}, _('Invalid regular expression') + ': ' + err.message));
|
|
|
|
|
return entriesArray;
|
|
|
|
|
} else {
|
|
|
|
|
throw err;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
return fArr;
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
setDateFilter(entriesArray) {
|
2023-11-21 18:16:55 +03:00
|
|
|
let fPattern = this.timeFilter.value;
|
2023-11-01 19:48:59 +03:00
|
|
|
if(!fPattern) {
|
|
|
|
|
return entriesArray;
|
|
|
|
|
};
|
|
|
|
|
return this.setRegexpFilter(entriesArray, 1, fPattern);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setHostFilter(entriesArray) {
|
2021-03-26 23:49:38 +03:00
|
|
|
let logHostsKeys = Object.keys(this.logHosts);
|
2021-03-27 18:35:35 +03:00
|
|
|
if(logHostsKeys.length > 0 && this.logHostsDropdown) {
|
2021-03-26 23:49:38 +03:00
|
|
|
let selectedHosts = this.logHostsDropdown.getValue();
|
2021-03-27 18:35:35 +03:00
|
|
|
this.logHostsDropdown.addChoices(logHostsKeys, this.logHosts);
|
2021-03-26 23:49:38 +03:00
|
|
|
if(selectedHosts.length === 0 || logHostsKeys.length === selectedHosts.length) {
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray;
|
2021-03-26 23:49:38 +03:00
|
|
|
};
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray.filter(e => selectedHosts.includes(e[2]));
|
2021-03-26 23:49:38 +03:00
|
|
|
};
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray;
|
2021-03-11 18:24:24 +03:00
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
setFacilityFilter(entriesArray) {
|
|
|
|
|
let logFacilitiesKeys = Object.keys(this.logFacilities);
|
|
|
|
|
if(logFacilitiesKeys.length > 0 && this.logFacilitiesDropdown) {
|
|
|
|
|
let selectedFacilities = this.logFacilitiesDropdown.getValue();
|
|
|
|
|
if(selectedFacilities.length === 0 || logFacilitiesKeys.length === selectedFacilities.length) {
|
|
|
|
|
return entriesArray;
|
|
|
|
|
};
|
|
|
|
|
return entriesArray.filter(e => selectedFacilities.includes(e[3]));
|
|
|
|
|
};
|
|
|
|
|
return entriesArray;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setLevelFilter(entriesArray) {
|
2021-03-15 21:02:38 +03:00
|
|
|
let logLevelsKeys = Object.keys(this.logLevels);
|
2021-03-27 18:35:35 +03:00
|
|
|
if(logLevelsKeys.length > 0 && this.logLevelsDropdown) {
|
2021-03-15 21:02:38 +03:00
|
|
|
let selectedLevels = this.logLevelsDropdown.getValue();
|
2021-03-26 23:49:38 +03:00
|
|
|
if(selectedLevels.length === 0 || logLevelsKeys.length === selectedLevels.length) {
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray;
|
2021-03-15 21:02:38 +03:00
|
|
|
};
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray.filter(e => selectedLevels.includes(e[4]));
|
2021-03-15 21:02:38 +03:00
|
|
|
};
|
2023-11-01 19:48:59 +03:00
|
|
|
return entriesArray;
|
2021-03-15 21:02:38 +03:00
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
setMsgFilter(entriesArray) {
|
2023-11-21 18:16:55 +03:00
|
|
|
let fPattern = this.msgFilter.value;
|
2023-11-01 19:48:59 +03:00
|
|
|
if(!fPattern) {
|
|
|
|
|
return entriesArray;
|
|
|
|
|
};
|
|
|
|
|
return this.setRegexpFilter(entriesArray, 5, fPattern);
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-10 02:39:58 +03:00
|
|
|
/**
|
|
|
|
|
* Creates the contents of the log area.
|
|
|
|
|
* Abstract method, must be overridden by a subclass!
|
|
|
|
|
*
|
|
|
|
|
* @param {Array<number, string|null, string|null, string|null, string|null, string|null>} logdataArray
|
|
|
|
|
* @returns {Node}
|
|
|
|
|
* Returns a DOM node containing the log area.
|
|
|
|
|
*/
|
2023-11-01 19:48:59 +03:00
|
|
|
makeLogArea(logdataArray) {
|
2023-11-11 19:42:54 +03:00
|
|
|
throw new Error('makeLogArea must be overridden by a subclass');
|
2021-03-11 18:24:24 +03:00
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
downloadLog(ev) {
|
2023-11-21 18:16:55 +03:00
|
|
|
let formElems = Array.from(this.logForm.elements);
|
2021-03-11 18:24:24 +03:00
|
|
|
formElems.forEach(e => e.disabled = true);
|
|
|
|
|
|
|
|
|
|
return this.getLogData(0).then(logdata => {
|
|
|
|
|
logdata = logdata || '';
|
|
|
|
|
let link = E('a', {
|
2021-03-15 21:02:38 +03:00
|
|
|
'download': this.viewName + '.log',
|
2023-11-01 19:48:59 +03:00
|
|
|
'href' : URL.createObjectURL(
|
2021-03-11 18:24:24 +03:00
|
|
|
new Blob([ logdata ], { type: 'text/plain' })),
|
|
|
|
|
});
|
|
|
|
|
link.click();
|
|
|
|
|
URL.revokeObjectURL(link.href);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
ui.addNotification(null,
|
|
|
|
|
E('p', {}, _('Download error') + ': ' + err.message));
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
formElems.forEach(e => e.disabled = false);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
restoreSettings() {
|
2021-03-11 18:24:24 +03:00
|
|
|
let tailValueLocal = localStorage.getItem(`luci-app-${this.viewName}-tailValue`);
|
|
|
|
|
if(tailValueLocal) {
|
|
|
|
|
this.tailValue = Number(tailValueLocal);
|
|
|
|
|
};
|
|
|
|
|
let logSortingLocal = localStorage.getItem(`luci-app-${this.viewName}-logSorting`);
|
|
|
|
|
if(logSortingLocal) {
|
|
|
|
|
this.logSortingValue = logSortingLocal;
|
|
|
|
|
};
|
2023-11-21 18:16:55 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
saveSettings(tailValue, logSortingValue) {
|
|
|
|
|
if(this.tailValue != tailValue) {
|
|
|
|
|
this.tailValue = (/^[0-9]+$/.test(tailValue)) ? tailValue : 0;
|
|
|
|
|
localStorage.setItem(
|
|
|
|
|
`luci-app-${this.viewName}-tailValue`, String(this.tailValue));
|
|
|
|
|
};
|
|
|
|
|
if(this.logSortingValue != logSortingValue) {
|
|
|
|
|
this.logSortingValue = logSortingValue;
|
|
|
|
|
localStorage.setItem(
|
|
|
|
|
`luci-app-${this.viewName}-logSorting`, this.logSortingValue);
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onSubmitForm(tail) {
|
|
|
|
|
let formElems = Array.from(this.logForm.elements);
|
|
|
|
|
formElems.forEach(e => e.disabled = true);
|
|
|
|
|
this.logDownloadBtn.disabled = true;
|
|
|
|
|
tail = (tail && tail > 0) ? tail : 0;
|
|
|
|
|
this.logSortingValue = this.logSorting.value;
|
|
|
|
|
|
|
|
|
|
return this.getLogData(tail).then(logdata => {
|
|
|
|
|
logdata = logdata || '';
|
|
|
|
|
this.logWrapper.innerHTML = '';
|
|
|
|
|
this.logWrapper.append(
|
|
|
|
|
this.makeLogArea(
|
|
|
|
|
this.setMsgFilter(
|
|
|
|
|
this.setFacilityFilter(
|
|
|
|
|
this.setLevelFilter(
|
|
|
|
|
this.setHostFilter(
|
|
|
|
|
this.setDateFilter(
|
|
|
|
|
this.parseLogData(logdata, tail)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if(logdata && logdata !== '') {
|
|
|
|
|
if(this.isFacilities && !this.logFacilitiesDropdown) {
|
|
|
|
|
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
|
|
|
|
};
|
|
|
|
|
if(this.isLevels && !this.logLevelsDropdown) {
|
|
|
|
|
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
|
|
|
|
};
|
|
|
|
|
if(this.isHosts && !this.logHostsDropdown) {
|
|
|
|
|
this.logHostsDropdownElem = this.makeLogHostsDropdownSection();
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
formElems.forEach(e => e.disabled = false);
|
|
|
|
|
this.logDownloadBtn.disabled = false;
|
|
|
|
|
this.fastTailValue = this.totalLogLines;
|
|
|
|
|
ui.hideModal();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
filterSettingsModal() {
|
|
|
|
|
return ui.showModal(_('Filter settings'), [
|
|
|
|
|
E('div', { 'class': 'cbi-map' }, [
|
|
|
|
|
E('div', { 'class': 'cbi-section' }, [
|
|
|
|
|
E('div', { 'class': 'cbi-section-node' }, [
|
|
|
|
|
E('div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
|
|
|
|
'for' : 'tailInput',
|
|
|
|
|
}, _('Last entries')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' },
|
|
|
|
|
this.tailInput
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
E('div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
|
|
|
|
'for' : 'timeFilter',
|
|
|
|
|
}, _('Timestamp filter')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' }, this.timeFilter),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
this.logHostsDropdownElem,
|
|
|
|
|
this.logFacilitiesDropdownElem,
|
|
|
|
|
this.logLevelsDropdownElem,
|
|
|
|
|
|
|
|
|
|
E('div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
|
|
|
|
'for' : 'msgFilter',
|
|
|
|
|
}, _('Message filter')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' }, this.msgFilter),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
E('div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
|
|
|
|
'for' : 'logSorting',
|
|
|
|
|
}, _('Sorting entries')),
|
|
|
|
|
E('div', { 'class': 'cbi-value-field' }, this.logSorting),
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
E('div', { 'class': 'right' }, [
|
|
|
|
|
this.logForm,
|
|
|
|
|
E('input', {
|
|
|
|
|
'type' : 'submit',
|
|
|
|
|
'form' : 'logForm',
|
|
|
|
|
'class': 'btn cbi-button-positive important',
|
|
|
|
|
'value': _('Apply'),
|
|
|
|
|
}),
|
|
|
|
|
' ',
|
|
|
|
|
E('button', {
|
|
|
|
|
'class': 'btn',
|
|
|
|
|
'click': ui.hideModal,
|
|
|
|
|
}, _('Close')),
|
|
|
|
|
]),
|
|
|
|
|
], 'cbi-modal');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
load() {
|
|
|
|
|
// Restoring settings from localStorage
|
|
|
|
|
this.restoreSettings();
|
2021-03-11 18:24:24 +03:00
|
|
|
return this.getLogData(this.tailValue);
|
|
|
|
|
},
|
|
|
|
|
|
2023-11-01 19:48:59 +03:00
|
|
|
render(logdata) {
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logWrapper = E('div', {
|
2021-11-04 18:57:08 +03:00
|
|
|
'id' : 'logWrapper',
|
2023-11-10 02:39:58 +03:00
|
|
|
'style': 'width:100%; min-height:20em'
|
2021-03-11 18:24:24 +03:00
|
|
|
}, this.makeLogArea(this.parseLogData(logdata, this.tailValue)));
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.fastTailValue = this.totalLogLines;
|
|
|
|
|
|
|
|
|
|
this.tailInput = E('input', {
|
2021-12-05 19:18:32 +03:00
|
|
|
'id' : 'tailInput',
|
|
|
|
|
'name' : 'tailInput',
|
|
|
|
|
'type' : 'text',
|
|
|
|
|
'form' : 'logForm',
|
|
|
|
|
'class' : 'cbi-input-text',
|
|
|
|
|
'style' : 'width:4em !important; min-width:4em !important',
|
2021-03-11 18:24:24 +03:00
|
|
|
'maxlength': 5,
|
|
|
|
|
});
|
2023-11-21 18:16:55 +03:00
|
|
|
this.tailInput.value = (this.tailValue === 0) ? null : this.tailValue;
|
|
|
|
|
ui.addValidator(this.tailInput, 'uinteger', true);
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logHostsDropdownElem = '';
|
|
|
|
|
this.logFacilitiesDropdownElem = '';
|
|
|
|
|
this.logLevelsDropdownElem = '';
|
2021-03-27 18:35:35 +03:00
|
|
|
if(this.isLevels) {
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logLevelsDropdownElem = this.makeLogLevelsDropdownSection();
|
2021-03-27 18:35:35 +03:00
|
|
|
};
|
2023-11-01 19:48:59 +03:00
|
|
|
if(this.isFacilities) {
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logFacilitiesDropdownElem = this.makeLogFacilitiesDropdownSection();
|
2023-11-01 19:48:59 +03:00
|
|
|
};
|
2021-03-27 18:35:35 +03:00
|
|
|
if(this.isHosts) {
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logHostsDropdownElem = this.makeLogHostsDropdownSection();
|
2021-03-11 18:24:24 +03:00
|
|
|
};
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.timeFilter = E('input', {
|
2023-11-01 19:48:59 +03:00
|
|
|
'id' : 'timeFilter',
|
|
|
|
|
'name' : 'timeFilter',
|
|
|
|
|
'type' : 'text',
|
|
|
|
|
'form' : 'logForm',
|
|
|
|
|
'class' : 'cbi-input-text',
|
|
|
|
|
'placeholder': _('Type an expression...'),
|
|
|
|
|
});
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.msgFilter = E('input', {
|
2023-11-01 19:48:59 +03:00
|
|
|
'id' : 'msgFilter',
|
|
|
|
|
'name' : 'msgFilter',
|
2021-11-04 18:57:08 +03:00
|
|
|
'type' : 'text',
|
|
|
|
|
'form' : 'logForm',
|
|
|
|
|
'class' : 'cbi-input-text',
|
2021-03-11 18:24:24 +03:00
|
|
|
'placeholder': _('Type an expression...'),
|
|
|
|
|
});
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logSorting = E('select', {
|
2021-11-04 18:57:08 +03:00
|
|
|
'id' : 'logSorting',
|
|
|
|
|
'name' : 'logSorting',
|
|
|
|
|
'form' : 'logForm',
|
2021-03-11 18:24:24 +03:00
|
|
|
'class': "cbi-input-select",
|
|
|
|
|
}, [
|
|
|
|
|
E('option', { 'value': 'asc' }, _('ascending')),
|
|
|
|
|
E('option', { 'value': 'desc' }, _('descending')),
|
|
|
|
|
]);
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logSorting.value = this.logSortingValue;
|
2021-03-11 18:24:24 +03:00
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logDownloadBtn = E('button', {
|
2021-11-04 18:57:08 +03:00
|
|
|
'id' : 'logDownloadBtn',
|
|
|
|
|
'name' : 'logDownloadBtn',
|
2021-03-11 18:24:24 +03:00
|
|
|
'class': 'cbi-button btn',
|
|
|
|
|
'click': ui.createHandlerFn(this, this.downloadLog),
|
|
|
|
|
}, _('Download log'));
|
|
|
|
|
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logForm = E('form', {
|
|
|
|
|
'id' : 'logForm',
|
|
|
|
|
'name' : 'logForm',
|
|
|
|
|
'style' : 'display:inline-block; margin-top:0.5em',
|
|
|
|
|
'submit': ui.createHandlerFn(this, function(ev) {
|
|
|
|
|
ev.preventDefault();
|
|
|
|
|
// Saving settings to localStorage
|
|
|
|
|
this.saveSettings(this.tailInput.value, this.logSorting.value);
|
|
|
|
|
return this.onSubmitForm(Number(this.tailInput.value));
|
|
|
|
|
}),
|
|
|
|
|
}, E('span', {}, ' '));
|
2023-11-01 19:48:59 +03:00
|
|
|
|
2023-11-10 02:39:58 +03:00
|
|
|
document.body.append(
|
|
|
|
|
E('div', {
|
2023-11-21 18:16:55 +03:00
|
|
|
'align': 'right',
|
|
|
|
|
'class': 'log-side-block',
|
|
|
|
|
'style': `right:1px; top:${window.innerHeight / 2 - 60}px`,
|
2023-11-10 02:39:58 +03:00
|
|
|
}, [
|
|
|
|
|
E('button', {
|
2023-11-21 18:16:55 +03:00
|
|
|
'title': _('Refresh log'),
|
|
|
|
|
'class': 'btn log-side-btn',
|
|
|
|
|
'click': ui.createHandlerFn(this, function(ev) {
|
|
|
|
|
ev.target.blur();
|
|
|
|
|
return this.onSubmitForm(
|
|
|
|
|
Math.max(Number(this.tailValue), this.fastTailValue));
|
|
|
|
|
}),
|
|
|
|
|
}, '🗘'),
|
|
|
|
|
E('button', {
|
|
|
|
|
'title': _('Get more entries'),
|
|
|
|
|
'class': 'btn log-side-btn',
|
|
|
|
|
'style': 'margin-top:1px !important',
|
|
|
|
|
'click': ui.createHandlerFn(this, function(ev) {
|
|
|
|
|
ev.target.blur();
|
|
|
|
|
if(this.fastTailValue === null) {
|
|
|
|
|
this.fastTailValue = Number(this.tailValue);
|
|
|
|
|
};
|
|
|
|
|
this.fastTailValue += this.fastTailIncrement;
|
|
|
|
|
return this.onSubmitForm(this.fastTailValue);
|
|
|
|
|
}),
|
|
|
|
|
}, `+${this.fastTailIncrement}`),
|
|
|
|
|
E('button', {
|
|
|
|
|
'title': _('Get all entries'),
|
|
|
|
|
'class': 'btn log-side-btn',
|
|
|
|
|
'style': 'margin-top:1px !important',
|
|
|
|
|
'click': ui.createHandlerFn(this, function(ev) {
|
|
|
|
|
ev.target.blur();
|
|
|
|
|
return this.onSubmitForm(0);
|
|
|
|
|
}),
|
|
|
|
|
}, '𝍤'),
|
|
|
|
|
E('button', {
|
|
|
|
|
'title': _('Filter settings'),
|
|
|
|
|
'class': 'btn log-side-btn',
|
|
|
|
|
'style': 'margin-top:10px !important',
|
|
|
|
|
'click': ev => {
|
|
|
|
|
ev.target.blur();
|
|
|
|
|
this.filterSettingsModal();
|
|
|
|
|
},
|
|
|
|
|
}, '🗔'),
|
|
|
|
|
|
|
|
|
|
E('button', {
|
|
|
|
|
'class': 'btn log-side-btn',
|
|
|
|
|
'style': 'margin-top:10px !important',
|
2023-11-10 02:39:58 +03:00
|
|
|
'click': ev => {
|
|
|
|
|
document.getElementById('logTitle').scrollIntoView(true);
|
|
|
|
|
ev.target.blur();
|
|
|
|
|
},
|
|
|
|
|
}, '↑'),
|
|
|
|
|
E('button', {
|
2023-11-21 18:16:55 +03:00
|
|
|
'class': 'btn log-side-btn',
|
2023-11-10 02:39:58 +03:00
|
|
|
'style': 'margin-top:1px !important',
|
|
|
|
|
'click': ev => {
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logWrapper.scrollIntoView(false);
|
2023-11-10 02:39:58 +03:00
|
|
|
ev.target.blur();
|
|
|
|
|
},
|
|
|
|
|
}, '↓'),
|
|
|
|
|
])
|
|
|
|
|
);
|
|
|
|
|
|
2021-03-11 18:24:24 +03:00
|
|
|
return E([
|
|
|
|
|
E('h2', { 'id': 'logTitle', 'class': 'fade-in' }, this.title),
|
|
|
|
|
E('div', { 'class': 'cbi-section-descr fade-in' }),
|
|
|
|
|
E('div', { 'class': 'cbi-section fade-in' },
|
|
|
|
|
E('div', { 'class': 'cbi-section-node' }, [
|
|
|
|
|
E('div', { 'class': 'cbi-value' }, [
|
|
|
|
|
E('label', {
|
|
|
|
|
'class': 'cbi-value-title',
|
2023-11-21 18:16:55 +03:00
|
|
|
'for' : 'filterSettings',
|
|
|
|
|
}, _('Filter settings')),
|
2021-03-11 18:24:24 +03:00
|
|
|
E('div', { 'class': 'cbi-value-field' }, [
|
2023-11-21 18:16:55 +03:00
|
|
|
E('div', {},
|
|
|
|
|
E('button', {
|
|
|
|
|
'class': 'cbi-button btn cbi-button-action',
|
|
|
|
|
'click': L.bind(this.filterSettingsModal, this),
|
|
|
|
|
}, _('Edit'))
|
|
|
|
|
),
|
2022-05-23 22:01:50 +03:00
|
|
|
E('input', {
|
2023-11-21 18:16:55 +03:00
|
|
|
'id' : 'filterSettings',
|
2022-05-23 22:01:50 +03:00
|
|
|
'type': 'hidden',
|
|
|
|
|
}),
|
2021-03-11 18:24:24 +03:00
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
])
|
|
|
|
|
),
|
|
|
|
|
E('div', { 'class': 'cbi-section fade-in' },
|
2023-11-10 02:39:58 +03:00
|
|
|
E('div', { 'class': 'cbi-section-node' },
|
2023-11-21 18:16:55 +03:00
|
|
|
this.logWrapper
|
2023-11-10 02:39:58 +03:00
|
|
|
)
|
2021-03-11 18:24:24 +03:00
|
|
|
),
|
|
|
|
|
E('div', { 'class': 'cbi-section fade-in' },
|
|
|
|
|
E('div', { 'class': 'cbi-section-node' },
|
|
|
|
|
E('div', { 'class': 'cbi-value' },
|
2023-11-21 18:16:55 +03:00
|
|
|
E('div', {
|
|
|
|
|
'align': 'left',
|
|
|
|
|
'style': 'width:100%',
|
|
|
|
|
}, this.logDownloadBtn)
|
2021-03-15 21:02:38 +03:00
|
|
|
),
|
2021-03-11 18:24:24 +03:00
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
]);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleSaveApply: null,
|
2021-12-05 19:18:32 +03:00
|
|
|
handleSave : null,
|
2021-11-04 18:57:08 +03:00
|
|
|
handleReset : null,
|
2021-03-11 18:24:24 +03:00
|
|
|
}),
|
|
|
|
|
})
|