Greasy Fork 还支持 简体中文。

BlueCat Address Manager Direct Actions (Deploy)

Add direct buttons for Deploy Actions in BlueCat Address Manager

  1. // ==UserScript==
  2. // @name BlueCat Address Manager Direct Actions (Deploy)
  3. // @namespace *
  4. // @description Add direct buttons for Deploy Actions in BlueCat Address Manager
  5. // @include */app*
  6. // @license MIT
  7. // @version 5
  8. // @grant none
  9. // @copyright 2018, Marius Galm
  10. // @license MIT
  11. // @icon https://www.bluecatnetworks.com/wp-content/uploads/2018/03/cropped-bluecat-favicon-32x32.png
  12. // ==/UserScript==
  13.  
  14. if (document.readyState === "interactive" ) {
  15. // always add deployment status quick button to toolbar
  16. var toolbar = document.getElementsByClassName("ToolBar");
  17. if (toolbar !== undefined) {
  18. var tRs1 = toolbar[0].getElementsByTagName("tr");
  19. if (tRs1 !== undefined) {
  20. var tR1 = tRs1[0];
  21. var a = tR1.insertCell(0);
  22. a.innerHTML = '<td><div class="ToolBarItemSeparator">&nbsp;</div></td>';
  23. var b = tR1.insertCell(0);
  24. b.innerHTML='<td><a id="link_DS" onclick="ProteusWaitingPage.start();" name="DStatusExtra" class="ToolBarItem" href="/app?component=%24ValueObjectFormTable_14.%24ComboButtonBar.%24ComboButton.direct&page=ConfigurationPage&service=direct&session=T&sp=Spage%3DDeploymentStatus&sp=Spage%3DDeploymentStatus"><img src="/images/icons/small/flash_question.gif" border="0" alt="Deployment Status" title="Deployment Status"></a></td>';
  25. }
  26. }
  27. var page = document.childNodes[2].nodeValue;
  28. if (/ Page: ConfigurationPage /.test(page)) {
  29. var subtab = document.getElementsByClassName("TabPanelLabelActive")[0];
  30. if (/Servers/.test(subtab.innerHTML.trim())) {
  31. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  32. var tBody = topBar.getElementsByTagName('tbody')[2];
  33. var tR = tBody.getElementsByTagName('tr')[0];
  34. var w = tR.insertCell(-1);
  35. w.innerHTML='<div class="separator"></div>';
  36. var x = tR.insertCell(-1);
  37. x.innerHTML='<span id="deployButton" class="title"><a style="color:inherit; text-decoration: none;" href="javascript:remoteSubmitLink( document.getElementById( \'form\' ), \'SDeploy\' );"><img src="/images/icons/small/flash.gif" border="0">&nbsp;<b style="vertical-align: super;">Deploy</b></a></span>';
  38. var y = tR.insertCell(-1);
  39. y.innerHTML='<div class="separator"></div>';
  40. var z = tR.insertCell(-1);
  41. z.innerHTML='<span id="deployStatusButton" class="title"><a style="color:inherit; text-decoration: none;" href="/app?component=%24ValueObjectFormTable_14.%24ComboButtonBar.%24ComboButton.direct&page=ConfigurationPage&service=direct&session=T&sp=Spage%3DDeploymentStatus&sp=Spage%3DDeploymentStatus"><img src="/images/icons/small/flash_question.gif" border="0">&nbsp;<span class="title-center"><b style="vertical-align: super;">Deployment Status</b></a></span>';
  42. }
  43. }
  44. if (/ Page: ServerPage /.test(page)) {
  45. var subtab = document.getElementsByClassName("TabPanelLabelActive")[0];
  46. if (! /Details/.test(subtab.innerHTML.trim())) {
  47. var actions = document.getElementsByClassName('action-items')[0];
  48. var tBody = actions.getElementsByTagName('tbody')[0];
  49. var w = tBody.insertRow(-1);
  50. w.innerHTML='<tr id="For_Deploy"><td class="action-item"><div id="action-item" class="with-description-with-icon"><a href="javascript:remoteSubmitLink( document.getElementById( \'form\' ), \'SDeploy\' );"><div class="selection " onmouseover="onActionItemOver(this, event);" onmouseout="onActionItemOut(this, event);" onclick="onActionItemClick(this, event);"><table class="action-item-selection" cellspacing="0" cellpadding="0"><tbody><tr><td class="icon"><div class="active"><img src="/images/icons/small/flash.gif" border="0"></div></td><td class="action"><div class="active"><div class="action-title">Deploy</div><div class="action-description">Deploy this server</div></div></td></tr></tbody></table></div></a></div></td></tr>';
  51. }
  52. }
  53. if (/ Page: IP4NetworkPage /.test(page)) {
  54. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  55. var tBody = topBar.getElementsByTagName('tbody')[2];
  56. var tR = tBody.getElementsByTagName('tr')[0];
  57. var w = tR.insertCell(-1);
  58. w.innerHTML='<div class="separator"></div>';
  59. var x = tR.insertCell(-1);
  60. x.innerHTML='<span id="deployButton" class="title"><a style="color:inherit; text-decoration: none;" href="javascript:remoteSubmitLink( document.getElementById( \'form\' ), \'SQuickDeploy\' );"><img src="/images/icons/small/flash.gif" border="0">&nbsp;<b style="vertical-align: super;">Quick Deploy</b></a></span>';
  61. var y = tR.insertCell(-1);
  62. }
  63. if (/ Page: ZoneDetails /.test(page)) {
  64. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  65. var tBody = topBar.getElementsByTagName('tbody')[2];
  66. var tR = tBody.getElementsByTagName('tr')[0];
  67. var w = tR.insertCell(-1);
  68. w.innerHTML='<div class="separator"></div>';
  69. var x = tR.insertCell(-1);
  70. x.innerHTML='<span id="deployButton" class="title"><a style="color:inherit; text-decoration: none;" href="javascript:remoteSubmitLink( document.getElementById( \'form\' ), \'SQuickDeploy\' );"><img src="/images/icons/small/flash.gif" border="0">&nbsp;<b style="vertical-align: super;">Quick Deploy</b></a></span>';
  71. var y = tR.insertCell(-1);
  72. }
  73. }