2021-07-05 14:51:05 +00:00
{% from 'include/input_macros.html' import input, checkbox, copy_to_clipboard %}
2022-04-27 18:10:26 +00:00
{% if user_status == 0 or user_plan == 'user' %}
< script >
$( function() {
$('select:regex(id, slavefor)').selectmenu("disable");
{% if user_status == 0 %}
$('#slavefor-th').attr("title", "Actions with the master config will automatically apply on the slave. You are not subscribed. Please subscribe to have access to this feature");
{% elif user_plan == 'user' %}
$('#slavefor-th').attr("title", "Actions with the master config will automatically apply on the slave. This feature is not available for your plan");
{% endif %}
});
< / script >
{% endif %}
2020-09-04 19:12:31 +00:00
{% if not adding %}
< table class = "overview" id = "ajax-servers" >
< thead >
< tr class = "overviewHead" >
2021-12-03 10:39:15 +00:00
< th class = "padding10 first-collumn" > Name< / th >
2021-07-05 14:51:05 +00:00
< th class = "ip-field" style = "width: 10%" > IP< / th >
2021-06-11 15:18:33 +00:00
< th class = "checkbox-head" style = "width: 5%" class = "help_cursor" > < span title = "SSH port" > Port< / span > < / th >
2020-09-04 19:12:31 +00:00
{% if page != "servers.py" %}
2021-01-22 04:01:08 +00:00
< th style = "width: 10%" > Group< / th >
2020-09-04 19:12:31 +00:00
{% endif %}
2021-08-15 09:02:12 +00:00
< th class = "checkbox-head" style = "min-width: 70px;" > Enabled< / th >
< th style = "min-width: 50px; padding-left: 5px;" class = "help_cursor" >
2020-09-04 19:12:31 +00:00
< span title = "Virtual IP, something like VRRP" > Virt< / span >
< / th >
2021-08-15 09:02:12 +00:00
< th class = "checkbox-head" style = "min-width: 75px" > HAProxy< / th >
< th class = "checkbox-head" style = "min-width: 65px;" > Nginx< / th >
2022-04-15 09:49:00 +00:00
< th class = "checkbox-head" style = "min-width: 65px;" > Apache< / th >
2021-08-02 08:19:22 +00:00
< th style = "min-width: 100px;" class = "help_cursor" >
2020-12-15 06:34:02 +00:00
< span title = "If the server has a firewall enabled, enable this option" > Firewalld< / span >
2020-11-18 04:45:34 +00:00
< / th >
2021-08-15 09:02:12 +00:00
< th class = "checkbox-head" style = "min-width: 80px;" class = "help_cursor" >
2021-05-16 05:27:47 +00:00
< span title = "If protection is enabled, then the server is inaccessible for editing by everyone except the admin role" > Protected< / span >
< / th >
2021-06-11 15:18:33 +00:00
< th style = "width: 10%" class = "help_cursor" >
2022-04-27 18:10:26 +00:00
< span id = "slavefor-th" title = "Actions with the master config will automatically apply on the slave" > Slave for< / span >
2020-09-04 19:12:31 +00:00
< / th >
2021-01-12 05:05:53 +00:00
< th class = "cred-field" > Credentials< / th >
2020-09-04 19:12:31 +00:00
< th style = "width: 100%" > Description< / th >
2021-12-03 10:39:15 +00:00
< th style = "min-width: 17px;" > < / th >
2020-09-04 19:12:31 +00:00
< th > < / th >
< th > < / th >
2022-04-06 12:32:04 +00:00
< th > < / th >
2020-09-04 19:12:31 +00:00
< / tr >
< / thead >
< tbody >
{% endif %}
{% for server in servers %}
< tr id = "server-{{server.0}}" class = "{{ loop.cycle('odd', 'even') }} {% if adding %}newserver{% endif %}" >
< td class = "padding10 first-collumn" >
{% set id = 'hostname-' + server.0|string() %}
2021-04-17 17:38:08 +00:00
{{ input(id, value=server.1, size='15') }}
2020-09-04 19:12:31 +00:00
< / td >
< td >
2021-07-05 14:51:05 +00:00
{% set id = 'ip-' + server.0|string() %}
{{ copy_to_clipboard(id=id, value=server.2, style='margin-right: 6px;') }}
2020-09-04 19:12:31 +00:00
< / td >
< td >
{% set id = 'port-' + server.0|string() %}
2021-01-12 05:05:53 +00:00
{{ input(id, value=server.10, type='number', style='width: 50px;') }}
2020-09-04 19:12:31 +00:00
< / td >
{% if page != "servers.py" %}
< td >
< select id = "servergroup-{{server.0}}" name = "servergroup-{{server.0}}" >
2021-08-16 09:22:30 +00:00
< option disabled selected > ------< / option >
2020-09-04 19:12:31 +00:00
{% for group in groups %}
2021-08-02 08:19:22 +00:00
{% if server.3 == group.group_id|string() %}
< option value = "{{ group.group_id }}" selected > {{ group.name }}< / option >
2020-09-04 19:12:31 +00:00
{% else %}
2021-08-02 08:19:22 +00:00
< option value = "{{ group.group_id }}" > {{ group.name }}< / option >
2020-09-04 19:12:31 +00:00
{% endif %}
{% endfor %}
< / select >
< / td >
2019-10-25 07:18:57 +00:00
{% else %}
2020-09-04 19:12:31 +00:00
< input type = "hidden" id = "servergroup-{{server.0}}" name = "servergroup-{{server.0}}" value = "{{ group }}" / >
2019-10-25 07:18:57 +00:00
{% endif %}
2020-09-04 19:12:31 +00:00
< td class = "checkbox" >
{% set id = 'enable-' + server.0|string() %}
{% if server.5 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< / td >
< td class = "checkbox" style = "padding-left: 0px;" >
{% set id = 'typeip-' + server.0|string() %}
{% if server.4 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< / td >
< td class = "checkbox" >
{% set id = 'haproxy-' + server.0|string() %}
{% if server.15 == 1 %}
{{ checkbox(id, checked='checked') }}
2019-10-25 07:18:57 +00:00
{% else %}
2020-09-04 19:12:31 +00:00
{{ checkbox(id) }}
2019-10-25 07:18:57 +00:00
{% endif %}
2020-09-04 19:12:31 +00:00
< / td >
2021-01-22 04:01:08 +00:00
< td class = "checkbox" style = "padding-left: 5px;" >
2020-09-04 19:12:31 +00:00
{% set id = 'nginx-' + server.0|string() %}
{% if server.14 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< / td >
2022-04-15 09:49:00 +00:00
< td class = "checkbox" style = "padding-left: 5px;" >
{% set id = 'apache-' + server.0|string() %}
{% if server.24 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< / td >
2021-01-22 04:01:08 +00:00
< td class = "checkbox" style = "padding-left: 0" >
2020-12-15 06:34:02 +00:00
< div class = "controlgroup" >
{% set id = 'firewall-' + server.0|string() %}
{% if server.18 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< button onclick = "viewFirewallRules('{{server.2}}')" title = "View firewall rules on server {{server.1}}" > view< / button >
< / div >
2020-11-18 04:45:34 +00:00
< / td >
2021-05-16 05:27:47 +00:00
< td class = "checkbox" style = "padding-left: 15px;" >
{% set id = 'protected-' + server.0|string() %}
{% if server.20 == 1 %}
{{ checkbox(id, checked='checked') }}
{% else %}
{{ checkbox(id) }}
{% endif %}
< / td >
2020-09-04 19:12:31 +00:00
< td >
< select id = "slavefor-{{server.0}}" >
< option value = "0" selected > Not slave< / option >
{% for master in masters %}
2021-01-10 04:48:18 +00:00
{% if master.0 == server.6 %}
2020-09-04 19:12:31 +00:00
< option value = "{{master.0}}" selected > {{master.1}}< / option >
{% else %}
2021-01-10 04:48:18 +00:00
{% if master.0 != server.0 %}
2020-09-04 19:12:31 +00:00
< option value = "{{master.0}}" > {{master.1}}< / option >
2021-01-10 04:48:18 +00:00
{% endif %}
2020-09-04 19:12:31 +00:00
{% endif %}
{% endfor %}
< / select >
< / td >
< td >
< div class = "controlgroup" >
< select id = "credentials-{{server.0}}" >
2021-08-16 09:22:30 +00:00
< option disabled selected > ------< / option >
2020-09-04 19:12:31 +00:00
{% for ssh in sshs %}
2021-08-02 08:19:22 +00:00
{% if ssh.id == server.7 %}
< option value = "{{ssh.id}}" selected > {{ssh.name}}< / option >
2020-09-04 19:12:31 +00:00
{% else %}
2021-08-02 08:19:22 +00:00
< option value = "{{ssh.id}}" > {{ssh.name}}< / option >
2020-09-04 19:12:31 +00:00
{% endif %}
{% endfor %}
< / select >
< button onclick = "checkSshConnect('{{server.2}}')" title = "Check SSH connect to the server {{server.1}}" > check< / button >
< / div >
< / td >
< td >
{% set id = 'desc-' + server.0|string() %}
2021-08-02 08:19:22 +00:00
{% if server.11 is not none %}
2020-09-04 19:12:31 +00:00
{{ input(id, value=server.11, size='20') }}
{% else %}
{{ input(id, size='20') }}
{% endif %}
< / td >
2022-04-06 12:32:04 +00:00
< td >
< a href = "history.py?service=server&serv={{server.2}}" title = "View history for this server" class = "history" > < / a >
< / td >
2021-12-03 10:39:15 +00:00
< td style = "min-width: 17px;" >
< a class = "info" onclick = "showServerInfo('{{server.0}}', '{{server.2}}')" id = "server_info_link-{{server.0}}" title = "Show server info" style = "cursor: pointer; color: var(--green-color)" > < / a >
< / td >
2020-09-04 19:12:31 +00:00
< td >
< a class = "add" onclick = "cloneServer({{server.0}})" id = "clone-{{server.0}}" title = "Clone {{server.1}}" style = "cursor: pointer;" > < / a >
< / td >
< td >
< a class = "delete" onclick = "confirmDeleteServer({{server.0}})" title = "Delete server {{server.1}}" style = "cursor: pointer;" > < / a >
< / td >
< / tr >
2021-12-03 10:39:15 +00:00
< tr id = "server_info-{{server.0}}" style = "display: none" > < / tr >
2020-09-04 19:12:31 +00:00
{% endfor %}
{% if not adding %}
< / tbody >
< / table >
< br / > < span class = "add-button" title = "Add server" id = "add-server-button" > + Add< / span >
< br / > < br / >
< div id = "checkSshConnect" > < / div >
2021-01-10 04:48:18 +00:00
< div class = "add-note addName alert alert-info" style = "width: inherit; margin-right: 15px;" >
2021-07-21 04:57:58 +00:00
You can read the description of all parameters < a href = "https://roxy-wi.org/description.py?description=servers" title = "Servers description" target = "_blank" > here< / a >
or read HowTo in this < a href = "https://roxy-wi.org/howto.py?howto=setup" title = "How to setup servers, group and SSH credentials" target = "_blank" > article< / a >
2020-09-04 19:12:31 +00:00
< / div >
{% endif %}