Skip to content

Instantly share code, notes, and snippets.

@eidantoei
Created January 29, 2012 18:05
Show Gist options
  • Save eidantoei/1699895 to your computer and use it in GitHub Desktop.
Save eidantoei/1699895 to your computer and use it in GitHub Desktop.
Nagiosのサービス詳細ページで[A]キー押すとackにするページに連れてってくれるdotjs
pattern=/https:\/\/([^\/]+)\/(.+)\/extinfo.cgi\?type=2&host=([^&]+)&service=(.+)$/
$(".extinfo").keypress(function(event) {
if ( event.which == 97 ) {
url_from = location.href;
if ( url_from.match(pattern)){
url_to = url_from.replace(pattern,"https://$1/$2/cmd.cgi?cmd_typ=34&host=$3&service=$4");
location.href = url_to;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment