haproxy-wi/app/templates/ovw.html

272 lines
9.0 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% block title %}{{lang.menu_links.overview.title}}{% endblock %}
{% block h2 %}{{lang.menu_links.overview.h2}}{% endblock %}
{% block content %}
<link href="/inc/css/chart.min.css" rel="stylesheet">
<script src="/inc/metrics.js"></script>
<script src="/inc/chart.min.js"></script>
<script src="/inc/overview-6.3.9.js"></script>
<script>
2018-09-07 07:44:23 +00:00
$("#secIntervals").css("display", "none");
2019-12-27 04:31:09 +00:00
var ip = []
var hostnamea = []
{% for s in servers %}
ip.push("{{s[2]}}")
var host = "{{s[2]}}"
host = host.replace(/\./g, '\\.');
host = host.replace(/ /g, '');
hostnamea.push(host)
2019-12-27 04:31:09 +00:00
{% endfor %}
</script>
<style>
.fa-sync-alt { margin-bottom: -1px; }
</style>
<table class="overview-wi" id="overview-roxy-wi">
2019-09-23 11:18:38 +00:00
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">
{% if role <= 2 %}
<a href="servers.py#servers" title="{{lang.words.manage|title()}} {{lang.words.servers}}">{{lang.words.servers|title()}}</a>
{% else %}
{{lang.words.servers|title()}}
{% endif %}
2019-10-05 20:41:07 +00:00
</td>
<td class="padding10 third-collumn-wi" style="width: 20%;">
<a href="/app/hapservers.py?service=haproxy" title="HAProxy {{lang.words.servers}} {{lang.words.overview}}" class="logs_link">
HAProxy
</a>
2019-09-23 11:18:38 +00:00
</td>
<td class="padding10">
<a href="/app/hapservers.py?service=nginx" title="NGINX {{lang.words.servers}} {{lang.words.overview}}" class="logs_link">
NGINX
</a>
</td>
<td class="padding10">
<a href="/app/hapservers.py?service=apache" title="Apache {{lang.words.servers}} {{lang.words.overview}}" class="logs_link">
Apache
</a>
</td>
<td class="padding10">
<a href="/app/hapservers.py?service=keepalived" title="Keepalived {{lang.words.servers}} {{lang.words.overview}}" class="logs_link">
Keepalived
</a>
</td>
2019-09-23 11:18:38 +00:00
<td class="padding10">
<a href="/app/waf.py?service=haproxy" title="HAProxy WAF {{lang.words.servers}} {{lang.words.overview}}" class="logs_link">
WAF
</a>
</td>
<td class="padding10">
<a onclick="showOverview(ip, hostnamea)" title="{{lang.words.refresh|title()}}" style="float: right;">
<span class="refresh"></span>
</a>
2019-09-23 11:18:38 +00:00
</td>
</tr>
2019-12-27 04:31:09 +00:00
{% for s in servers %}
<tr class="{{ loop.cycle('odd', 'even') }}" id="{{s[2]}}"></tr>
2019-12-27 04:31:09 +00:00
{% endfor %}
2019-09-23 11:18:38 +00:00
</table>
<table class="overview-wi" id="overview-load">
<tr class="overviewHead" style="height: 30px;">
<td class="padding10 first-collumn-wi" colspan="2">
{% if role <= 1 %}
<a href="/app/viewlogs.py?viewlogs={{roxy_wi_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} Roxy-WI {{lang.words.logs}}" class="logs_link">
Roxy-WI {{lang.words.server_status}}
</a>
{% else %}
Roxy-WI {{lang.words.server_status}}
{% endif %}
2019-10-04 17:04:25 +00:00
</td>
2019-10-04 19:20:09 +00:00
<td>
<a onclick="showOverviewHapWI()" title="{{lang.words.refresh|title()}}" style="float: right; margin-right: 15px;">
<span class="refresh"></span>
</a>
2019-10-04 19:20:09 +00:00
</td>
2019-10-04 16:58:47 +00:00
</tr>
<tr>
<td style="width:100%" colspan="3">
<div id="cpu_div" style="height: 140px;width: 50%;float: left; margin:0; padding:0;">
<canvas id="cpu" role="img"></canvas>
</div>
<div id="ram_div" style="height: 140px;width: 50%;float: right;margin:0; padding:0;">
<canvas id="ram" role="img"></canvas>
</div>
2019-10-04 16:58:47 +00:00
</td>
</tr>
</table>
<table class="overview-wi" id="overview-services">
<thead>
<tr class="overviewHead">
<td class="padding10 first-collumn-wi" colspan=2>
{% if role <= 1 %}
<a href="/app/users.py#services" title="{{lang.words.view|title()}} {{lang.words.services}} {{lang.words.status}}" class="logs_link">
Roxy-WI {{lang.words.services_status}}
</a>
{% else %}
Roxy-WI {{lang.words.services_status}}
{% endif %}
</td>
<td>
<a onclick="showServicesOverview()" title="{{lang.words.refresh|title()}}" style="float: right; margin-right: 15px;">
<span class="refresh"></span>
</a>
</td>
</tr>
</thead>
<tbody id="services_ovw"></tbody>
2019-09-23 11:18:38 +00:00
</table>
{% if role <= 2 %}
{% if role == 2 %}
{% set admin_uri = 'servers.py' %}
{% elif role == 1 %}
{% set admin_uri = 'users.py' %}
{% endif %}
<table class="overview-wi" id="overview-users">
<thead>
<tr class="overviewHead" style="height: 30px;">
<td class="padding10 first-collumn-wi">
<a href="{{admin_uri}}#users" title="{{lang.words.manage|title()}} {{lang.words.users2}}" class="logs_link">{{lang.words.login|title()}}</a>
</td>
<td class="second-collumn">{{lang.words.groups|title()}}</td>
<td>{{lang.words.role|title()}}</td>
<td>
<span class="add-button-wi" id="show_all_users" style="display: none;">
<span id="show-all-users">
{{lang.words.show_all}}
</span>
<span id="hide-all-users" style="display: none;">
{{lang.words.hide|title()}}
</span>
</span>
</td>
<td style="padding-right: 10px;">
<a onclick="showUsersOverview()" title="{{lang.words.refresh|title()}}" style="float: right;">
<span class="refresh"></span>
</a>
</td>
</tr>
</thead>
<tbody id="users-table"></tbody>
</table>
{% endif %}
{% if role <= 1 %}
<table class="overview-wi" id="overview-groups">
2019-09-23 11:18:38 +00:00
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">
<a href="users.py#groups" title="Manage groups" class="logs_link">{{lang.words.groups|title()}}</a>
</td>
<td class="second-collumn" style="width: 40%">{{lang.words.desc|title()}}</td>
2019-10-04 16:58:47 +00:00
<td>
{% if groups|length > 3 %}
<span class="add-button-wi">
<span id="show-all-groups">
{{lang.words.show_all}}
</span>
<span id="hide-all-groups" style="display: none;">
{{lang.words.hide|title()}} {{lang.words.groups}}
</span>
2019-10-04 16:58:47 +00:00
</span>
{% endif %}
2019-10-04 16:58:47 +00:00
</td>
2019-09-23 11:18:38 +00:00
</tr>
2019-10-04 16:58:47 +00:00
{% set counter = 0 -%}
2019-09-23 11:18:38 +00:00
{% for group in groups %}
2019-10-04 16:58:47 +00:00
{% set counter = counter + loop.index0 %}
{% if counter <= 2 %}
2019-09-23 11:18:38 +00:00
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
{{ group.name }}
2019-09-23 11:18:38 +00:00
</td>
<td class="third-collumn-wi" colspan="2">{{ group.description }}</td>
2019-10-04 16:58:47 +00:00
</tr>
{% else %}
<tr style="display: none;" class="show-groups {{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
{{ group.name }}
2019-10-04 16:58:47 +00:00
</td>
<td class="third-collumn-wi" colspan="2">{{ group.description }}</td>
2019-09-23 11:18:38 +00:00
</tr>
2019-10-04 16:58:47 +00:00
{% endif %}
2019-09-23 11:18:38 +00:00
{% endfor %}
</table>
<table class="overview-wi" id="overview-roles">
2019-09-23 11:18:38 +00:00
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">{{lang.words.role|title()}}</td>
<td class="second-collumn" style="width: 60%">{{lang.words.desc|title()}}</td>
</tr>
2019-09-23 11:18:38 +00:00
{% for role in roles %}
<tr class="{{ loop.cycle('odd', 'even') }}">
<td class="padding10 first-collumn-wi">
{{ role.name }}
2019-09-23 11:18:38 +00:00
</td>
<td class="third-collumn-wi">{{ lang.roles[role.name] }}</td>
2019-09-23 11:18:38 +00:00
</tr>
{% endfor %}
</table>
{% endif %}
{% if role <= 2 %}
<table class="overview-wi" id="overview-logs">
2019-12-08 10:44:23 +00:00
<tr class="overviewHead">
<td class="padding10 first-collumn-wi">
{% if role == 2 %}
<a href="/app/viewlogs.py?type=2&viewlogs={{roxy_wi_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} Roxy-WI {{lang.words.logs}}" class="logs_link">
{% else %}
<a href="/app/viewlogs.py?viewlogs={{roxy_wi_log_id}}&rows=10&grep=&hour=00&minut=00&hour1=24&minut1=00" title="{{lang.words.view|title()}} Roxy-WI {{lang.words.logs}}" class="logs_link">
{% endif %}
{{lang.words.recent|title()}} Roxy-WI {{lang.words.logs}}
</a>
</td>
2019-12-08 10:44:23 +00:00
<td>
{% if roxy_wi_log|length > 3 %}
2019-12-08 10:44:23 +00:00
<span class="add-button-wi">
<span id="show-all-haproxy-wi-log">
{{lang.words.show_all}}
</span>
<span id="hide-all-haproxy-wi-log" style="display: none;">
{{lang.words.hide|title()}} {{lang.words.logs}}
</span>
2019-12-08 10:44:23 +00:00
</span>
{% endif %}
2019-12-08 10:44:23 +00:00
</td>
</tr>
<tr>
{% set counter = 0 -%}
{% for log in roxy_wi_log %}
2019-12-08 10:44:23 +00:00
{% 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 }}
2019-12-08 10:44:23 +00:00
</td>
</tr>
{% else %}
<tr style="display: none;" class="show-haproxy-wi-log {{ loop.cycle('odd', 'even') }}">
2019-12-08 10:44:23 +00:00
<td class="padding10 first-collumn-wi" style="font-size: 12.5px" colspan="2">
{{ log }}
2019-12-08 10:44:23 +00:00
</td>
</tr>
{% endif %}
{% endfor %}
</tr>
</table>
{% endif %}
{% if role <= 1 %}
<table class="overview-wi" id="overview-subs">
<tr class="overviewHead" style="height: 30px;">
<td class="padding10 first-collumn-wi" colspan="2">
<a href="https://roxy-wi.org/cabinet" title="{{lang.words.personal|title()}} {{lang.words.cabinet}}" class="logs_link" target="_blank">{{lang.words.subs|title()}}</a>
</td>
</tr>
<tbody id="sub-table"></tbody>
</table>
{% endif %}
2018-05-10 17:25:45 +00:00
<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>
showOverview(ip, hostnamea);
</script>
{% include 'include/intro/ovw.html' %}
{% include 'include/intro/js_script.html' %}
{% endblock %}