Created
November 13, 2020 20:37
-
-
Save theY4Kman/96e3222c8423a76efda8ce6cf3de8bbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fix Kibana monitoring nodes links | |
// @version 0.1 | |
// @description Allows node links to be clicked in Kibana Monitoring without getting "node/cluster not found" | |
// @author Zach "theY4Kman" Kanzler | |
// @match https://mon.kibana.perchsecurity.com/app/monitoring | |
// @require https://cdn.jsdelivr.net/npm/[email protected]/js/rison.min.js | |
// @require http://code.jquery.com/jquery-3.4.1.min.js | |
// @grant unsafeWindow | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const getGlobalParams = () => { | |
const url = new URL(location.origin + location.hash.substr(1)); | |
return url.searchParams.get('_g'); | |
}; | |
$(unsafeWindow.document.body).on('click auxclick', '[data-test-subj^="nodeLink"]', evt => { | |
const anchor = evt.target; | |
const url = new URL(anchor.href); | |
const hashUrl = new URL(location.origin + url.hash.substr(1)); | |
hashUrl.searchParams.set('_g', getGlobalParams()); | |
url.hash = `#${hashUrl.pathname}${hashUrl.search}`; | |
const fixedUrl = url.toString(); | |
anchor.href = fixedUrl; | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment