diff --git a/assets/gui/css/alas-mobile.css b/assets/gui/css/alas-mobile.css index 9acad6eb7..eb9412144 100644 --- a/assets/gui/css/alas-mobile.css +++ b/assets/gui/css/alas-mobile.css @@ -35,6 +35,14 @@ grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; } +#pywebio-scope-dashboard { + font-weight: 400; + width: 100%; + display: grid; + grid-auto-flow: row; + grid-template-columns: repeat(auto-fit,minmax(6rem,1fr)); + overflow: hidden; +} #pywebio-scope-_groups { grid-template-columns: 0fr 1fr; @@ -59,4 +67,26 @@ #pywebio-scope-waiting, #pywebio-scope-log { overflow-y: auto; +} + +#output-container .status-point { + margin: 45% 50% 55% 50%; + width: .4rem; + height: .4rem; + border-radius: 50%; +} + +*[style*="--dashboard-limit--"] { + font-size: .8rem; + padding: 0.2rem 0 0 0; +} +*[style*="--dashboard-value--"] { + font-size: 1rem; + margin: 0 0 0 0.4rem !important; +} +*[style*="--dashboard-total--"] { + font-size: 1rem; +} +*[style*="--dashboard-help--"] { + font-size: .6rem; } \ No newline at end of file diff --git a/assets/gui/css/alas.css b/assets/gui/css/alas.css index 94e696480..423550cf2 100644 --- a/assets/gui/css/alas.css +++ b/assets/gui/css/alas.css @@ -117,6 +117,13 @@ footer { margin-bottom: .25rem !important; } +.status-point { + margin: 37% 50% 63% 50%; + width: .75rem; + height: .75rem; + border-radius: 50%; +} + .hr-task-group-box { display: flex; align-items: center; @@ -399,11 +406,31 @@ pre.rich-traceback-code { justify-content: space-between; } +#pywebio-scope-log-bar { + flex-wrap: wrap; +} + #pywebio-scope-log-bar-btns { display: grid; grid-auto-flow: column; } +#pywebio-scope-log-bar .hr-group { + width: 100%; +} + +#pywebio-scope-dashboard { + font-weight: 400; + width: 100%; + display: grid; + grid-auto-flow: row; + grid-template-columns: repeat(auto-fit,minmax(10rem,1fr)); +} + +#pywebio-scope-dashboard .form-control{ + padding: 0 0 0; + } + #pywebio-scope-log { line-height: 1.2; font-size: 0.85rem; @@ -523,4 +550,50 @@ pre.rich-traceback-code { width: 1.5rem; height: 1.5rem; border: .2em solid currentColor; -} \ No newline at end of file +} + +/**[style*="--dashboard-value--"] {*/ +/* font-size: 1.3rem;*/ +/* font-weight: 400;*/ +/* margin: 0 0 -0.2rem 0.6rem !important;*/ +/* overflow-wrap: break-word;*/ +/* overflow: visible;*/ +/* border-bottom: 0;*/ +/*}*/ + +*[style*="--dashboard-value--"] { + font-size: 1.2rem; + font-weight: 400; + margin: 0 0 0 0.6rem !important; + font-family: + "Arial", + serif; +} + +*[style*="--dashboard-total--"] { + font-size: 1.2rem; + font-weight: 400; + margin: 0 0 0 0.15rem !important; + font-family: + "Arial", + serif; +} + +*[style*="--dashboard-help--"] { + font-size: .8rem; + margin: 0 0 0 0.6rem !important; + font-family: + "Arial", + serif; +} + +*[style*="--dashboard-limit--"] { + font-weight: 400; + font-size: .9rem; + margin: 0 0 0 0 !important; + vertical-align: text-bottom; + overflow-wrap: normal; + font-family: + "Arial", + serif; +} diff --git a/assets/gui/css/dark-alas.css b/assets/gui/css/dark-alas.css index c36fa31b0..7d097c06a 100644 --- a/assets/gui/css/dark-alas.css +++ b/assets/gui/css/dark-alas.css @@ -149,7 +149,19 @@ pre.rich-traceback-code { border-bottom: 1px solid #36393f; } +#pywebio-scope-dashboard input { + background-color: #2f3136 !important; +} + *[style*="--arg-help--"], [id^="pywebio-scope-group_"] > p + p { color: #adb5bd; -} \ No newline at end of file +} + +*[style*="--dashboard-help--"]{ + color: #adb5bd; +} + +*[style*="--dashboard-limit--"]{ + color: #adb5bd; +} diff --git a/assets/gui/css/light-alas.css b/assets/gui/css/light-alas.css index b65067f11..0f80aedd4 100644 --- a/assets/gui/css/light-alas.css +++ b/assets/gui/css/light-alas.css @@ -56,6 +56,10 @@ box-shadow: 0 0.06rem 0 #4e4c97; } +#pywebio-scope-dashboard input { + background-color: white !important; +} + input[type="checkbox"] { accent-color: #7a77bb; } @@ -151,4 +155,12 @@ pre.rich-traceback-code { *[style*="--arg-help--"], [id^="pywebio-scope-group_"] > p + p { color: #777777; +} + +*[style*="--dashboard-help--"]{ + color: #777777; +} + +*[style*="--dashboard-limit--"]{ + color: #777777; } \ No newline at end of file diff --git a/config/template.json b/config/template.json index e0f98d747..c8151a292 100644 --- a/config/template.json +++ b/config/template.json @@ -1,4 +1,72 @@ { + "Dashboard": { + "Oil": { + "Value": 0, + "Limit": 0, + "Color": "^000000", + "Record": "2020-01-01 00:00:00" + }, + "Coin": { + "Value": 0, + "Limit": 0, + "Color": "^FFAA33", + "Record": "2020-01-01 00:00:00" + }, + "Gem": { + "Value": 0, + "Color": "^FF3333", + "Record": "2020-01-01 00:00:00" + }, + "Pt": { + "Value": 0, + "Color": "^00BFFF", + "Record": "2020-01-01 00:00:00" + }, + "Cube": { + "Value": 0, + "Color": "^33FFFF", + "Record": "2020-01-01 00:00:00" + }, + "ActionPoint": { + "Value": 0, + "Total": 0, + "Color": "^0000FF", + "Record": "2020-01-01 00:00:00" + }, + "YellowCoin": { + "Value": 0, + "Color": "^FF8800", + "Record": "2020-01-01 00:00:00" + }, + "PurpleCoin": { + "Value": 0, + "Color": "^7700BB", + "Record": "2020-01-01 00:00:00" + }, + "Core": { + "Value": 0, + "Color": "^AAAAAA", + "Record": "2020-01-01 00:00:00" + }, + "Medal": { + "Value": 0, + "Color": "^FFDD00", + "Record": "2020-01-01 00:00:00" + }, + "Merit": { + "Value": 0, + "Color": "^FFFF00", + "Record": "2020-01-01 00:00:00" + }, + "GuildCoin": { + "Value": 0, + "Color": "^AAAAAA", + "Record": "2020-01-01 00:00:00" + }, + "Storage": { + "Storage": {} + } + }, "Alas": { "Emulator": { "Serial": "auto", diff --git a/module/config/argument/args.json b/module/config/argument/args.json index fc9f4a570..86083894e 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1,4 +1,218 @@ { + "Dashboard": { + "Oil": { + "Value": { + "type": "input", + "value": 0 + }, + "Limit": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^000000", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Coin": { + "Value": { + "type": "input", + "value": 0 + }, + "Limit": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FFAA33", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Gem": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FF3333", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Pt": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^00BFFF", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Cube": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^33FFFF", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "ActionPoint": { + "Value": { + "type": "input", + "value": 0 + }, + "Total": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^0000FF", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "YellowCoin": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FF8800", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "PurpleCoin": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^7700BB", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Core": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^AAAAAA", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Medal": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FFDD00", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Merit": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FFFF00", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "GuildCoin": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^AAAAAA", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "Storage": { + "Storage": { + "type": "storage", + "value": {}, + "valuetype": "ignore", + "display": "disabled" + } + } + }, "Alas": { "Emulator": { "Serial": { diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 06c75dfdd..853147323 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -896,4 +896,82 @@ GameRestart: InstanceRestart: Enable: false MaxRetryTimes: 5 - Notify: false \ No newline at end of file + Notify: false + +# ==================== Dashboard ==================== + +Oil: + Value: 0 + Limit: 0 + Color: + value: ^000000 + display: hide + Record: 2020-01-01 00:00:00 +Coin: + Value: 0 + Limit: 0 + Color: + value: ^FFAA33 + display: hide + Record: 2020-01-01 00:00:00 +Gem: + Value: 0 + Color: + value: ^FF3333 + display: hide + Record: 2020-01-01 00:00:00 +Pt: + Value: 0 + Color: + value: ^00BFFF + display: hide + Record: 2020-01-01 00:00:00 +YellowCoin: + Value: 0 + Color: + value: ^FF8800 + display: hide + Record: 2020-01-01 00:00:00 +PurpleCoin: + Value: 0 + Color: + value: ^7700BB + display: hide + Record: 2020-01-01 00:00:00 +ActionPoint: + Value: 0 + Total: 0 + Color: + value: ^0000FF + display: hide + Record: 2020-01-01 00:00:00 +Merit: + Value: 0 + Color: + value: ^FFFF00 + display: hide + Record: 2020-01-01 00:00:00 +Cube: + Value: 0 + Color: + value: ^33FFFF + display: hide + Record: 2020-01-01 00:00:00 +Core: + Value: 0 + Color: + value: ^AAAAAA + display: hide + Record: 2020-01-01 00:00:00 +Medal: + Value: 0 + Color: + value: ^FFDD00 + display: hide + Record: 2020-01-01 00:00:00 +GuildCoin: + Value: 0 + Color: + value: ^AAAAAA + display: hide + Record: 2020-01-01 00:00:00 \ No newline at end of file diff --git a/module/config/argument/dashboard.yaml b/module/config/argument/dashboard.yaml new file mode 100644 index 000000000..93dc59ede --- /dev/null +++ b/module/config/argument/dashboard.yaml @@ -0,0 +1,18 @@ +# -------------------- +# Define argument group of dashboard-only arguments. +# -------------------- + +# ==================== Dashboard ==================== +Dashboard: + - Oil + - Coin + - Gem + - Pt + - Cube + - ActionPoint + - YellowCoin + - PurpleCoin + - Core + - Medal + - Merit + - GuildCoin \ No newline at end of file diff --git a/module/config/argument/gui.yaml b/module/config/argument/gui.yaml index 82302d3ea..d6c36792a 100644 --- a/module/config/argument/gui.yaml +++ b/module/config/argument/gui.yaml @@ -14,6 +14,8 @@ Button: Stop: ScrollON: ScrollOFF: + DashboardON: + DashboardOFF: ClearLog: Setting: CheckUpdate: @@ -46,6 +48,26 @@ MenuDevelop: Overview: Scheduler: + Dashboard: + SecondsAgo: + MinutesAgo: + HoursAgo: + DaysAgo: + MonthsAgo: + YearsAgo: + NoData: + Oil: + Coin: + Gem: + Cube: + Pt: + YellowCoin: + PurpleCoin: + ActionPoint: + Merit: + Medal: + Core: + GuildCoin: Log: Running: Pending: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index d1d8b1c70..ed5a959df 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -555,5 +555,68 @@ class GeneratedConfig: InstanceRestart_MaxRetryTimes = 5 InstanceRestart_Notify = False + # Group `Oil` + Oil_Value = 0 + Oil_Limit = 0 + Oil_Color = '^000000' + Oil_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Coin` + Coin_Value = 0 + Coin_Limit = 0 + Coin_Color = '^FFAA33' + Coin_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Gem` + Gem_Value = 0 + Gem_Color = '^FF3333' + Gem_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Pt` + Pt_Value = 0 + Pt_Color = '^00BFFF' + Pt_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `YellowCoin` + YellowCoin_Value = 0 + YellowCoin_Color = '^FF8800' + YellowCoin_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `PurpleCoin` + PurpleCoin_Value = 0 + PurpleCoin_Color = '^7700BB' + PurpleCoin_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `ActionPoint` + ActionPoint_Value = 0 + ActionPoint_Total = 0 + ActionPoint_Color = '^0000FF' + ActionPoint_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Merit` + Merit_Value = 0 + Merit_Color = '^FFFF00' + Merit_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Cube` + Cube_Value = 0 + Cube_Color = '^33FFFF' + Cube_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Core` + Core_Value = 0 + Core_Color = '^AAAAAA' + Core_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `Medal` + Medal_Value = 0 + Medal_Color = '^FFDD00' + Medal_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `GuildCoin` + GuildCoin_Value = 0 + GuildCoin_Color = '^AAAAAA' + GuildCoin_Record = datetime.datetime(2020, 1, 1, 0, 0) + # Group `Storage` Storage_Storage = {} diff --git a/module/config/config_updater.py b/module/config/config_updater.py index f6db95260..2bd7d3255 100644 --- a/module/config/config_updater.py +++ b/module/config/config_updater.py @@ -829,6 +829,98 @@ EVENTS += ['Event3', 'Event4', 'Event5', 'Event6'] class ConfigGenerator(ConfigGenerator): + @cached_property + def dashboard(self): + """ + + - + """ + return read_file(filepath_argument('dashboard')) + + @cached_property + @timer + def args(self): + """ + Merge definitions into standardised json. + + task.yaml ---+ + argument.yaml ---+-----> args.json + override.yaml ---+ + default.yaml ---+ + + """ + # Construct args + data = {} + # Add dashboard to args + dashboard_and_task = {**self.task, **self.dashboard} + for path, groups in deep_iter(dashboard_and_task, min_depth=1, depth=3): + if 'tasks' not in path and 'Dashboard' not in path: + continue + task = path[2] if 'tasks' in path else path[0] + # Add storage to all task + groups.append('Storage') + for group in groups: + if group not in self.argument: + print(f'`{task}.{group}` is not related to any argument group') + continue + deep_set(data, keys=[task, group], value=deepcopy(self.argument[group])) + + def check_override(path, value): + # Check existence + old = deep_get(data, keys=path, default=None) + if old is None: + print(f'`{".".join(path)}` is not a existing argument') + return False + # Check type + # But allow `Interval` to be different + old_value = old.get('value', None) if isinstance(old, dict) else old + value = old.get('value', None) if isinstance(value, dict) else value + if type(value) != type(old_value) \ + and old_value is not None \ + and path[2] not in ['SuccessInterval', 'FailureInterval']: + print( + f'`{value}` ({type(value)}) and `{".".join(path)}` ({type(old_value)}) are in different types') + return False + # Check option + if isinstance(old, dict) and 'option' in old: + if value not in old['option']: + print(f'`{value}` is not an option of argument `{".".join(path)}`') + return False + return True + + # Set defaults + for p, v in deep_iter(self.default, depth=3): + if not check_override(p, v): + continue + deep_set(data, keys=p + ['value'], value=v) + # Override non-modifiable arguments + for p, v in deep_iter(self.override, depth=3): + if not check_override(p, v): + continue + if isinstance(v, dict): + typ = v.get('type') + if typ == 'state': + pass + elif typ == 'lock': + pass + elif deep_get(v, keys='value') is not None: + deep_default(v, keys='display', value='hide') + for arg_k, arg_v in v.items(): + deep_set(data, keys=p + [arg_k], value=arg_v) + else: + deep_set(data, keys=p + ['value'], value=v) + deep_set(data, keys=p + ['display'], value='hide') + # Set command + for path, groups in deep_iter(self.task, depth=3): + if 'tasks' not in path: + continue + task = path[2] + if deep_get(data, keys=f'{task}.Scheduler.Command'): + deep_set(data, keys=f'{task}.Scheduler.Command.value', value=task) + deep_set(data, keys=f'{task}.Scheduler.Command.display', value='hide') + + return data + def insert_event(self): for server in ARCHIVES_PREFIX.keys(): for event in self.event: diff --git a/module/config/full_config_generated.py b/module/config/full_config_generated.py index d442739af..155ea7fce 100644 --- a/module/config/full_config_generated.py +++ b/module/config/full_config_generated.py @@ -7,6 +7,48 @@ class FullGeneratedConfig: Auto generated full configuration """ + # Task `Dashboard` + Dashboard_Oil_Value = None + Dashboard_Oil_Limit = None + Dashboard_Oil_Color = None + Dashboard_Oil_Record = None + Dashboard_Coin_Value = None + Dashboard_Coin_Limit = None + Dashboard_Coin_Color = None + Dashboard_Coin_Record = None + Dashboard_Gem_Value = None + Dashboard_Gem_Color = None + Dashboard_Gem_Record = None + Dashboard_Pt_Value = None + Dashboard_Pt_Color = None + Dashboard_Pt_Record = None + Dashboard_Cube_Value = None + Dashboard_Cube_Color = None + Dashboard_Cube_Record = None + Dashboard_ActionPoint_Value = None + Dashboard_ActionPoint_Total = None + Dashboard_ActionPoint_Color = None + Dashboard_ActionPoint_Record = None + Dashboard_YellowCoin_Value = None + Dashboard_YellowCoin_Color = None + Dashboard_YellowCoin_Record = None + Dashboard_PurpleCoin_Value = None + Dashboard_PurpleCoin_Color = None + Dashboard_PurpleCoin_Record = None + Dashboard_Core_Value = None + Dashboard_Core_Color = None + Dashboard_Core_Record = None + Dashboard_Medal_Value = None + Dashboard_Medal_Color = None + Dashboard_Medal_Record = None + Dashboard_Merit_Value = None + Dashboard_Merit_Color = None + Dashboard_Merit_Record = None + Dashboard_GuildCoin_Value = None + Dashboard_GuildCoin_Color = None + Dashboard_GuildCoin_Record = None + Dashboard_Storage_Storage = None + # Task `Alas` Alas_Emulator_Serial = None Alas_Emulator_PackageName = None diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 00792c3c6..86c9c2065 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -3154,6 +3154,234 @@ "help": "InstanceRestart.Notify.help" } }, + "Oil": { + "_info": { + "name": "Oil._info.name", + "help": "Oil._info.help" + }, + "Value": { + "name": "Oil.Value.name", + "help": "Oil.Value.help" + }, + "Limit": { + "name": "Oil.Limit.name", + "help": "Oil.Limit.help" + }, + "Color": { + "name": "Oil.Color.name", + "help": "Oil.Color.help" + }, + "Record": { + "name": "Oil.Record.name", + "help": "Oil.Record.help" + } + }, + "Coin": { + "_info": { + "name": "Coin._info.name", + "help": "Coin._info.help" + }, + "Value": { + "name": "Coin.Value.name", + "help": "Coin.Value.help" + }, + "Limit": { + "name": "Coin.Limit.name", + "help": "Coin.Limit.help" + }, + "Color": { + "name": "Coin.Color.name", + "help": "Coin.Color.help" + }, + "Record": { + "name": "Coin.Record.name", + "help": "Coin.Record.help" + } + }, + "Gem": { + "_info": { + "name": "Gem._info.name", + "help": "Gem._info.help" + }, + "Value": { + "name": "Gem.Value.name", + "help": "Gem.Value.help" + }, + "Color": { + "name": "Gem.Color.name", + "help": "Gem.Color.help" + }, + "Record": { + "name": "Gem.Record.name", + "help": "Gem.Record.help" + } + }, + "Pt": { + "_info": { + "name": "Pt._info.name", + "help": "Pt._info.help" + }, + "Value": { + "name": "Pt.Value.name", + "help": "Pt.Value.help" + }, + "Color": { + "name": "Pt.Color.name", + "help": "Pt.Color.help" + }, + "Record": { + "name": "Pt.Record.name", + "help": "Pt.Record.help" + } + }, + "YellowCoin": { + "_info": { + "name": "YellowCoin._info.name", + "help": "YellowCoin._info.help" + }, + "Value": { + "name": "YellowCoin.Value.name", + "help": "YellowCoin.Value.help" + }, + "Color": { + "name": "YellowCoin.Color.name", + "help": "YellowCoin.Color.help" + }, + "Record": { + "name": "YellowCoin.Record.name", + "help": "YellowCoin.Record.help" + } + }, + "PurpleCoin": { + "_info": { + "name": "PurpleCoin._info.name", + "help": "PurpleCoin._info.help" + }, + "Value": { + "name": "PurpleCoin.Value.name", + "help": "PurpleCoin.Value.help" + }, + "Color": { + "name": "PurpleCoin.Color.name", + "help": "PurpleCoin.Color.help" + }, + "Record": { + "name": "PurpleCoin.Record.name", + "help": "PurpleCoin.Record.help" + } + }, + "ActionPoint": { + "_info": { + "name": "ActionPoint._info.name", + "help": "ActionPoint._info.help" + }, + "Value": { + "name": "ActionPoint.Value.name", + "help": "ActionPoint.Value.help" + }, + "Total": { + "name": "ActionPoint.Total.name", + "help": "ActionPoint.Total.help" + }, + "Color": { + "name": "ActionPoint.Color.name", + "help": "ActionPoint.Color.help" + }, + "Record": { + "name": "ActionPoint.Record.name", + "help": "ActionPoint.Record.help" + } + }, + "Merit": { + "_info": { + "name": "Merit._info.name", + "help": "Merit._info.help" + }, + "Value": { + "name": "Merit.Value.name", + "help": "Merit.Value.help" + }, + "Color": { + "name": "Merit.Color.name", + "help": "Merit.Color.help" + }, + "Record": { + "name": "Merit.Record.name", + "help": "Merit.Record.help" + } + }, + "Cube": { + "_info": { + "name": "Cube._info.name", + "help": "Cube._info.help" + }, + "Value": { + "name": "Cube.Value.name", + "help": "Cube.Value.help" + }, + "Color": { + "name": "Cube.Color.name", + "help": "Cube.Color.help" + }, + "Record": { + "name": "Cube.Record.name", + "help": "Cube.Record.help" + } + }, + "Core": { + "_info": { + "name": "Core._info.name", + "help": "Core._info.help" + }, + "Value": { + "name": "Core.Value.name", + "help": "Core.Value.help" + }, + "Color": { + "name": "Core.Color.name", + "help": "Core.Color.help" + }, + "Record": { + "name": "Core.Record.name", + "help": "Core.Record.help" + } + }, + "Medal": { + "_info": { + "name": "Medal._info.name", + "help": "Medal._info.help" + }, + "Value": { + "name": "Medal.Value.name", + "help": "Medal.Value.help" + }, + "Color": { + "name": "Medal.Color.name", + "help": "Medal.Color.help" + }, + "Record": { + "name": "Medal.Record.name", + "help": "Medal.Record.help" + } + }, + "GuildCoin": { + "_info": { + "name": "GuildCoin._info.name", + "help": "GuildCoin._info.help" + }, + "Value": { + "name": "GuildCoin.Value.name", + "help": "GuildCoin.Value.help" + }, + "Color": { + "name": "GuildCoin.Color.name", + "help": "GuildCoin.Color.help" + }, + "Record": { + "name": "GuildCoin.Record.name", + "help": "GuildCoin.Record.help" + } + }, "Storage": { "_info": { "name": "Task status", @@ -3178,6 +3406,8 @@ "Stop": "Stop", "ScrollON": "Auto Scroll ON", "ScrollOFF": "Auto Scroll OFF", + "DashboardON": "Gui.Button.DashboardON", + "DashboardOFF": "Gui.Button.DashboardOFF", "ClearLog": "Clear Log", "Setting": "Setting", "CheckUpdate": "Check update", @@ -3210,6 +3440,26 @@ }, "Overview": { "Scheduler": "Scheduler", + "Dashboard": "Gui.Overview.Dashboard", + "SecondsAgo": "Gui.Overview.SecondsAgo", + "MinutesAgo": "Gui.Overview.MinutesAgo", + "HoursAgo": "Gui.Overview.HoursAgo", + "DaysAgo": "Gui.Overview.DaysAgo", + "MonthsAgo": "Gui.Overview.MonthsAgo", + "YearsAgo": "Gui.Overview.YearsAgo", + "NoData": "Gui.Overview.NoData", + "Oil": "Gui.Overview.Oil", + "Coin": "Gui.Overview.Coin", + "Gem": "Gui.Overview.Gem", + "Cube": "Gui.Overview.Cube", + "Pt": "Gui.Overview.Pt", + "YellowCoin": "Gui.Overview.YellowCoin", + "PurpleCoin": "Gui.Overview.PurpleCoin", + "ActionPoint": "Gui.Overview.ActionPoint", + "Merit": "Gui.Overview.Merit", + "Medal": "Gui.Overview.Medal", + "Core": "Gui.Overview.Core", + "GuildCoin": "Gui.Overview.GuildCoin", "Log": "Log", "Running": "Running", "Pending": "Pending", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index cd616063a..eb00a9553 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -3154,6 +3154,234 @@ "help": "InstanceRestart.Notify.help" } }, + "Oil": { + "_info": { + "name": "Oil._info.name", + "help": "Oil._info.help" + }, + "Value": { + "name": "Oil.Value.name", + "help": "Oil.Value.help" + }, + "Limit": { + "name": "Oil.Limit.name", + "help": "Oil.Limit.help" + }, + "Color": { + "name": "Oil.Color.name", + "help": "Oil.Color.help" + }, + "Record": { + "name": "Oil.Record.name", + "help": "Oil.Record.help" + } + }, + "Coin": { + "_info": { + "name": "Coin._info.name", + "help": "Coin._info.help" + }, + "Value": { + "name": "Coin.Value.name", + "help": "Coin.Value.help" + }, + "Limit": { + "name": "Coin.Limit.name", + "help": "Coin.Limit.help" + }, + "Color": { + "name": "Coin.Color.name", + "help": "Coin.Color.help" + }, + "Record": { + "name": "Coin.Record.name", + "help": "Coin.Record.help" + } + }, + "Gem": { + "_info": { + "name": "Gem._info.name", + "help": "Gem._info.help" + }, + "Value": { + "name": "Gem.Value.name", + "help": "Gem.Value.help" + }, + "Color": { + "name": "Gem.Color.name", + "help": "Gem.Color.help" + }, + "Record": { + "name": "Gem.Record.name", + "help": "Gem.Record.help" + } + }, + "Pt": { + "_info": { + "name": "Pt._info.name", + "help": "Pt._info.help" + }, + "Value": { + "name": "Pt.Value.name", + "help": "Pt.Value.help" + }, + "Color": { + "name": "Pt.Color.name", + "help": "Pt.Color.help" + }, + "Record": { + "name": "Pt.Record.name", + "help": "Pt.Record.help" + } + }, + "YellowCoin": { + "_info": { + "name": "YellowCoin._info.name", + "help": "YellowCoin._info.help" + }, + "Value": { + "name": "YellowCoin.Value.name", + "help": "YellowCoin.Value.help" + }, + "Color": { + "name": "YellowCoin.Color.name", + "help": "YellowCoin.Color.help" + }, + "Record": { + "name": "YellowCoin.Record.name", + "help": "YellowCoin.Record.help" + } + }, + "PurpleCoin": { + "_info": { + "name": "PurpleCoin._info.name", + "help": "PurpleCoin._info.help" + }, + "Value": { + "name": "PurpleCoin.Value.name", + "help": "PurpleCoin.Value.help" + }, + "Color": { + "name": "PurpleCoin.Color.name", + "help": "PurpleCoin.Color.help" + }, + "Record": { + "name": "PurpleCoin.Record.name", + "help": "PurpleCoin.Record.help" + } + }, + "ActionPoint": { + "_info": { + "name": "ActionPoint._info.name", + "help": "ActionPoint._info.help" + }, + "Value": { + "name": "ActionPoint.Value.name", + "help": "ActionPoint.Value.help" + }, + "Total": { + "name": "ActionPoint.Total.name", + "help": "ActionPoint.Total.help" + }, + "Color": { + "name": "ActionPoint.Color.name", + "help": "ActionPoint.Color.help" + }, + "Record": { + "name": "ActionPoint.Record.name", + "help": "ActionPoint.Record.help" + } + }, + "Merit": { + "_info": { + "name": "Merit._info.name", + "help": "Merit._info.help" + }, + "Value": { + "name": "Merit.Value.name", + "help": "Merit.Value.help" + }, + "Color": { + "name": "Merit.Color.name", + "help": "Merit.Color.help" + }, + "Record": { + "name": "Merit.Record.name", + "help": "Merit.Record.help" + } + }, + "Cube": { + "_info": { + "name": "Cube._info.name", + "help": "Cube._info.help" + }, + "Value": { + "name": "Cube.Value.name", + "help": "Cube.Value.help" + }, + "Color": { + "name": "Cube.Color.name", + "help": "Cube.Color.help" + }, + "Record": { + "name": "Cube.Record.name", + "help": "Cube.Record.help" + } + }, + "Core": { + "_info": { + "name": "Core._info.name", + "help": "Core._info.help" + }, + "Value": { + "name": "Core.Value.name", + "help": "Core.Value.help" + }, + "Color": { + "name": "Core.Color.name", + "help": "Core.Color.help" + }, + "Record": { + "name": "Core.Record.name", + "help": "Core.Record.help" + } + }, + "Medal": { + "_info": { + "name": "Medal._info.name", + "help": "Medal._info.help" + }, + "Value": { + "name": "Medal.Value.name", + "help": "Medal.Value.help" + }, + "Color": { + "name": "Medal.Color.name", + "help": "Medal.Color.help" + }, + "Record": { + "name": "Medal.Record.name", + "help": "Medal.Record.help" + } + }, + "GuildCoin": { + "_info": { + "name": "GuildCoin._info.name", + "help": "GuildCoin._info.help" + }, + "Value": { + "name": "GuildCoin.Value.name", + "help": "GuildCoin.Value.help" + }, + "Color": { + "name": "GuildCoin.Color.name", + "help": "GuildCoin.Color.help" + }, + "Record": { + "name": "GuildCoin.Record.name", + "help": "GuildCoin.Record.help" + } + }, "Storage": { "_info": { "name": "Storage._info.name", @@ -3178,6 +3406,8 @@ "Stop": "中止", "ScrollON": "自動スクロール ON", "ScrollOFF": "自動スクロール OFF", + "DashboardON": "Gui.Button.DashboardON", + "DashboardOFF": "Gui.Button.DashboardOFF", "ClearLog": "ログクリーニング", "Setting": "設定", "CheckUpdate": "アップデータチェック", @@ -3210,6 +3440,26 @@ }, "Overview": { "Scheduler": "スケジューラー", + "Dashboard": "Gui.Overview.Dashboard", + "SecondsAgo": "Gui.Overview.SecondsAgo", + "MinutesAgo": "Gui.Overview.MinutesAgo", + "HoursAgo": "Gui.Overview.HoursAgo", + "DaysAgo": "Gui.Overview.DaysAgo", + "MonthsAgo": "Gui.Overview.MonthsAgo", + "YearsAgo": "Gui.Overview.YearsAgo", + "NoData": "Gui.Overview.NoData", + "Oil": "Gui.Overview.Oil", + "Coin": "Gui.Overview.Coin", + "Gem": "Gui.Overview.Gem", + "Cube": "Gui.Overview.Cube", + "Pt": "Gui.Overview.Pt", + "YellowCoin": "Gui.Overview.YellowCoin", + "PurpleCoin": "Gui.Overview.PurpleCoin", + "ActionPoint": "Gui.Overview.ActionPoint", + "Merit": "Gui.Overview.Merit", + "Medal": "Gui.Overview.Medal", + "Core": "Gui.Overview.Core", + "GuildCoin": "Gui.Overview.GuildCoin", "Log": "ログ", "Running": "実行中", "Pending": "隊列中", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 67e6d1f9d..488242b62 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -3154,6 +3154,234 @@ "help": "谨慎开启,小心消息轰炸" } }, + "Oil": { + "_info": { + "name": "Oil._info.name", + "help": "Oil._info.help" + }, + "Value": { + "name": "Oil.Value.name", + "help": "Oil.Value.help" + }, + "Limit": { + "name": "Oil.Limit.name", + "help": "Oil.Limit.help" + }, + "Color": { + "name": "Oil.Color.name", + "help": "Oil.Color.help" + }, + "Record": { + "name": "Oil.Record.name", + "help": "Oil.Record.help" + } + }, + "Coin": { + "_info": { + "name": "Coin._info.name", + "help": "Coin._info.help" + }, + "Value": { + "name": "Coin.Value.name", + "help": "Coin.Value.help" + }, + "Limit": { + "name": "Coin.Limit.name", + "help": "Coin.Limit.help" + }, + "Color": { + "name": "Coin.Color.name", + "help": "Coin.Color.help" + }, + "Record": { + "name": "Coin.Record.name", + "help": "Coin.Record.help" + } + }, + "Gem": { + "_info": { + "name": "Gem._info.name", + "help": "Gem._info.help" + }, + "Value": { + "name": "Gem.Value.name", + "help": "Gem.Value.help" + }, + "Color": { + "name": "Gem.Color.name", + "help": "Gem.Color.help" + }, + "Record": { + "name": "Gem.Record.name", + "help": "Gem.Record.help" + } + }, + "Pt": { + "_info": { + "name": "Pt._info.name", + "help": "Pt._info.help" + }, + "Value": { + "name": "Pt.Value.name", + "help": "Pt.Value.help" + }, + "Color": { + "name": "Pt.Color.name", + "help": "Pt.Color.help" + }, + "Record": { + "name": "Pt.Record.name", + "help": "Pt.Record.help" + } + }, + "YellowCoin": { + "_info": { + "name": "YellowCoin._info.name", + "help": "YellowCoin._info.help" + }, + "Value": { + "name": "YellowCoin.Value.name", + "help": "YellowCoin.Value.help" + }, + "Color": { + "name": "YellowCoin.Color.name", + "help": "YellowCoin.Color.help" + }, + "Record": { + "name": "YellowCoin.Record.name", + "help": "YellowCoin.Record.help" + } + }, + "PurpleCoin": { + "_info": { + "name": "PurpleCoin._info.name", + "help": "PurpleCoin._info.help" + }, + "Value": { + "name": "PurpleCoin.Value.name", + "help": "PurpleCoin.Value.help" + }, + "Color": { + "name": "PurpleCoin.Color.name", + "help": "PurpleCoin.Color.help" + }, + "Record": { + "name": "PurpleCoin.Record.name", + "help": "PurpleCoin.Record.help" + } + }, + "ActionPoint": { + "_info": { + "name": "ActionPoint._info.name", + "help": "ActionPoint._info.help" + }, + "Value": { + "name": "ActionPoint.Value.name", + "help": "ActionPoint.Value.help" + }, + "Total": { + "name": "ActionPoint.Total.name", + "help": "ActionPoint.Total.help" + }, + "Color": { + "name": "ActionPoint.Color.name", + "help": "ActionPoint.Color.help" + }, + "Record": { + "name": "ActionPoint.Record.name", + "help": "ActionPoint.Record.help" + } + }, + "Merit": { + "_info": { + "name": "Merit._info.name", + "help": "Merit._info.help" + }, + "Value": { + "name": "Merit.Value.name", + "help": "Merit.Value.help" + }, + "Color": { + "name": "Merit.Color.name", + "help": "Merit.Color.help" + }, + "Record": { + "name": "Merit.Record.name", + "help": "Merit.Record.help" + } + }, + "Cube": { + "_info": { + "name": "Cube._info.name", + "help": "Cube._info.help" + }, + "Value": { + "name": "Cube.Value.name", + "help": "Cube.Value.help" + }, + "Color": { + "name": "Cube.Color.name", + "help": "Cube.Color.help" + }, + "Record": { + "name": "Cube.Record.name", + "help": "Cube.Record.help" + } + }, + "Core": { + "_info": { + "name": "Core._info.name", + "help": "Core._info.help" + }, + "Value": { + "name": "Core.Value.name", + "help": "Core.Value.help" + }, + "Color": { + "name": "Core.Color.name", + "help": "Core.Color.help" + }, + "Record": { + "name": "Core.Record.name", + "help": "Core.Record.help" + } + }, + "Medal": { + "_info": { + "name": "Medal._info.name", + "help": "Medal._info.help" + }, + "Value": { + "name": "Medal.Value.name", + "help": "Medal.Value.help" + }, + "Color": { + "name": "Medal.Color.name", + "help": "Medal.Color.help" + }, + "Record": { + "name": "Medal.Record.name", + "help": "Medal.Record.help" + } + }, + "GuildCoin": { + "_info": { + "name": "GuildCoin._info.name", + "help": "GuildCoin._info.help" + }, + "Value": { + "name": "GuildCoin.Value.name", + "help": "GuildCoin.Value.help" + }, + "Color": { + "name": "GuildCoin.Color.name", + "help": "GuildCoin.Color.help" + }, + "Record": { + "name": "GuildCoin.Record.name", + "help": "GuildCoin.Record.help" + } + }, "Storage": { "_info": { "name": "任务状态", @@ -3178,6 +3406,8 @@ "Stop": "停止", "ScrollON": "自动滚动 开", "ScrollOFF": "自动滚动 关", + "DashboardON": "折叠", + "DashboardOFF": "展开", "ClearLog": "清空日志", "Setting": "设置", "CheckUpdate": "检查更新", @@ -3210,6 +3440,26 @@ }, "Overview": { "Scheduler": "调度器", + "Dashboard": "仪表盘", + "SecondsAgo": "秒前", + "MinutesAgo": "分钟前", + "HoursAgo": "小时前", + "DaysAgo": "天前", + "MonthsAgo": "月前", + "YearsAgo": "年前", + "NoData": "无数据", + "Oil": "石油", + "Coin": "物资", + "Gem": "钻石", + "Cube": "魔方", + "Pt": "活动PT", + "YellowCoin": "大世界黄币", + "PurpleCoin": "大世界紫币", + "ActionPoint": "行动力", + "Merit": "功勋", + "Medal": "勋章", + "Core": "核心数据", + "GuildCoin": "舰队币", "Log": "日志", "Running": "运行中", "Pending": "队列中", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 2044de16f..65403e11d 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -3154,6 +3154,234 @@ "help": "InstanceRestart.Notify.help" } }, + "Oil": { + "_info": { + "name": "Oil._info.name", + "help": "Oil._info.help" + }, + "Value": { + "name": "Oil.Value.name", + "help": "Oil.Value.help" + }, + "Limit": { + "name": "Oil.Limit.name", + "help": "Oil.Limit.help" + }, + "Color": { + "name": "Oil.Color.name", + "help": "Oil.Color.help" + }, + "Record": { + "name": "Oil.Record.name", + "help": "Oil.Record.help" + } + }, + "Coin": { + "_info": { + "name": "Coin._info.name", + "help": "Coin._info.help" + }, + "Value": { + "name": "Coin.Value.name", + "help": "Coin.Value.help" + }, + "Limit": { + "name": "Coin.Limit.name", + "help": "Coin.Limit.help" + }, + "Color": { + "name": "Coin.Color.name", + "help": "Coin.Color.help" + }, + "Record": { + "name": "Coin.Record.name", + "help": "Coin.Record.help" + } + }, + "Gem": { + "_info": { + "name": "Gem._info.name", + "help": "Gem._info.help" + }, + "Value": { + "name": "Gem.Value.name", + "help": "Gem.Value.help" + }, + "Color": { + "name": "Gem.Color.name", + "help": "Gem.Color.help" + }, + "Record": { + "name": "Gem.Record.name", + "help": "Gem.Record.help" + } + }, + "Pt": { + "_info": { + "name": "Pt._info.name", + "help": "Pt._info.help" + }, + "Value": { + "name": "Pt.Value.name", + "help": "Pt.Value.help" + }, + "Color": { + "name": "Pt.Color.name", + "help": "Pt.Color.help" + }, + "Record": { + "name": "Pt.Record.name", + "help": "Pt.Record.help" + } + }, + "YellowCoin": { + "_info": { + "name": "YellowCoin._info.name", + "help": "YellowCoin._info.help" + }, + "Value": { + "name": "YellowCoin.Value.name", + "help": "YellowCoin.Value.help" + }, + "Color": { + "name": "YellowCoin.Color.name", + "help": "YellowCoin.Color.help" + }, + "Record": { + "name": "YellowCoin.Record.name", + "help": "YellowCoin.Record.help" + } + }, + "PurpleCoin": { + "_info": { + "name": "PurpleCoin._info.name", + "help": "PurpleCoin._info.help" + }, + "Value": { + "name": "PurpleCoin.Value.name", + "help": "PurpleCoin.Value.help" + }, + "Color": { + "name": "PurpleCoin.Color.name", + "help": "PurpleCoin.Color.help" + }, + "Record": { + "name": "PurpleCoin.Record.name", + "help": "PurpleCoin.Record.help" + } + }, + "ActionPoint": { + "_info": { + "name": "ActionPoint._info.name", + "help": "ActionPoint._info.help" + }, + "Value": { + "name": "ActionPoint.Value.name", + "help": "ActionPoint.Value.help" + }, + "Total": { + "name": "ActionPoint.Total.name", + "help": "ActionPoint.Total.help" + }, + "Color": { + "name": "ActionPoint.Color.name", + "help": "ActionPoint.Color.help" + }, + "Record": { + "name": "ActionPoint.Record.name", + "help": "ActionPoint.Record.help" + } + }, + "Merit": { + "_info": { + "name": "Merit._info.name", + "help": "Merit._info.help" + }, + "Value": { + "name": "Merit.Value.name", + "help": "Merit.Value.help" + }, + "Color": { + "name": "Merit.Color.name", + "help": "Merit.Color.help" + }, + "Record": { + "name": "Merit.Record.name", + "help": "Merit.Record.help" + } + }, + "Cube": { + "_info": { + "name": "Cube._info.name", + "help": "Cube._info.help" + }, + "Value": { + "name": "Cube.Value.name", + "help": "Cube.Value.help" + }, + "Color": { + "name": "Cube.Color.name", + "help": "Cube.Color.help" + }, + "Record": { + "name": "Cube.Record.name", + "help": "Cube.Record.help" + } + }, + "Core": { + "_info": { + "name": "Core._info.name", + "help": "Core._info.help" + }, + "Value": { + "name": "Core.Value.name", + "help": "Core.Value.help" + }, + "Color": { + "name": "Core.Color.name", + "help": "Core.Color.help" + }, + "Record": { + "name": "Core.Record.name", + "help": "Core.Record.help" + } + }, + "Medal": { + "_info": { + "name": "Medal._info.name", + "help": "Medal._info.help" + }, + "Value": { + "name": "Medal.Value.name", + "help": "Medal.Value.help" + }, + "Color": { + "name": "Medal.Color.name", + "help": "Medal.Color.help" + }, + "Record": { + "name": "Medal.Record.name", + "help": "Medal.Record.help" + } + }, + "GuildCoin": { + "_info": { + "name": "GuildCoin._info.name", + "help": "GuildCoin._info.help" + }, + "Value": { + "name": "GuildCoin.Value.name", + "help": "GuildCoin.Value.help" + }, + "Color": { + "name": "GuildCoin.Color.name", + "help": "GuildCoin.Color.help" + }, + "Record": { + "name": "GuildCoin.Record.name", + "help": "GuildCoin.Record.help" + } + }, "Storage": { "_info": { "name": "任務狀態", @@ -3178,6 +3406,8 @@ "Stop": "停止", "ScrollON": "自動滾動 開", "ScrollOFF": "自動滾動 關", + "DashboardON": "Gui.Button.DashboardON", + "DashboardOFF": "Gui.Button.DashboardOFF", "ClearLog": "清空日誌", "Setting": "設定", "CheckUpdate": "檢查更新", @@ -3210,6 +3440,26 @@ }, "Overview": { "Scheduler": "調度器", + "Dashboard": "Gui.Overview.Dashboard", + "SecondsAgo": "Gui.Overview.SecondsAgo", + "MinutesAgo": "Gui.Overview.MinutesAgo", + "HoursAgo": "Gui.Overview.HoursAgo", + "DaysAgo": "Gui.Overview.DaysAgo", + "MonthsAgo": "Gui.Overview.MonthsAgo", + "YearsAgo": "Gui.Overview.YearsAgo", + "NoData": "Gui.Overview.NoData", + "Oil": "Gui.Overview.Oil", + "Coin": "Gui.Overview.Coin", + "Gem": "Gui.Overview.Gem", + "Cube": "Gui.Overview.Cube", + "Pt": "Gui.Overview.Pt", + "YellowCoin": "Gui.Overview.YellowCoin", + "PurpleCoin": "Gui.Overview.PurpleCoin", + "ActionPoint": "Gui.Overview.ActionPoint", + "Merit": "Gui.Overview.Merit", + "Medal": "Gui.Overview.Medal", + "Core": "Gui.Overview.Core", + "GuildCoin": "Gui.Overview.GuildCoin", "Log": "日誌", "Running": "執行中", "Pending": "佇列中", diff --git a/module/log_res/log_res.py b/module/log_res/log_res.py new file mode 100644 index 000000000..f4f4bebb1 --- /dev/null +++ b/module/log_res/log_res.py @@ -0,0 +1,82 @@ +from cached_property import cached_property +from module.logger import logger +from module.config.deep import deep_get +from datetime import datetime + + +class LogRes: + """ + set attr---> + Logres(AzurLaneConfig).=resource_value:int + OR ={'Value:int, 'Limit/Total':int}:dict + """ + YellowCoin: int + Oil: list + Coin: list + Gem: int + Pt: int + Cube: int + ActionPoint: list + PurpleCoin: int + Core: int + Medal: int + Merit: int + GuildCoin: int + ResearchPercent: int + AlasCoin: int + + def __init__(self, config): + self.__dict__['config'] = config + + def __setattr__(self, key, value): + if key in self.groups: + _key_group = f'Dashboard.{key}' + _mod = False + original = deep_get(self.config.data, keys=_key_group) + if isinstance(value, int): + if original['Value'] != value: + _key = _key_group + '.Value' + self.config.modified[_key] = value + _time = datetime.now().replace(microsecond=0) + _key_time = _key_group + f'.Record' + self.config.modified[_key_time] = _time + elif isinstance(value, dict): + for value_name, _value in value.items(): + if _value == original[value_name]: + continue + _key = _key_group + f'.{value_name}' + self.config.modified[_key] = _value + _key_time = _key_group + f'.Record' + _time = datetime.now().replace(microsecond=0) + self.config.modified[_key_time] = _time + else: + logger.info('No such resource on dashboard') + super().__setattr__(name=key, value=value) + + @cached_property + def groups(self) -> dict: + from module.config.utils import read_file, filepath_argument + return deep_get(d=read_file(filepath_argument("dashboard")), keys='Dashboard') + + """ + def log_res(self, name, modified: dict, update=True): + if name in self.groups: + key = f'Dashboard.{name}' + original = deep_get(self.config.data, keys=key) + _mod = False + for value_name, value in modified.items(): + if value == original[value_name]: + continue + _key = key + f'.{value_name}' + self.config.modified[_key] = value + _mod = True + if _mod: + _key_time = key + f'.Record' + _time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + self.config.modified[_key_time] = _time + if update: + self.config.update() + else: + logger.warning('No such resource!') + return True + """ diff --git a/module/webui/app.py b/module/webui/app.py index 0f30af394..ff7426e21 100644 --- a/module/webui/app.py +++ b/module/webui/app.py @@ -151,7 +151,7 @@ class AlasGUI(Frame): @use_scope("aside_instance") def set_aside_status(self) -> None: - flag = True + flag = True def update(name, seq): with use_scope(f"alas-instance-{seq}", clear=True): icon_html = Icon.RUN @@ -164,7 +164,7 @@ class AlasGUI(Frame): onclick=self.ui_alas, ) return rendered_state - + if not len(self.rendered_cache) or self.load_home: # Reload when add/delete new instance | first start app.py | go to HomePage (HomePage load call force reload) flag = False @@ -187,7 +187,7 @@ class AlasGUI(Frame): # Redraw lost focus, now focus on aside button aside_name = get_localstorage("aside") self.active_button("aside", aside_name) - + return @use_scope("header_status") @@ -1527,7 +1527,33 @@ def app(): return app +import re from module.instance_watcher import InstanceWatcher +from module.webui.utils import time_delta +from module.log_res.log_res import LogRes + + +def timedelta_to_text(delta=None): + time_delta_name_suffix_dict = { + 'Y': 'YearsAgo', + 'M': 'MonthsAgo', + 'D': 'DaysAgo', + 'h': 'HoursAgo', + 'm': 'MinutesAgo', + 's': 'SecondsAgo', + } + time_delta_name_prefix = 'Gui.Overview.' + time_delta_name_suffix = 'NoData' + time_delta_display = '' + if isinstance(delta, dict): + for _key in delta: + if delta[_key]: + time_delta_name_suffix = time_delta_name_suffix_dict[_key] + time_delta_display = delta[_key] + break + time_delta_display = str(time_delta_display) + time_delta_name = time_delta_name_prefix + time_delta_name_suffix + return time_delta_display + t(time_delta_name) class AlasGUI(AlasGUI): @@ -1597,22 +1623,43 @@ class AlasGUI(AlasGUI): ) log = RichLog("log") + self._log = log + self._log.dashboard_arg_group = LogRes(self.alas_config).groups with use_scope("logs"): - put_scope( - "log-bar", - [ - put_text(t("Gui.Overview.Log")).style( - "font-size: 1.25rem; margin: auto .5rem auto;" - ), - put_scope( - "log-bar-btns", - [ - put_scope("log_scroll_btn"), - ], - ), - ], - ) + if 'Maa' in self.ALAS_ARGS: + put_scope( + "log-bar", + [ + put_text(t("Gui.Overview.Log")).style( + "font-size: 1.25rem; margin: auto .5rem auto;" + ), + put_scope( + "log-bar-btns", + [ + put_scope("log_scroll_btn"), + ], + ), + ], + ), + else: + put_scope( + "log-bar", + [ + put_text(t("Gui.Overview.Log")).style( + "font-size: 1.25rem; margin: auto .5rem auto;" + ), + put_scope( + "log-bar-btns", + [ + put_scope("log_scroll_btn"), + put_scope("dashboard_btn"), + ], + ), + put_html('
'), + put_scope("dashboard"), + ], + ), put_scope("log", [put_html("")]) log.console.width = log.get_width() @@ -1627,12 +1674,133 @@ class AlasGUI(AlasGUI): color_off="off", scope="log_scroll_btn", ) + switch_dashboard = BinarySwitchButton( + label_on=t("Gui.Button.DashboardON"), + label_off=t("Gui.Button.DashboardOFF"), + onclick_on=lambda: self.set_dashboard_display(False), + onclick_off=lambda: self.set_dashboard_display(True), + get_state=lambda: log.display_dashboard, + color_on="off", + color_off="on", + scope="dashboard_btn", + ) self.task_handler.add(switch_scheduler.g(), 1, True) self.task_handler.add(switch_log_scroll.g(), 1, True) + + if 'Maa' not in self.ALAS_ARGS: + self.task_handler.add(switch_dashboard.g(), 1, True) + self.task_handler.add(self.alas_update_overview_task, 10, True) + + if 'Maa' not in self.ALAS_ARGS: + self.task_handler.add(self.alas_update_dashboard, 10, True) + self.task_handler.add(log.put_log(self.alas), 0.25, True) + def set_dashboard_display(self, b): + self._log.set_dashboard_display(b) + self.alas_update_dashboard(True) + + def alas_update_dashboard(self, _clear=False): + if not self.visible: + return + with use_scope("dashboard", clear=_clear): + if not self._log.display_dashboard: + self._update_dashboard(num=4, groups_to_display=['Oil', 'Coin', 'Gem', 'Pt']) + elif self._log.display_dashboard: + self._update_dashboard() + + def _update_dashboard(self, num=None, groups_to_display=None): + x = 0 + _num = 10000 if num is None else num + _arg_group = self._log.dashboard_arg_group if groups_to_display is None else groups_to_display + time_now = datetime.now().replace(microsecond=0) + for group_name in _arg_group: + group = deep_get(d=self.alas_config.data, keys=f'Dashboard.{group_name}') + if group is None: + continue + + value = str(group['Value']) + if 'Limit' in group.keys(): + value_limit = f' / {group["Limit"]}' + value_total = '' + elif 'Total' in group.keys(): + value_total = f' ({group["Total"]})' + value_limit = '' + elif group_name == 'Pt': + value_limit = ' / ' + re.sub(r'[,.\'",。]', '', + str(deep_get(self.alas_config.data, 'EventGeneral.EventGeneral.PtLimit'))) + if value_limit == ' / 0': + value_limit = '' + else: + value_limit = '' + value_total = '' + # value = value + value_limit + value_total + + value_time = group['Record'] + if value_time is None or value_time == datetime(2020, 1, 1, 0, 0, 0): + value_time = datetime(2023, 1, 1, 0, 0, 0) + + # Handle time delta + if value_time == datetime(2023, 1, 1, 0, 0, 0): + value = 'None' + delta = timedelta_to_text() + else: + delta = timedelta_to_text(time_delta(value_time - time_now)) + if group_name not in self._log.last_display_time.keys(): + self._log.last_display_time[group_name] = '' + if self._log.last_display_time[group_name] == delta and not self._log.first_display: + continue + self._log.last_display_time[group_name] = delta + + # if self._log.first_display: + # Handle width + # value_width = len(value) * 0.7 + 0.6 if value != 'None' else 4.5 + # value_width = str(value_width/1.12) + 'rem' if self.is_mobile else str(value_width) + 'rem' + value_limit = '' if value == 'None' else value_limit + # limit_width = len(value_limit) * 0.7 + # limit_width = str(limit_width) + 'rem' + value_total = '' if value == 'None' else value_total + limit_style = '--dashboard-limit--' if value_limit else '--dashboard-total--' + value_limit = value_limit if value_limit else value_total + # Handle dot color + _color = f"""background-color:{deep_get(d=group, keys='Color').replace('^', '#')}""" + color = f'
' + with use_scope(group_name, clear=True): + put_row( + [ + put_html(color), + put_scope( + f"{group_name}_group", + [ + put_column( + [ + put_row( + [ + put_text(value + ).style(f'--dashboard-value--'), + put_text(value_limit + ).style(limit_style), + ], + ).style('grid-template-columns:min-content auto;align-items: baseline;'), + put_text( + t(f'Gui.Overview.{group_name}') + " - " + delta + ).style('---dashboard-help--') + ], + size="auto auto", + ), + ], + ), + ], + size="20px 1fr" + ).style("height: 1fr"), + x += 1 + if x >= _num: + break + if self._log.first_display: + self._log.first_display = False + old_app = app diff --git a/module/webui/utils.py b/module/webui/utils.py index 6426e76fa..9c2068dcb 100644 --- a/module/webui/utils.py +++ b/module/webui/utils.py @@ -545,6 +545,48 @@ def get_alas_config_listen_path(args): yield path +def time_delta(_timedelta): + """ + Output the delta between two times + + Args: + _timedelta : datetime.timedelta + + Returns: + dict : { + 'Y' : int, + 'M' : int, + 'D' : int, + 'h' : int, + 'm' : int, + 's' : int + } + """ + _time_delta = abs(_timedelta.total_seconds()) + d_base = datetime(2010, 1, 1, 0, 0, 0) + d = datetime(2010, 1, 1, 0, 0, 0) - _timedelta + _time_dict = { + 'Y': d.year - d_base.year, + 'M': d.month - d_base.month, + 'D': d.day - d_base.day, + 'h': d.hour - d_base.hour, + 'm': d.minute - d_base.minute, + 's': d.second - d_base.second + } + # _sec ={ + # 'Y': 365*24*60*60, + # 'M': 30*24*60*60, + # 'D': 24*60*60, + # 'h': 60*60, + # 'm': 60, + # 's': 1 + # } + # for _key in _time_dict: + # _time_dict[_key] = int(_time_delta//_sec[_key]) + # _time_delta = _time_delta%_sec[_key] + return _time_dict + + if __name__ == "__main__": def gen(x): diff --git a/module/webui/widgets.py b/module/webui/widgets.py index ad879d9dd..4b354f0ab 100644 --- a/module/webui/widgets.py +++ b/module/webui/widgets.py @@ -209,6 +209,20 @@ class RichLog: pass +class RichLog(RichLog): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.display_dashboard = False + self.first_display = True + self.last_display_time = {} + self.dashboard_arg_group = None + + def set_dashboard_display(self, b: bool) -> None: + # use for lambda callback function. Copied. + self.display_dashboard = b + self.first_display = True + + class BinarySwitchButton(Switch): def __init__( self,