Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

main.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* global d3:true, require:false, requirejs:false */ // eslint-disable-line no-unused-vars
  2. requirejs.config({
  3. baseUrl: "js/lib",
  4. paths: {
  5. app: "../app",
  6. jquery: "jquery-3.4.1.min",
  7. visibility: "visibility.min",
  8. bootstrap: "bootstrap.bundle.min",
  9. d3: "d3.min",
  10. d3evolution: "d3evolution.min",
  11. d3pie: "d3pie.min",
  12. footable: "footable.min",
  13. nprogress: "nprogress.min",
  14. stickytabs: "jquery.stickytabs.min"
  15. },
  16. shim: {
  17. bootstrap: {exports:"bootstrap", deps:["jquery"]},
  18. d3pie: {exports:"d3pie", deps:["d3.global", "jquery"]},
  19. d3evolution: {exports:"D3Evolution", deps:["d3", "jquery"]},
  20. footable: {deps:["bootstrap", "jquery"]},
  21. stickytabs: {deps:["jquery"]}
  22. },
  23. waitSeconds: 30,
  24. });
  25. document.title = window.location.hostname +
  26. (window.location.port ? ":" + window.location.port : "") +
  27. (window.location.pathname !== "/" ? window.location.pathname : "") +
  28. " - Rspamd Web Interface";
  29. // Ugly hack to get d3pie work with requirejs
  30. define("d3.global", ["d3"], function (d3global) { // eslint-disable-line strict
  31. d3 = d3global;
  32. });
  33. // Notify user on module loading failure
  34. requirejs.onError = function (e) {
  35. "use strict";
  36. document.getElementsByClassName("notification-area")[0].innerHTML =
  37. "<div class=\"alert alert-error\">" +
  38. "<strong>Module loading error: " + e.requireType + ", module: " + e.requireModules + "</strong>" +
  39. "<button type=\"button\" class=\"btn btn-info btn-xs float-right\" " +
  40. "onClick=\"window.location.reload(); this.parentNode.parentNode.removeChild(this.parentNode);\" " +
  41. "title=\"Reload current page\">" +
  42. "<i class=\"glyphicon glyphicon-repeat\"></i> Reload" +
  43. "</button>" +
  44. "</div>";
  45. throw e;
  46. };
  47. // Load main UI
  48. require(["app/rspamd"],
  49. function (rspamd) {
  50. "use strict";
  51. rspamd.setup();
  52. rspamd.connect();
  53. }
  54. );