SOLR-7784 Hide core menu when main page is selected

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1690589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Upayavira 2015-07-13 08:54:32 +00:00
parent 82bb97f005
commit 1958b2f4d9
6 changed files with 12 additions and 10 deletions

View File

@ -47,7 +47,7 @@ solrAdminApp.config([
templateUrl: 'partials/cores.html',
controller: 'CoreAdminController'
}).
when('/~cores/:core', {
when('/~cores/:corename', {
templateUrl: 'partials/cores.html',
controller: 'CoreAdminController'
}).
@ -325,6 +325,7 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $
Cores.list(function(data) {
$scope.cores = [];
var currentCoreName = $route.current.params.core;
delete $scope.currentCore;
for (key in data.status) {
var core = data.status[key];
$scope.cores.push(core);
@ -339,10 +340,11 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $
};
$scope.refresh();
$scope.resetMenu = function(page) {
$scope.resetMenu = function(page, isMainPage) {
$scope.showingLogging = page.lastIndexOf("logging", 0) === 0;
$scope.showingCloud = page.lastIndexOf("cloud", 0) === 0;
$scope.page = page;
if (isMainPage) delete $scope.currentCore;
};
$scope.ping = function() {

View File

@ -30,13 +30,13 @@ solrAdminApp.controller('CloudController',
var view = $location.search().view ? $location.search().view : "graph";
if (view == "tree") {
$scope.resetMenu("cloud-tree");
$scope.resetMenu("cloud-tree", true);
treeSubController($scope, Zookeeper);
} else if (view == "rgraph") {
$scope.resetMenu("cloud-rgraph");
$scope.resetMenu("cloud-rgraph", true);
graphSubController($scope, Zookeeper, true);
} else if (view == "graph") {
$scope.resetMenu("cloud-graph");
$scope.resetMenu("cloud-graph", true);
graphSubController($scope, Zookeeper, false);
}
}

View File

@ -19,8 +19,8 @@
solrAdminApp.controller('CoreAdminController',
['$scope', '$routeParams', '$location', '$timeout', 'Cores', 'Update',
function($scope, $routeParams, $location, $timeout, Cores, Update){
$scope.resetMenu("cores");
$scope.currentCore = $routeParams.core;
$scope.resetMenu("cores", true);
$scope.currentCore = $routeParams.corename; // use 'corename' not 'core' to distinguish from /solr/:core/
$scope.refresh = function() {
Cores.get(function(data) {
var coreCount = 0;

View File

@ -17,7 +17,7 @@
solrAdminApp.controller('JavaPropertiesController',
function($scope, Properties){
$scope.resetMenu("java-props");
$scope.resetMenu("java-props", true);
$scope.refresh = function() {
Properties.get(function(data) {
var sysprops = data["system.properties"];

View File

@ -25,7 +25,7 @@ var format_time_content = function( time, timeZone ) {
solrAdminApp.controller('LoggingController',
function($scope, $timeout, $cookies, Logging){
$scope.resetMenu("logging");
$scope.resetMenu("logging", true);
$scope.timezone = $cookies.logging_timezone || "Local";
$scope.refresh = function() {
Logging.events(function(data) {

View File

@ -18,7 +18,7 @@
solrAdminApp.controller('ThreadsController',
["$scope", "Threads",
function($scope, Threads){
$scope.resetMenu("threads");
$scope.resetMenu("threads", true);
$scope.refresh = function() {
Threads.get(function(data) {
var threadDump = data.system.threadDump;