Skip to content

Commit 16b8efd

Browse files
committed
Refactor widget tray menu panel
1 parent 7a3f48b commit 16b8efd

File tree

19 files changed

+363
-167
lines changed

19 files changed

+363
-167
lines changed

public/widget.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -137,38 +137,38 @@
137137
]
138138
},
139139
{
140-
"name": "cn.widgetjs.widgets.phone_reminder",
140+
"name": "cn.widgetjs.widgets.labor_progress",
141141
"title": {
142-
"zh-CN": "来电提醒"
142+
"zh-CN": "打工进度"
143143
},
144144
"description": {
145-
"zh-CN": "用灵动通知加语音,提醒重要事项"
145+
"zh-CN": "打工人,打工魂"
146146
},
147147
"keywords": [
148148
"recommend"
149149
],
150150
"security": false,
151151
"permissions": [],
152152
"lang": "zh-CN",
153-
"width": 1,
153+
"width": 4,
154154
"height": 1,
155-
"maxWidth": 1,
155+
"maxWidth": 6,
156156
"webviewTag": false,
157-
"maxHeight": 1,
158-
"minWidth": 1,
157+
"maxHeight": 2,
158+
"minWidth": 3,
159159
"minHeight": 1,
160160
"movable": true,
161161
"singleton": false,
162162
"resizable": true,
163-
"path": "/widget/phone_reminder",
163+
"path": "/widget/labor_progress",
164164
"meta": {},
165-
"backgroundThrottling": false,
166-
"previewImage": "/images/preview_phone_reminder.png",
165+
"backgroundThrottling": true,
166+
"previewImage": "/images/preview_labor_progress.png",
167167
"categories": [
168168
"fun"
169169
],
170-
"supportDeployMode": 65536,
171-
"configPagePath": "/widget/config/phone_reminder?frame=true&transparent=false",
170+
"supportDeployMode": 17,
171+
"configPagePath": "/widget/config/labor_progress?frame=true&transparent=false",
172172
"routes": [],
173173
"socialLinks": [
174174
{
@@ -178,38 +178,38 @@
178178
]
179179
},
180180
{
181-
"name": "cn.widgetjs.widgets.labor_progress",
181+
"name": "cn.widgetjs.widgets.phone_reminder",
182182
"title": {
183-
"zh-CN": "打工进度"
183+
"zh-CN": "来电提醒"
184184
},
185185
"description": {
186-
"zh-CN": "打工人,打工魂"
186+
"zh-CN": "用灵动通知加语音,提醒重要事项"
187187
},
188188
"keywords": [
189189
"recommend"
190190
],
191191
"security": false,
192192
"permissions": [],
193193
"lang": "zh-CN",
194-
"width": 4,
194+
"width": 1,
195195
"height": 1,
196-
"maxWidth": 6,
196+
"maxWidth": 1,
197197
"webviewTag": false,
198-
"maxHeight": 2,
199-
"minWidth": 3,
198+
"maxHeight": 1,
199+
"minWidth": 1,
200200
"minHeight": 1,
201201
"movable": true,
202202
"singleton": false,
203203
"resizable": true,
204-
"path": "/widget/labor_progress",
204+
"path": "/widget/phone_reminder",
205205
"meta": {},
206-
"backgroundThrottling": true,
207-
"previewImage": "/images/preview_labor_progress.png",
206+
"backgroundThrottling": false,
207+
"previewImage": "/images/preview_phone_reminder.png",
208208
"categories": [
209209
"fun"
210210
],
211-
"supportDeployMode": 17,
212-
"configPagePath": "/widget/config/labor_progress?frame=true&transparent=false",
211+
"supportDeployMode": 65536,
212+
"configPagePath": "/widget/config/phone_reminder?frame=true&transparent=false",
213213
"routes": [],
214214
"socialLinks": [
215215
{
35.8 KB
Loading

src/assets/images/logo.png

68.1 KB
Loading

src/composition/useAppConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { LanguageCode } from '@widget-js/core'
22
import { AppApi } from '@widget-js/core'
33
import { onMounted, ref, watch } from 'vue'
44

5+
const debugMode = ref(false)
56
export function useDebugConfig(onLoad?: (debug: boolean) => void) {
6-
const debugMode = ref(false)
77
onMounted(async () => {
88
debugMode.value = await AppApi.getDevMode()
99
onLoad?.(debugMode.value)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type { AppRuntimeInfo } from '@widget-js/core'
2+
import { AppApi } from '@widget-js/core'
3+
import { computed, ref } from 'vue'
4+
5+
export type SimpleAppRuntimeInfo = Omit<AppRuntimeInfo, 'chrome' | 'node' | 'appPath' | 'platform' | 'v8'>
6+
export function useAppRuntimeInfo() {
7+
const info = ref<AppRuntimeInfo>()
8+
9+
AppApi.getRuntimeInfo().then((data) => {
10+
// sort keys
11+
const res = Object.keys(data).sort().reduce((obj, key) => {
12+
obj[key] = data[key]
13+
return obj
14+
}, {})
15+
info.value = res as AppRuntimeInfo
16+
})
17+
18+
const simpleInfo = computed<SimpleAppRuntimeInfo | undefined>(() => {
19+
if (info.value) {
20+
const simple: SimpleAppRuntimeInfo = {
21+
app: info.value.app,
22+
cpuModel: info.value.cpuModel,
23+
arch: info.value.arch,
24+
electron: info.value.electron,
25+
release: info.value.release,
26+
isWindowsStore: info.value.isWindowsStore,
27+
totalMem: info.value.totalMem,
28+
systemName: info.value.systemName,
29+
}
30+
return simple
31+
}
32+
return undefined
33+
})
34+
35+
return { info, simpleInfo }
36+
}

src/i18n/default/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"infoCopied": "Info Copied",
55
"appInfo": "App Info",
66
"loading": "Loading",
7-
"fullDetail": "Full Detail",
7+
"fullDetail": "Detail",
88
"copyAndReport": "Copy & Report",
99
"copy": "Copy",
1010
"add": "Add",
@@ -61,5 +61,6 @@
6161
},
6262
"notification": {
6363
"enableDevMode": "Developer mode enabled"
64-
}
64+
},
65+
"exit": "Exit"
6566
}

src/i18n/i18n.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import defaultZh from '@/i18n/default/zh.json'
33
import defaultEn from '@/i18n/default/en.json'
44
import settingsZh from '@/i18n/settings/zh.json'
55
import settingsEn from '@/i18n/settings/en.json'
6+
import trayEn from '@/i18n/tray/en.json'
7+
import trayZh from '@/i18n/tray/zh.json'
68

79
export const i18n = createI18n({
810
legacy: false,
@@ -11,10 +13,12 @@ export const i18n = createI18n({
1113
'zh': {
1214
...defaultZh,
1315
settings: settingsZh,
16+
tray: trayZh,
1417
},
1518
'en-US': {
1619
...defaultEn,
1720
settings: settingsEn,
21+
tray: trayEn,
1822
},
1923
},
2024
fallbackLocale: 'en',

src/i18n/tray/en.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"appVersion": "Version",
3+
"systemVersion": "System",
4+
"fullDetail": "Detail",
5+
"runningWidgets": "Running Widgets",
6+
"addWidget": "Widgets",
7+
"settings": {
8+
"title": "Settings"
9+
},
10+
"checkUpdates": "Update",
11+
"shareApp": "Share App",
12+
"exit": "Exit",
13+
"suggestions": "Suggestions & Feedback",
14+
"infoCopied": "Info Copied",
15+
"downloadLinkCopied": "Download link copied to clipboard"
16+
}

src/i18n/tray/zh.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"appVersion": "应用版本",
3+
"systemVersion": "系统版本",
4+
"fullDetail": "详细信息",
5+
"runningWidgets": "运行中的组件",
6+
"addWidget": "添加组件",
7+
"settings": {
8+
"title": "设置"
9+
},
10+
"checkUpdates": "检测更新",
11+
"shareApp": "分享应用",
12+
"exit": "退出",
13+
"suggestions": "建议与反馈",
14+
"infoCopied": "已复制信息",
15+
"downloadLinkCopied": "已复制下载链接到剪贴板"
16+
}

src/router/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const routes: RouteRecordRaw[] = [
2727
name: 'setting',
2828
component: () => import('@/views/settings/SettingView.vue'),
2929
},
30+
{
31+
path: '/setting/app/runtime',
32+
name: 'AppRunTime',
33+
component: () => import('@/views/settings/AppRuntimeView.vue'),
34+
},
3035
{
3136
path: '/manager',
3237
name: 'manager',
@@ -57,6 +62,11 @@ const routes: RouteRecordRaw[] = [
5762
name: 'tray',
5863
component: () => import('../views/desktop/TrayGuide.vue'),
5964
},
65+
{
66+
path: '/tray/menu',
67+
name: 'TrayMenu',
68+
component: () => import('../views/tray/TrayMenuView.vue'),
69+
},
6070
{
6171
path: '/check-update',
6272
name: 'check-update',

0 commit comments

Comments
 (0)