File tree Expand file tree Collapse file tree 8 files changed +14
-84
lines changed Expand file tree Collapse file tree 8 files changed +14
-84
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,8 @@ sleepy_status_not_using = "未在使用"
64
64
sleepy_util_metrics = true
65
65
# 是否启用自动切换状态
66
66
sleepy_util_auto_switch_status = true
67
- # 是否启用旧版 Steam 状态 (文字显示, 需要填写 key 和 ids, 不建议使用)
68
- sleepy_util_steam_legacy_enabled = false
69
67
# 是否启用新版 Steam 状态 (iframe 框架显示, 只需要填写 ids)
70
68
sleepy_util_steam_enabled = false
71
- # Steam API 密钥
72
- sleepy_util_steam_key = " "
73
69
# Steam 用户 ID
74
70
sleepy_util_steam_ids = " "
75
71
# Steam 状态刷新间隔 (毫秒)
Original file line number Diff line number Diff line change 64
64
65
65
## (util) 可选功能
66
66
67
- | 环境变量 | 类型 | 默认值 | 说明与提示 |
68
- | ------------------------------------ | ---- | ------ | -------------------------------------------------------------------------------------------------------------------- |
69
- | ` sleepy_util_metrics ` | bool | true | 控制是否启用内置的访问计数功能,并启用 ` /metrics ` 接口 |
70
- | ` sleepy_util_auto_switch_status ` | bool | true | 是否启用自动切换状态 * (当状态为 ` 0 ` (活着) 且所有设备都未在使用时自动切换为 ` 1 ` (似了))* |
71
- | ` sleepy_util_steam_legacy_enabled ` | bool | false | 是否启用旧版 Steam 状态 * (纯文字显示,需同时配置 ` sleepy_util_steam_key ` 和 ` sleepy_util_steam_ids ` )* ** 不建议使用** |
72
- | ` sleepy_util_steam_enabled ` | bool | false | 是否启用新版 Steam 状态 * (iframe 卡片显示,只需配置 ` sleepy_util_steam_ids ` )* ** (推荐使用)** |
73
- | ` sleepy_util_steam_key ` | str | ` ` | Steam Web API 密钥,可在 [ 这里] ( https://steamcommunity.com/dev/apikey ) 申请 |
74
- | ` sleepy_util_steam_ids ` | str | ` ` | 你的 Steam 账号 ID * (应为一串数字)* |
75
- | ` sleepy_util_steam_refresh_interval ` | int | 20000 | 刷新 Steam 状态的频率 (** 毫秒** ,* 建议至少设置为 10000ms,过低可能触发速率限制* ) |
67
+ | 环境变量 | 类型 | 默认值 | 说明与提示 |
68
+ | ------------------------------------ | ---- | ------ | ---------------------------------------------------------------------------------------- |
69
+ | ` sleepy_util_metrics ` | bool | true | 控制是否启用内置的访问计数功能,并启用 ` /metrics ` 接口 |
70
+ | ` sleepy_util_auto_switch_status ` | bool | true | 是否启用自动切换状态 * (当状态为 ` 0 ` (活着) 且所有设备都未在使用时自动切换为 ` 1 ` (似了))* |
71
+ | ` sleepy_util_steam_enabled ` | bool | false | 是否启用新版 Steam 状态 * (iframe 卡片显示,需配置 ` sleepy_util_steam_ids ` )* |
72
+ | ` sleepy_util_steam_ids ` | str | ` ` | 你的 Steam 账号 ID * (应为一串数字)* |
73
+ | ` sleepy_util_steam_refresh_interval ` | int | 20000 | 刷新 Steam 状态的频率 (** 毫秒** ,* 建议至少设置为 10000ms,过低可能触发速率限制* ) |
Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ class _util:
74
74
'''
75
75
metrics : bool = getenv ('sleepy_util_metrics' , True , bool )
76
76
auto_switch_status : bool = getenv ('sleepy_util_auto_switch_status' , True , bool )
77
- steam_legacy_enabled : bool = getenv ('sleepy_util_steam_legacy_enabled' , False , bool )
78
77
steam_enabled : bool = getenv ('sleepy_util_steam_enabled' , False , bool )
79
- steam_key : str = getenv ('sleepy_util_steam_key' , '' , str )
80
78
steam_ids : str = getenv ('sleepy_util_steam_ids' , '' , str )
81
79
steam_refresh_interval : int = getenv ('sleepy_util_steam_refresh_interval' , 20000 , int )
82
80
Original file line number Diff line number Diff line change @@ -241,8 +241,7 @@ def get_status_list():
241
241
- 无需鉴权
242
242
- Method: **GET**
243
243
'''
244
- stlst = status_list
245
- return u .format_dict (stlst ), 200
244
+ return u .format_dict (status_list ), 200
246
245
247
246
248
247
# --- Status API
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ def load(self, filename: str):
34
34
status_list : list = setting ('status_list' ).content
35
35
metrics_list : list = setting ('metrics_list' ).content
36
36
37
+ # status_list 中自动补全 id
38
+ for i in range (len (status_list )):
39
+ status_list [i ]['id' ] = i
40
+
37
41
# metrics_list 中 [static] 处理
38
42
if '[static]' in metrics_list :
39
43
metrics_list .remove ('[static]' )
Original file line number Diff line number Diff line change @@ -31,14 +31,9 @@ <h3><i><b>{{ env.page.user }}'s</b></i> Status:<br><a id="status">{{ status['nam
31
31
< p id ="additional-info "> {{ status['desc'] | safe }}</ p >
32
32
< p id ="device-status "> [设备状态列表]</ p >
33
33
34
- {% if env.util.steam_legacy_enabled %}
35
- <!-- (steam-legacy) 旧版 Steam 状态模块 (文字) -->
36
- {% include "steam-legacy.html" %}
37
- {% endif %}
38
-
39
34
{% if env.util.steam_enabled %}
40
- <!-- (steam-new) 新版 Steam 状态模块 (iframe) -->
41
- {% include "steam-new .html" %}
35
+ <!-- (steam) Steam 状态模块 (iframe) -->
36
+ {% include "steam.html" %}
42
37
{% endif %}
43
38
44
39
< p id ="last-updated "> 最后更新: {{ last_updated }}</ p >
Load Diff This file was deleted.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments