mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 17:55:29 +01:00
Merge branch 'tweak/reaction-schedules' into 'dev'
Make default option be selected option in edit See merge request crafty-controller/crafty-4!462
This commit is contained in:
commit
44abbef9c7
@ -10,6 +10,7 @@ TBD
|
|||||||
- Temp fix for `&` issue in pathing and minecraft colour codes ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/457))
|
- Temp fix for `&` issue in pathing and minecraft colour codes ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/457))
|
||||||
- Cache Gravatar pfp's as to not query every page load ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/459))
|
- Cache Gravatar pfp's as to not query every page load ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/459))
|
||||||
- Fix crash on client list changing while sending websockets ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/461))
|
- Fix crash on client list changing while sending websockets ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/461))
|
||||||
|
- Set default parent option on edit of reaction schedule ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/462))
|
||||||
### Tweaks
|
### Tweaks
|
||||||
- Add button to scroll to bottom of vterm ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/454))
|
- Add button to scroll to bottom of vterm ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/454))
|
||||||
- Persist schedules and execution commands across backup restores ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/458))
|
- Persist schedules and execution commands across backup restores ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/458))
|
||||||
|
@ -977,6 +977,7 @@ class PanelHandler(BaseHandler):
|
|||||||
# We'll just default to basic for new schedules
|
# We'll just default to basic for new schedules
|
||||||
page_data["schedule"]["difficulty"] = "basic"
|
page_data["schedule"]["difficulty"] = "basic"
|
||||||
page_data["schedule"]["interval_type"] = "days"
|
page_data["schedule"]["interval_type"] = "days"
|
||||||
|
page_data["parent"] = None
|
||||||
|
|
||||||
if not EnumPermissionsServer.SCHEDULE in page_data["user_permissions"]:
|
if not EnumPermissionsServer.SCHEDULE in page_data["user_permissions"]:
|
||||||
if not superuser:
|
if not superuser:
|
||||||
@ -1059,8 +1060,12 @@ class PanelHandler(BaseHandler):
|
|||||||
page_data["schedule"]["interval_type"] = schedule.interval_type
|
page_data["schedule"]["interval_type"] = schedule.interval_type
|
||||||
if schedule.interval_type == "reaction":
|
if schedule.interval_type == "reaction":
|
||||||
difficulty = "reaction"
|
difficulty = "reaction"
|
||||||
|
page_data["parent"] = self.controller.management.get_scheduled_task(
|
||||||
|
schedule.parent
|
||||||
|
)
|
||||||
elif schedule.cron_string == "":
|
elif schedule.cron_string == "":
|
||||||
difficulty = "basic"
|
difficulty = "basic"
|
||||||
|
page_data["parent"] = None
|
||||||
else:
|
else:
|
||||||
difficulty = "advanced"
|
difficulty = "advanced"
|
||||||
page_data["schedule"]["difficulty"] = difficulty
|
page_data["schedule"]["difficulty"] = difficulty
|
||||||
|
@ -145,8 +145,12 @@
|
|||||||
data['lang']) }}</small> </label>
|
data['lang']) }}</small> </label>
|
||||||
<select id="parent" name="parent" class="form-control form-control-lg select-css"
|
<select id="parent" name="parent" class="form-control form-control-lg select-css"
|
||||||
value="{{ data['schedule']['action'] }}">
|
value="{{ data['schedule']['action'] }}">
|
||||||
|
{% if data['parent'] %}
|
||||||
|
<option id="{{data['parent']['schedule_id']}}" value="{{data['parent']['schedule_id']}}">
|
||||||
|
{{data['parent']['name']}} | {{data['parent']['command']}} | {{data['parent']['interval']}}
|
||||||
|
</option>
|
||||||
{% for schedule in data['schedules'] %}
|
{% for schedule in data['schedules'] %}
|
||||||
{% if schedule.schedule_id != data['schedule']['schedule_id'] %}
|
{% if schedule.schedule_id != data['schedule']['schedule_id'] and schedule.schedule_id != data['parent']['schedule_id'] %}
|
||||||
{% if schedule.interval != '' %}
|
{% if schedule.interval != '' %}
|
||||||
<option id="{{schedule.schedule_id}}" value="{{schedule.schedule_id}}">
|
<option id="{{schedule.schedule_id}}" value="{{schedule.schedule_id}}">
|
||||||
{{schedule.name}} | {{schedule.command}} | {{schedule.interval}} {{
|
{{schedule.name}} | {{schedule.command}} | {{schedule.interval}} {{
|
||||||
@ -157,6 +161,20 @@
|
|||||||
{% end %}
|
{% end %}
|
||||||
{% end %}
|
{% end %}
|
||||||
{% end %}
|
{% end %}
|
||||||
|
{% else %}
|
||||||
|
{% for schedule in data['schedules'] %}
|
||||||
|
{% if schedule.schedule_id != data['schedule']['schedule_id'] and schedule.schedule_id %}
|
||||||
|
{% if schedule.interval != '' %}
|
||||||
|
<option id="{{schedule.schedule_id}}" value="{{schedule.schedule_id}}">
|
||||||
|
{{schedule.name}} | {{schedule.command}} | {{schedule.interval}} {{
|
||||||
|
schedule.interval_type}}</option>
|
||||||
|
{% else %}
|
||||||
|
<option id="{{schedule.schedule_id}}" value="{{schedule.schedule_id}}">
|
||||||
|
{{schedule.name}} | {{schedule.command}} | {{schedule.cron_string}}</option>
|
||||||
|
{% end %}
|
||||||
|
{% end %}
|
||||||
|
{% end %}
|
||||||
|
{% end %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user