ECOD-Live-Warnings

Warn Users for PROD/DEMO envs

目前为 2024-04-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ECOD-Live-Warnings
  3. // @namespace ecod.live.warnings
  4. // @version 1.0.0
  5. // @description Warn Users for PROD/DEMO envs
  6. // @author CRK
  7.  
  8. // @match https://aws-summit-demo.ecodesigncloud.com/*
  9. // @match https://cluster-dashboard.aws-summit-demo.ecodesigncloud.com/*
  10. // @match https://deployment.aws-summit-demo.ecodesigncloud.com/*
  11. // @match https://workflows.aws-summit-demo.ecodesigncloud.com/*
  12. // @match https://rollouts-dashboard.aws-summit-demo.ecodesigncloud.com/*
  13. // @match https://apim.aws-summit-demo.ecodesigncloud.com/*
  14. // @match https://pgadmin.aws-summit-demo.ecodesigncloud.com/*
  15.  
  16. // @match https://puig-demo.ecodesigncloud.com/*
  17. // @match https://deployment.puig-demo.ecodesigncloud.com/*
  18. // @match https://rollouts-dashboard.puig-demo.ecodesigncloud.com/*
  19. // @match https://pgadmin.puig-demo.ecodesigncloud.com/*
  20. // @match https://cluster-dashboard.puig-demo.ecodesigncloud.com/*
  21. // @match https://workflows.puig-demo.ecodesigncloud.com/*
  22. // @match https://apim.puig-demo.ecodesigncloud.com/console/*
  23.  
  24. // @match https://apim.loreal-demo.ecodesigncloud.com/console/*
  25. // @match https://workflows.loreal-demo.ecodesigncloud.com/*
  26. // @match https://cluster-dashboard.loreal-demo.ecodesigncloud.com/*
  27. // @match https://loreal-demo.ecodesigncloud.com/*
  28. // @match https://pgadmin.loreal-demo.ecodesigncloud.com/*
  29. // @match https://rollouts-dashboard.loreal-demo.ecodesigncloud.com/*
  30. // @match https://deployment.loreal-demo.ecodesigncloud.com/*
  31. // @match https://demo.retailecoscore.net/*
  32.  
  33. // @match https://deployment.ecodesigncloud.com/*
  34. // @match https://cluster-dashboard.ecodesigncloud.com/*
  35. // @match https://retailecoscore.net/*
  36. // @match https://ecodesigncloud.com/*
  37. // @match https://pgadmin.ecodesigncloud.com/*
  38. // @match https://apim.ecodesigncloud.com/console/*
  39. // @match https://rollouts-dashboard.ecodesigncloud.com/*
  40. // @match https://workflows.ecodesigncloud.com/*
  41.  
  42. // @grant none
  43. // @license MIT
  44. // ==/UserScript==
  45.  
  46. (function() {
  47. 'use strict';
  48. // Function to create and append the live text
  49. function createLiveText() {
  50. var liveText = document.createElement('div');
  51. liveText.innerHTML = 'LIVE';
  52. liveText.style.position = 'fixed';
  53. liveText.style.top = '0';
  54. liveText.style.left = '0';
  55. liveText.style.color = 'white';
  56. liveText.style.backgroundColor = 'red';
  57. liveText.style.fontSize = '40px';
  58. liveText.style.fontFamily = 'Arial';
  59. liveText.style.fontWeight = 'bold';
  60. liveText.style.zIndex = '9999'; // Make sure it's always on top
  61. document.documentElement.appendChild(liveText);
  62. }
  63.  
  64. // Initial creation of the live text
  65. createLiveText();
  66.  
  67. // Function to reapply live text after AJAX updates
  68. function reapplyLiveText() {
  69. var liveText = document.querySelector('#liveText');
  70. if (!liveText) {
  71. createLiveText();
  72. }
  73. }
  74.  
  75. // Create a MutationObserver to detect changes in the DOM
  76. var observer = new MutationObserver(function(mutations) {
  77. mutations.forEach(function(mutation) {
  78. reapplyLiveText();
  79. });
  80. });
  81.  
  82. // Configuration of the MutationObserver
  83. var config = { attributes: true, childList: true, subtree: true };
  84.  
  85. // Start observing the document
  86. observer.observe(document.body, config);
  87. })();