index.twig 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. {% extends 'server/status/base.twig' %}
  2. {% set active = 'variables' %}
  3. {% block content %}
  4. {% if is_data_loaded %}
  5. <div class="row">
  6. <fieldset id="tableFilter">
  7. <legend>{% trans 'Filters' %}</legend>
  8. <form action="{{ url('/server/status/variables') }}" method="post">
  9. {{ get_hidden_inputs() }}
  10. <input class="btn btn-secondary" type="submit" value="{% trans 'Refresh' %}">
  11. <div class="formelement">
  12. <label for="filterText">{% trans 'Containing the word:' %}</label>
  13. <input name="filterText" type="text" id="filterText" value="{{ filter_text }}">
  14. </div>
  15. <div class="formelement">
  16. <input type="checkbox" name="filterAlert" id="filterAlert"{{ is_only_alerts ? ' checked' }}>
  17. <label for="filterAlert">
  18. {% trans 'Show only alert values' %}
  19. </label>
  20. </div>
  21. <div class="formelement">
  22. <select id="filterCategory" name="filterCategory">
  23. <option value="">{% trans 'Filter by category…' %}</option>
  24. {% for category in categories %}
  25. <option value="{{ category.id }}"{{ category.is_selected ? ' selected' }}>{{ category.name }}</option>
  26. {% endfor %}
  27. </select>
  28. </div>
  29. <div class="formelement">
  30. <input type="checkbox" name="dontFormat" id="dontFormat"{{ is_not_formatted ? ' checked' }}>
  31. <label for="dontFormat">
  32. {% trans 'Show unformatted values' %}
  33. </label>
  34. </div>
  35. </form>
  36. </fieldset>
  37. </div>
  38. <div id="linkSuggestions" class="defaultLinks hide">
  39. <p class="alert alert-primary" role="alert">
  40. {% trans 'Related links:' %}
  41. {% for link in links %}
  42. <span class="{{ link.name }}">
  43. {% for link_name, link_url in link.links %}
  44. {% if link_name == 'doc' %}
  45. {{ show_mysql_docu(link_url) }}
  46. {% else %}
  47. <a href="{{ link_url.url }}"{% if link_url.params is not empty %} data-post="{{ link_url.params }}"{% endif %}>{{ link_name }}</a>
  48. {% endif %}
  49. |
  50. {% endfor %}
  51. </span>
  52. {% endfor %}
  53. </p>
  54. </div>
  55. <div class="responsivetable row">
  56. <table class="table table-light table-striped table-hover table-sm" id="serverStatusVariables">
  57. <colgroup>
  58. <col class="namecol">
  59. <col class="valuecol">
  60. <col class="descrcol">
  61. </colgroup>
  62. <thead class="thead-light">
  63. <tr>
  64. <th scope="col">{% trans 'Variable' %}</th>
  65. <th scope="col">{% trans 'Value' %}</th>
  66. <th scope="col">{% trans 'Description' %}</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. {% for variable in variables %}
  71. <tr{% if variable.class is not empty %} class="s_{{ variable.class }}"{% endif %}>
  72. <th class="name">
  73. {{ variable.name|replace({'_': ' '}) }}
  74. {{ variable.doc|raw }}
  75. </th>
  76. <td class="value text-monospace text-right">
  77. <span class="formatted">
  78. {% if variable.has_alert %}
  79. <span class="{{ variable.is_alert ? 'attention' : 'allfine' }}">
  80. {% endif %}
  81. {% if variable.name ends with '%' %}
  82. {{ format_number(variable.value, 0, 2) }} %
  83. {% elseif 'Uptime' in variable.name %}
  84. {{ timespan_format(variable.value) }}
  85. {% elseif variable.is_numeric and variable.value >= 1000 %}
  86. <abbr title="{{ format_number(variable.value, 0) }}">
  87. {{ format_number(variable.value, 3, 1) }}
  88. </abbr>
  89. {% elseif variable.is_numeric %}
  90. {{ format_number(variable.value, 3, 1) }}
  91. {% else %}
  92. {{ variable.value }}
  93. {% endif %}
  94. {% if variable.has_alert %}
  95. </span>
  96. {% endif %}
  97. </span>
  98. <span class="original hide">
  99. {% if variable.has_alert %}
  100. <span class="{{ variable.is_alert ? 'attention' : 'allfine' }}">
  101. {% endif %}
  102. {{ variable.value }}
  103. {% if variable.has_alert %}
  104. </span>
  105. {% endif %}
  106. </span>
  107. </td>
  108. <td class="w-50">
  109. {{ variable.description }}
  110. {% for doc in variable.description_doc %}
  111. {% if doc.name == 'doc' %}
  112. {{ show_mysql_docu(doc.url) }}
  113. {% else %}
  114. <a href="{{ doc.url.url }}" data-post="{{ doc.url.params }}">{{ doc.name }}</a>
  115. {% endif %}
  116. {% endfor %}
  117. </td>
  118. </tr>
  119. {% endfor %}
  120. </tbody>
  121. </table>
  122. </div>
  123. {% else %}
  124. {{ 'Not enough privilege to view status variables.'|trans|error }}
  125. {% endif %}
  126. {% endblock %}