RabbitMQ MGMT UI Additions

Depends on rabbitmq being in the URL somewhere

  1. // ==UserScript==
  2. // @name RabbitMQ MGMT UI Additions
  3. // @namespace cpriest
  4. // @version 0.1
  5. // @description Depends on rabbitmq being in the URL somewhere
  6. // • Adds Update every 1 & .5 second to rabbitmq UI's
  7. // @author Clint Priest
  8. // @homepage https://github.com/cpriest/userscripts/tree/master/RabbitMQ
  9. // @include http*://*rabbitmq*
  10. // @grant none
  11. // @license MIT
  12. // @compatible firefox
  13. // @compatible chrome
  14. // @compatible opera
  15. // @compatible safari
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. if(!document.querySelector('IMG[src="img/rabbitmqlogo.png"]'))
  21. return;
  22.  
  23. let sel = document.querySelector('SELECT#update-every');
  24. if(sel) {
  25. sel.innerHTML = '<option value="500">Refresh every 1/2 second</option>' +
  26. '<option value="1000">Refresh every 1 second</option>' + sel.innerHTML;
  27. sel.selectedIndex = 2;
  28. }
  29. })();