2018-08-17 11:55:17 +00:00
|
|
|
{% for service in service_status %}
|
2018-10-01 02:32:13 +00:00
|
|
|
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" or url == "waf.py" %}
|
2019-09-10 05:44:02 +00:00
|
|
|
<tr class="{{ loop.cycle('odd', 'even') }}" id="{{service.0}}-select-line">
|
2019-09-23 11:18:38 +00:00
|
|
|
<td class="padding10 first-collumn-wi">
|
2019-10-04 06:23:48 +00:00
|
|
|
{% if service.2|int() >= 1 %}
|
|
|
|
<span class="serverUp server-status" title="running {{service.2 }} processes"></span>
|
|
|
|
{% else %}
|
|
|
|
<span class="serverDown server-status"></span>
|
|
|
|
{% endif %}
|
|
|
|
<a href="/app/logs.py?serv={{ service.1 }}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00&waf=1" title="View {{service.0 }}'s WAF logs" class="logs_link">
|
|
|
|
{{ service.0 }}
|
|
|
|
</a>
|
2019-09-22 15:46:26 +00:00
|
|
|
</td>
|
2018-09-12 02:25:32 +00:00
|
|
|
<td>
|
|
|
|
{% if role <= 1 %}
|
|
|
|
<a id="{{ service.1 }}" class="start-waf" title="Start WAF service">
|
2019-10-25 07:18:57 +00:00
|
|
|
<img src=/inc/images/start.png alt="start" class="icon" style="margin-bottom: -4px;">
|
2018-09-12 02:25:32 +00:00
|
|
|
</a>
|
|
|
|
<a id="{{ service.1 }}" class="stop-waf" title="Stop WAF service">
|
2019-09-09 19:14:37 +00:00
|
|
|
<img src=/inc/images/stop.png alt="start" class="icon" width="17px">
|
2018-09-12 02:25:32 +00:00
|
|
|
</a>
|
|
|
|
<a id="{{ service.1 }}" class="restart-waf" title="Restart WAF service">
|
2019-09-09 19:14:37 +00:00
|
|
|
<img src=/inc/images/update.png alt="restart" class="icon">
|
2018-09-12 02:25:32 +00:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2019-09-10 05:44:02 +00:00
|
|
|
{% if role <= 1 %}
|
2018-10-01 02:32:13 +00:00
|
|
|
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" %}
|
2019-09-10 05:44:02 +00:00
|
|
|
<select class="waf_mode" id="{{ service.0 }}_select">
|
|
|
|
{% set waf_modes = [] %}
|
|
|
|
{% do waf_modes.append("On") %}
|
|
|
|
{% do waf_modes.append("Off") %}
|
|
|
|
{% do waf_modes.append("DetectionOnly") %}
|
|
|
|
{% for waf_mode in waf_modes %}
|
|
|
|
{% if service.3 == waf_mode %}
|
|
|
|
<option value={{waf_mode}} selected="selected">{{waf_mode}}</option>
|
|
|
|
{% else %}
|
|
|
|
<option value={{waf_mode}}>{{waf_mode}}</option>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2018-09-12 02:25:32 +00:00
|
|
|
{%else %}
|
|
|
|
<a title="Install WAF"><button onclick="installWaf('{{ service.1 }}')">Install</button></a>
|
|
|
|
{% endif %}
|
2019-09-10 05:44:02 +00:00
|
|
|
{% else %}
|
|
|
|
{{ service.3 }}
|
|
|
|
{% endif %}
|
2018-09-12 02:25:32 +00:00
|
|
|
</td>
|
2019-09-10 05:44:02 +00:00
|
|
|
<td style="padding-top: 2px;">
|
2018-10-01 02:32:13 +00:00
|
|
|
{% if service.3 == "On" or service.3 == "Off" or service.3 == "DetectionOnly" %}
|
2018-09-12 02:25:32 +00:00
|
|
|
{% if service.4|int() == 1 %}
|
2018-10-01 02:32:13 +00:00
|
|
|
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}" checked>
|
2018-09-12 02:25:32 +00:00
|
|
|
{% else %}
|
2018-10-01 02:32:13 +00:00
|
|
|
<label for="{{ service.0 }}"></label><input type="checkbox" id="{{ service.0 }}">
|
2018-09-12 02:25:32 +00:00
|
|
|
{% endif %}
|
2018-08-20 06:39:52 +00:00
|
|
|
{% endif %}
|
2018-09-12 02:25:32 +00:00
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2019-09-10 05:44:02 +00:00
|
|
|
<script>
|
|
|
|
$( "select" ).selectmenu();
|
|
|
|
{% if role <= 1 %}
|
|
|
|
$( "select" ).on('selectmenuchange',function() {
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
changeWafMode(id)
|
|
|
|
});
|
|
|
|
{% endif %}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
.ui-selectmenu-button.ui-button {width: 10em;}
|
|
|
|
</style>
|