moduleList.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <html>
  2. <head>
  3. <title>Module List</title>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
  6. <link rel="stylesheet" href="../../script/semantic/semantic.min.css">
  7. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  8. <script type="text/javascript" src="../../script/semantic/semantic.min.js"></script>
  9. <!-- <script type="text/javascript" src="../../script/ao_module.js"></script> -->
  10. </head>
  11. <body>
  12. <div class="ui container">
  13. <table class="ui basic celled structured table">
  14. <thead>
  15. <tr>
  16. <th rowspan="2">Module</th>
  17. <th rowspan="2">Group</th>
  18. <th rowspan="2">Supported Extensions</th>
  19. <th colspan="3">Supported Mode</th>
  20. </tr>
  21. <tr>
  22. <th>Default</th>
  23. <th>FloatWindow</th>
  24. <th>Embedded</th>
  25. </tr>
  26. </thead>
  27. <tbody id="moduleList">
  28. </tbody>
  29. </table>
  30. </div>
  31. <script>
  32. initModuleList();
  33. function initModuleList(){
  34. $("#moduleList").html("");
  35. $.ajax({
  36. url: "../../system/modules/list",
  37. success: function(data){
  38. console.log(data);
  39. for (var i =0; i < data.length; i++){
  40. var thisModule = data[i];
  41. var iconURL = "../../img/system/service.png";
  42. if (thisModule.IconPath !== ""){
  43. iconURL = "../../" + thisModule.IconPath;
  44. }
  45. var supportMode = ['<i class="large red remove icon"></i>', '<i class="large red remove icon"></i>', '<i class="large red remove icon"></i>'];
  46. var group = "Unknown";
  47. if (thisModule.Group != ""){
  48. group = thisModule.Group;
  49. }
  50. if (thisModule.StartDir != ""){
  51. supportMode[0] = '<i class="large green checkmark icon"></i>';
  52. }
  53. if (thisModule.SupportFW == true){
  54. supportMode[1] = '<i class="large green checkmark icon"></i>';
  55. }
  56. if (thisModule.SupportEmb == true){
  57. supportMode[2] = '<i class="large green checkmark icon"></i>';
  58. }
  59. var supportedExt = "N/A";
  60. if (thisModule.SupportedExt !== null){
  61. supportedExt = thisModule.SupportedExt.join("<br>");
  62. }
  63. $("#moduleList").append(`<tr>
  64. <td>
  65. <h4 class="ui image header">
  66. <img src="${iconURL}" class="ui mini rounded image">
  67. <div class="content">
  68. ${thisModule.Name}
  69. <div class="sub header">Version: ${thisModule.Version} </div>
  70. </div>
  71. </h4>
  72. </td>
  73. <td>
  74. ${group}
  75. </td>
  76. <td>
  77. ${supportedExt}
  78. </td>
  79. <td>
  80. ${supportMode[0]}
  81. </td>
  82. <td>
  83. ${supportMode[1]}
  84. </td>
  85. <td>
  86. ${supportMode[2]}
  87. </td>
  88. </tr>`);
  89. }
  90. }
  91. });
  92. }
  93. </script>
  94. </body>
  95. </html>