Release 0.9.0
This commit is contained in:
1
bot/modules/webserver/templates/frontpage/footer.html
Normal file
1
bot/modules/webserver/templates/frontpage/footer.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>© this page was created in 2019 by <a href="http://chrani.net/">ecv</a> for the <a href="https://notjustfor.me/chrani-bot">chrani-bot</a> webinterface</p>
|
||||
14
bot/modules/webserver/templates/frontpage/header.html
Normal file
14
bot/modules/webserver/templates/frontpage/header.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<div id="header_widgets">
|
||||
<div id="login_logout_widget" class="widget">
|
||||
<div>
|
||||
{% if current_user.is_authenticated %}
|
||||
<a href="/logout" title="{{ current_user.id }}">log out</a>
|
||||
{%- else %}
|
||||
<a href="/login">log in</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hgroup>
|
||||
<h1>{{ title }}</h1>
|
||||
</hgroup>
|
||||
36
bot/modules/webserver/templates/frontpage/index.html
Normal file
36
bot/modules/webserver/templates/frontpage/index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{%- set not_configured_message = "You should not see this on a configured bot" -%}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<link rel="stylesheet" type="text/css" href="/static/reset.css" />
|
||||
<link rel="shortcut icon" href="/static/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="/static/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/lcars/000-style.css" />
|
||||
<title>{{ title }}</title>
|
||||
<script src="/static/jquery-3.4.1.min.js"></script>
|
||||
{% if current_user.is_authenticated == True %}
|
||||
<script src="https://cdn.socket.io/4.5.4/socket.io.min.js"></script>
|
||||
<script src="/static/system.js"></script>
|
||||
{% endif %}
|
||||
{%- if head -%}{{ head }}{%- endif -%}
|
||||
</head>
|
||||
<body{%- if instance_token %} data-instance-identifier="{{ instance_token }}"{% endif %}>
|
||||
<header>
|
||||
<div>
|
||||
{{ header }}
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div>
|
||||
{{ main }}
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<div>
|
||||
{{ footer }}
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
20
bot/modules/webserver/templates/jinja2_macros.html
Normal file
20
bot/modules/webserver/templates/jinja2_macros.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{%- macro construct_toggle_link(bool, active_text, deactivate_event, inactive_text, activate_event) -%}
|
||||
{%- set bool = bool|default(false) -%}
|
||||
{%- set active_text = active_text|default(none) -%}
|
||||
{%- set deactivate_event = deactivate_event|default(none) -%}
|
||||
{%- set inactive_text = inactive_text|default(none) -%}
|
||||
{%- set activate_event = activate_event|default(none) -%}
|
||||
{%- if bool == true -%}
|
||||
{%- if deactivate_event != none and activate_event != none -%}
|
||||
<span class="active"><a href="#" onclick="window.socket.emit('{{ deactivate_event[0] }}', {{ deactivate_event[1] }}); return false;">{{ active_text }}</a></span>
|
||||
{%- elif deactivate_event != none and activate_event == none -%}
|
||||
<span class="active"><a href="#" onclick="window.socket.emit('{{ deactivate_event[0] }}', {{ deactivate_event[1] }}); return false;">{{ active_text }}</a></span>
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- if deactivate_event != none and activate_event != none -%}
|
||||
<span class="inactive"><a href="#" onclick="window.socket.emit('{{ activate_event[0] }}', {{ activate_event[1] }}); return false;">{{ inactive_text }}</a></span>
|
||||
{%- elif deactivate_event != none and activate_event == none -%}
|
||||
<span class="inactive"><a href="#" onclick="window.socket.emit('{{ deactivate_event[0] }}', {{ deactivate_event[1] }}); return false;">{{ active_text }}</a></span>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
@@ -0,0 +1,9 @@
|
||||
{%- set logged_in_users_count = webserver_logged_in_users|length -%}
|
||||
<tr id="server_status_widget_logged_in_users">
|
||||
<td>
|
||||
<strong>{{ logged_in_users_count }}</strong>{%- if logged_in_users_count == 1 %} user is {%- else %} users are {%- endif %} currently using the webinterface!<br />
|
||||
{%- if webserver_logged_in_users -%}
|
||||
({{ webserver_logged_in_users|join(', ') }})
|
||||
{%- endif -%}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div id="server_status_widget_servertime">
|
||||
<span class="info">
|
||||
<div>{{ time }}</div>
|
||||
</span>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
|
||||
<div>
|
||||
{{ construct_toggle_link(
|
||||
options_view_toggle,
|
||||
"options", ['widget_event', ['webserver', ['toggle_webserver_status_widget_view', {'steamid': steamid, "action": "show_options"}]]],
|
||||
"back", ['widget_event', ['webserver', ['toggle_webserver_status_widget_view', {'steamid': steamid, "action": "show_frontend"}]]]
|
||||
)}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<div id="webserver_status_widget_options_toggle" class="pull_out right">
|
||||
{{ control_switch_options_view }}
|
||||
{{ control_servertime }}
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<header>
|
||||
<div>
|
||||
<span>Webinterface</span>
|
||||
</div>
|
||||
</header>
|
||||
<aside>
|
||||
{{ options_toggle }}
|
||||
</aside>
|
||||
<main>
|
||||
<table>
|
||||
<caption>
|
||||
<span>consume</span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Webserver Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ component_logged_in_users }}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="dialog">
|
||||
<div class="modal-content">
|
||||
<p>this is the text inside the modal</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -0,0 +1,27 @@
|
||||
<header>
|
||||
<div>
|
||||
<span>Webinterface</span>
|
||||
</div>
|
||||
</header>
|
||||
<aside>
|
||||
{{ options_toggle }}
|
||||
</aside>
|
||||
<main>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">webserver widget options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2"><span>widget-options</span></th>
|
||||
</tr>
|
||||
{% for key, value in widget_options.items() %}
|
||||
<tr>
|
||||
<td><span>{{key}}</span></td><td>{{value}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
Reference in New Issue
Block a user