index.twig 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {% extends 'server/status/base.twig' %}
  2. {% set active = 'advisor' %}
  3. {% block content %}
  4. <h2>{% trans 'Advisor system' %}</h2>
  5. {% if data is empty %}
  6. {{ 'Not enough privilege to view the advisor.'|trans|error }}
  7. {% else %}
  8. <button type="button" class="btn btn-secondary mb-4" data-toggle="modal" data-target="#advisorInstructionsModal">
  9. {{ get_icon('b_help', 'Instructions'|trans) }}
  10. </button>
  11. <div class="modal fade" id="advisorInstructionsModal" tabindex="-1" role="dialog" aria-labelledby="advisorInstructionsModalLabel" aria-hidden="true">
  12. <div class="modal-dialog" role="document">
  13. <div class="modal-content">
  14. <div class="modal-header">
  15. <h5 class="modal-title" id="advisorInstructionsModalLabel">{% trans 'Advisor system' %}</h5>
  16. <button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}">
  17. <span aria-hidden="true">&times;</span>
  18. </button>
  19. </div>
  20. <div class="modal-body">
  21. <p>
  22. {%- trans -%}
  23. The Advisor system can provide recommendations on server variables by analyzing the server status variables.
  24. {%- endtrans -%}
  25. </p>
  26. <p>
  27. {%- trans -%}
  28. Do note however that this system provides recommendations based on simple calculations and by rule of thumb which may not necessarily apply to your system.
  29. {%- endtrans -%}
  30. </p>
  31. <p>
  32. {%- trans -%}
  33. Prior to changing any of the configuration, be sure to know what you are changing (by reading the documentation) and how to undo the change. Wrong tuning can have a very negative effect on performance.
  34. {%- endtrans -%}
  35. </p>
  36. <p>
  37. {%- trans -%}
  38. The best way to tune your system would be to change only one setting at a time, observe or benchmark your database, and undo the change if there was no clearly measurable improvement.
  39. {%- endtrans -%}
  40. </p>
  41. </div>
  42. <div class="modal-footer">
  43. <button type="button" class="btn btn-primary" data-dismiss="modal">{% trans 'Close' %}</button>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. {% if data.errors|length > 0 %}
  49. <div class="alert alert-danger mt-2 mb-2" role="alert">
  50. <h4 class="alert-heading">{% trans 'Errors occurred while executing rule expressions:' %}</h4>
  51. <ul>
  52. {% for error in data.errors %}
  53. <li>{{ error }}</li>
  54. {% endfor %}
  55. </ul>
  56. </div>
  57. {% endif %}
  58. {% if data.fired|length > 0 %}
  59. <h4>{% trans 'Possible performance issues' %}</h4>
  60. <div class="accordion mb-4" id="rulesAccordion">
  61. {% for rule in data.fired %}
  62. <div class="card">
  63. <div class="card-header" id="heading{{ loop.index }}">
  64. <button class="btn btn-link{{ not loop.first ? ' collapsed' }}" type="button" data-toggle="collapse" data-target="#collapse{{ loop.index }}" aria-expanded="{{ loop.first ? 'true' : 'false' }}" aria-controls="collapse{{ loop.index }}">
  65. {{ rule.issue|striptags }}
  66. </button>
  67. </div>
  68. <div id="collapse{{ loop.index }}" class="collapse{{ loop.first ? ' show' }}" aria-labelledby="heading{{ loop.index }}" data-parent="#rulesAccordion">
  69. <div class="card-body">
  70. <dl>
  71. <dt>{% trans 'Issue:' %}</dt>
  72. <dd>{{ rule.issue|raw }}</dd>
  73. <dt>{% trans 'Recommendation:' %}</dt>
  74. <dd>{{ rule.recommendation|raw }}</dd>
  75. <dt>{% trans 'Justification:' %}</dt>
  76. <dd>{{ rule.justification }}</dd>
  77. <dt>{% trans 'Used variable / formula:' %}</dt>
  78. <dd>{{ rule.formula }}</dd>
  79. <dt>{% trans 'Test:' %}</dt>
  80. <dd>{{ rule.test }}</dd>
  81. </dl>
  82. </div>
  83. </div>
  84. </div>
  85. {% endfor %}
  86. </div>
  87. {% endif %}
  88. {% endif %}
  89. {% endblock %}