Opt: [ALAS] Turn type lock to type state

This commit is contained in:
LmeSzinc 2023-08-27 23:06:18 +08:00
parent 361c4c2257
commit e4e5d8d558
9 changed files with 51 additions and 14 deletions

View File

@ -124,9 +124,14 @@
"Restart": {
"Scheduler": {
"Enable": {
"type": "checkbox",
"type": "state",
"value": true,
"display": "disabled"
"option": [
true
],
"option_bold": [
true
]
},
"NextRun": {
"type": "datetime",
@ -149,7 +154,11 @@
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
"value": false,
"option": [
true,
false
]
},
"NextRun": {
"type": "datetime",
@ -363,7 +372,11 @@
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
"value": false,
"option": [
true,
false
]
},
"NextRun": {
"type": "datetime",
@ -777,7 +790,11 @@
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
"value": false,
"option": [
true,
false
]
},
"NextRun": {
"type": "datetime",
@ -800,7 +817,11 @@
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
"value": false,
"option": [
true,
false
]
},
"NextRun": {
"type": "datetime",

View File

@ -5,7 +5,10 @@
# ==================== Alas ====================
Scheduler:
Enable: false
Enable:
type: checkbox
value: false
option: [ true, false]
NextRun: 2020-01-01 00:00:00
Command: Alas
ServerUpdate:

View File

@ -15,8 +15,10 @@ Alas:
Restart:
Scheduler:
Enable:
type: state
value: true
display: disabled
option: [ true, ]
option_bold: [ true, ]
ServerUpdate: 04:00
# ==================== Farm ====================

View File

@ -10,7 +10,7 @@ class GeneratedConfig:
"""
# Group `Scheduler`
Scheduler_Enable = False
Scheduler_Enable = False # True, False
Scheduler_NextRun = datetime.datetime(2020, 1, 1, 0, 0)
Scheduler_Command = 'Alas'
Scheduler_ServerUpdate = '04:00'

View File

@ -216,7 +216,10 @@ class ConfigGenerator:
if not check_override(p, v):
continue
if isinstance(v, dict):
if deep_get(v, keys='type') in ['lock']:
typ = v.get('type')
if typ == 'state':
pass
elif typ == 'lock':
deep_default(v, keys='display', value="disabled")
elif deep_get(v, keys='value') is not None:
deep_default(v, keys='display', value='hide')

View File

@ -42,7 +42,9 @@
},
"Enable": {
"name": "Enable Task",
"help": "Join this task to scheduler.\nTask commission, research, reward are force to enable."
"help": "Join this task to scheduler.\nTask commission, research, reward are force to enable.",
"True": "Enabled",
"False": "False"
},
"NextRun": {
"name": "Next Run",

View File

@ -42,7 +42,9 @@
},
"Enable": {
"name": "Scheduler.Enable.name",
"help": "Scheduler.Enable.help"
"help": "Scheduler.Enable.help",
"True": "True",
"False": "False"
},
"NextRun": {
"name": "Scheduler.NextRun.name",

View File

@ -42,7 +42,9 @@
},
"Enable": {
"name": "启用该功能",
"help": "将这个任务加入调度器"
"help": "将这个任务加入调度器",
"True": "已启用",
"False": "False"
},
"NextRun": {
"name": "下一次运行时间",

View File

@ -42,7 +42,9 @@
},
"Enable": {
"name": "啟用該功能",
"help": "將這個任務加入調度器\n委託、科研、收穫任務是強制打開的"
"help": "將這個任務加入調度器\n委託、科研、收穫任務是強制打開的",
"True": "已啟用",
"False": "False"
},
"NextRun": {
"name": "下一次執行時間",