BlueCat Address Manager Direct Actions (Deploy)

Add direct buttons for Deploy Actions in BlueCat Address Manager

当前为 2018-03-27 提交的版本,查看 最新版本

  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 3
  8. // @grant none
  9. // @copyright 2018, Marius Galm
  10. // @license MIT
  11. // @icon https://www.bluecatnetworks.com/wp-content/themes/bluecat/assets/img/icons/favicon.ico
  12. // ==/UserScript==
  13.  
  14. if (document.readyState === "interactive" ) {
  15. var page = document.childNodes[2].nodeValue;
  16. if (/ Page: ConfigurationPage /.test(page)) {
  17. var subtab = document.getElementsByClassName("TabPanelLabelActive")[0];
  18. if (/Servers/.test(subtab.innerHTML.trim())) {
  19. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  20. var tBody = topBar.getElementsByTagName('tbody')[2];
  21. var tR = tBody.getElementsByTagName('tr')[0];
  22. var w = tR.insertCell(-1);
  23. w.innerHTML='<div class="separator"></div>';
  24. var x = tR.insertCell(-1);
  25. 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>';
  26. var y = tR.insertCell(-1);
  27. y.innerHTML='<div class="separator"></div>';
  28. var z = tR.insertCell(-1);
  29. 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>';
  30. }
  31. }
  32. if (/ Page: ServerPage /.test(page)) {
  33. var subtab = document.getElementsByClassName("TabPanelLabelActive")[0];
  34. if (! /Details/.test(subtab.innerHTML.trim())) {
  35. var actions = document.getElementsByClassName('action-items')[0];
  36. var tBody = actions.getElementsByTagName('tbody')[0];
  37. var w = tBody.insertRow(-1);
  38. 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>';
  39. }
  40. }
  41. if (/ Page: IP4NetworkPage /.test(page)) {
  42. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  43. var tBody = topBar.getElementsByTagName('tbody')[2];
  44. var tR = tBody.getElementsByTagName('tr')[0];
  45. var w = tR.insertCell(-1);
  46. w.innerHTML='<div class="separator"></div>';
  47. var x = tR.insertCell(-1);
  48. 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>';
  49. var y = tR.insertCell(-1);
  50. }
  51. if (/ Page: ZoneDetails /.test(page)) {
  52. var topBar = document.getElementsByClassName('value-table-topToolBar')[0];
  53. var tBody = topBar.getElementsByTagName('tbody')[2];
  54. var tR = tBody.getElementsByTagName('tr')[0];
  55. var w = tR.insertCell(-1);
  56. w.innerHTML='<div class="separator"></div>';
  57. var x = tR.insertCell(-1);
  58. 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>';
  59. var y = tR.insertCell(-1);
  60. }
  61. }