-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenCodeUsageSettings.qml
More file actions
95 lines (83 loc) · 2.97 KB
/
Copy pathOpenCodeUsageSettings.qml
File metadata and controls
95 lines (83 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import QtQuick
import Quickshell
import qs.Common
import qs.Widgets
import qs.Modules.Plugins
PluginSettings {
id: root
pluginId: "opencodeGoUsage"
Column {
width: parent.width
spacing: Theme.spacingL
StyledText {
width: parent.width
text: "OpenCode Go Usage"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Bold
color: Theme.surfaceText
}
StyledText {
width: parent.width
text: "通过抓取 opencode.ai 仪表盘获取 Go 套餐用量数据(滚动窗口5小时/本周/本月)。"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
StyledText {
width: parent.width
text: "需要先登录 https://opencode.ai ,从浏览器开发者工具中获取 Workspace ID 和 Cookie。\n\nWorkspace ID 格式: wrk_xxxxx\nauth Cookie 值: 从 Cookie 中提取 auth 字段的值(以 Fe26.2** 开头)"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
lineHeight: 1.5
}
StyledRect {
width: parent.width
height: columnAuth.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainerHigh
Column {
id: columnAuth
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
StringSetting {
settingKey: "workspaceId"
label: "Workspace ID"
description: "从 opencode.ai 仪表盘 URL 获取,格式: wrk_xxxxx"
placeholder: "wrk_xxxxx"
defaultValue: ""
}
StringSetting {
settingKey: "authCookie"
label: "Auth Cookie"
description: "浏览器 Cookie 中 auth 字段的值"
placeholder: "Fe26.2**..."
defaultValue: ""
}
}
}
StyledRect {
width: parent.width
height: columnDisplay.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainerHigh
Column {
id: columnDisplay
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
SliderSetting {
settingKey: "refreshInterval"
label: "刷新间隔"
description: "数据刷新频率(秒)"
defaultValue: 300
minimum: 30
maximum: 3600
unit: "sec"
leftIcon: ""
}
}
}
}
}