diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 924862fe..3e9d598b 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -18,6 +18,7 @@ from app.classes.web.base_handler import BaseHandler from app.classes.models.servers import Servers from app.classes.models.server_permissions import Enum_Permissions_Server from app.classes.models.crafty_permissions import Enum_Permissions_Crafty +from app.classes.models.management import management_helper from app.classes.shared.helpers import helper @@ -185,7 +186,7 @@ class PanelHandler(BaseHandler): self.redirect("/panel/error?error=Invalid Server ID") return False - valid_subpages = ['term', 'logs', 'backup', 'config', 'files', 'admin_controls'] + valid_subpages = ['term', 'logs', 'backup', 'config', 'files', 'admin_controls', 'tasks'] if subpage not in valid_subpages: logger.debug('not a valid subpage') @@ -232,7 +233,8 @@ class PanelHandler(BaseHandler): if not exec_user['superuser']: self.redirect("/panel/error?error=Unauthorized access To Scheduled Tasks") return - page_data[''] + for schedule in management_helper.get_schedules_by_server(server_id): + page_data['schedules'] = management_helper.get_schedules_by_server(server_id) if subpage == 'config': if not page_data['permissions']['Config'] in page_data['user_permissions']: diff --git a/app/frontend/templates/panel/server_tasks.html b/app/frontend/templates/panel/server_tasks.html index f09bb1ed..7fc2af98 100644 --- a/app/frontend/templates/panel/server_tasks.html +++ b/app/frontend/templates/panel/server_tasks.html @@ -4,7 +4,7 @@ {% end %} -{% block title %}Crafty Controller - Schedule{% end %} +{% block title %}Crafty Controller - {{ translate('serverDetails', 'serverDetails', data['lang']) }}{% end %} {% block content %} @@ -14,221 +14,128 @@
+ {% include "parts/details_stats.html %} +
- + {% include "parts/server_controls_list.html %}
-
- {% if data['new_user'] %} -
- {% else %} - - {% end %} +
+ {% raw xsrf_form_html() %} - + - -
-
-

User Settings

-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
+
+
+
-
-
-

Roles - the roles this user is a member of

-
-
-
-
- - - - - - - - - {% for role in data['roles_all'] %} - - - - - {% end %} - -
Role NameMember?
{{ role.role_name }} - {% if role.role_id in data['user']['roles'] %} - - {% else %} - - {% end %} - -
-
-
-
+
+ + +
+
+
- - -
-
-

Crafty Permissions - permissions this user has on Crafty Controller

-
-
-
-
- - - - - - - - - - {% for permission in data['permissions_all'] %} - - - - - - {% end %} - -
Permission NameAuthorized ?Number of Uses Allowed (-1=No Limit)
{{ permission.name }} - {% if permission in data['permissions_list'] %} - - {% else %} - - {% end %} -
-
-
-
+
+ +
+
- - -
+
+
- - + +
-
+
-

User Config Area

-

Here is where you can change the configuration of your user

-
-

- Created: {{ str(data['user']['created']) }} -
- Last login: {{ str(data['user']['last_login']) }} -
- Last update: {{ str(data['user']['last_update']) }} -
- Last IP: {{ data['user']['last_ip'] }} -
- API Key: {{ data['user']['api_token'] }} -
-

-
+

Scheduled Tasks

+ + + + + + + + + {% for schedule in data['schedules'] %} + + + + + + {% end %} + + {% end %} +
ActionIntervalStart TimeEnabledEdit
+

{{schedule.action}}

+
+

Every

+

{{schedule.interval}} {{schedule.interval_type}}

+
+

{{schedule.start_time}}

+
+ {% if schedule.enabled %} + + Yes + + {% else %} + + No + + + + +
-
- {% if data['new_user'] %} - Delete User
- You cannot delete something that does not yet exist - {% elif data['user']['superuser'] %} - Delete User
- You cannot delete a superuser - {% else %} - Delete User - {% end %} - -
@@ -259,6 +166,13 @@ }); + function yesnoCheck(that) { + if (that.value == "command") { + document.getElementById("ifYes").style.display = "block"; + } else { + document.getElementById("ifYes").style.display = "none"; + } + }