Sin descripción

modal_module_info.html 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <div class="modal-header">
  2. <h4>{{ data.module_human_name|unquote }} - Module Information</h4>
  3. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  4. aria-hidden="true">&times;</span></button>
  5. </div>
  6. <div class="modal-body">
  7. <div class="row">
  8. <div class="container col-6">
  9. <div class="form-group">
  10. <label>Name :</label>
  11. <span type="text" class="">{{ data.module_human_name|unquote }}</span>
  12. </div>
  13. <div class="form-group mt--3">
  14. <label>Description :</label>
  15. <span type="text" class="">{{ data.module_description }}</span>
  16. </div>
  17. <div class="form-group mt--3">
  18. <label>Target package :</label>
  19. <span type="text" class="text-faded">{{ data.module_name }}</span>
  20. </div>
  21. <div class="form-group mt--3">
  22. <label>Date added :</label>
  23. <span type="text" class="text-faded">{{ data.date_added }}</span>
  24. </div>
  25. {% if not is_configured %}
  26. <div class="form-group">
  27. <b class="text-danger">The module was automatically disabled because mandatory parameters are not set.</b>
  28. </div>
  29. {% endif %}
  30. </div>
  31. <div class="container col-6">
  32. <div class="form-group">
  33. <label>Module version :</label>
  34. <span type="text" class="text-faded">{{ data.module_version }}</span>
  35. </div>
  36. <div class="form-group mt--3">
  37. <label>Interface version :</label>
  38. <span type="text" class="text-faded">{{ data.interface_version }}</span>
  39. </div>
  40. <div class="form-group mt--3">
  41. <label>Is active :</label>
  42. <span type="text" class="text-faded">{{ data.is_active }} </span>
  43. </div>
  44. <div class="form-group mt--3">
  45. <label>Provides pipeline :</label>
  46. <span type="text" class="text-faded">{{ data.has_pipeline }}</span>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="container col-12">
  51. <hr/>
  52. <div class="form-group mt-3">
  53. <label>Configuration (click on a setting to edit)</label>
  54. <button type="button" class="btn btn-sm btn-outline-dark float-right" onclick="export_mod_config('{{ data.id }}');">Export configuration</button>
  55. <button type="button" class="btn btn-sm btn-outline-dark float-right mr-2" data-toggle="modal" data-target="#modal_input_config">Import configuration</button>
  56. </div>
  57. <div class="form-group mt-3">
  58. <table id="datatable_db_list" class="table display table-bordered table-striped table-hover mt-4" width="100%"
  59. cellspacing="0">
  60. <thead>
  61. <tr role="row">
  62. <th>Section</th>
  63. <th>Parameter</th>
  64. <th>Value</th>
  65. <th>Mandatory</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. {% for id in config %}
  70. <tr role="row">
  71. <td>{{ id["section"] or "Main" }}</td>
  72. <td><a href="#" onclick="update_param({{ data.id }}, '{{ data.id }}##{{ id['param_name'] }}');">
  73. {% if (id['param_name'] in missing_params) %}
  74. <i class="fa-solid fa-triangle-exclamation text-danger" title="Mandatory parameter not set"></i>
  75. {% endif %}
  76. {{ id["param_human_name"] }}
  77. </a></td>
  78. <td>{% if id["value"] is not none %}{% if id["type"] != "sensitive_string" %} {% if id["value"] is string %}{{ id["value"][0:20] }}{% else %}{{id["value"]}}{% endif %} {% else %} *************** {% endif %}{% endif %}</td>
  79. <td>{{ id["mandatory"] }}</td>
  80. </tr>
  81. {% endfor %}
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="modal-footer">
  88. <button type="button" class="btn btn-outline-danger mr-auto" onclick="remove_module('{{ data.id }}');">Remove module</button>
  89. {% if is_configured and not data.is_active %}
  90. <button type="button" class="btn btn-outline-success" onclick="enable_module('{{ data.id }}');">Enable module</button>
  91. {% elif is_configured and data.is_active %}
  92. <button type="button" class="btn btn-outline-warning" onclick="disable_module('{{ data.id }}');">Disable module</button>
  93. {% endif %}
  94. <button type="button" class="btn btn-default" data-dismiss="modal">Dismiss</button>
  95. </div>
  96. <div class="modal bg-shadow-gradient" tabindex="-1" role="dialog" id="modal_input_config" data-backdrop="true">
  97. <div class="modal-lg modal-dialog" role="document">
  98. <div class="modal-content">
  99. <div class="modal-header">
  100. <h5>Import module configuration from file</h5>
  101. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  102. aria-hidden="true">&times;</span></button>
  103. </div>
  104. <div class="modal-body">
  105. <div class="form-group">
  106. <p>Select a configuration file to upload. Existing configuration for this module will be overwritten.</p>
  107. <label class="placeholder">Configuration file : </label>
  108. <input id="input_configuration_file" type="file" accept="text/json">
  109. <button type="button" class="btn btn-outline-success float-right mr-2" onclick="import_mod_config('{{ data.id }}');">Import</button>
  110. </div>
  111. </div>
  112. </div><!-- /.modal-content -->
  113. </div><!-- /.modal-dialog -->
  114. </div>
  115. <script>
  116. $(document).ready(function(){
  117. $("#datatable_db_list").DataTable({
  118. filter: true,
  119. order: [[0, 'asc']],
  120. rowGroup: {
  121. dataSrc: 0
  122. }
  123. });
  124. });
  125. </script>