Add ability for users to disable hints

This commit is contained in:
amcmanu3 2022-04-02 21:25:26 -04:00
parent 4166d99885
commit c7394ab77e
9 changed files with 558 additions and 463 deletions

View File

@ -72,6 +72,7 @@ class Users_Controller:
up_data[key] = user_data[key] up_data[key] = user_data[key]
up_data["last_update"] = helper.get_time_as_string() up_data["last_update"] = helper.get_time_as_string()
up_data["lang"] = user_data["lang"] up_data["lang"] = user_data["lang"]
up_data["hints"] = user_data["hints"]
logger.debug(f"user: {user_data} +role:{added_roles} -role:{removed_roles}") logger.debug(f"user: {user_data} +role:{added_roles} -role:{removed_roles}")
for role in added_roles: for role in added_roles:
users_helper.get_or_create(user_id=user_id, role_id=role) users_helper.get_or_create(user_id=user_id, role_id=role)

View File

@ -49,6 +49,7 @@ class Users(Model):
valid_tokens_from = DateTimeField(default=datetime.datetime.now) valid_tokens_from = DateTimeField(default=datetime.datetime.now)
server_order = CharField(default="") server_order = CharField(default="")
preparing = BooleanField(default=False) preparing = BooleanField(default=False)
hints = BooleanField(default=True)
class Meta: class Meta:
table_name = "users" table_name = "users"

View File

@ -769,6 +769,7 @@ class PanelHandler(BaseHandler):
page_data["user"]["last_ip"] = "N/A" page_data["user"]["last_ip"] = "N/A"
page_data["user"]["last_update"] = "N/A" page_data["user"]["last_update"] = "N/A"
page_data["user"]["roles"] = set() page_data["user"]["roles"] = set()
page_data["user"]["hints"] = True
if Enum_Permissions_Crafty.User_Config not in exec_user_crafty_permissions: if Enum_Permissions_Crafty.User_Config not in exec_user_crafty_permissions:
self.redirect( self.redirect(
@ -1734,6 +1735,11 @@ class PanelHandler(BaseHandler):
password1 = bleach.clean(self.get_argument("password1", None)) password1 = bleach.clean(self.get_argument("password1", None))
email = bleach.clean(self.get_argument("email", "default@example.com")) email = bleach.clean(self.get_argument("email", "default@example.com"))
enabled = int(float(self.get_argument("enabled", "0"))) enabled = int(float(self.get_argument("enabled", "0")))
try:
hints = int(bleach.clean(self.get_argument("hints")))
hints = True
except:
hints = False
lang = bleach.clean( lang = bleach.clean(
self.get_argument("language"), helper.get_setting("language") self.get_argument("language"), helper.get_setting("language")
) )
@ -1765,6 +1771,7 @@ class PanelHandler(BaseHandler):
"password": password0, "password": password0,
"email": email, "email": email,
"lang": lang, "lang": lang,
"hints": hints,
} }
self.controller.users.update_user(user_id, user_data=user_data) self.controller.users.update_user(user_id, user_data=user_data)
@ -1806,6 +1813,7 @@ class PanelHandler(BaseHandler):
"roles": roles, "roles": roles,
"lang": lang, "lang": lang,
"superuser": superuser, "superuser": superuser,
"hints": hints,
} }
user_crafty_data = { user_crafty_data = {
"permissions_mask": permissions_mask, "permissions_mask": permissions_mask,
@ -1901,6 +1909,7 @@ class PanelHandler(BaseHandler):
password1 = bleach.clean(self.get_argument("password1", None)) password1 = bleach.clean(self.get_argument("password1", None))
email = bleach.clean(self.get_argument("email", "default@example.com")) email = bleach.clean(self.get_argument("email", "default@example.com"))
enabled = int(float(self.get_argument("enabled", "0"))) enabled = int(float(self.get_argument("enabled", "0")))
hints = True
lang = bleach.clean( lang = bleach.clean(
self.get_argument("lang", helper.get_setting("language")) self.get_argument("lang", helper.get_setting("language"))
) )
@ -1942,10 +1951,7 @@ class PanelHandler(BaseHandler):
enabled=enabled, enabled=enabled,
superuser=new_superuser, superuser=new_superuser,
) )
user_data = { user_data = {"roles": roles, "lang": lang, "hints": True}
"roles": roles,
"lang": lang,
}
user_crafty_data = { user_crafty_data = {
"permissions_mask": permissions_mask, "permissions_mask": permissions_mask,
"server_quantity": server_quantity, "server_quantity": server_quantity,

View File

@ -24,7 +24,11 @@
<div class="card"> <div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center"> <div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-history"></i> &nbsp;Audit Logs</h4> <h4 class="card-title"><i class="fas fa-history"></i> &nbsp;Audit Logs</h4>
<span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile', data['lang']) }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}", data-placement="top"></span> {% if data['user_data']['hints'] %}
<span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile', data['lang']) }}" ,
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span>
{% end %}
</div> </div>
<div class="card-body"> <div class="card-body">
@ -61,7 +65,8 @@
</div> </div>
<style> <style>
.popover-body { .popover-body {
color: white !important;; color: white !important;
;
} }
</style> </style>

View File

@ -15,7 +15,8 @@
<div class="page-header"> <div class="page-header">
<h4 class="page-title">{{ translate('dashboard', 'dashboard', data['lang']) }} <h4 class="page-title">{{ translate('dashboard', 'dashboard', data['lang']) }}
{% if data['server_stats']['running'] != 0 %} {% if data['server_stats']['running'] != 0 %}
<span id="sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span></h4> <span id="sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span>
</h4>
{% end %} {% end %}
</div> </div>
</div> </div>
@ -74,7 +75,8 @@
<h3 class="mb-0 font-weight-semibold" id="total_players">{{ data['num_players'] }}</h3> <h3 class="mb-0 font-weight-semibold" id="total_players">{{ data['num_players'] }}</h3>
</div> </div>
<div class="wrapper my-auto ml-auto ml-lg-4"> <div class="wrapper my-auto ml-auto ml-lg-4">
<p class="mb-0 text-warning"><span id="max_players">0</span> {{ translate('dashboard', 'max', data['lang']) }}</p> <p class="mb-0 text-warning"><span id="max_players">0</span> {{ translate('dashboard', 'max',
data['lang']) }}</p>
</div> </div>
</div> </div>
</div> </div>
@ -91,10 +93,12 @@
<h4 class="card-title"><i class="fas fa-server"></i> &nbsp;{{ translate('dashboard', 'allServers', <h4 class="card-title"><i class="fas fa-server"></i> &nbsp;{{ translate('dashboard', 'allServers',
data['lang']) }}</h4> data['lang']) }}</h4>
{% if len(data['servers']) > 0 %} {% if len(data['servers']) > 0 %}
{% if data['user_data']['hints'] %}
<span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile', data['lang']) }}" , <span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile', data['lang']) }}" ,
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span> data-placement="top"></span>
{% end %} {% end %}
{% end %}
<div><a class="nav-link" href="/server/step1"><i class="fas fa-plus-circle"></i> &nbsp; {{ <div><a class="nav-link" href="/server/step1"><i class="fas fa-plus-circle"></i> &nbsp; {{
translate('dashboard', 'newServer', data['lang']) }}</a></div> translate('dashboard', 'newServer', data['lang']) }}</a></div>
</div> </div>
@ -136,18 +140,18 @@
<td draggable="false" id="controls{{server['server_data']['server_id']}}" class="actions_serverlist"> <td draggable="false" id="controls{{server['server_data']['server_id']}}" class="actions_serverlist">
{% if server['user_command_permission'] %} {% if server['user_command_permission'] %}
{% if server['stats']['running'] %} {% if server['stats']['running'] %}
<a data-id="{{server['server_data']['server_id']}}" class="stop_button" <a data-id="{{server['server_data']['server_id']}}" class="stop_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'stop' , data['lang']) }}"> title="{{ translate('dashboard', 'stop' , data['lang']) }}">
<i class="fas fa-stop"></i> <i class="fas fa-stop"></i>
</a> &nbsp; </a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="restart_button" <a data-id="{{server['server_data']['server_id']}}" class="restart_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'restart' , data['lang']) }}"> title="{{ translate('dashboard', 'restart' , data['lang']) }}">
<i class="fas fa-sync"></i> <i class="fas fa-sync"></i>
</a> &nbsp; </a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="kill_button" <a data-id="{{server['server_data']['server_id']}}" class="kill_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}"> title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i> <i class="fas fa-skull"></i>
</a> &nbsp; </a> &nbsp;
@ -161,19 +165,20 @@
translate('dashboard', 'delay-explained' , data['lang'])}}">{{ translate('dashboard', 'starting', translate('dashboard', 'delay-explained' , data['lang'])}}">{{ translate('dashboard', 'starting',
data['lang']) }}</i></a> data['lang']) }}</i></a>
{% elif server['stats']['downloading']%} {% elif server['stats']['downloading']%}
<a data-id="{{server['server_data']['server_id']}}" class=""><i class="fa fa-spinner fa-spin"></i> {{ translate('serverTerm', 'downloading', <a data-id="{{server['server_data']['server_id']}}" class=""><i class="fa fa-spinner fa-spin"></i>
{{ translate('serverTerm', 'downloading',
data['lang']) }}</a> data['lang']) }}</a>
{% else %} {% else %}
<a data-id="{{server['server_data']['server_id']}}" class="play_button" <a data-id="{{server['server_data']['server_id']}}" class="play_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'start' , data['lang']) }}"> title="{{ translate('dashboard', 'start' , data['lang']) }}">
<i class="fas fa-play"></i> <i class="fas fa-play"></i>
</a> &nbsp; </a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="clone_button" <a data-id="{{server['server_data']['server_id']}}" class="clone_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'clone' , data['lang']) }}"> title="{{ translate('dashboard', 'clone' , data['lang']) }}">
<i class="fas fa-clone"></i> <i class="fas fa-clone"></i>
</a> &nbsp; </a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="kill_button" <a data-id="{{server['server_data']['server_id']}}" class="kill_button" data-toggle="tooltip"
data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}"> title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i> <i class="fas fa-skull"></i>
</a> &nbsp; </a> &nbsp;
{% end %} {% end %}
@ -228,7 +233,9 @@
data['lang']) }} <br /> data['lang']) }} <br />
{% if server['stats']['desc'] != 'False' %} {% if server['stats']['desc'] != 'False' %}
<div id="desc_id" style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{ server['stats']['desc'] }}</div> <br /> <div id="desc_id"
style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{
server['stats']['desc'] }}</div> <br />
{% end %} {% end %}
{% if server['stats']['version'] != 'False' %} {% if server['stats']['version'] != 'False' %}
@ -242,14 +249,16 @@
<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online', <span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online',
data['lang']) }}</span> data['lang']) }}</span>
{% elif server['stats']['crashed'] %} {% elif server['stats']['crashed'] %}
<span class="text-danger"><i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed', <span class="text-danger"><i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard',
'crashed',
data['lang']) }}</span> data['lang']) }}</span>
{% else %} {% else %}
<span class="text-warning"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', <span class="text-warning"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline',
data['lang']) }}</span> data['lang']) }}</span>
{% end %} {% end %}
</td> </td>
<span class="server-player-totals" id="server_players_{{server['server_data']['server_id']}}" data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"></span> <span class="server-player-totals" id="server_players_{{server['server_data']['server_id']}}"
data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"></span>
</tr> </tr>
{% end %} {% end %}
@ -271,14 +280,18 @@
color: white !important; color: white !important;
; ;
} }
#desc_id { #desc_id {
-ms-overflow-style: none; /* for Internet Explorer, Edge */ -ms-overflow-style: none;
scrollbar-width: none; /* for Firefox */ /* for Internet Explorer, Edge */
scrollbar-width: none;
/* for Firefox */
overflow-y: scroll; overflow-y: scroll;
} }
#desc_id::-webkit-scrollbar { #desc_id::-webkit-scrollbar {
display: none; /* for Chrome, Safari, and Opera */ display: none;
/* for Chrome, Safari, and Opera */
} }
</style> </style>
@ -589,12 +602,16 @@
<link rel="stylesheet" href="/static/assets/css/jquery-ui.structure.css"> <link rel="stylesheet" href="/static/assets/css/jquery-ui.structure.css">
<style> <style>
@media only screen and (max-width: 760px) { @media only screen and (max-width: 760px) {
#mobile { display: none; } #mobile {
display: none;
} }
}
.ui-sortable-handle { .ui-sortable-handle {
cursor: default; cursor: default;
padding: 2px; padding: 2px;
} }
.ui-sortable-handle:hover { .ui-sortable-handle:hover {
cursor: grab !important; cursor: grab !important;
padding: 2px; padding: 2px;

View File

@ -30,11 +30,16 @@
<div class="col-md-12 col-lg-12 grid-margin stretch-card"> <div class="col-md-12 col-lg-12 grid-margin stretch-card">
<div class="card"> <div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center"> <div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-users"></i> {{ translate('panelConfig', 'users', data['lang']) }}</h4> <h4 class="card-title"><i class="fas fa-users"></i> {{ translate('panelConfig', 'users', data['lang'])
<span class="too_small" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}", data-placement="top"></span> }}</h4>
{% if data['user_data']['hints'] %}
<span class="too_small" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}" ,
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span>
{% end %}
<!-- TODO: Translate the following --> <!-- TODO: Translate the following -->
<div><a class="nav-link" href="/panel/add_user"><i class="fas fa-plus-circle"></i> &nbsp; {{ translate('panelConfig', 'newUser', data['lang']) }}</a></div> <div><a class="nav-link" href="/panel/add_user"><i class="fas fa-plus-circle"></i> &nbsp; {{
translate('panelConfig', 'newUser', data['lang']) }}</a></div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
@ -93,9 +98,15 @@
<div class="col-md-12 col-lg-12 grid-margin stretch-card"> <div class="col-md-12 col-lg-12 grid-margin stretch-card">
<div class="card"> <div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center"> <div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-user-tag"></i> {{ translate('panelConfig', 'roles', data['lang']) }}</h4> <h4 class="card-title"><i class="fas fa-user-tag"></i> {{ translate('panelConfig', 'roles',
<span class="too_small2" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}", data-placement="top"></span> data['lang']) }}</h4>
<div><a class="nav-link" href="/panel/add_role"><i class="fas fa-plus-circle"></i> &nbsp; {{ translate('panelConfig', 'newRole', data['lang']) }}</a></div> {% if data['user_data']['hints'] %}
<span class="too_small2" title="{{ translate('dashboard', 'cannotSee', data['lang']) }}" ,
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span>
{% end %}
<div><a class="nav-link" href="/panel/add_role"><i class="fas fa-plus-circle"></i> &nbsp; {{
translate('panelConfig', 'newRole', data['lang']) }}</a></div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
@ -120,7 +131,8 @@
{% end %} {% end %}
</ul> </ul>
</td> </td>
<td><ul> <td>
<ul>
{% for user in data['users'] %} {% for user in data['users'] %}
{% for ruser in data['user-roles'][user.user_id] %} {% for ruser in data['user-roles'][user.user_id] %}
{% if ruser == role.role_name %} {% if ruser == role.role_name %}
@ -146,10 +158,12 @@
<div class="col-md-12 col-lg-12 grid-margin stretch-card"> <div class="col-md-12 col-lg-12 grid-margin stretch-card">
<div class="card"> <div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center"> <div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-user-tag"></i> {{ translate('panelConfig', 'adminControls', data['lang']) }}</h4> <h4 class="card-title"><i class="fas fa-user-tag"></i> {{ translate('panelConfig', 'adminControls',
data['lang']) }}</h4>
</div> </div>
<div class="card-body"> <div class="card-body">
<button type="button" class="btn btn-outline-danger clear-comm">{{ translate('panelConfig', 'clearComms', data['lang']) }}</button> <button type="button" class="btn btn-outline-danger clear-comm">{{ translate('panelConfig',
'clearComms', data['lang']) }}</button>
</div> </div>
</div> </div>
@ -166,7 +180,8 @@
<style> <style>
.popover-body { .popover-body {
color: white !important;; color: white !important;
;
} }
</style> </style>
<!-- content-wrapper ends --> <!-- content-wrapper ends -->

View File

@ -224,6 +224,16 @@
{% end %} {% end %}
</label> </label>
<label for="hints" class="form-check-label ml-4 mb-4">
{% if data['user']['hints'] %}
<input type="checkbox" class="form-check-input" id="hints" name="hints" checked=""
value="1">Enable Hints?
{% else %}
<input type="checkbox" class="form-check-input" id="hints" name="hints" value="1"> Enable
Hints?
{% end %}
</label>
</div> </div>
<button type="submit" class="btn btn-success mr-2"><i class="fas fa-save"></i> {{ <button type="submit" class="btn btn-success mr-2"><i class="fas fa-save"></i> {{

View File

@ -14,7 +14,8 @@
<div class="col-12"> <div class="col-12">
<div class="page-header"> <div class="page-header">
<h4 class="page-title"> <h4 class="page-title">
{{ translate('serverDetails', 'serverDetails', data['lang']) }} - {{ data['server_stats']['server_id']['server_name'] }} {{ translate('serverDetails', 'serverDetails', data['lang']) }} - {{
data['server_stats']['server_id']['server_name'] }}
<br /> <br />
<small>UUID: {{ data['server_stats']['server_id']['server_uuid'] }}</small> <small>UUID: {{ data['server_stats']['server_id']['server_uuid'] }}</small>
</h4> </h4>
@ -38,11 +39,18 @@
<div class="card"> <div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center"> <div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-calendar"></i> Scheduled Tasks</h4> <h4 class="card-title"><i class="fas fa-calendar"></i> Scheduled Tasks</h4>
<span class="too_small" title="{{ translate('serverSchedules', 'cannotSee', data['lang']) }}", data-content="{{ translate('serverSchedules', 'cannotSeeOnMobile', data['lang']) }}", data-placement="bottom"></span> {% if data['user_data']['hints'] %}
<div><button onclick="location.href=`/panel/add_schedule?id={{ data['server_stats']['server_id']['server_id'] }}`" class="btn btn-info">Create New Schedule <i class="fas fa-pencil-alt"></i></button></div> <span class="too_small" title="{{ translate('serverSchedules', 'cannotSee', data['lang']) }}" ,
data-content="{{ translate('serverSchedules', 'cannotSeeOnMobile', data['lang']) }}" ,
data-placement="bottom"></span>
{% end %}
<div><button
onclick="location.href=`/panel/add_schedule?id={{ data['server_stats']['server_id']['server_id'] }}`"
class="btn btn-info">Create New Schedule <i class="fas fa-pencil-alt"></i></button></div>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table table-hover d-none d-lg-block responsive-table" id="schedule_table" width="100%" style="table-layout:fixed;"> <table class="table table-hover d-none d-lg-block responsive-table" id="schedule_table" width="100%"
style="table-layout:fixed;">
<thead> <thead>
<tr class="rounded"> <tr class="rounded">
<th style="width: 2%; min-width: 10px;">ID</th> <th style="width: 2%; min-width: 10px;">ID</th>
@ -92,7 +100,9 @@
{% end %} {% end %}
</td> </td>
<td id="{{schedule.action}}" class="action"> <td id="{{schedule.action}}" class="action">
<button onclick="window.location.href='/panel/edit_schedule?id={{ data['server_stats']['server_id']['server_id'] }}&sch_id={{schedule.schedule_id}}'" class="btn btn-info"> <button
onclick="window.location.href='/panel/edit_schedule?id={{ data['server_stats']['server_id']['server_id'] }}&sch_id={{schedule.schedule_id}}'"
class="btn btn-info">
<i class="fas fa-pencil-alt"></i> <i class="fas fa-pencil-alt"></i>
</button> </button>
<br> <br>
@ -106,7 +116,8 @@
</tbody> </tbody>
</table> </table>
<hr /> <hr />
<table class="table table-hover d-block d-lg-none" id="mini_schedule_table" width="100%" style="table-layout:fixed;"> <table class="table table-hover d-block d-lg-none" id="mini_schedule_table" width="100%"
style="table-layout:fixed;">
<thead> <thead>
<tr class="rounded"> <tr class="rounded">
<th style="width: 25%; min-width: 50px;">Action</th> <th style="width: 25%; min-width: 50px;">Action</th>
@ -136,7 +147,8 @@
</td> </td>
</tr> </tr>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="task_details_{{schedule.schedule_id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="task_details_{{schedule.schedule_id}}" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -148,27 +160,35 @@
<div class="modal-body"> <div class="modal-body">
<ul style="list-style: none;"> <ul style="list-style: none;">
<li id="{{schedule.schedule_id}}" class="id" style="border-top: .1em solid gray;"> <li id="{{schedule.schedule_id}}" class="id" style="border-top: .1em solid gray;">
<h4>ID</h4><p>{{schedule.schedule_id}}</p> <h4>ID</h4>
<p>{{schedule.schedule_id}}</p>
</li> </li>
<li id="{{schedule.action}}" class="action" style="border-top: .1em solid gray;"> <li id="{{schedule.action}}" class="action" style="border-top: .1em solid gray;">
<h4>Action</h4><p>{{schedule.action}}</p> <h4>Action</h4>
<p>{{schedule.action}}</p>
</li> </li>
<li id="{{schedule.command}}" class="action" style="border-top: .1em solid gray;"> <li id="{{schedule.command}}" class="action" style="border-top: .1em solid gray;">
<h4>Command</h4><p>{{schedule.command}}</p> <h4>Command</h4>
<p>{{schedule.command}}</p>
</li> </li>
<li id="{{schedule.interval}}" class="action" style="border-top: .1em solid gray;"> <li id="{{schedule.interval}}" class="action" style="border-top: .1em solid gray;">
{% if schedule.interval != '' %} {% if schedule.interval != '' %}
<h4>Interval</h4> <p>Every {{schedule.interval}} {{schedule.interval_type}}</p> <h4>Interval</h4>
<p>Every {{schedule.interval}} {{schedule.interval_type}}</p>
{% elif schedule.interval_type == 'reaction' %} {% elif schedule.interval_type == 'reaction' %}
<h4>Interval</h4> <p>{{schedule.interval_type}}<br><br>child of ID: {{ schedule.parent }}</p> <h4>Interval</h4>
<p>{{schedule.interval_type}}<br><br>child of ID: {{ schedule.parent }}</p>
{% else %} {% else %}
<h4>Interval</h4> <p>Cron String: {{schedule.cron_string}}</p> <h4>Interval</h4>
<p>Cron String: {{schedule.cron_string}}</p>
{% end %} {% end %}
</li> </li>
<li id="{{schedule.start_time}}" class="action" style="border-top: .1em solid gray;"> <li id="{{schedule.start_time}}" class="action" style="border-top: .1em solid gray;">
<h4>Start Time</h4> <p>{{schedule.start_time}}</p> <h4>Start Time</h4>
<p>{{schedule.start_time}}</p>
</li> </li>
<li id="{{schedule.enabled}}" class="action" style="border-top: .1em solid gray; border-bottom: .1em solid gray"> <li id="{{schedule.enabled}}" class="action"
style="border-top: .1em solid gray; border-bottom: .1em solid gray">
{% if schedule.enabled %} {% if schedule.enabled %}
<h4>Enabled</h4> <span class="text-success"> <h4>Enabled</h4> <span class="text-success">
<i class="fas fa-check-square"></i> Yes <i class="fas fa-check-square"></i> Yes
@ -182,7 +202,9 @@
</ul> </ul>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button onclick="window.location.href='/panel/edit_schedule?id={{ data['server_stats']['server_id']['server_id'] }}&sch_id={{schedule.schedule_id}}'" class="btn btn-info"> <button
onclick="window.location.href='/panel/edit_schedule?id={{ data['server_stats']['server_id']['server_id'] }}&sch_id={{schedule.schedule_id}}'"
class="btn btn-info">
<i class="fas fa-pencil-alt"></i> Edit <i class="fas fa-pencil-alt"></i> Edit
</button> </button>
<button data-sch={{ schedule.schedule_id }} class="btn btn-danger del_button"> <button data-sch={{ schedule.schedule_id }} class="btn btn-danger del_button">
@ -207,7 +229,8 @@
</div> </div>
<style> <style>
.popover-body { .popover-body {
color: white !important;; color: white !important;
;
} }
</style> </style>
@ -215,7 +238,6 @@
</div> </div>
<style> <style>
/* Hide scrollbar for Chrome, Safari and Opera */ /* Hide scrollbar for Chrome, Safari and Opera */
td::-webkit-scrollbar { td::-webkit-scrollbar {
display: none; display: none;
@ -223,8 +245,10 @@ td::-webkit-scrollbar {
/* Hide scrollbar for IE, Edge and Firefox */ /* Hide scrollbar for IE, Edge and Firefox */
td { td {
-ms-overflow-style: none; /* IE and Edge */ -ms-overflow-style: none;
scrollbar-width: none; /* Firefox */ /* IE and Edge */
scrollbar-width: none;
/* Firefox */
} }
</style> </style>
<!-- content-wrapper ends --> <!-- content-wrapper ends -->

View File

@ -0,0 +1,16 @@
# Generated by database migrator
import peewee
def migrate(migrator, database, **kwargs):
migrator.add_columns("users", hints=peewee.BooleanField(default=True))
"""
Write your migrations here.
"""
def rollback(migrator, database, **kwargs):
migrator.drop_columns("users", ["hints"])
"""
Write your rollback migrations here.
"""