fix(webui): prevent settings crash on missing class.data
This commit is contained in:
@@ -163,6 +163,24 @@
|
|||||||
status_code: 201
|
status_code: 201
|
||||||
when: aw_apply_worktime_settings | default(false) | bool
|
when: aw_apply_worktime_settings | default(false) | bool
|
||||||
|
|
||||||
|
- name: Apply baseline worktime period (startOfDay)
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://127.0.0.1:{{ aw_server_port }}/api/0/settings/startOfDay"
|
||||||
|
method: POST
|
||||||
|
body: "{{ aw_worktime_start_of_day }}"
|
||||||
|
body_format: json
|
||||||
|
status_code: 200
|
||||||
|
when: aw_apply_worktime_settings | default(false) | bool
|
||||||
|
|
||||||
|
- name: Apply baseline worktime period (durationDefault seconds)
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://127.0.0.1:{{ aw_server_port }}/api/0/settings/durationDefault"
|
||||||
|
method: POST
|
||||||
|
body: "{{ aw_worktime_duration_default }}"
|
||||||
|
body_format: json
|
||||||
|
status_code: 200
|
||||||
|
when: aw_apply_worktime_settings | default(false) | bool
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: Reload systemd
|
- name: Reload systemd
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
|
|||||||
@@ -13,3 +13,9 @@ aw_repo_root: "/home/igor/tmp/AWatch-rus"
|
|||||||
# Optional: apply a baseline worktime-focused categorization and views via AW settings API.
|
# Optional: apply a baseline worktime-focused categorization and views via AW settings API.
|
||||||
# WARNING: this overwrites existing server-side settings/classes/views.
|
# WARNING: this overwrites existing server-side settings/classes/views.
|
||||||
aw_apply_worktime_settings: false
|
aw_apply_worktime_settings: false
|
||||||
|
|
||||||
|
# Optional defaults for the worktime period in Web UI.
|
||||||
|
# startOfDay controls day-boundary and default report window start.
|
||||||
|
# durationDefault controls default time range (seconds) shown in UI.
|
||||||
|
aw_worktime_start_of_day: "08:00"
|
||||||
|
aw_worktime_duration_default: 32400
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"name": ["Работа"],
|
"name": ["Работа"],
|
||||||
"rule": { "type": "none" }
|
"rule": { "type": "none" },
|
||||||
|
"data": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -47,7 +48,8 @@
|
|||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
"name": ["Интернет"],
|
"name": ["Интернет"],
|
||||||
"rule": { "type": "none" }
|
"rule": { "type": "none" },
|
||||||
|
"data": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
@@ -62,7 +64,8 @@
|
|||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"name": ["Система"],
|
"name": ["Система"],
|
||||||
"rule": { "type": "none" }
|
"rule": { "type": "none" },
|
||||||
|
"data": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
@@ -81,6 +84,7 @@
|
|||||||
"type": "regex",
|
"type": "regex",
|
||||||
"regex": "ActivityWatch|\\baw-(watcher|qt)\\.exe\\b",
|
"regex": "ActivityWatch|\\baw-(watcher|qt)\\.exe\\b",
|
||||||
"ignore_case": true
|
"ignore_case": true
|
||||||
}
|
},
|
||||||
|
"data": {}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user