Release 0.9.0
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
|
||||
{# set this to 'false' for debug purposes, to see the offline state, set it to 'server_is_online' or remove the line
|
||||
for regular use #}
|
||||
{%- set server_is_online = server_is_online -%}
|
||||
{%- set online_status_string = "online" if server_is_online else "offline" -%}
|
||||
|
||||
<div class="{%- if server_is_online == true -%}active{%- else -%}inactive{%- endif -%}">
|
||||
<span>The server is <strong>{{ online_status_string }}</strong>
|
||||
{% if shutdown_in_seconds == none -%}
|
||||
{{ construct_toggle_link(
|
||||
server_is_online,
|
||||
"shutdown", ['widget_event', ['game_environment', ['schedule_shutdown', {
|
||||
"action": "schedule_shutdown",
|
||||
"shutdown_in_seconds": '900'
|
||||
}]]]
|
||||
)}}
|
||||
{%- else -%}
|
||||
{{ construct_toggle_link(
|
||||
server_is_online,
|
||||
"cancel", ['widget_event', ['game_environment', ['cancel_shutdown', {
|
||||
"action": "cancel_shutdown"
|
||||
}]]]
|
||||
)}}
|
||||
{{ shutdown_in_seconds }} seconds to
|
||||
{{ construct_toggle_link(
|
||||
server_is_online,
|
||||
"shutdown", ['widget_event', ['game_environment', ['force_shutdown', {
|
||||
"action": "force_shutdown"
|
||||
}]]]
|
||||
)}}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
|
||||
{% set current_day = last_recorded_gametime["day"] %}
|
||||
{% set current_hour = last_recorded_gametime["hour"] %}
|
||||
{% set current_minute = last_recorded_gametime["minute"] %}
|
||||
{%
|
||||
set current_weekday =
|
||||
"BloodDay"
|
||||
if last_recorded_gametime["is_bloodday"] == true else
|
||||
last_recorded_gametime["weekday"]
|
||||
%}
|
||||
{% set bloodmoon_modifier = "is_bloodmoon" if last_recorded_gametime["is_bloodmoon"] == true else "regular_gametime" %}
|
||||
{% set bloodday_modifier = "is_bloodday" if last_recorded_gametime["is_bloodday"] == true else "regular_day" %}
|
||||
<div class="{{ bloodmoon_modifier }} {{ bloodday_modifier }}">
|
||||
<span>
|
||||
Day <span class="day">{{ current_day }}/{{ next_bloodmoon_date }}</span>,
|
||||
<span class="time">{{ current_hour }}:{{ current_minute }}</span>
|
||||
({{ current_weekday }})
|
||||
</span>
|
||||
</div>
|
||||
20
bot/modules/game_environment/templates/jinja2_macros.html
Normal file
20
bot/modules/game_environment/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 @@
|
||||
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
|
||||
<div>
|
||||
{{ construct_toggle_link(
|
||||
options_view_toggle,
|
||||
"options", ['widget_event', ['game_environment', ['toggle_entities_widget_view', {'steamid': steamid, "action": "show_options"}]]],
|
||||
"back", ['widget_event', ['game_environment', ['toggle_entities_widget_view', {'steamid': steamid, "action": "show_frontend"}]]]
|
||||
)}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<div id="entity_table_widget_options_toggle" class="pull_out right">
|
||||
{{ control_switch_options_view }}
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<div>
|
||||
{{ action_delete_button }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,10 @@
|
||||
<tr>
|
||||
<th>*</th>
|
||||
<th onclick="window.sorting(this, entity_table, 1)">actions</th>
|
||||
<th onclick="window.sorting(this, entity_table, 2)">name</th>
|
||||
<th onclick="window.sorting(this, entity_table, 3)">type</th>
|
||||
<th onclick="window.sorting(this, entity_table, 4)">pos</th>
|
||||
<th onclick="window.sorting(this, entity_table, 5)">id</th>
|
||||
<th onclick="window.sorting(this, entity_table, 6)">health</th>
|
||||
<th onclick="window.sorting(this, entity_table, 7)" class="right">gametime</th>
|
||||
</tr>
|
||||
@@ -0,0 +1,25 @@
|
||||
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
|
||||
<tr id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}"{%- if css_class %} class="{{ css_class }}"{%- endif -%}>
|
||||
<td>
|
||||
<span id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_control_select_link" class="select_button">{{ control_select_link }}</span>
|
||||
</td>
|
||||
<td class="nobr" id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_actions"> </td>
|
||||
<td id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_name" onclick="$(this).selectText();">{{ entity.name }}</td>
|
||||
<td id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_type" onclick="$(this).selectText();">{{ entity.type }}</td>
|
||||
<td class="position right" onclick="$(this).selectText();">
|
||||
<span id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_pos_x">
|
||||
{{ ((entity | default({})).pos | default({}) ).x | default('0') }}
|
||||
</span>
|
||||
<span id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_pos_y">
|
||||
{{ ((entity | default({})).pos | default({}) ).y | default('0') }}
|
||||
</span>
|
||||
<span id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_pos_z">
|
||||
{{ ((entity | default({})).pos | default({}) ).z | default('0') }}
|
||||
</span>
|
||||
</td>
|
||||
<td id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_id" onclick="$(this).selectText();">{{ entity.id }}</td>
|
||||
<td class="center" id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_health">{{ entity.health }}</td>
|
||||
<td class="nobr right" id="entity_table_row_{{ entity.dataset }}_{{ entity.id }}_last_seen_gametime">
|
||||
{{ entity.last_seen_gametime }}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,29 @@
|
||||
<header>
|
||||
<div>
|
||||
<span>Entities</span>
|
||||
</div>
|
||||
</header>
|
||||
<aside>
|
||||
{{ options_toggle }}
|
||||
</aside>
|
||||
<main>
|
||||
<table class="data_table">
|
||||
<caption>
|
||||
<span>obey</span>
|
||||
</caption>
|
||||
<thead>
|
||||
{{ table_header }}
|
||||
</thead>
|
||||
<tbody id="entity_table">
|
||||
{{ table_rows }}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{{ table_footer }}
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="dialog">
|
||||
<div id="manage_entities_widget_modal" class="modal-content">
|
||||
<p>this is the text inside the modal</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -0,0 +1,27 @@
|
||||
<header>
|
||||
<div>
|
||||
<span>Entities</span>
|
||||
</div>
|
||||
</header>
|
||||
<aside>
|
||||
{{ options_toggle }}
|
||||
</aside>
|
||||
<main>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Entity Module 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