Enhance drawer for alarms and events panel
Enhance the drawer for alarms and events panel to display the entire data set and not just a subset. Remove the link to the details page for alarms and events. Remove the details page for events. The details page for alarms is being used by the “Admin/Platform/Provider Network Topology“ panel. Story: 2004818 Task: 29048 Depends-On: https://review.openstack.org/#/c/633060/ Change-Id: I81ac78416ab52ec2b8942be08ed3e5e12976a97d Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
This commit is contained in:
parent
8569c522fc
commit
ce1a444f1d
|
@ -1,2 +1,2 @@
|
||||||
SRC_DIR="starlingx-dashboard"
|
SRC_DIR="starlingx-dashboard"
|
||||||
TIS_PATCH_VER=24
|
TIS_PATCH_VER=25
|
||||||
|
|
|
@ -107,6 +107,10 @@ def alarm_list(request, search_opts=None):
|
||||||
paginate = False
|
paginate = False
|
||||||
include_suppress = False
|
include_suppress = False
|
||||||
|
|
||||||
|
# If expand is set to true then all the data of the alarm is returned not
|
||||||
|
# just a subset.
|
||||||
|
expand = False
|
||||||
|
|
||||||
if search_opts is None:
|
if search_opts is None:
|
||||||
search_opts = {}
|
search_opts = {}
|
||||||
|
|
||||||
|
@ -124,6 +128,9 @@ def alarm_list(request, search_opts=None):
|
||||||
elif suppression == FM_SUPPRESS_HIDE:
|
elif suppression == FM_SUPPRESS_HIDE:
|
||||||
include_suppress = False
|
include_suppress = False
|
||||||
|
|
||||||
|
if "expand" in search_opts:
|
||||||
|
expand = True
|
||||||
|
|
||||||
if 'paginate' in search_opts:
|
if 'paginate' in search_opts:
|
||||||
paginate = search_opts.pop('paginate')
|
paginate = search_opts.pop('paginate')
|
||||||
if paginate:
|
if paginate:
|
||||||
|
@ -131,7 +138,7 @@ def alarm_list(request, search_opts=None):
|
||||||
|
|
||||||
alarms = fmclient(request).alarm.list(
|
alarms = fmclient(request).alarm.list(
|
||||||
limit=limit, marker=marker, sort_key=sort_key, sort_dir=sort_dir,
|
limit=limit, marker=marker, sort_key=sort_key, sort_dir=sort_dir,
|
||||||
include_suppress=include_suppress)
|
include_suppress=include_suppress, expand=expand)
|
||||||
|
|
||||||
has_more_data = False
|
has_more_data = False
|
||||||
if paginate and len(alarms) > page_size:
|
if paginate and len(alarms) > page_size:
|
||||||
|
@ -178,6 +185,11 @@ class EventLog(base.APIResourceWrapper):
|
||||||
|
|
||||||
def event_log_list(request, search_opts=None):
|
def event_log_list(request, search_opts=None):
|
||||||
paginate = False
|
paginate = False
|
||||||
|
|
||||||
|
# If expand is set to true then all the data of the alarm is returned not
|
||||||
|
# just a subset.
|
||||||
|
expand = False
|
||||||
|
|
||||||
if search_opts is None:
|
if search_opts is None:
|
||||||
search_opts = {}
|
search_opts = {}
|
||||||
|
|
||||||
|
@ -210,13 +222,17 @@ def event_log_list(request, search_opts=None):
|
||||||
elif suppression == FM_SUPPRESS_HIDE:
|
elif suppression == FM_SUPPRESS_HIDE:
|
||||||
include_suppress = False
|
include_suppress = False
|
||||||
|
|
||||||
|
if "expand" in search_opts:
|
||||||
|
expand = True
|
||||||
|
|
||||||
logs = fmclient(request)\
|
logs = fmclient(request)\
|
||||||
.event_log.list(q=query,
|
.event_log.list(q=query,
|
||||||
limit=limit,
|
limit=limit,
|
||||||
marker=marker,
|
marker=marker,
|
||||||
alarms=alarms,
|
alarms=alarms,
|
||||||
logs=logs,
|
logs=logs,
|
||||||
include_suppress=include_suppress)
|
include_suppress=include_suppress,
|
||||||
|
expand=expand)
|
||||||
|
|
||||||
has_more_data = False
|
has_more_data = False
|
||||||
if paginate and len(logs) > page_size:
|
if paginate and len(logs) > page_size:
|
||||||
|
|
|
@ -35,7 +35,8 @@ class Alarms(generic.View):
|
||||||
|
|
||||||
@rest_utils.ajax()
|
@rest_utils.ajax()
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
search_opts = {'suppression': 'SUPPRESS_SHOW'}
|
search_opts = {'suppression': 'SUPPRESS_SHOW', 'expand': True}
|
||||||
|
|
||||||
result = fm.alarm_list(request, search_opts=search_opts)
|
result = fm.alarm_list(request, search_opts=search_opts)
|
||||||
|
|
||||||
return {'items': [sc.to_dict() for sc in result]}
|
return {'items': [sc.to_dict() for sc in result]}
|
||||||
|
@ -59,7 +60,8 @@ class Events(generic.View):
|
||||||
|
|
||||||
@rest_utils.ajax()
|
@rest_utils.ajax()
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
search_opts = {'suppression': 'SUPPRESS_SHOW'}
|
search_opts = {'suppression': 'SUPPRESS_SHOW', 'expand': True}
|
||||||
|
|
||||||
result, _more = fm.event_log_list(request, search_opts=search_opts)
|
result, _more = fm.event_log_list(request, search_opts=search_opts)
|
||||||
|
|
||||||
return {'items': [sc.to_dict() for sc in result]}
|
return {'items': [sc.to_dict() for sc in result]}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAlarms() {
|
function getAlarms() {
|
||||||
var results = apiService.get('/api/fm/alarm_list/?include_suppress=True')
|
var results = apiService.get('/api/fm/alarm_list/')
|
||||||
return results
|
return results
|
||||||
.error(function () {
|
.error(function () {
|
||||||
toastService.clearErrors();
|
toastService.clearErrors();
|
||||||
|
|
|
@ -68,8 +68,7 @@
|
||||||
.tableColumns
|
.tableColumns
|
||||||
.append({
|
.append({
|
||||||
id: 'alarm_id',
|
id: 'alarm_id',
|
||||||
priority: 1,
|
priority: 1
|
||||||
urlFunction: service.urlFunction
|
|
||||||
})
|
})
|
||||||
.append({
|
.append({
|
||||||
id: 'reason_text',
|
id: 'reason_text',
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<hz-resource-property-list
|
<hz-resource-property-list
|
||||||
resource-type-name="OS::StarlingX::ActiveAlarms"
|
resource-type-name="OS::StarlingX::ActiveAlarms"
|
||||||
item="item"
|
item="item"
|
||||||
property-groups="[['uuid', 'mgmt_affecting']]">
|
property-groups="[['uuid', 'alarm_state', 'alarm_type', 'entity_type_id'],
|
||||||
|
['service_affecting', 'mgmt_affecting', 'probable_cause'],
|
||||||
|
['proposed_repair_action']]">
|
||||||
</hz-resource-property-list>
|
</hz-resource-property-list>
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License. You may obtain
|
|
||||||
* a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2019 Wind River Systems, Inc.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc overview
|
|
||||||
* @ngname horizon.dashboard.fault_management.events.details
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Provides details features for Event.
|
|
||||||
*/
|
|
||||||
angular
|
|
||||||
.module('horizon.dashboard.fault_management.events.details', [
|
|
||||||
'horizon.app.core',
|
|
||||||
'horizon.framework.conf'
|
|
||||||
])
|
|
||||||
.run(registerDetails);
|
|
||||||
|
|
||||||
registerDetails.$inject = [
|
|
||||||
'horizon.app.core.openstack-service-api.fm',
|
|
||||||
'horizon.dashboard.fault_management.events.basePath',
|
|
||||||
'horizon.dashboard.fault_management.events.resourceType',
|
|
||||||
'horizon.framework.conf.resource-type-registry.service'
|
|
||||||
];
|
|
||||||
|
|
||||||
function registerDetails(
|
|
||||||
api,
|
|
||||||
basePath,
|
|
||||||
resourceType,
|
|
||||||
registry
|
|
||||||
) {
|
|
||||||
registry.getResourceType(resourceType)
|
|
||||||
.setLoadFunction(loadFunction)
|
|
||||||
.detailsViews.append({
|
|
||||||
id: 'eventsDetailsOverview',
|
|
||||||
name: gettext('Overview'),
|
|
||||||
template: basePath + 'details/overview.html'
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function loadFunction(uuid) {
|
|
||||||
return api.getEvent(uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
|
@ -1,5 +1,8 @@
|
||||||
<hz-resource-property-list
|
<hz-resource-property-list
|
||||||
resource-type-name="OS::StarlingX::Events"
|
resource-type-name="OS::StarlingX::Events"
|
||||||
item="item"
|
item="item"
|
||||||
property-groups="[['uuid', 'event_type']]">
|
property-groups="[['uuid', 'event_log_type', 'suppression'],
|
||||||
|
['event_type', 'entity_type_id', 'service_affecting'],
|
||||||
|
['probable_cause', 'proposed_repair_action']]">
|
||||||
|
|
||||||
</hz-resource-property-list>
|
</hz-resource-property-list>
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2019 Wind River Systems, Inc.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
angular
|
|
||||||
.module('horizon.dashboard.fault_management.events')
|
|
||||||
.controller('horizon.dashboard.fault_management.events.OverviewController', controller);
|
|
||||||
|
|
||||||
controller.$inject = [
|
|
||||||
'$scope',
|
|
||||||
'horizon.dashboard.fault_management.events.service'
|
|
||||||
];
|
|
||||||
|
|
||||||
function controller(
|
|
||||||
$scope, eventService
|
|
||||||
) {
|
|
||||||
var ctrl = this;
|
|
||||||
ctrl.event = {};
|
|
||||||
|
|
||||||
$scope.context.loadPromise.then(onGetEvent);
|
|
||||||
|
|
||||||
function onGetEvent(item) {
|
|
||||||
|
|
||||||
eventService.setEventType(item.data);
|
|
||||||
|
|
||||||
ctrl.event = item.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
|
@ -1,17 +0,0 @@
|
||||||
<div ng-controller="horizon.dashboard.fault_management.events.OverviewController as ctrl">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 detail">
|
|
||||||
<h3> {$ ctrl.event.state $} - {$ ctrl.event.event_log_id $} - {$ctrl.event.reason_text $} </h3>
|
|
||||||
<hr>
|
|
||||||
<hz-resource-property-list
|
|
||||||
resource-type-name="OS::StarlingX::Events"
|
|
||||||
cls="dl-horizontal"
|
|
||||||
item="ctrl.event"
|
|
||||||
property-groups="[['uuid', 'event_log_id', 'severity', 'state', 'event_log_type', 'timestamp',
|
|
||||||
'suppression', 'entity_instance_id', 'entity_type_id',
|
|
||||||
'probable_cause', 'proposed_repair_action', 'service_affecting',
|
|
||||||
'reason_text', 'event_type']]">
|
|
||||||
</hz-resource-property-list>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -30,8 +30,7 @@
|
||||||
*/
|
*/
|
||||||
angular
|
angular
|
||||||
.module('horizon.dashboard.fault_management.events', [
|
.module('horizon.dashboard.fault_management.events', [
|
||||||
'ngRoute',
|
'ngRoute'
|
||||||
'horizon.dashboard.fault_management.events.details'
|
|
||||||
])
|
])
|
||||||
.constant('horizon.dashboard.fault_management.events.resourceType', 'OS::StarlingX::Events')
|
.constant('horizon.dashboard.fault_management.events.resourceType', 'OS::StarlingX::Events')
|
||||||
.run(run)
|
.run(run)
|
||||||
|
@ -76,8 +75,7 @@
|
||||||
})
|
})
|
||||||
.append({
|
.append({
|
||||||
id: 'event_log_id',
|
id: 'event_log_id',
|
||||||
priority: 1,
|
priority: 1
|
||||||
urlFunction: service.urlFunction
|
|
||||||
})
|
})
|
||||||
.append({
|
.append({
|
||||||
id: 'reason_text',
|
id: 'reason_text',
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
service.$inject = [
|
service.$inject = [
|
||||||
'$filter',
|
'$filter',
|
||||||
'horizon.app.core.detailRoute',
|
|
||||||
'horizon.app.core.openstack-service-api.fm',
|
'horizon.app.core.openstack-service-api.fm',
|
||||||
'$q',
|
'$q',
|
||||||
'horizon.framework.conf.resource-type-registry.service',
|
'horizon.framework.conf.resource-type-registry.service',
|
||||||
|
@ -44,13 +43,12 @@
|
||||||
* but do not need to be restricted to such use. Each exposed function
|
* but do not need to be restricted to such use. Each exposed function
|
||||||
* is documented below.
|
* is documented below.
|
||||||
*/
|
*/
|
||||||
function service($filter, detailRoute, api, $q, registry, resourceType) {
|
function service($filter, api, $q, registry, resourceType) {
|
||||||
|
|
||||||
var showSuppressColumn = null;
|
var showSuppressColumn = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getPromise: getPromise,
|
getPromise: getPromise,
|
||||||
urlFunction: urlFunction,
|
|
||||||
suppressColAllowedPromiseFunction: suppressColAllowedPromiseFunction,
|
suppressColAllowedPromiseFunction: suppressColAllowedPromiseFunction,
|
||||||
getSuppressionList: getSuppressionList,
|
getSuppressionList: getSuppressionList,
|
||||||
setEventType: setEventType
|
setEventType: setEventType
|
||||||
|
@ -83,10 +81,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function urlFunction(item) {
|
|
||||||
return detailRoute + 'OS::StarlingX::Events/' + item.uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSuppressionList() {
|
function getSuppressionList() {
|
||||||
var include_unsuppressed = false;
|
var include_unsuppressed = false;
|
||||||
return api.getEventsSuppression(include_unsuppressed).then(modifyResponseSupp);
|
return api.getEventsSuppression(include_unsuppressed).then(modifyResponseSupp);
|
||||||
|
|
|
@ -46,14 +46,6 @@
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('urlFunction', function() {
|
|
||||||
it("get url", inject(function($injector) {
|
|
||||||
var detailRoute = $injector.get('horizon.app.core.detailRoute');
|
|
||||||
var result = service.urlFunction({uuid:"123abc"});
|
|
||||||
expect(result).toBe(detailRoute + "OS::StarlingX::Events/123abc");
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue