show trigger tags, #487
This commit is contained in:
6
dist/panel-triggers/partials/module.html
vendored
6
dist/panel-triggers/partials/module.html
vendored
@@ -16,6 +16,12 @@
|
||||
<i ng-if="trigger.maintenance" class="fa fa-wrench zbx-maintenance-icon"></i>
|
||||
{{ ctrl.formatHostName(trigger) }}
|
||||
</span>
|
||||
|
||||
<span class="zbx-trigger-tags" ng-if="ctrl.panel.showTags && trigger.tags">
|
||||
<span ng-repeat="tag in trigger.tags" tag-color-from-name="tag.tag+tag.value" class="label label-tag zbx-tag">
|
||||
{{tag.tag}}: {{tag.value}}
|
||||
</span>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p class="alert-list-text">
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
checked="ctrl.panel.hostTechNameField"
|
||||
on-change="ctrl.render()">
|
||||
</gf-form-switch>
|
||||
<gf-form-switch class="gf-form"
|
||||
label-class="width-9"
|
||||
label="Tags"
|
||||
checked="ctrl.panel.showTags"
|
||||
on-change="ctrl.render()">
|
||||
</gf-form-switch>
|
||||
<gf-form-switch class="gf-form"
|
||||
label-class="width-9"
|
||||
label="Status"
|
||||
|
||||
2
dist/panel-triggers/specs/migrations.spec.js
vendored
2
dist/panel-triggers/specs/migrations.spec.js
vendored
@@ -51,6 +51,7 @@ describe('Triggers Panel schema migration', () => {
|
||||
},
|
||||
hostField: true,
|
||||
hostTechNameField: false,
|
||||
showTags: true,
|
||||
statusField: false,
|
||||
severityField: false,
|
||||
descriptionField: true,
|
||||
@@ -86,6 +87,7 @@ describe('Triggers Panel schema migration', () => {
|
||||
},
|
||||
hostField: true,
|
||||
hostTechNameField: false,
|
||||
showTags: true,
|
||||
statusField: true,
|
||||
severityField: true,
|
||||
descriptionField: true,
|
||||
|
||||
10
dist/panel-triggers/triggers_panel_ctrl.js
vendored
10
dist/panel-triggers/triggers_panel_ctrl.js
vendored
@@ -132,6 +132,7 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
||||
// Fields
|
||||
hostField: true,
|
||||
hostTechNameField: false,
|
||||
showTags: true,
|
||||
statusField: true,
|
||||
severityField: true,
|
||||
descriptionField: true,
|
||||
@@ -467,6 +468,11 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
||||
triggerObj.hostTechName = trigger.hosts[0].host;
|
||||
}
|
||||
|
||||
// Set tags if present
|
||||
if (trigger.tags && trigger.tags.length === 0) {
|
||||
trigger.tags = null;
|
||||
}
|
||||
|
||||
// Handle multi-line description
|
||||
if (trigger.comments) {
|
||||
trigger.comments = trigger.comments.replace('\n', '<br>');
|
||||
@@ -682,11 +688,15 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
||||
triggerCardElem.find('.alert-list-icon').css({ 'font-size': fontSize + '%' });
|
||||
triggerCardElem.find('.alert-list-title').css({ 'font-size': fontSize + '%' });
|
||||
triggerCardElem.find('.alert-list-text').css({ 'font-size': fontSize * 0.8 + '%' });
|
||||
triggerCardElem.find('.zbx-tag').css({ 'font-size': fontSize * 0.6 + '%' });
|
||||
triggerCardElem.find('.zbx-tag').css({ 'line-height': fontSize / 100 * 16 + 'px' });
|
||||
} else {
|
||||
// remove css
|
||||
triggerCardElem.find('.alert-list-icon').css({ 'font-size': '' });
|
||||
triggerCardElem.find('.alert-list-title').css({ 'font-size': '' });
|
||||
triggerCardElem.find('.alert-list-text').css({ 'font-size': '' });
|
||||
triggerCardElem.find('.zbx-tag').css({ 'font-size': '' });
|
||||
triggerCardElem.find('.zbx-tag').css({ 'line-height': '' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user