You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/templates/ovw.html

372 lines
12 KiB

{% extends "base.html" %}
{% block content %}
<link href="/inc/chart.min.css" rel="stylesheet">
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
5 years ago
<script src="/inc/overview.js"></script>
<script>
6 years ago
$("#secIntervals").css("display", "none");
5 years ago
var ip = []
var hostnamea = []
{% for s in servers %}
ip.push("{{s[2]}}")
var host = "{{s[1]}}"
host = host.replace(/\./g, '\\.');
hostnamea.push(host)
5 years ago
{% endfor %}
</script>
<style>
.fa-sync-alt { margin-bottom: -1px; }
</style>
5 years ago
<table class="overview-wi">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">
Server
</td>
<td class="padding10 third-collumn-wi" style="width: 20%;">
<a href="/app/hapservers.py" title="HAProxy servers overview" class="logs_link">
HAProxy
</a>
5 years ago
</td>
<td class="padding10">
<a href="/app/hapservers.py?service=nginx" title="Nginx servers overview" class="logs_link">
Nginx
</a>
</td>
<td class="padding10">
Keepalived
</td>
5 years ago
<td class="padding10">
<a href="/app/waf.py" title="WAf servers overview" class="logs_link">
WAF
</a>
5 years ago
</td class="padding10">
<td>
<a onclick="showOverview(ip, hostnamea)" title="Refresh" style="float: right; margin-right: 25px;">
<span class="service-reload"></span>
</a>
5 years ago
</td>
</tr>
5 years ago
{% for s in servers %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="{{s[1]}}"></tr>
{% endfor %}
5 years ago
</table>
<table class="overview-wi">
<tr class="overviewHead" style="height: 40px;">
<td class="padding10 first-collumn-wi" colspan="2">
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{haproxy_wi_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View HAProxy-WI logs" class="logs_link">
HAProxy-WI server status
</a>
{% else %}
HAProxy-WI server status
{% endif %}
5 years ago
</td>
5 years ago
<td>
<a onclick="showOverviewHapWI()" title="Refresh" style="float: right; margin-right: 25px;">
<span class="service-reload"></span>
</a>
5 years ago
</td>
5 years ago
</tr>
<tr>
<td style="width:100%" colspan="2">
<div style="height: 140px;width: 50%;float: left; margin:0; padding:0;">
<canvas id="cpu" role="img"></canvas>
</div>
<div style="height: 140px;width: 50%;float: right;margin:0; padding:0;">
<canvas id="ram" role="img"></canvas>
</div>
5 years ago
</td>
</tr>
</table>
<table class="overview-wi">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi" colspan=4>
5 years ago
Tools status
</td>
5 years ago
</tr>
<tr>
<td class="padding10 first-collumn-wi">
{% if metrics_master|int() >= 1 %}
<span title="running {{ metrics_master }} master processes"><span class="serverUp server-status"></span></span>
{% else %}
<span class="serverDown server-status"></span>
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{metrics_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View metrics master's logs" class="logs_link">
<span>Metrics master</span>
</a>
{% else %}
<span>Metrics master</span>
{% endif %}
5 years ago
</td>
<td class="third-collumn-wi">
{% if checker_master|int() >= 1 %}
<span title="running {{ checker_master }} master processes"><span class="serverUp server-status"></span></span>
5 years ago
{% else %}
<span class="serverDown server-status"></span>
5 years ago
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{checker_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View checker master's logs" class="logs_link">
<span>Checker master</span>
</a>
{% else %}
<span>Checker master</span>
{% endif %}
5 years ago
</td>
<td class="third-collumn-wi">
5 years ago
{% if keep_alive|int() >= 1 %}
<span title="running {{ keep_alive }} processe"><span class="serverUp server-status"></span></span>
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{keep_alive_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View keep alive logs" class="logs_link">
<span>Auto start</span>
</a>
{% else %}
<span>Auto star</span>
{% endif %}
5 years ago
{% else %}
<span class="serverDown server-status"></span>
{% if role <= 1 %}
<a href="/app/users.py#services" title="Start Auto star - HAProxy-WI service" class="logs_link">
Auto start
</a>
{% else %}
<span>Auto star</span>
{% endif %}
5 years ago
{% endif %}
5 years ago
</td>
</tr>
<tr class="even">
5 years ago
<td class="padding10 first-collumn-wi">
{% if metrics_worker|int() >= 1 %}
<span title="running {{metrics_worker}} worker processes"><span class="serverUp server-status"></span></span>
5 years ago
{% else %}
{% if is_metrics_worker|int == 0 %}
<span title="There is not jobs for metrics"><span class="serverNone server-status"></span></span>
{% else %}
<span title="running {{is_checker_worker}} worker processes"><span class="serverDown server-status"></span></span>
{% endif %}
5 years ago
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{metrics_error_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View worker's logs" class="logs_link">
<span>Metrics workers</span>
</a>
{% else %}
<span>Metrics workers</span>
{% endif %}
5 years ago
</td>
<td>
{% if checker_worker|int() >= 1 %}
<span title="running {{ checker_worker }} worker processes"><span class="serverUp server-status"></span></span>
5 years ago
{% else %}
{% if is_checker_worker|int == 0 %}
<span title="There is not jobs for checker"><span class="serverNone server-status"></span> </span>
{% else %}
<span title="running {{ checker_worker }} worker processes"><span class="serverDown server-status"></span> </span>
{% endif %}
5 years ago
{% endif %}
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{checker_error_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View checker's logs" class="logs_link">
<span>Checker workers</span>
</a>
{% else %}
<span>Checker workers</span>
{% endif %}
5 years ago
</td>
<td>
{% if smon == 'active' %}
<span title="SMON is started"><span class="serverUp server-status"></span></span>
<a href="/app/smon.py?action=view" title="SMON Dashboard" class="logs_link">
SMON
</a>
{% else %}
{% if smon == 'inactive' or smon== 'failed' %}
<span title="SMON is stoped"><span class="serverDown server-status"></span></span>
<a href="/app/users.py#services" title="Start SMON - HAProxy-WI service" class="logs_link">
SMON
</a>
{% else %}
<span title="SMON is not installed"><span class="serverNone server-status"></span></span>
<a href="https://haproxy-wi.org/services.py?service=smon" title="Simple monitoring ports installation" target="_blank" class="logs_link">
SMON
</a>
{% endif %}
{% endif %}
</td>
5 years ago
</tr>
<tr>
<td class="padding10 first-collumn-wi">
{% if grafana|int() >= 1 %}
<span title="running {{grafana}} process"><span class="serverUp server-status"></span></span>
<a href="http://{{host}}:3000" target="_blank" title="Open Grafana" class="logs_link">Grafana</a>
{% else %}
<span title="The service does not started or does not installed"><span class="serverNone server-status"></span></span>
<span>Grafana</span>
{% endif %}
</td>
<td>
{% if prometheus|int() >= 1 %}
<span title="running {{ prometheus }} process"><span class="serverUp server-status"></span></span>
{% else %}
<span title="The service does not started or does not installed"><span class="serverNone server-status" title="The service does not started or does not installed"></span></span>
{% endif %}
<span>Prometheus</span>
</td>
</tr>
5 years ago
</table>
{% if role <= 1 %}
5 years ago
<table class="overview-wi">
<tr class="overviewHead">
5 years ago
<td class="padding10 first-collumn-wi">Login</td>
<td class="second-collumn">Groups</td>
<td>Role</td>
5 years ago
<td>
5 years ago
<span class="add-button-wi">
<a title="Show all users" id="show-all-users" style="color: #fff">
Show all
</a>
</span>
</td>
</tr>
{% set counter = 0 %}
{% for USER in users %}
{% set counter = counter + loop.index0 %}
{% if counter <= 2 %}
6 years ago
<tr class="{{ loop.cycle('odd', 'even') }}">
5 years ago
<td class="padding10 first-collumn-wi">
<a href="users.py#users" title="Edit user" class="logs_link div-pic">
{{ USER.1 }}
5 years ago
</a>
</td>
<td class="third-collumn-wi">
{% for group in users_groups %}
{% if USER.0|string() == group.0|string() %}
{{ group.1 }}{{ "," if not loop.last }}
{% endif %}
{% endfor %}
</td>
<td colspan="2">{{ USER.4 }}</td>
</tr>
{% else %}
6 years ago
<tr style="display: none;" class="show-users {{ loop.cycle('odd', 'even') }}">
5 years ago
<td class="padding10 first-collumn-wi">
<a href="users.py#users" title="Edit user" class="logs_link div-pic">
5 years ago
{{ USER.1 }}
</a>
</td>
<td class="third-collumn-wi">
{% for group in users_groups %}
{% if group.0|string() == USER.0|string() %}
{{ group.1 }}{{ "," if not loop.last }}
{% endif %}
{% endfor %}
</td>
<td colspan="2">{{ USER.4 }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
6 years ago
5 years ago
<table class="overview-wi">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">Group</td>
<td class="second-collumn" style="width: 40%">Description</td>
5 years ago
<td>
<span class="add-button-wi">
<a title="Show all groups" id="show-all-groups" style="color: #fff">
Show all
</a>
</span>
</td>
5 years ago
</tr>
5 years ago
{% set counter = 0 -%}
5 years ago
{% for group in groups %}
5 years ago
{% set counter = counter + loop.index0 %}
{% if counter <= 2 %}
5 years ago
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
<a href="users.py#groups" title="Edit groups" class="logs_link div-pic">
5 years ago
{{ group.1 }}
</a>
</td>
<td class="third-collumn-wi" colspan="2">{{ group.2 }}</td>
5 years ago
</tr>
{% else %}
<tr style="display: none;" class="show-groups {{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
<a href="users.py#groups" title="Edit groups" class="logs_link div-pic">
5 years ago
{{ group.1 }}
</a>
</td>
<td class="third-collumn-wi" colspan="2">{{ group.2 }}</td>
5 years ago
</tr>
5 years ago
{% endif %}
5 years ago
{% endfor %}
</table>
<table class="overview-wi">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">Role</td>
<td class="second-collumn" style="width: 50%">Description</td>
5 years ago
<td></td>
<td></td>
</tr>
{% for role in roles %}
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
{{ role.1 }}
</td>
<td class="third-collumn-wi">{{ role.2 }}</td>
<td></td>
<td></td>
</tr>
{% endfor %}
</table>
5 years ago
<table class="overview-wi">
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">
<a href="/app/viewlogs.py?viewlogs={{haproxy_wi_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="View HAProxy-WI logs" class="logs_link">
Recent HAProxy-WI`s log
</a>
</td>
5 years ago
<td>
<span class="add-button-wi">
<a title="Show more log" id="show-all-haproxy-wi-log" style="color: #fff">
Show more log
</a>
</span>
</td>
</tr>
<tr>
{% set counter = 0 -%}
{% for log in haproxy_wi_log %}
{% set counter = counter + loop.index0 %}
{% if counter <= 2 %}
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi" style="font-size: 12.5px;" colspan="2">
{{log }}
</td>
</tr>
{% else %}
<tr style="display: none;" class="show-haproxy-wi-log" class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi" style="font-size: 12.5px" colspan="2">
{{log }}
</td>
</tr>
{% endif %}
{% endfor %}
</tr>
</table>
{% endif %}
<div id="dialog-confirm" style="display: none;">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Are you sure?</p>
</div>
<script>
5 years ago
showOverview(ip, hostnamea)
</script>
{% endblock %}