Sidebar-Cumulus.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. (function()
  2. {
  3. Sidebar.prototype.addCumulusPalette = function()
  4. {
  5. var sc = 2;
  6. var dt = 'cumulus';
  7. var sb = this;
  8. var s = 'image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;fontSize=12;verticalAlign=top;fontColor=#364149;shadow=0;dashed=0;image=img/lib/cumulus/';
  9. this.setCurrentSearchEntryLibrary('cumulus');
  10. // Adds Cumulus shapes
  11. var gn = ' ';
  12. var fns = [
  13. this.createVertexTemplateEntry(s + 'switch_bare_metal_empty.svg;',
  14. sc * 48, sc * 12, '', 'Switch - Bare Metal (empty)', false, null, this.getTagsForStencil(gn, 'switch bare metal empty', dt).join(' ')),
  15. this.createVertexTemplateEntry(s + 'switch_cumulus_linux.svg;',
  16. sc * 48, sc * 12, '', 'Switch - Cumulus Linux', false, null, this.getTagsForStencil(gn, 'switch cumulus linux', dt).join(' ')),
  17. this.createVertexTemplateEntry(s + 'switch_out_of_band.svg;',
  18. sc * 48, sc * 12, '', 'Switch - Out of Band', false, null, this.getTagsForStencil(gn, 'switch_out_of_band', dt).join(' ')),
  19. this.createVertexTemplateEntry(s + 'switch_voyager.svg;',
  20. sc * 48, sc * 12, '', 'Switch Voyager', false, null, this.getTagsForStencil(gn, 'switch voyager', dt).join(' ')),
  21. this.createVertexTemplateEntry(s + 'cumulus_linux_icon.svg;',
  22. sc * 48, sc * 48, '', 'Linux Icon', false, null, this.getTagsForStencil(gn, 'cumulus linux icon', dt).join(' ')),
  23. this.createVertexTemplateEntry(s + 'cumulus_netq_icon.svg;',
  24. sc * 48, sc * 48, '', 'NetQ Icon', false, null, this.getTagsForStencil(gn, '', dt).join(' ')),
  25. this.createVertexTemplateEntry(s + 'rack_bare_metal.svg;',
  26. sc * 48, sc * 57, '', 'Rack Bare Metal', false, null, this.getTagsForStencil(gn, 'rack bare metal', dt).join(' ')),
  27. this.createVertexTemplateEntry(s + 'rack_cumulus_linux.svg;',
  28. sc * 48, sc * 57, '', 'Rack Cumulus Linux', false, null, this.getTagsForStencil(gn, 'rack linux', dt).join(' ')),
  29. this.createVertexTemplateEntry(s + 'rack_out_of_band.svg;',
  30. sc * 48, sc * 57, '', 'Rack Out of Band', false, null, this.getTagsForStencil(gn, 'rack out of band', dt).join(' ')),
  31. this.createVertexTemplateEntry(s + 'rack_voyager.svg;',
  32. sc * 48, sc * 57, '', 'Rack Voyager', false, null, this.getTagsForStencil(gn, 'rack voyager', dt).join(' ')),
  33. this.createVertexTemplateEntry(s + 'server_bare_metal.svg;',
  34. sc * 48, sc * 10, '', 'Server - Bare Metal', false, null, this.getTagsForStencil(gn, 'server bare metal', dt).join(' ')),
  35. this.createVertexTemplateEntry(s + 'chassis_bare_metal_empty.svg;',
  36. sc * 53, sc * 36, '', 'Chassis - Bare Metal Empty', false, null, this.getTagsForStencil(gn, 'chassis bare metal empty', dt).join(' ')),
  37. this.createVertexTemplateEntry(s + 'chassis_cumulus_linux.svg;',
  38. sc * 53, sc * 36, '', 'Chassis - Cumulus Linux', false, null, this.getTagsForStencil(gn, 'chassis linux', dt).join(' ')),
  39. this.createVertexTemplateEntry(s + 'netq_chassis.svg;',
  40. sc * 53, sc * 36, '', 'NetQ Chassis', false, null, this.getTagsForStencil(gn, 'netq chassis', dt).join(' ')),
  41. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;', sc * 50, sc * 50, '', 'Unspecified', null, dt + 'unspecified'),
  42. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#EB4770;', sc * 50, sc * 50, '', '1G', null, dt + '1g'),
  43. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#FB9F41;', sc * 50, sc * 50, '', '10G', null, dt + '10g'),
  44. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#FCC548;', sc * 50, sc * 50, '', '25G', null, dt + '25g'),
  45. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#83CA73;', sc * 50, sc * 50, '', '40G', null, dt + '40g'),
  46. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#2EAB6D;', sc * 50, sc * 50, '', '100G', null, dt + '100g'),
  47. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#4EFDC0;', sc * 50, sc * 50, '', 'OOB / RMP', null, dt + 'oob rmp'),
  48. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#EB4770;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  49. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#FB9F41;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  50. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#FCC548;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  51. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#83CA73;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  52. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#2EAB6D;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  53. this.createEdgeTemplateEntry('endArrow=block;html=1;startArrow=block;startFill=1;endFill=1;strokeColor=#4EFDC0;dashed=1;dashPattern=5 5;', sc * 50, sc * 50, '', 'Virtual', null, dt + 'virtual'),
  54. this.createVertexTemplateEntry(s + 'netq_agent.svg;',
  55. sc * 9, sc * 9, '', 'NetQ Agent', false, null, this.getTagsForStencil(gn, 'netq agent', dt).join(' ')),
  56. this.createVertexTemplateEntry(s + 'netq_telemetry_server.svg;',
  57. sc * 48, sc * 12, '', 'NetQ Telemetry Server', false, null, this.getTagsForStencil(gn, 'netq telemetry server', dt).join(' ')),
  58. this.createVertexTemplateEntry(s + 'netq_server.svg;',
  59. sc * 48, sc * 10, '', 'NetQ Server', false, null, this.getTagsForStencil(gn, 'netq server', dt).join(' ')),
  60. this.createVertexTemplateEntry(
  61. 'image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;image=img/lib/cumulus/internet.svg;labelPosition=center;verticalLabelPosition=middle;verticalAlign=middle;fontSize=14;fontColor=#36424A;whiteSpace=wrap;',
  62. sc * 137, sc * 49, 'Internet', 'Internet', true, null, this.getTagsForStencil(gn, 'internet', dt).join(' ')),
  63. this.createVertexTemplateEntry(s + 'container.svg;',
  64. sc * 45, sc * 40, '', 'Container', true, null, this.getTagsForStencil(gn, 'container', dt).join(' ')),
  65. this.addEntry(dt + 'pbr switch', function()
  66. {
  67. var cell1 = new mxCell('swp51', new mxGeometry(0, 0, sc * 30, sc * 12), 'rounded=0;whiteSpace=wrap;html=1;fillColor=#FB9F41;strokeColor=none;fontColor=#FFFFFF;whiteSpace=wrap;');
  68. cell1.vertex = true;
  69. var cell2 = new mxCell('PBR', new mxGeometry(sc * 30, 0, sc * 30, sc * 12), 'text;verticalAlign=middle;align=center;fontColor=#FB9F41;fontStyle=1;html=1;whiteSpace=wrap;');
  70. cell2.vertex = true;
  71. return sb.createVertexTemplateFromCells([cell1, cell2], sc * 60, sc * 12, 'Package Diagram');
  72. }),
  73. this.createVertexTemplateEntry(s + 'ddos_server.svg;',
  74. sc * 48, sc * 10, '192.168.0.32', 'DDos Server', true, null, this.getTagsForStencil(gn, 'ddos server', dt).join(' ')),
  75. this.createVertexTemplateEntry(s + 'switch.svg;',
  76. sc * 48, sc * 10, '', 'Switch', true, null, this.getTagsForStencil(gn, 'switch', dt).join(' ')),
  77. this.createVertexTemplateEntry(s + 'limed_spruce.svg;',
  78. sc * 150, sc * 34, '', 'Limed Spruce', false, null, this.getTagsForStencil(gn, 'limed spruce', dt).join(' ')),
  79. this.createVertexTemplateEntry('fillColor=#36424A;strokeColor=none;whiteSpace=wrap;html=1;',
  80. sc * 25, sc * 25, '', 'Limited Spruce', true, null, this.getTagsForStencil(gn, 'color limited spruce', dt).join(' ')),
  81. this.createVertexTemplateEntry('fillColor=#515D68;strokeColor=none;whiteSpace=wrap;html=1;',
  82. sc * 25, sc * 25, '', 'Nevada', true, null, this.getTagsForStencil(gn, 'color nevada', dt).join(' ')),
  83. this.createVertexTemplateEntry('fillColor=#6E7B86;strokeColor=none;whiteSpace=wrap;html=1;',
  84. sc * 25, sc * 25, '', 'Rolling Stone', true, null, this.getTagsForStencil(gn, 'color rolling stone', dt).join(' ')),
  85. this.createVertexTemplateEntry('fillColor=#8C9AA6;strokeColor=none;whiteSpace=wrap;html=1;',
  86. sc * 25, sc * 25, '', 'Gray Chateau', true, null, this.getTagsForStencil(gn, 'color gray chateau', dt).join(' ')),
  87. this.createVertexTemplateEntry('fillColor=#AEB8C3;strokeColor=none;whiteSpace=wrap;html=1;',
  88. sc * 25, sc * 25, '', 'Cadet Blue', true, null, this.getTagsForStencil(gn, 'color cadet blue', dt).join(' ')),
  89. this.createVertexTemplateEntry('fillColor=#D2D6DF;strokeColor=none;whiteSpace=wrap;html=1;',
  90. sc * 25, sc * 25, '', 'Heather', true, null, this.getTagsForStencil(gn, 'color heather', dt).join(' ')),
  91. this.createVertexTemplateEntry('fillColor=#EAEDF2;strokeColor=none;whiteSpace=wrap;html=1;',
  92. sc * 25, sc * 25, '', 'Athens Gray', true, null, this.getTagsForStencil(gn, 'color athens gray', dt).join(' ')),
  93. this.createVertexTemplateEntry('fillColor=#7CCC6C;strokeColor=none;whiteSpace=wrap;html=1;',
  94. sc * 25, sc * 25, '', 'Mantis', true, null, this.getTagsForStencil(gn, 'color mantis', dt).join(' ')),
  95. this.createVertexTemplateEntry('fillColor=#4BC05B;strokeColor=none;whiteSpace=wrap;html=1;',
  96. sc * 25, sc * 25, '', 'Fern', true, null, this.getTagsForStencil(gn, 'color fern', dt).join(' ')),
  97. this.createVertexTemplateEntry('fillColor=#00AD69;strokeColor=none;whiteSpace=wrap;html=1;',
  98. sc * 25, sc * 25, '', 'Jade', true, null, this.getTagsForStencil(gn, 'color jade', dt).join(' ')),
  99. this.createVertexTemplateEntry('fillColor=#009271;strokeColor=none;whiteSpace=wrap;html=1;',
  100. sc * 25, sc * 25, '', 'Observatory', true, null, this.getTagsForStencil(gn, 'color observatory', dt).join(' ')),
  101. this.createVertexTemplateEntry('fillColor=#FFC82E;strokeColor=none;whiteSpace=wrap;html=1;',
  102. sc * 25, sc * 25, '', 'Energy Jellow', true, null, this.getTagsForStencil(gn, 'color energy jellow', dt).join(' ')),
  103. this.createVertexTemplateEntry('fillColor=#FFA12D;strokeColor=none;whiteSpace=wrap;html=1;',
  104. sc * 25, sc * 25, '', 'Neon Carrot', true, null, this.getTagsForStencil(gn, 'color neon carrot', dt).join(' ')),
  105. this.createVertexTemplateEntry('fillColor=#F1446F;strokeColor=none;whiteSpace=wrap;html=1;',
  106. sc * 25, sc * 25, '', 'Radical Red', true, null, this.getTagsForStencil(gn, 'color radical red', dt).join(' ')),
  107. this.createVertexTemplateEntry('fillColor=#83389B;strokeColor=none;whiteSpace=wrap;html=1;',
  108. sc * 25, sc * 25, '', 'Rarity', true, null, this.getTagsForStencil(gn, 'color rarity', dt).join(' ')),
  109. this.createVertexTemplateEntry('fillColor=#1EB5BD;strokeColor=none;whiteSpace=wrap;html=1;',
  110. sc * 25, sc * 25, '', 'Seagull', true, null, this.getTagsForStencil(gn, 'color seagull', dt).join(' ')),
  111. this.createVertexTemplateEntry('fillColor=#78CDD1;strokeColor=none;whiteSpace=wrap;html=1;',
  112. sc * 25, sc * 25, '', 'Half Baked', true, null, this.getTagsForStencil(gn, 'color half baked', dt).join(' '))
  113. ];
  114. this.addPalette('cumulus', 'Cumulus', false, mxUtils.bind(this, function(content)
  115. {
  116. for (var i = 0; i < fns.length; i++)
  117. {
  118. content.appendChild(fns[i](content));
  119. }
  120. }));
  121. this.setCurrentSearchEntryLibrary();
  122. };
  123. })();