moduleList.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 class="ui divider"></div>
  31. <p>If you have installed WebApps manually, you can click the "Reload WebApps" button to load it without restarting ArozOS.</p>
  32. <button class="ui basic small blue button" onclick="reloadWebapps();">
  33. <i class="refresh icon"></i> Reload WebApps
  34. </button>
  35. <br><br>
  36. </div>
  37. <script>
  38. initModuleList();
  39. function reloadWebapps(){
  40. $("#moduleList").html(`<tr><td colspan="6"><i class="ui loading spinner icon"></i> Reloading...</tr></td>`);
  41. $.get("../../system/modules/reload", function(data){
  42. initModuleList();
  43. });
  44. }
  45. function initModuleList(){
  46. $("#moduleList").html("");
  47. $.ajax({
  48. url: "../../system/modules/list",
  49. success: function(data){
  50. console.log(data);
  51. for (var i =0; i < data.length; i++){
  52. var thisModule = data[i];
  53. var iconURL = "../../img/system/service.png";
  54. if (thisModule.IconPath !== ""){
  55. iconURL = "../../" + thisModule.IconPath;
  56. }
  57. var supportMode = ['<i class="large red remove icon"></i>', '<i class="large red remove icon"></i>', '<i class="large red remove icon"></i>'];
  58. var group = "Unknown";
  59. if (thisModule.Group != ""){
  60. group = thisModule.Group;
  61. }
  62. if (thisModule.StartDir != ""){
  63. supportMode[0] = '<i class="large green checkmark icon"></i>';
  64. }
  65. if (thisModule.SupportFW == true){
  66. supportMode[1] = '<i class="large green checkmark icon"></i>';
  67. }
  68. if (thisModule.SupportEmb == true){
  69. supportMode[2] = '<i class="large green checkmark icon"></i>';
  70. }
  71. var supportedExt = "N/A";
  72. if (thisModule.SupportedExt !== null){
  73. supportedExt = thisModule.SupportedExt.join("<br>");
  74. }
  75. $("#moduleList").append(`<tr>
  76. <td>
  77. <h4 class="ui image header">
  78. <img src="${iconURL}" class="ui mini rounded image">
  79. <div class="content">
  80. ${thisModule.Name}
  81. <div class="sub header">Version: ${thisModule.Version} </div>
  82. </div>
  83. </h4>
  84. </td>
  85. <td>
  86. ${group}
  87. </td>
  88. <td>
  89. ${supportedExt}
  90. </td>
  91. <td>
  92. ${supportMode[0]}
  93. </td>
  94. <td>
  95. ${supportMode[1]}
  96. </td>
  97. <td>
  98. ${supportMode[2]}
  99. </td>
  100. </tr>`);
  101. }
  102. }
  103. });
  104. }
  105. </script>
  106. </body>
  107. </html>