2018-05-05 12:40:41 +00:00
{% extends "base.html" %}
{% block content %}
2020-01-11 21:16:27 +00:00
{% from 'include/input_macros.html' import input, select %}
2018-05-05 12:40:41 +00:00
< script src = "/inc/users.js" > < / script >
2018-09-28 10:35:44 +00:00
< script src = "/inc/fontawesome.min.js" > < / script >
2019-10-25 07:18:57 +00:00
{% include 'include/del_confirm.html' %}
2018-05-05 12:40:41 +00:00
< div id = "tabs" >
< ul >
2020-08-03 13:31:51 +00:00
< li > < a href = "#users" title = "Admin area: Manage users - HAProxy-WI" > Users< / a > < / li >
< li > < a href = "#groups" title = "Admin area: Manage groups - HAProxy-WI" > Groups< / a > < / li >
< li > < a href = "#servers" title = "Admin area: Manage servers - HAProxy-WI" > Servers< / a > < / li >
< li > < a href = "#ssh" title = "Admin area: Manage SSH credentials - HAProxy-WI" > SSH credentials< / a > < / li >
< li > < a href = "#checker" title = "Admin area: Manage checker - HAProxy-WI" > Checker< / a > < / li >
2020-10-09 15:56:16 +00:00
< li > < a href = "#openvpn" title = "Admin area: OpenVPN - HAProxy-WI" > OpenVPN< / a > < / li >
2020-08-03 13:31:51 +00:00
< li > < a href = "#settings" title = "Admin area: Manage HAProxy-WI settings - HAProxy-WI" > Settings< / a > < / li >
< li > < a href = "#services" title = "Admin area: Manage HAProxy-WI services - HAProxy-WI" > Services< / a > < / li >
< li > < a href = "#updatehapwi" title = "Admin area: Update HAProxy-WI - HAProxy-WI" > Update< / a > < / li >
< li > < a href = "#backup" title = "Admin area: Backup configs - HAProxy-WI" > Backup< / a > < / li >
2020-08-08 20:54:53 +00:00
< li > < a href = "#installmon" title = "Servers: Monitoring service installation - HAProxy-WI" > Monitoring installation< / a > < / li >
2019-10-25 07:18:57 +00:00
{% include 'include/login.html' %}
2018-05-05 12:40:41 +00:00
< / ul >
2020-01-12 16:13:48 +00:00
< ul id = 'browse_histroy' > < / ul >
2020-09-05 06:31:40 +00:00
2018-05-05 12:40:41 +00:00
< div id = "users" >
2020-09-05 06:31:40 +00:00
{% include 'include/admin_users.html' %}
2018-05-05 12:40:41 +00:00
< / div >
2020-09-05 06:31:40 +00:00
2018-05-05 12:40:41 +00:00
< div id = "groups" >
< table class = "overview" id = "ajax-group" >
2020-01-18 23:50:43 +00:00
< thead >
2018-05-05 12:40:41 +00:00
< tr class = "overviewHead" >
2020-01-18 23:50:43 +00:00
< th class = "padding10 first-collumn" > Name< / th >
2020-08-07 15:14:59 +00:00
< th style = "width: 100%;" > Description< / th >
2020-01-18 23:50:43 +00:00
< th > < / th >
2018-05-05 12:40:41 +00:00
< / tr >
2020-01-18 23:50:43 +00:00
< tbody >
2018-05-05 12:40:41 +00:00
{% for group in groups %}
2018-08-05 14:37:14 +00:00
< tr id = "group-{{ group.0 }}" class = "{{ loop.cycle('odd', 'even') }}" >
2018-09-07 07:44:23 +00:00
{% if group.1 == "All" %}
2018-05-05 12:40:41 +00:00
< td class = "padding10 first-collumn" > {{ group.1 }}< / td >
< td > {{ group.2 }}< / td >
< td > < / td >
{% else %}
< td class = "padding10 first-collumn" >
2020-04-06 16:38:58 +00:00
{% set id = 'name-' + group.0|string() %}
{{ input(id, value=group.1) }}
2018-05-05 12:40:41 +00:00
< / td >
2020-08-04 16:40:58 +00:00
< td >
2020-04-06 16:38:58 +00:00
{% set id = 'descript-' + group.0|string() %}
2018-10-01 02:32:13 +00:00
{% if group.2 != "None" %}
2020-04-06 16:38:58 +00:00
{{ input(id, value=group.2, size='60') }}
2018-10-01 02:32:13 +00:00
{% else %}
2020-04-06 16:38:58 +00:00
{{ input(id, value='', size='60') }}
2018-10-01 02:32:13 +00:00
{% endif %}
2018-05-05 12:40:41 +00:00
< / td >
< td >
2018-09-23 09:16:16 +00:00
< a class = "delete" onclick = "confirmDeleteGroup({{ group.0 }})" title = "Delete group {{group.1}}" style = "cursor: pointer;" > < / a >
2018-05-05 12:40:41 +00:00
< / td >
{% endif %}
< / tr >
{% endfor %}
2020-01-18 23:50:43 +00:00
< / tbody >
2018-05-05 12:40:41 +00:00
< / table >
< br / > < span class = "add-button" title = "Add group" id = "add-group-button" > + Add< / span >
< br / > < br / >
2019-10-14 21:23:49 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
2020-12-29 14:16:46 +00:00
How to setup groups you can read in this < a href = "https://haproxy-wi.org/howto.py?howto=setup" title = "How to setup servers, group and SSH credentials" target = "_blank" > article< / a >
2019-10-14 21:23:49 +00:00
< / div >
2018-05-05 12:40:41 +00:00
< / div >
< div id = "servers" >
2020-09-04 19:12:31 +00:00
{% include 'include/admin_servers.html' %}
2018-05-05 12:40:41 +00:00
< / div >
2019-10-14 06:55:29 +00:00
2018-05-07 13:24:22 +00:00
< div id = "ssh" >
2020-08-11 09:54:03 +00:00
{% include 'include/admin_ssh.html' %}
2018-05-05 12:40:41 +00:00
< / div >
2018-07-25 05:25:27 +00:00
< div id = "checker" >
2020-09-05 06:31:40 +00:00
{% include 'include/admin_telegram.html' %}
2018-07-25 05:25:27 +00:00
< / div >
2020-10-09 15:56:16 +00:00
< div id = "openvpn" >
2020-11-26 04:18:51 +00:00
{% if openvpn != '' %}
2020-10-09 15:56:16 +00:00
< table id = "openvpn_table" class = "overview" >
< caption > < h3 > OpenVPN profiles< / h3 > < / caption >
< tr class = "overviewHead" >
< td class = "padding10 first-collumn" style = "width: 25%;" >
Profile name
< / td >
< td class = "padding10 first-collumn" style = "width: 35%;" >
Time of creation
< / td >
< td > < / td >
< td > < / td >
< / tr >
{% for c in openvpn_configs %}
< tr class = "{{ loop.cycle('odd', 'even') }}" id = "{{c.split('/')[-1].split('.')[0]}}" >
< td class = "padding10 first-collumn" >
{{c.split('/')[-1]}}
< / td >
< td style = "width: 100%" >
{{c.split('/')[0]}}
< / td >
< td >
< a class = "service-start" onclick = "OpenVpnSess('{{c.split('/')[-1].split('.')[0]}}', 'start')" title = "Start OpenVPN with profile {{c.split('/')[-1]}}" > < / a >
< / td >
< td >
< a class = "delete" onclick = "confirmDeleteOpenVpnProfile('{{c.split('/')[-1].split('.')[0]}}')" title = "Delete OpenVPN profile {{c.split('/')[-1]}}" style = "cursor: pointer;" > < / a >
< / td >
< / tr >
{% endfor %}
< / table >
< br / >
< table id = "openvpn_table" class = "overview" >
< caption > < h3 > OpenVPN sessions< / h3 > < / caption >
< tr class = "overviewHead" >
< td class = "padding10 first-collumn" style = "width: 25%;" >
Session name
< / td >
< td class = "padding10 first-collumn" style = "width: 35%;" >
Status
< / td >
< td > < / td >
< td > < / td >
< / tr >
{% for c in openvpn_sess %}
< tr class = "{{ loop.cycle('odd', 'even') }}" >
< td class = "padding10 first-collumn" >
{{c.split(' ')[0]}}
< / td >
< td style = "width: 100%" >
{{c.split(' ')[4]}}
< / td >
< td >
< a class = "service-reload" onclick = "OpenVpnSess('{{c.split(' ')[0]}}', 'restart')" title = "Restart OpenVPN with profile {{c.split('/')[0]}}" > < / a >
< / td >
< td >
< a class = "delete" onclick = "OpenVpnSess('{{c.split(' ')[0]}}', 'disconnect')" title = "Disconnect OpenVPN profile {{c.split('/')[2]}}" style = "cursor: pointer;" > < / a >
< / td >
< / tr >
{% endfor %}
< / table >
< br / >
< table id = "openvpn_upload_table" class = "overview" >
< caption > < h3 > Uploading ovpn files< / h3 > < / caption >
< tr class = "overviewHead" style = "width: 50%;" >
< td class = "padding10 first-collumn" style = "width: 25%;" > Ovpn file name< / td >
< td >
< span title = "Ovpn file must be with an auto-login profile" > Upload ovpn file (?)< / span >
< / td >
< / tr >
< tr style = "width: 50%;" >
< td class = "first-collumn" valign = "top" style = "padding-top: 15px;" >
{{ input('ovpn_upload_name', size='30') }}
< / td >
< td style = "padding-top: 15px;" >
< textarea id = "ovpn_upload_file" cols = "50" rows = "5" > < / textarea > < br / > < br / >
< a class = "ui-button ui-widget ui-corner-all" id = "ovpn_upload" title = "Upload ovpn file" onclick = "uploadOvpn()" > Upload< / a >
< br / > < br / >
< / td >
< / tr >
< / table >
{% else %}
< center >
< br / >
< h3 > You do not have installed OpenVPN client.
Read < a href = "https://haproxy-wi.org/services.py?service=openvpn" title = "OpenVPN" style = "color: #5d9ceb;" target = "_blank" > hear< / a >
how to install OpenVPN client< / h3 >
< / center >
{% endif %}
< / div >
2019-10-21 06:00:16 +00:00
< div id = "settings" >
2020-08-10 18:32:44 +00:00
{% include 'include/admin_settings.html' %}
2019-10-21 06:00:16 +00:00
< / div >
2020-05-12 18:57:05 +00:00
< div id = "services" >
< table id = "services_table" class = "overview" >
< tr class = "overviewHead" >
< td class = "padding10 first-collumn" style = "width: 25%;" >
Service
< / td >
< td class = "padding10 first-collumn" style = "width: 35%;" >
Actions
< / td >
< td > Description< / td >
< / tr >
{% for s in services %}
< tr class = "{{ loop.cycle('odd', 'even') }}" id = "{{s.0}}" >
< td class = "padding10 first-collumn" >
{% if s.1.0 == 'active' %}
< span title = "{{s.0}} is started" > < span class = "serverUp server-status" > < / span > < / span >
{% else %}
{% if s.1.0 == 'inactive' or s.1.0 == 'failed' %}
< span title = "{{s.0}} is stoped" > < span class = "serverDown server-status" > < / span > < / span >
{% else %}
< span title = "{{s.0}} is not installed" > < span class = "serverNone server-status" > < / span > < / span >
{% endif %}
{% endif %}
{{s.0}}
< / td >
< td class = "padding10 first-collumn" >
< a id = "start-{{ s.0 }}" class = "start" title = "Start and enable {{s.0}} service" >
< span class = "service-start" onclick = "confirmAjaxServiceAction('start', '{{s.0}}')" > < / span >
< / a >
< a id = "restart-{{ s.2 }}" class = "restart" title = "Restart {{s.0}} service" >
< span class = "service-reload service-restart" onclick = "confirmAjaxServiceAction('restart', '{{s.0}}')" > < / span >
< / a >
< a id = "stop-{{ s.0 }}" class = "stop" title = "Stop and disable {{s.0}} service" >
< span class = "service-stop" onclick = "confirmAjaxServiceAction('stop', '{{s.0}}')" > < / span >
< / a >
< / td >
< td >
{{ s.2 }}
< / td >
< / tr >
{% endfor %}
< / table >
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read about services < a href = "https://haproxy-wi.org/services.py" title = "HAProxy-WI services" target = "_blank" > here< / a >
< / div >
< / div >
2019-10-21 06:00:16 +00:00
< div id = "updatehapwi" >
{% set current_ver = versions.0 %}
{% set new_ver = versions.1 %}
{% set current_ver_without_dots = versions.2 %}
{% set new_ver_without_dots = versions.3 %}
< table class = "overview" >
< tr class = "overviewHead" >
2020-09-24 05:01:48 +00:00
< td class = "padding10 first-collumn" style = "width: 25%;" > Service< / td >
< td > Currnet version< / td >
2019-10-21 06:00:16 +00:00
< td class = "padding10" > Last version< / td >
< td > < / td >
2020-11-14 06:57:19 +00:00
< td >
Description
< / td >
2019-10-21 06:00:16 +00:00
< / tr >
< tr >
2020-09-24 05:01:48 +00:00
< td class = "padding10 first-collumn" >
HAProxy-WI
< / td >
< td >
< b > {{current_ver}}< / b >
< / td >
< td class = "padding10" >
< b > {{new_ver}}< / b >
< / td >
< td >
{% if new_ver_without_dots > current_ver_without_dots and new_ver != "Sorry cannot get current version" %}
< a class = "ui-button ui-widget ui-corner-all" onclick = "updateService('haproxy-wi')" title = "Update HAProxy-WI" > Update< / a >
{% endif %}
< / td >
2020-11-14 06:57:19 +00:00
< td >
The main application
< / td >
2020-09-24 05:01:48 +00:00
< / tr >
{% for s in services %}
{% if s.0 == 'smon' or s.0 == 'checker_haproxy' or s.0 == 'keep_alive' or s.0 == 'metrics_haproxy' %}
< tr >
{% set is_need_update = 0 %}
{% if s.0 == 'smon' %}
{% set service_name = 'SMON' %}
{% set service_link = 'smon' %}
2020-11-14 06:57:19 +00:00
{% set desc_link = 'https://haproxy-wi.org/services.py?service=smon' %}
2020-11-15 06:50:56 +00:00
{% if s.3|float < smon_ver | float % }
2020-09-24 05:01:48 +00:00
{% set is_need_update = 1 %}
{% endif %}
{% elif s.0 == 'checker_haproxy' %}
{% set service_name = 'Checker' %}
{% set service_link = 'checker' %}
2020-11-14 06:57:19 +00:00
{% set desc_link = 'https://haproxy-wi.org/services.py?service=checker' %}
2020-11-15 06:50:56 +00:00
{% if s.3|float < checker_ver | float % }
2020-09-24 05:01:48 +00:00
{% set is_need_update = 1 %}
{% endif %}
{% elif s.0 == 'keep_alive' %}
{% set service_name = 'Auto start' %}
{% set service_link = 'auto_start' %}
2020-11-14 06:57:19 +00:00
{% set desc_link = 'https://haproxy-wi.org/services.py?service=auto_start' %}
2020-11-15 06:50:56 +00:00
{% if s.3|float < keep_ver | float % }
2020-09-24 05:01:48 +00:00
{% set is_need_update = 1 %}
{% endif %}
{% elif s.0 == 'metrics_haproxy' %}
{% set service_name = 'Metrics' %}
{% set service_link = 'metrics' %}
2020-11-14 06:57:19 +00:00
{% set desc_link = 'https://haproxy-wi.org/services.py?service=metrics' %}
2020-11-15 06:50:56 +00:00
{% if s.3|float < metrics_ver | float % }
2020-09-24 05:01:48 +00:00
{% set is_need_update = 1 %}
{% endif %}
2019-10-21 06:00:16 +00:00
{% endif %}
2020-09-24 05:01:48 +00:00
< td class = "padding10 first-collumn" >
{{service_name}}
< / td >
< td >
{% if s.3 != '* is not installed' %}
< b > {{s.3}}< / b >
{% endif %}
< / td >
< td class = "padding10" >
< b >
{% if s.0 == 'smon' %}
{{smon_ver}}
{% elif s.0 == 'checker_haproxy' %}
{{checker_ver}}
{% elif s.0 == 'keep_alive' %}
{{keep_ver}}
{% elif s.0 == 'metrics_haproxy' %}
{{metrics_ver}}
{% endif %}
< / b >
< / td >
< td >
{% if s.3 != '* is not installed' %}
{% if is_need_update %}
< a class = "ui-button ui-widget ui-corner-all" onclick = "updateService('{{s.0}}')" title = "Update {{service_name}}" > Update< / a >
{% endif %}
{% else %}
{{service_name}} service is not installed
2020-11-14 06:57:19 +00:00
< a href = "https://haproxy-wi.org/services.py?service={{service_link}}#installation" title = "{{service_name}} installation" target = "_blank" style = "color: #5d9ceb;" > Read about installation< / a >
2020-09-24 05:01:48 +00:00
{% endif %}
< / td >
2020-11-14 06:57:19 +00:00
< td >
Read more about < a href = "{{desc_link}}" title = "Read more about {{service_name}}" target = "_blank" class = "link" > {{service_name}}< / a >
< / td >
2020-09-24 05:01:48 +00:00
< / tr >
{% endif %}
{% endfor %}
2019-10-21 06:00:16 +00:00
< / table >
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
< b style = "font-size: 20px; display: block; padding-bottom: 10px;" > Note:< / b >
2020-11-14 06:57:19 +00:00
For updating you have to use HAProxy-WI RPM. How to start using repository read < a href = "https://haproxy-wi.org/installation.py" title = "HAProxy-WI installation" target = "_blank" > here< / a >
2019-10-25 07:18:57 +00:00
< br / > < br / >
2020-11-14 06:57:19 +00:00
If the HAProxy-WI server uses a proxy to connect to the Internet, add the proxy settings to yum.conf
2019-10-25 07:18:57 +00:00
< br / > < br / >
2020-11-14 06:57:19 +00:00
Read more about updating in < a href = "https://haproxy-wi.org/updates.py" title = "Doc" target = "_blank" > docs< / a >
2019-10-21 06:00:16 +00:00
and < a href = "https://haproxy-wi.org/changelog.py" title = "Changelog" target = "_blank" > changelog< / a >
< / div >
< div id = "ajax-update" > < / div >
< / div >
2020-08-08 06:26:43 +00:00
2020-01-11 21:16:27 +00:00
< div id = "backup" >
2020-08-08 06:26:43 +00:00
{% include 'include/admin_backup.html' %}
2020-01-11 21:16:27 +00:00
< / div >
2020-08-08 20:54:53 +00:00
< div id = "installmon" >
{% include 'include/mon_installation.html' %}
< / div >
2020-01-11 21:16:27 +00:00
< / div >
2020-08-07 15:14:59 +00:00
{% include 'include/admins_dialogs.html' %}
2019-10-25 07:18:57 +00:00
{% include 'include/change_pass_form.html' %}
2020-05-10 06:17:07 +00:00
< div id = "change-user-groups-dialog" style = "display: none;" >
< div id = "change-user-groups-form" > < / div >
< / div >
2018-09-23 09:16:16 +00:00
< style >
2020-08-07 15:14:59 +00:00
.ui-selectmenu-button.ui-button {
width: 10em;
}
.first-collumn {
width: 10%;
}
2020-12-17 10:30:49 +00:00
.container {
margin-right: 0;
}
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
.ui-checkboxradio-label {
padding-bottom: 0.6em !important;
padding-top: 0.6em !important;
}
}
2018-09-23 09:16:16 +00:00
< / style >
2020-01-18 23:50:43 +00:00
< script >
2020-05-10 06:17:07 +00:00
$( function() {
{% for user in users %}
$("#role-{{user.0}}" ).selectmenu({
width: 100
});
{% endfor %}
{% for server in servers %}
$("#servergroup-{{ server.0}}" ).selectmenu({
width: 100
});
$("#slavefor-{{server.0}}" ).selectmenu({
width: 130
});
$("#credentials-{{server.0}}" ).selectmenu({
width: 150
});
{% endfor %}
{% for ssh in sshs %}
if (window.matchMedia('(max-width: 1280px)').matches) {
$("#sshgroup-{{ ssh.0}}" ).selectmenu({
width: 100
2020-01-18 23:50:43 +00:00
});
2020-05-10 06:17:07 +00:00
}
{% endfor %}
{% for server in backups %}
$("#backup-time-{{ server.0}}" ).selectmenu({
width: 100
});
$("#backup-type-{{server.0}}" ).selectmenu({
width: 130
});
$("#backup-credentials-{{server.0}}" ).selectmenu({
width: 150
});
{% endfor %}
});
< / script >
2018-05-05 12:40:41 +00:00
{% endblock %}