haproxy-wi/app/templates/include/smon/smon_http_server.html

102 lines
3.6 KiB
HTML

<td class="padding10 first-collumn" style="width: 150px;">
{% set id = 'smon-name-' + s.id|string() %}
{{ input(id, value=s.name.strip("'"), size='20') }}
</td>
<td style="width: 150px;">
{% set id = 'smon-url-' + s.id|string() %}
{{ input(id, value=s_service.url, size='20') }}
</td>
<td class="checkbox">
{% set id = 'smon-enable-' + s.id|string() %}
{% if s.en == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
</td>
<td>
{% set id = 'smon-body-' + s.id|string() %}
{{ input(id, value=s_service.body, size='20') }}
</td>
<td>
{% set id = 'smon-http_method-' + s.id|string() %}
{% set http_methods = {'get': 'GET', 'post': 'POST', 'put': 'PUT', 'patch': 'PATCH', 'delete': 'DELETE',
'head': 'HEAD', 'options': 'OPTIONS'} %}
{{ select(id, values=http_methods, selected=s_service.method) }}
</td>
<td>
<select id="smon-telegram-{{s.id}}">
<option value="0">{{lang.words.disabled|title()}}</option>
{% for t in telegrams %}
{% if s.telegram_channel_id|int() == t.id|int() %}
<option value="{{t.id}}" selected>{{t.chanel_name}}</option>
{% else %}
<option value="{{t.id}}">{{t.chanel_name}}</option>
{% endif %}
{% endfor %}
</select>
</td>
<td>
<select id="smon-slack-{{s.id}}">
<option value="0">{{lang.words.disabled|title()}}</option>
{% for t in slacks %}
{% if s.slack_channel_id|int() == t.id|int() %}
<option value="{{t.id}}" selected>{{t.chanel_name}}</option>
{% else %}
<option value="{{t.id}}">{{t.chanel_name}}</option>
{% endif %}
{% endfor %}
</select>
</td>
<td>
<select id="smon-pd-{{s.id}}">
<option value="0">{{lang.words.disabled|title()}}</option>
{% for t in pds %}
{% if s.pd_channel_id|int() == t.id|int() %}
<option value="{{t.id}}" selected>{{t.chanel_name}}</option>
{% else %}
<option value="{{t.id}}">{{t.chanel_name}}</option>
{% endif %}
{% endfor %}
</select>
</td>
<td>
{% set id = 'smon-group-' + s.id|string() %}
{% if s.group is not none %}
{{ input(id, value=s.group, size='15') }}
{% else %}
{{ input(id, size='15') }}
{% endif %}
</td>
<td>
{% set id = 'smon-desc-' + s.id|string() %}
{% if s.desc is not none %}
{{ input(id, value=s.desc.strip("'"), size='20') }}
{% else %}
{{ input(id, size='20') }}
{% endif %}
</td>
<td>
<a class="add" onclick="cloneSmom({{s.id}}, 'http')" id="clone-{{s.id}}" title="{{lang.words.clone|title()}} {{s.ip}}" style="cursor: pointer; color: #000;"></a>
</td>
<td>
<a class="delete" onclick="confirmDeleteSmon({{s.id}}, 'http')" title="{{lang.words.delete|title()}} {{s.ip}}" style="cursor: pointer; color: #000;"></a>
</td>
</tr>
<script>
$( function() {
$("#smon-telegram-{{s.id}}" ).selectmenu({
width: 160
});
$("#smon-slack-{{s.id}}" ).selectmenu({
width: 160
});
$("#smon-pd-{{s.id}}" ).selectmenu({
width: 160
});
$("#smon-proto-{{s.id}}" ).selectmenu({
width: 78
});
});
</script>