Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_systemCheckSection.twig « templates « Installation « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1fe5d0b3e5ca558369b2cdc4dc440bf5384d1b5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{% import _self as local %}
<p>{{ 'Installation_CopyBelowInfoForSupport'|translate }}
    <br/> <br/>
    <a href="javascript:void(0);"
       onclick="var textarea = document.getElementById('matomo_system_check_info');textarea.select();document.execCommand('copy');jQuery(textarea).effect('highlight', {}, 600)"
       class='btn'>{{ 'Installation_CopySystemCheck'|translate }}</a>
    <a href="javascript:void(0);"
       onclick="var textarea = document.getElementById('matomo_system_check_info');piwikHelper.sendContentAsDownload('matomo_system_check.txt', textarea.innerHTML);"
       class='btn'>{{ 'Installation_DownloadSystemCheck'|translate }}</a>

</p>
{% macro diagnosticInfo(results) -%}
{% set error = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_ERROR') %}
{% set warning = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_WARNING') %}
{% set informational = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_INFORMATIONAL') %}
{%- for result in results %}

#### {{ result.label }}:
{% for item in result.items -%}
{%- if item.status == error -%} &#9888; Error: {{ item.comment|anonymiseSystemInfo|striptags('<br><p><strong><code>') }}{% elseif item.status == warning %} &#9888; Warning: {{ item.comment|anonymiseSystemInfo|striptags('<br><p><strong><code>') }}{% elseif item.status == informational %} {{ item.comment|anonymiseSystemInfo|striptags('<br><p><strong><code>') }}{% else %} &#10004; {{ item.comment|anonymiseSystemInfo|striptags('<br><p><strong><code>') }}{% endif -%}
{%- endfor %}

{% if result.longErrorMessage -%}
{{ result.longErrorMessage|striptags('<br><p><strong><code>') }}
{%- endif -%}
    {%- endfor -%}
{%- endmacro %}
<textarea style="width:100%;height: 200px;" readonly
          id="matomo_system_check_info">
<details>
<summary>Click to view System Check</summary>

### Mandatory checks
{{ local.diagnosticInfo(diagnosticReport.getMandatoryDiagnosticResults()) }}

### Optional checks
{{ local.diagnosticInfo(diagnosticReport.getOptionalDiagnosticResults()) }}

### Informational results
{{ local.diagnosticInfo(diagnosticReport.getInformationalResults()) }}
</details>
</textarea>

<table class="entityTable system-check" id="systemCheckRequired" {% if isInstallation is not defined %}piwik-content-table{% endif %}>
    {{ local.diagnosticTable(diagnosticReport.getMandatoryDiagnosticResults()) }}
</table>

<h3>{{ 'Installation_Optional'|translate }}</h3>

<table class="entityTable system-check" id="systemCheckOptional" {% if isInstallation is not defined %}piwik-content-table{% endif %}>
    {{ local.diagnosticTable(diagnosticReport.getOptionalDiagnosticResults()) }}
</table>

<h3>{{ 'Installation_InformationalResults'|translate }}</h3>

<table class="entityTable system-check" id="systemCheckInformational" {% if isInstallation is not defined %}piwik-content-table{% endif %}>
    {{ local.diagnosticTable(diagnosticReport.getInformationalResults()) }}
</table>

{% macro diagnosticTable(results) %}

    {% set error = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_ERROR') %}
    {% set warning = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_WARNING') %}
    {% set informational = constant('Piwik\\Plugins\\Diagnostics\\Diagnostic\\DiagnosticResult::STATUS_INFORMATIONAL') %}

    {% set errorIcon %} <span class="icon-error"></span> {% endset %}
    {% set warningIcon %} <span class="icon-warning"></span> {% endset %}
    {% set okIcon %} <span class="icon-ok"></span> {% endset %}
    {% set infoIcon %} <span class="icon-info2"></span> {% endset %}

    {% for result in results %}
        <tr>
            <td>{{ result.label }}</td>
            <td>
                {% for item in result.items %}

                    {% if item.status == error %}
                        {{ errorIcon }} <span class="err">{{ item.comment|raw }}</span>
                    {% elseif item.status == warning %}
                        {{ warningIcon }} {{ item.comment|raw }}
                    {% elseif item.status == informational %}
                        {{ infoIcon }} {{ item.comment|raw }}
                    {% else %}
                        {{ okIcon }} {{ item.comment|raw }}
                    {% endif %}

                    <br/>

                {% endfor %}
            </td>
        </tr>
        {% if result.longErrorMessage %}
            <tr>
                <td colspan="2" class="error" style="font-size: small;">
                    {{ result.longErrorMessage|raw }}
                </td>
            </tr>
        {% endif %}
    {% endfor %}

{% endmacro %}