SOLR Admin - Auto-expand shards and replicas

Automatically shards in the SOLR Admin collections display

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          SOLR Admin - Auto-expand shards and replicas
// @description   Automatically shards in the SOLR Admin collections display
// @include       https://*/solr/*
// @include       http://*/solr/*
// @version       0.3
// @namespace https://greasyfork.org/users/77886
// @require  https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// ==/UserScript==

function clickWhenItAppears (jNode) {
    var clickEvent = document.createEvent ('MouseEvents');
    clickEvent.initEvent ('click', true, true);
    jNode[0].dispatchEvent (clickEvent);
}

bWaitOnce = true;

// <b class="ng-binding">Shard: shard2</b>
// <span ng-class="{open:shard.show}" class="open"><b class="ng-binding">Shard: shard2</b></span>
waitForKeyElements (
    //"b[class='ng-binding']",
    "span[ng-class='{open:shard.show}']",
    clickWhenItAppears
);

// <span class="openReplica ng-binding" ng-class="{open:replica.show}">Replica: core_node6</span>
waitForKeyElements (
    "span[class='openReplica ng-binding']",
    clickWhenItAppears
);