Replaced some variable names on Management

This commit is contained in:
Juanjo Jiménez 2018-06-14 12:35:00 +02:00
parent c7aa159d40
commit 2a35be1667
15 changed files with 31 additions and 31 deletions

View File

@ -15,43 +15,43 @@ import TabNames from '../utils/tab-names'
const app = modules.get('app/wazuh', []);
app.controller('managerController', function ($scope, $rootScope, $routeParams, $location) {
$scope.submenuNavItem = 'welcome';
$scope.submenuNavItem2 = 'rules';
$scope.tab = 'welcome';
$scope.rulesetTab = 'rules';
// Tab names
$scope.tabNames = TabNames;
if ($routeParams.tab){
$scope.submenuNavItem = $routeParams.tab;
$scope.tab = $routeParams.tab;
}
$scope.reloadGroups = () => {
$scope.submenuNavItem = 'groups';
$scope.tab = 'groups';
$scope.$broadcast('groupsIsReloaded')
}
$scope.reloadRuleset = () => {
$scope.submenuNavItem = 'ruleset';
$scope.tab = 'ruleset';
$scope.$broadcast('rulesetIsReloaded')
}
// Watchers
$scope.$watch('submenuNavItem', () => {
if($scope.submenuNavItem === 'ruleset') {
$scope.$watch('tab', () => {
if($scope.tab === 'ruleset') {
$rootScope.globalRuleSet = 'ruleset';
$rootScope.globalsubmenuNavItem2 = $scope.submenuNavItem2;
$rootScope.globalRulesetTab = $scope.rulesetTab;
} else {
delete $rootScope.globalRuleSet;
delete $rootScope.globalsubmenuNavItem2;
delete $rootScope.globalRulesetTab;
}
$location.search('tab', $scope.submenuNavItem);
$location.search('tab', $scope.tab);
});
$scope.switchTab = tab => {
$scope.submenuNavItem = tab;
$scope.tab = tab;
}
$scope.setRulesTab = (tab) => $scope.submenuNavItem2 = tab;
$scope.setRulesTab = (tab) => $scope.rulesetTab = tab;
$scope.$on("$destroy", () => {

View File

@ -16,7 +16,7 @@ const app = modules.get('app/wazuh', []);
app.controller('rulesController', function ($timeout, $scope, $rootScope, $sce, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState, csvReq) {
$scope.setRulesTab = tab => $rootScope.globalsubmenuNavItem2 = tab;
$scope.setRulesTab = tab => $rootScope.globalRulesetTab = tab;
//Initialization
$scope.searchTerm = '';
@ -196,7 +196,7 @@ app.controller('rulesController', function ($timeout, $scope, $rootScope, $sce,
});
app.controller('decodersController', function ($timeout, $scope, $rootScope, $sce, Decoders, DecodersRelated, DecodersAutoComplete, errorHandler, genericReq, appState, csvReq) {
$scope.setRulesTab = tab => $rootScope.globalsubmenuNavItem2 = tab;
$scope.setRulesTab = tab => $rootScope.globalRulesetTab = tab;
//Initialization
$scope.searchTerm = '';

View File

@ -1,2 +1,2 @@
<div ng-cloak flex layout="column" class="mozilla-table-size-85" ng-controller="groupsController" ng-if="submenuNavItem == 'groups'">
<div ng-cloak flex layout="column" class="mozilla-table-size-85" ng-controller="groupsController" ng-if="tab == 'groups'">
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>

View File

@ -1,4 +1,4 @@
<md-content flex layout="column" ng-controller="managerConfigurationController" ng-if="!load && submenuNavItem == 'configuration'">
<md-content flex layout="column" ng-controller="managerConfigurationController" ng-if="!load && tab == 'configuration'">
<!-- Loading ring -->
<div class='uil-ring-css' ng-show="load">

View File

@ -1,4 +1,4 @@
<div ng-cloak flex layout="column" layout-padding class="mozilla-table-size-85" ng-controller="managerLogController" ng-if="!loading && submenuNavItem == 'logs'">
<div ng-cloak flex layout="column" layout-padding class="mozilla-table-size-85" ng-controller="managerLogController" ng-if="!loading && tab == 'logs'">
<!-- Loading ring -->
<div class='uil-ring-css' ng-show="loading">

View File

@ -1,4 +1,4 @@
<md-content flex layout="column" ng-if="!load && submenuNavItem == 'status'" ng-controller="managerStatusController">
<md-content flex layout="column" ng-if="!load && tab == 'status'" ng-controller="managerStatusController">
<!-- Loading ring -->
<div class='uil-ring-css' ng-show="load">

View File

@ -1,4 +1,4 @@
<div flex layout="column" layout-align="start stretch" ng-if="submenuNavItem === 'welcome'">
<div flex layout="column" layout-align="start stretch" ng-if="tab === 'welcome'">
<!-- Wazuh management section -->
<!-- Headline -->

View File

@ -9,13 +9,13 @@
<!-- Breadcrumbs -->
<div layout="row" layout-padding>
<!-- If you're not on the Welcome tab, show a functional breadcrumb -->
<div ng-if="submenuNavItem !== 'welcome'">
<div ng-if="tab !== 'welcome'">
<i class="fa fa-fw fa-server" aria-hidden="true"></i>
<span class="wz-text-link cursor-pointer" ng-click="switchTab('welcome')">Management</span>
<span> / {{ tabNames[submenuNavItem] }}</span>
<span> / {{ tabNames[tab] }}</span>
</div>
<!-- If you're on the Welcome tab, show a blank, simple breadcrumb -->
<div ng-if="submenuNavItem === 'welcome'">
<div ng-if="tab === 'welcome'">
<i class="fa fa-fw fa-server" aria-hidden="true"></i>
<span>Management / Welcome</span>
</div>

View File

@ -1 +1 @@
<md-content flex layout="column" ng-if="submenuNavItem == 'monitoring'" ng-show="isClusterEnabled" ng-controller="clusterController">
<md-content flex layout="column" ng-if="tab == 'monitoring'" ng-show="isClusterEnabled" ng-controller="clusterController">

View File

@ -1,4 +1,4 @@
<md-content flex layout="column" ng-if="submenuNavItem == 'monitoring'" ng-show="!isClusterEnabled" ng-controller="clusterController">
<md-content flex layout="column" ng-if="tab == 'monitoring'" ng-show="!isClusterEnabled" ng-controller="clusterController">
<div flex layout="row" layout-align="start start">
<md-card class="wz-md-card" flex>
<md-card-content class="wz-text-center">

View File

@ -1 +1 @@
<md-content flex layout="column" ng-if="submenuNavItem == 'reporting'" ng-controller="reportingController">
<md-content flex layout="column" ng-if="tab == 'reporting'" ng-controller="reportingController">

View File

@ -27,11 +27,11 @@
</select>
</div>
<md-button ng-class="(globalsubmenuNavItem2 == 'rules') ? 'active' : ''" ng-click="setRulesTab('rules')"
<md-button ng-class="(globalRulesetTab == 'rules') ? 'active' : ''" ng-click="setRulesTab('rules')"
class="wz-button md-raised md-primary manager-ruleset-btn" aria-label="Ruleset rules button">
<i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i> Rules
</md-button>
<md-button ng-class="(globalsubmenuNavItem2 == 'decoders') ? 'active' : ''" ng-click="setRulesTab('decoders')"
<md-button ng-class="(globalRulesetTab == 'decoders') ? 'active' : ''" ng-click="setRulesTab('decoders')"
class="wz-button md-raised md-primary manager-ruleset-btn" aria-label="Ruleset decoders button">
<i class="fa fa-fw fa-search" aria-hidden="true"></i> Decoders
</md-button>

View File

@ -1,4 +1,4 @@
<div flex ng-if="!loading && globalsubmenuNavItem2 == 'decoders'" ng-controller="decodersController" layout="column" id="rulesContainer"
<div flex ng-if="!loading && globalRulesetTab == 'decoders'" ng-controller="decodersController" layout="column" id="rulesContainer"
layout-padding layout-align="start space-around">
<div class='uil-ring-css' ng-show="loading">

View File

@ -34,11 +34,11 @@
</md-autocomplete>
</span>
<md-button ng-class="(globalsubmenuNavItem2 == 'rules') ? 'active' : ''"
<md-button ng-class="(globalRulesetTab == 'rules') ? 'active' : ''"
ng-click="setRulesTab('rules')" class="wz-button md-raised md-primary manager-ruleset-btn" aria-label="Ruleset rules button">
<i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i> Rules
</md-button>
<md-button ng-class="(globalsubmenuNavItem2 == 'decoders') ? 'active' : ''"
<md-button ng-class="(globalRulesetTab == 'decoders') ? 'active' : ''"
ng-click="setRulesTab('decoders')" class="wz-button md-raised md-primary manager-ruleset-btn" aria-label="Ruleset decoders button">
<i class="fa fa-fw fa-search" aria-hidden="true"></i> Decoders
</md-button>

View File

@ -1,4 +1,4 @@
<div flex ng-if="!loading && globalRuleSet == 'ruleset' && globalsubmenuNavItem2 == 'rules'" ng-controller="rulesController"
<div flex ng-if="!loading && globalRuleSet == 'ruleset' && globalRulesetTab == 'rules'" ng-controller="rulesController"
layout="column" id="rulesContainer" layout-padding layout-align="start space-around">
<div class='uil-ring-css' ng-show="loading">