index.twig 4.6 KB

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