Added beter support for use without Javascript

This commit is contained in:
TimZ99 2019-03-30 22:22:15 +01:00
parent 9915a112e5
commit 59be9f2b6d
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
8 changed files with 70 additions and 13 deletions

View File

@ -35,7 +35,7 @@
<main role="main" class="container"> <main role="main" class="container">
<noscript> <noscript>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<b>Javascript is disabled!</b> For PHP Server Monitor to work properly enabling javascript is required! <b>Javascript is disabled!</b> PHP Server Monitor works best with JavaScript enabled!
</div> </div>
</noscript> </noscript>
{% if not user_level %}<h1>{{ subtitle }}</h1>{% endif %} {% if not user_level %}<h1>{{ subtitle }}</h1>{% endif %}
@ -56,7 +56,7 @@
<div class="container"> <div class="container">
<span class="text-muted"> <span class="text-muted">
Powered by Powered by
<a href="http://www.phpservermonitor.org/" target="_blank" rel="noopener"> <a href="https://github.com/phpservermon/phpservermon/" target="_blank" rel="noopener">
PHP Server Monitor {{ version }}. PHP Server Monitor {{ version }}.
</a> </a>
{{ update_available }} <a href="#" class="float-right">{{ label_back_to_top }}</a> {{ update_available }} <a href="#" class="float-right">{{ label_back_to_top }}</a>

View File

@ -107,8 +107,10 @@
{% endmacro button_save %} {% endmacro button_save %}
{% macro table_search(label) %} {% macro table_search(label) %}
<noscript><div hidden></noscript>
<div class="searchbar mb-3"> <div class="searchbar mb-3">
<input class="search_input" type="search" name="" maxlength="255" placeholder="{{ label }}..." aria-label="{{ label }}"> <input class="search_input" type="search" name="" maxlength="255" placeholder="{{ label }}..." aria-label="{{ label }}">
<a href="#" class="search_icon"><i class="fas fa-search"></i><p>0</p></a> <a href="#" class="search_icon"><i class="fas fa-search"></i><p>0</p></a>
</div> </div>
<noscript></div></noscript>
{% endmacro table_search %} {% endmacro table_search %}

View File

@ -5,8 +5,21 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<noscript>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="{{ url_profile|raw }}">{{ label_profile }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_logout|raw }}">{{ label_logout }}</a>
</li>
<span class="navbar-text">{{ label_usermenu }}</span>
</li>
</ul>
</noscript>
<noscript><div hidden></noscript>
<ul class="navbar-nav"> <ul class="navbar-nav">
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ label_usermenu }} {{ label_usermenu }}
@ -16,9 +29,10 @@
<a class="dropdown-item" href="{{ url_logout|raw }}">{{ label_logout }} </a> <a class="dropdown-item" href="{{ url_logout|raw }}">{{ label_logout }} </a>
</div> </div>
</li> </li>
<!-- <!--
<li class="nav-item"> <li class="nav-item">
<i class="text-white fas fa-universal-access fa-lg nav-link"></i> <i class="text-white fas fa-universal-access fa-lg nav-link"></i>
</li> </li>
--> -->
</ul> </ul>
<noscript></div></noscript>

View File

@ -5,13 +5,15 @@
<canvas id="{{ graph.id }}">Your browser does not support the canvas element.</canvas> <canvas id="{{ graph.id }}">Your browser does not support the canvas element.</canvas>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<noscript><div hidden></noscript>
<div class="btn-group btn-group-toggle" data-toggle="buttons"> <div class="btn-group btn-group-toggle" data-toggle="buttons">
{% for button in graph.buttons %} {% for button in graph.buttons %}
<label class="btn btn-secondary {{ button.class_active }}"> <label class="btn btn-secondary {{ button.class_active }}">
<input type="radio" name="{{ graph.button_name }}" value="{{ button.time }}" id="{{ button.unit }}" autocomplete="off" {% if button.class_active %} checked {% endif %}> {{ button.label }} <input type="radio" name="{{ graph.button_name }}" value="{{ button.time }}" id="{{ button.unit }}" autocomplete="off" {% if button.class_active %} checked {% endif %}> {{ button.label }}
</label> </label>
{% endfor %} {% endfor %}
</div> </div>
<noscript></div></noscript>
</div> </div>
{% if graph.id == 'history_short' %} {% if graph.id == 'history_short' %}
<script> <script>

View File

@ -4,12 +4,16 @@
<div class="card-body d-flex align-items-center justify-content-center"> <div class="card-body d-flex align-items-center justify-content-center">
{% if status|lower == 'on' %} {% if status|lower == 'on' %}
<i class="fas fa-check-circle fa-6x"></i> <i class="fas fa-check-circle fa-6x"></i>
<noscript><h1>&#10003</h1></noscript>
{% elseif status|lower == 'warning' %} {% elseif status|lower == 'warning' %}
<i class="fas fa-exclamation-triangle fa-6x"></i> <i class="fas fa-exclamation-triangle fa-6x"></i>
<noscript><h1>&#9888</h1></noscript>
{% elseif status|lower == 'off' %} {% elseif status|lower == 'off' %}
<i class="fas fa-times-circle fa-6x"></i> <i class="fas fa-times-circle fa-6x"></i>
<noscript><h1>&#10005</h1></noscript>
{% else %} {% else %}
<i class="fas fa-question-circle fa-6x"></i> <i class="fas fa-question-circle fa-6x"></i>
<noscript><h1>&#8263</h1></noscript>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -247,50 +251,65 @@
{{ label_monitoring }}: {{ label_monitoring }}:
{% if active|lower == 'yes' %} {% if active|lower == 'yes' %}
<i class="fas fa-eye float-right"></i> <i class="fas fa-eye float-right"></i>
<noscript>&#10003</noscript>
{% elseif active|lower == 'no' %} {% elseif active|lower == 'no' %}
<i class="fas fa-eye-slash float-right"></i> <i class="fas fa-eye-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %} {% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i> <i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %} {% endif %}
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{{ label_email }}: {{ label_email }}:
{% if email|lower == 'yes' %} {% if email|lower == 'yes' %}
<i class="fas fa-bell float-right"></i> <i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif email|lower == 'no' %} {% elseif email|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i> <i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %} {% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i> <i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %} {% endif %}
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{{ label_sms }}: {{ label_sms }}:
{% if sms|lower == 'yes' %} {% if sms|lower == 'yes' %}
<i class="fas fa-bell float-right"></i> <i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif sms|lower == 'no' %} {% elseif sms|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i> <i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %} {% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i> <i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %} {% endif %}
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{{ label_pushover }}: {{ label_pushover }}:
{% if pushover|lower == 'yes' %} {% if pushover|lower == 'yes' %}
<i class="fas fa-bell float-right"></i> <i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif pushover|lower == 'no' %} {% elseif pushover|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i> <i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %} {% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i> <i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %} {% endif %}
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{{ label_telegram }}: {{ label_telegram }}:
{% if telegram|lower == 'yes' %} {% if telegram|lower == 'yes' %}
<i class="fas fa-bell float-right"></i> <i class="fas fa-bell float-right"></i>
<noscript>&#10003</noscript>
{% elseif telegram|lower == 'no' %} {% elseif telegram|lower == 'no' %}
<i class="fas fa-bell-slash float-right"></i> <i class="fas fa-bell-slash float-right"></i>
<noscript>&#10005</noscript>
{% else %} {% else %}
<i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i> <i class="fas fa-question-circle float-right" title="Value from database should either be yes or no."></i>
<noscript>&#8263</noscript>
{% endif %} {% endif %}
</li> </li>
</ul> </ul>

View File

@ -1,4 +1,5 @@
<div class="row"> <div class="row">
<noscript><div hidden></noscript>
<div class="float-right btn-group btn-group-sm mb-3" role="group"> <div class="float-right btn-group btn-group-sm mb-3" role="group">
<button type="button" class="btn btn-secondary {% if block_layout_active %} active {% endif %}" <button type="button" class="btn btn-secondary {% if block_layout_active %} active {% endif %}"
id="block-layout" aria-label="Block layout" id="block-layout" aria-label="Block layout"
@ -11,4 +12,5 @@
<i class="fas fa-bars"></i> <i class="fas fa-bars"></i>
</button> </button>
</div> </div>
<noscript></div></noscript>
</div> </div>

View File

@ -4,6 +4,7 @@
<div class="row"> <div class="row">
{% for server in servers_offline %} {% for server in servers_offline %}
<div class="col-sm-4 col-md-3"> <div class="col-sm-4 col-md-3">
<noscript><a href="{{ server.url_view|raw }}"></noscript>
<div class="card text-white bg-danger mb-3" onclick="window.location.href='{{ server.url_view|raw }}'"> <div class="card text-white bg-danger mb-3" onclick="window.location.href='{{ server.url_view|raw }}'">
<div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></div> <div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_offline }})</span></div>
<div class="card-body"> <div class="card-body">
@ -13,10 +14,12 @@
</p> </p>
</div> </div>
</div> </div>
<noscript></a></noscript>
</div> </div>
{% endfor %} {% endfor %}
{% for server in servers_online %} {% for server in servers_online %}
<div class="col-sm-4 col-md-3"> <div class="col-sm-4 col-md-3">
<noscript><a href="{{ server.url_view|raw }}"></noscript>
<div class="card text-white bg-success mb-3" onclick="window.location.href='{{ server.url_view|raw }}'"> <div class="card text-white bg-success mb-3" onclick="window.location.href='{{ server.url_view|raw }}'">
<div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></div> <div class="card-header">{{ server.label }}<span class="sr-only"> ({{ label_online }})</span></div>
<div class="card-body"> <div class="card-body">
@ -27,6 +30,7 @@
</p> </p>
</div> </div>
</div> </div>
<noscript></a></noscript>
</div> </div>
{% endfor %} {% endfor %}
{% if not servers_offline and not servers_online %} {% if not servers_offline and not servers_online %}
@ -35,7 +39,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div id="list-layout" class="{{ list_layout_active }}" aria-labelledby="block-layout"> <div id="list-layout" class="{{ list_layout_active }}" aria-labelledby="block-layout" style="display:none;">
<div class="row table-responsive"> <div class="row table-responsive">
{% if servers_offline or servers_online %} {% if servers_offline or servers_online %}
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">

View File

@ -30,7 +30,10 @@
<td>{% for server in user.emp_servers %} {{ server.label }}<br /> {% endfor %}</td> <td>{% for server in user.emp_servers %} {{ server.label }}<br /> {% endfor %}</td>
<td> <td>
<div class="item-action dropdown"> <div class="item-action dropdown">
<a data-toggle="dropdown" class="icon"><i class="fas fa-ellipsis-v"></i></a> <a data-toggle="dropdown" class="icon">
<i class="fas fa-ellipsis-v"></i>
</a>
<noscript><div hidden></noscript>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{{ user.url_edit|raw }}" title="{{ label_edit }}"> <a class="dropdown-item" href="{{ user.url_edit|raw }}" title="{{ label_edit }}">
<i class="fas fa-edit"></i> {{ label_edit }} <i class="fas fa-edit"></i> {{ label_edit }}
@ -40,6 +43,17 @@
<i class="fas fa-trash"></i> {{ label_delete }} <i class="fas fa-trash"></i> {{ label_delete }}
</a> </a>
</div> </div>
<noscript>
</div>
<a href="{{ user.url_edit|raw }}" title="{{ label_edit }}">
&#9998
</a>
<br>
<a href="{{ user.url_delete|raw }}" title="{{ label_delete }}" data-modal-id="delete"
data-modal-param="{{ user.user_name }}">
&#10005
</a>
</noscript>
</div> </div>
</td> </td>
</tr> </tr>