diff --git a/vitragedashboard/static/dashboard/project/alarmList/alarmList.controller.js b/vitragedashboard/static/dashboard/project/alarmList/alarmList.controller.js index 2aabcbc..8cdd274 100644 --- a/vitragedashboard/static/dashboard/project/alarmList/alarmList.controller.js +++ b/vitragedashboard/static/dashboard/project/alarmList/alarmList.controller.js @@ -5,9 +5,9 @@ .module('horizon.dashboard.project.vitrage') .controller('AlarmListController', AlarmListController); - AlarmListController.$inject = ['$scope', '$modal', 'vitrageTopologySrv','$interval']; + AlarmListController.$inject = ['$scope', 'modalSrv', 'vitrageTopologySrv','$interval']; - function AlarmListController($scope, $modal, vitrageTopologySrv,$interval) { + function AlarmListController($scope, modalSrv, vitrageTopologySrv,$interval) { var alarmList = this; alarmList.alarms = []; alarmList.ialarms = []; @@ -33,7 +33,7 @@ } $scope.$on('$destroy',function(){ alarmList.stopCollectData(); - }) + }); alarmList.autoRefreshChanged = function(){ if (alarmList.checkboxAutoRefresh){ @@ -42,7 +42,7 @@ }else{ stopCollectData(); } - } + }; function getData() { vitrageTopologySrv.getAlarms('all').then(function(result){ @@ -61,7 +61,7 @@ }} }; - $modal.open(modalOptions); + modalSrv.show(modalOptions); } } diff --git a/vitragedashboard/static/dashboard/project/components/alarms/alarms.directive.js b/vitragedashboard/static/dashboard/project/components/alarms/alarms.directive.js index 72e9167..92d82a6 100644 --- a/vitragedashboard/static/dashboard/project/components/alarms/alarms.directive.js +++ b/vitragedashboard/static/dashboard/project/components/alarms/alarms.directive.js @@ -13,10 +13,10 @@ function hzAlarms() { controllerAs: 'alarmsCtrl' }; - AlarmsController.$inject = ['$scope', '$modal', 'vitrageTopologySrv']; + AlarmsController.$inject = ['$scope', 'modalSrv', 'vitrageTopologySrv']; return directive; - function AlarmsController($scope, $modal, vitrageTopologySrv) { + function AlarmsController($scope, modalSrv, vitrageTopologySrv) { var alarmsCtrl = this; $scope.$watch('selected', function(newData, oldData) { @@ -39,7 +39,7 @@ function hzAlarms() { }} }; - $modal.open(modalOptions); + modalSrv.show(modalOptions); } } } diff --git a/vitragedashboard/static/dashboard/project/components/rca/rcaContainer.controller.js b/vitragedashboard/static/dashboard/project/components/rca/rcaContainer.controller.js index 0f5fe41..877db25 100644 --- a/vitragedashboard/static/dashboard/project/components/rca/rcaContainer.controller.js +++ b/vitragedashboard/static/dashboard/project/components/rca/rcaContainer.controller.js @@ -5,13 +5,17 @@ .module('horizon.dashboard.project.vitrage') .controller('RcaContainerController', RcaContainerController); - RcaContainerController.$inject = ['alarm', '$scope', 'vitrageTopologySrv']; + RcaContainerController.$inject = ['alarm', '$scope', 'modalSrv', 'vitrageTopologySrv']; - function RcaContainerController(alarm, $scope, vitrageTopologySrv) { + function RcaContainerController(alarm, $scope, modalSrv, vitrageTopologySrv) { var vm = this; $scope.STATIC_URL = STATIC_URL; vm.isLoading = true; + $scope.closeModal = function () { + modalSrv.close(); + }; + var getData = function() { vm.isLoading = true; vitrageTopologySrv.getRootCauseAnalysis(alarm.vitrage_id) diff --git a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.directive.js b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.directive.js index 1846882..672425e 100644 --- a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.directive.js +++ b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.directive.js @@ -242,7 +242,7 @@ function hzRootCauseAnalysisGraph($filter) { scope.onCenterGraph = function() { centerGraph(false); - } + }; } } diff --git a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.html b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.html index 9913977..3b905fd 100644 --- a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.html +++ b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.html @@ -1,5 +1,8 @@
- +
+ + +
diff --git a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.scss b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.scss index 70444d3..be3e691 100644 --- a/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.scss +++ b/vitragedashboard/static/dashboard/project/components/rca/rootCauseAnalysisGraph.scss @@ -54,9 +54,18 @@ #arrowhead { fill: #656a70 !important; } + .fa{ display: inline; } + + .controls { + padding: 15px; + float: right; + font-size:30px; + cursor: pointer; + } + .center-button { float: right; margin: 10px 10px 0 0; diff --git a/vitragedashboard/static/dashboard/project/components/template/templateContainer.controller.js b/vitragedashboard/static/dashboard/project/components/template/templateContainer.controller.js index 8797a67..17fcf89 100644 --- a/vitragedashboard/static/dashboard/project/components/template/templateContainer.controller.js +++ b/vitragedashboard/static/dashboard/project/components/template/templateContainer.controller.js @@ -5,22 +5,29 @@ .module('horizon.dashboard.project.vitrage') .controller('TemplateContainerController', TemplateContainerController); - TemplateContainerController.$inject = ['template', '$scope', 'vitrageTopologySrv']; + TemplateContainerController.$inject = ['$scope', 'modalSrv', 'vitrageTopologySrv', 'template']; - function TemplateContainerController(template, $scope, vitrageTopologySrv) { + function TemplateContainerController($scope, modalSrv, vitrageTopologySrv, template) { var vm = this; $scope.STATIC_URL = STATIC_URL; vm.isLoading = true; var getData = function() { vm.isLoading = true; + + $scope.closeModal = function () { + modalSrv.close(); + }; + vitrageTopologySrv.getTemplates(template.uuid) .then( function success(result) { + $scope.yaml_view = false; $scope.data = result.data; + $scope.str_data = JSON.stringify(result.data, null, 4); }, function error(result) { - console.log('Error in Template Show:', result); + console.error('Error in Template Show:', result); } ) }; diff --git a/vitragedashboard/static/dashboard/project/components/template/templateContainer.html b/vitragedashboard/static/dashboard/project/components/template/templateContainer.html index a776eef..5ef98e2 100644 --- a/vitragedashboard/static/dashboard/project/components/template/templateContainer.html +++ b/vitragedashboard/static/dashboard/project/components/template/templateContainer.html @@ -1,38 +1,46 @@
-

Template: {$ data.metadata.name $}

-
-

Entities

-
-
- {$ entity.entity.template_id $} -
-
    -
  • - {$ property $}: {$ value $} -
  • -
-
-
-
-
+
+ +
-
-

Relationships

-
-
- {$ rel.relationship.template_id $} -
-
    -
  • - {$ property $}: {$ value $} -
  • -
-
-
+

+ Template: + {$ data.metadata.name $} +

+
+
+

Entities

+
+
+ {$ entity.entity.template_id $} +
+
    +
  • + {$ property $}: {$ value $} +
  • +
+
+
+
+
-
-
-
+
+

Relationships

+
+
+ {$ rel.relationship.template_id $} +
+
    +
  • + {$ property $}: {$ value $} +
  • +
+
+
+
+
+
+

Scenarios

@@ -59,4 +67,10 @@

+
+
+
+            {$ str_data $}
+        
+
\ No newline at end of file diff --git a/vitragedashboard/static/dashboard/project/components/template/templateContainer.scss b/vitragedashboard/static/dashboard/project/components/template/templateContainer.scss index bda1934..2531c6f 100644 --- a/vitragedashboard/static/dashboard/project/components/template/templateContainer.scss +++ b/vitragedashboard/static/dashboard/project/components/template/templateContainer.scss @@ -18,8 +18,19 @@ } } +.controls { + padding: 15px; + float: right; + font-size:30px; + cursor: pointer; +} + +.fa{ + display: inline; +} + .tabbed { - padding-left:2em; + padding-left:1em; } .definition-block { @@ -36,6 +47,10 @@ summary:focus { outline: none; } + + pre { + color: #000; + } } diff --git a/vitragedashboard/static/dashboard/project/services/modal.service.js b/vitragedashboard/static/dashboard/project/services/modal.service.js new file mode 100644 index 0000000..a850257 --- /dev/null +++ b/vitragedashboard/static/dashboard/project/services/modal.service.js @@ -0,0 +1,29 @@ +(function() { + 'use strict'; + + angular + .module('horizon.dashboard.project.vitrage') + .service('modalSrv', ModalSrv); + + ModalSrv.$inject = ['$modal']; + + function ModalSrv($modal) { + var modalInstance = null; + + function show(modalOptions) { + modalInstance = $modal.open(modalOptions); + } + + function close() { + if(modalInstance) { + modalInstance.close(); + modalInstance = null; + } + } + + return { + show: show, + close: close + } + } +})(); diff --git a/vitragedashboard/static/dashboard/project/templateList/templateList.controller.js b/vitragedashboard/static/dashboard/project/templateList/templateList.controller.js index 842ec1d..784b4be 100644 --- a/vitragedashboard/static/dashboard/project/templateList/templateList.controller.js +++ b/vitragedashboard/static/dashboard/project/templateList/templateList.controller.js @@ -5,44 +5,16 @@ .module('horizon.dashboard.project.vitrage') .controller('TemplateListController', TemplateListController); - TemplateListController.$inject = ['$scope', '$modal', 'vitrageTopologySrv','$interval']; + TemplateListController.$inject = ['$scope', 'modalSrv', 'vitrageTopologySrv']; - function TemplateListController($scope, $modal, vitrageTopologySrv,$interval) { + function TemplateListController($scope, modalSrv, vitrageTopologySrv) { var templateList = this; templateList.templates = []; templateList.itemplates = []; - templateList.$interval = $interval; - templateList.checkboxAutoRefresh = true; $scope.STATIC_URL = STATIC_URL; templateList.templates = []; - templateList.templateInterval; getData(); - startCollectData(); - - function startCollectData() { - if (angular.isDefined(templateList.templateInterval)) return; - templateList.templateInterval = templateList.$interval(getData,10000); - } - - function stopCollectData() { - if (angular.isDefined(templateList.templateInterval)) { - templateList.$interval.cancel(templateList.templateInterval); - templateList.templateInterval = undefined; - } - } - $scope.$on('$destroy',function(){ - templateList.stopCollectData(); - }) - - templateList.autoRefreshChanged = function(){ - if (templateList.checkboxAutoRefresh){ - getData(); - startCollectData(); - }else{ - stopCollectData(); - } - } function getData() { vitrageTopologySrv.getTemplates('all').then(function(result){ @@ -60,7 +32,7 @@ }} }; - $modal.open(modalOptions); + modalSrv.show(modalOptions); } } } diff --git a/vitragedashboard/static/dashboard/project/templateList/templateList.html b/vitragedashboard/static/dashboard/project/templateList/templateList.html index 63539c7..bddedc1 100644 --- a/vitragedashboard/static/dashboard/project/templateList/templateList.html +++ b/vitragedashboard/static/dashboard/project/templateList/templateList.html @@ -1,8 +1,4 @@
-
- - -
@@ -28,7 +24,7 @@ - +
{$template.status$} {$template["status details"]$} {$template.date | date:"yyyy-MM-dd hh:mm:ss"$}
diff --git a/vitragedashboard/static/dashboard/project/vitrage.scss b/vitragedashboard/static/dashboard/project/vitrage.scss index 31ce800..a0aef2f 100644 --- a/vitragedashboard/static/dashboard/project/vitrage.scss +++ b/vitragedashboard/static/dashboard/project/vitrage.scss @@ -1,13 +1,10 @@ -@import 'layout/main/compute/compute'; +@import 'layout/main/compute/compute.scss'; @import 'alarmList/alarmList.scss'; -@import 'components/sunburst/sunburst'; +@import 'components/sunburst/sunburst.scss'; @import 'components/alarms/alarms.scss'; @import 'components/rca/rootCauseAnalysisGraph.scss'; @import 'components/rca/rcaContainer.scss'; -@import 'components/alarms/alarms'; -@import 'components/rca/rcaContainer'; -@import 'components/rca/rootCauseAnalysisGraph'; -@import 'components/information/information'; +@import 'components/information/information.scss'; @import 'entities/graph/entities-graph.scss'; @import 'entities/info/entities-info.scss'; @import 'entities/toolbox/entities-toolbox.scss';