Monero/Aeon Webminer add-on module for After Dark https://habd.as/code/toxic-swamp/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {{ if ne .settings.enabled false }}
  2. {{ if eq .settings.debugging true }}
  3. <meta title="mod:toxic-swamp" content="status:debugging">
  4. {{ else }}
  5. <meta title="mod:toxic-swamp" content="status:enabled">
  6. {{ end }}
  7. {{ with .settings.translations }}
  8. <meta title="mod:toxic-swamp" content="translations:{{ . | jsonify }}">
  9. {{ end }}
  10. {{ $scratch := newScratch }}
  11. {{ range (default (slice "fire-swamp") .settings.proxies) }}
  12. {{ $proxy_settings := (index $.data.modules.toxic_swamp.proxies .) }}
  13. {{ $scratch.SetInMap "proxies" . $proxy_settings }}
  14. {{ end }}
  15. {{ with .data.modules.toxic_swamp.settings }}
  16. {{ $scratch.Set "throttle" .throttle }}
  17. {{ if lt .throttle .governor }}
  18. {{ $scratch.Set "throttle" .governor }}
  19. {{ end }}
  20. {{ end }}
  21. {{ with $scratch.Get "proxies" }}
  22. {{ $throttle := $scratch.Get "throttle" | default "100" }}
  23. {{ $settings := (dict "accounts" (dict "default" (dict "address" $.settings.address)) "proxies" . "throttle" $throttle) }}
  24. <meta title="mod:toxic-swamp" content="settings:{{ $settings | jsonify | base64Encode }}">
  25. {{ end }}
  26. {{ if eq .settings.debugging true }}
  27. <script>
  28. (function proxySocketEvents (window, document, undefined) {
  29. window.WebSocketProxy = new Proxy(window.WebSocket, {
  30. construct: (target, args) => {
  31. const instance = new target(...args);
  32. const messageHandler = evt => console.log('Message:', evt);
  33. instance.addEventListener('message', messageHandler);
  34. return instance;
  35. }
  36. });
  37. window.WebSocket = WebSocketProxy;
  38. })(window, document);
  39. </script>
  40. {{ end }}
  41. {{ else }}
  42. <meta title="mod:toxic-swamp" content="status:disabled">
  43. {{ end }}