@@ -2,6 +2,7 @@ const $ = new Env('chavy.box.js')
2
2
$ . domain = '8.8.8.8'
3
3
4
4
$ . KEY_sessions = 'chavy_boxjs_sessions'
5
+ $ . KEY_userCfgs = 'chavy_boxjs_userCfgs'
5
6
6
7
$ . json = $ . name
7
8
$ . html = $ . name
@@ -50,10 +51,20 @@ function getSystemCfgs() {
50
51
return {
51
52
env : $ . isSurge ( ) ? 'Surge' : $ . isQuanX ? 'QuanX' : 'Loon' ,
52
53
envs : [
53
- { id : 'Surge' , icon : 'https://is3-ssl.mzstatic.com/image/thumb/Purple123/v4/21/0a/0d/210a0df9-cbe1-b9dc-7549-4c10cd996279/AppIcon-0-0-1x_U007emarketing-0-0-0-6-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/492x0w.png' } ,
54
- { id : 'QuanX' , icon : 'https://is4-ssl.mzstatic.com/image/thumb/Purple123/v4/ae/7c/a2/ae7ca2fb-c4b6-d3a9-885a-935c1ea34cdb/AppIcon-1x_U007emarketing-0-7-0-0-85-220.png/492x0w.png' } ,
55
- { id : 'Loon' , icon : 'https://is2-ssl.mzstatic.com/image/thumb/Purple123/v4/59/2c/fb/592cfb3b-162e-83dc-4e96-7a2175e1d29f/AppIcon-0-1x_U007emarketing-0-7-0-0-85-220.png/492x0w.png' }
56
- ]
54
+ { id : 'Surge' , icon : 'https://raw.githubusercontent.com/Orz-3/task/master/surge.png' } ,
55
+ { id : 'QuanX' , icon : 'https://raw.githubusercontent.com/Orz-3/task/master/quantumultx.png' } ,
56
+ { id : 'Loon' , icon : 'https://raw.githubusercontent.com/Orz-3/task/master/loon.png' }
57
+ ] ,
58
+ chavy : {
59
+ id : 'Chavy Scripts' ,
60
+ icon : 'https://avatars3.githubusercontent.com/u/29748519?s=460&u=392a19e85465abbcb1791c9b8b32184a16e6795e&v=4' ,
61
+ repo : 'https://github.com/chavyleung/scripts'
62
+ } ,
63
+ orz3 : {
64
+ id : 'Orz-3' ,
65
+ icon : 'https://raw.githubusercontent.com/Orz-3/task/master/Orz-3.png' ,
66
+ repo : 'https://github.com/Orz-3/'
67
+ }
57
68
}
58
69
}
59
70
@@ -65,23 +76,23 @@ function getSystemApps() {
65
76
keys : [ 'chavy_tokenurl_10010' , 'chavy_tokenheader_10010' , 'chavy_signurl_10010' , 'chavy_signheader_10010' , 'chavy_loginlotteryurl_10010' , 'chavy_loginlotteryheader_10010' , 'chavy_findlotteryurl_10010' , 'chavy_findlotteryheader_10010' ] ,
66
77
author : '@chavyleung' ,
67
78
repo : 'https://github.com/chavyleung/scripts/tree/master/10010' ,
68
- icon : 'https://is4-ssl.mzstatic .com/image/thumb/Purple113/v4/f7/03/75/f70375ee-7462-d5fc-4b76-79809e63a325/AppIcon-0-0-1x_U007emarketing-0-0-0-6-0-0-85-220.png/492x0w .png'
79
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/10010.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/10010 .png']
69
80
} ,
70
81
{
71
82
id : '52poje' ,
72
83
name : '吾爱破解' ,
73
84
keys : [ 'CookieWA' ] ,
74
85
author : '@NobyDa' ,
75
86
repo : 'https://github.com/NobyDa/Script/blob/master/52pojie-DailyBonus/52pojie.js' ,
76
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/52pj.png'
87
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/52pj.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/52pj.png' ]
77
88
} ,
78
89
{
79
90
id : 'AcFun' ,
80
91
name : 'AcFun' ,
81
92
keys : [ 'chavy_cookie_acfun' , 'chavy_token_acfun' ] ,
82
93
author : '@chavyleung' ,
83
94
repo : 'https://github.com/chavyleung/scripts/tree/master/acfun' ,
84
- icon : 'https://is5-ssl.mzstatic .com/image/thumb/Purple123/v4/41/f0/11/41f011f8-1bbc-188f-220f-3db5164a9ae9/AppIcon-1x_U007emarketing-0-7-0-0-85-220.png/492x0w .png'
95
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/acfun.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/acfun .png']
85
96
} ,
86
97
{
87
98
id : 'ApkTw' ,
@@ -90,7 +101,7 @@ function getSystemApps() {
90
101
author : '@chavyleung' ,
91
102
repo : 'https://github.com/chavyleung/scripts/tree/master/apktw' ,
92
103
url : 'https://apk.tw/' ,
93
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/apktw.png' ,
104
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/apktw.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/apktw.png' ] ,
94
105
tasks : [ { cron : '3 0 * * *' , script : 'apktw.js' } ] ,
95
106
rewrites : [ { type : 'request' , pattern : '^https://apk.tw/member.php(.*?)action=login' , script : 'apktw.cookie.js' , body : true } ]
96
107
} ,
@@ -106,23 +117,23 @@ function getSystemApps() {
106
117
] ,
107
118
author : '@chavyleung' ,
108
119
repo : 'https://github.com/chavyleung/scripts/tree/master/tieba' ,
109
- icon : 'https://is4-ssl.mzstatic .com/image/thumb/Purple113/v4/0a/33/50/0a335055-952a-6860-76aa-c657b2627a78/AppIcon-0-0-1x_U007emarketing-0-0-0-7-0-0-sRGB-85-220.jpeg/434x0w.jpg'
120
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/baidu.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/baidu.png' ]
110
121
} ,
111
122
{
112
123
id : 'iQIYI' ,
113
124
name : '爱奇艺' ,
114
125
keys : [ 'CookieQY' ] ,
115
126
author : '@NobyDa' ,
116
127
repo : 'https://github.com/NobyDa/Script/blob/master/iQIYI-DailyBonus/iQIYI.js' ,
117
- icon : 'https://is3-ssl.mzstatic .com/image/thumb/Purple113/v4/fa/dd/9a/fadd9a15-6b01-e4f7-0e59-920b23e58490/AppIcon-0-0-1x_U007emarketing-0-0-0-5-0-0-85-220.png/492x0w .png'
128
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/iQIYI.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/iQIYI .png']
118
129
} ,
119
130
{
120
131
id : 'JD' ,
121
132
name : '京东' ,
122
133
keys : [ 'CookieJD' , 'CookieJD2' ] ,
123
134
author : '@NobyDa' ,
124
135
repo : 'https://github.com/NobyDa/Script/blob/master/JD-DailyBonus/JD_DailyBonus.js' ,
125
- icon : 'https://is4-ssl.mzstatic .com/image/thumb/Purple113/v4/0b/7c/08/0b7c08b3-4c03-1d92-5461-32c176a6fc30/AppIcon-0-0-1x_U007emarketing-0-0-0-6-0-0-85-220.png/460x0w .png'
136
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/jd.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/jd .png']
126
137
} ,
127
138
{
128
139
id : 'JD618' ,
@@ -138,23 +149,23 @@ function getSystemApps() {
138
149
] ,
139
150
author : '@chavyleung' ,
140
151
repo : 'https://github.com/chavyleung/scripts/tree/master/jd' ,
141
- icon : 'https://is4-ssl.mzstatic .com/image/thumb/Purple113/v4/0b/7c/08/0b7c08b3-4c03-1d92-5461-32c176a6fc30/AppIcon-0-0-1x_U007emarketing-0-0-0-6-0-0-85-220.png/460x0w .png'
152
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/jd.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/jd .png']
142
153
} ,
143
154
{
144
155
id : 'videoqq' ,
145
156
name : '腾讯视频' ,
146
157
keys : [ 'chavy_cookie_videoqq' , 'chavy_auth_url_videoqq' , 'chavy_auth_header_videoqq' , 'chavy_msign_url_videoqq' , 'chavy_msign_header_videoqq' ] ,
147
158
author : '@chavyleung' ,
148
159
repo : 'https://github.com/chavyleung/scripts/tree/master/videoqq' ,
149
- icon : 'https://is3-ssl.mzstatic .com/image/thumb/Purple113/v4/f1/b4/87/f1b4871f-717d-50c6-3151-b087733768ec/AppIcon-0-0-1x_U007emarketing-0-0-0-8-0-85-220.png/492x0w .png'
160
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/videoqq.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/videoqq .png']
150
161
} ,
151
162
{
152
163
id : 'V2EX' ,
153
164
name : 'V2EX' ,
154
165
keys : [ 'chavy_cookie_v2ex' ] ,
155
166
author : '@chavyleung' ,
156
167
repo : 'https://github.com/chavyleung/scripts/tree/master/v2ex' ,
157
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/v2ex.png'
168
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/v2ex.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/v2ex.png' ]
158
169
} ,
159
170
{
160
171
id : 'NeteaseMusic' ,
@@ -166,15 +177,15 @@ function getSystemApps() {
166
177
] ,
167
178
author : '@chavyleung' ,
168
179
repo : 'https://github.com/chavyleung/scripts/tree/master/neteasemusic' ,
169
- icon : 'https://is3-ssl.mzstatic .com/image/thumb/Purple113/v4/ef/e3/f4/efe3f4fa-288f-65fc-fc59-eacf6c1cea01/AppIcon-0-0-1x_U007emarketing-0-0-0-6-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/460x0w .png'
180
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/Netease.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/Netease .png']
170
181
} ,
171
182
{
172
183
id : 'WPS' ,
173
184
name : 'WPS' ,
174
185
keys : [ 'chavy_signhomeurl_wps' , 'chavy_signhomeheader_wps' ] ,
175
186
author : '@chavyleung' ,
176
187
repo : 'https://github.com/chavyleung/scripts/tree/master/wps' ,
177
- icon : 'https://is3-ssl.mzstatic .com/image/thumb/Purple123/v4/a0/15/bc/a015bcec-e853-cdb3-a97b-573c15771265/AppIcon-0-1x_U007emarketing-0-7-0-0-0-0-85-220.png/492x0w .png'
188
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/wps.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/wps .png']
178
189
} ,
179
190
{
180
191
id : 'NoteYoudao' ,
@@ -183,87 +194,94 @@ function getSystemApps() {
183
194
author : '@chavyleung' ,
184
195
repo : 'https://github.com/chavyleung/scripts/tree/master/noteyoudao' ,
185
196
url : 'https://apps.apple.com/cn/app/有道云笔记-扫描王版/id450748070' ,
186
- icon : 'https://is1-ssl.mzstatic .com/image/thumb/Purple113/v4/25/6a/00/256a002d-b5f0-46e1-ef55-841d41f8aafc/AppIcon-0-1x_U007emarketing-0-7-0-0-85-220.png/460x0w .png' ,
197
+ icons : [ 'https://raw.githubusercontent .com/Orz-3/mini/master/noteyoudao.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/noteyoudao .png'] ,
187
198
tasks : [ { cron : '3 0 * * *' , script : 'noteyoudao.js' } ] ,
188
199
rewrites : [ { type : 'request' , pattern : '^https://note.youdao.com/yws/mapi/user?method=checkin' , script : 'noteyoudao.cookie.js' , body : true } ]
189
200
} ,
190
201
{
191
202
id : 'QTT' ,
192
203
name : '趣头条' ,
193
- keys : [ 'senku_signKey_qtt' , 'senku_signXTK_qtt' , 'senku_readKey_qtt' , 'senku_navCoinKey_qtt' ] ,
204
+ keys : [ 'senku_signKey_qtt' , 'senku_signXTK_qtt' , 'senku_readKey_qtt' , 'senku_navCoinKey_qtt' ] ,
194
205
author : '@GideonSenku' ,
195
206
repo : 'https://github.com/chavyleung/scripts/tree/master/qtt' ,
196
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/qtt.png' ,
207
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/qtt.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/qtt.png' ]
197
208
} ,
198
209
{
199
210
id : 'qmkg' ,
200
211
name : '全民K歌' ,
201
212
keys : [ 'senku_signurl_qmkg' , 'senku_signheader_qmkg' , 'senku_signbody_qmkg' ] ,
202
213
author : '@GideonSenku' ,
203
214
repo : 'https://github.com/chavyleung/scripts/tree/master/qmkg' ,
204
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/qmkg.png' ,
215
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/qmkg.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/qmkg.png' ]
205
216
} ,
206
217
{
207
218
id : 'bcz' ,
208
219
name : '百词斩' ,
209
220
keys : [ 'senku_cookie_bcz' , 'senku_key_bcz' ] ,
210
221
author : '@GideonSenku' ,
211
222
repo : 'https://github.com/chavyleung/scripts/tree/master/bcz' ,
212
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/midu.png' ,
223
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/midu.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/midu.png' ]
213
224
} ,
214
225
{
215
226
id : 'zxhc' ,
216
227
name : '智行火车票' ,
217
- keys : [ 'senku_signurl_zxhc' , 'senku_signheader_zxhc' , 'senku_signbody_zxhc' ] ,
228
+ keys : [ 'senku_signurl_zxhc' , 'senku_signheader_zxhc' , 'senku_signbody_zxhc' ] ,
218
229
author : '@GideonSenku' ,
219
230
repo : 'https://github.com/chavyleung/scripts/tree/master/zxhc' ,
220
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/zxhc.png' ,
231
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/zxhc.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/zxhc.png' ]
221
232
} ,
222
233
{
223
234
id : 'fenqile' ,
224
235
name : '分期乐' ,
225
- keys : [ 'senku_signurl_fenqile' , 'senku_signheader_fenqile' , 'senku_signbody_fenqile' , 'senku_signDailyKey_fenqile' , 'senku_signDailyUrlKey_fenqile' ] ,
236
+ keys : [ 'senku_signurl_fenqile' , 'senku_signheader_fenqile' , 'senku_signbody_fenqile' , 'senku_signDailyKey_fenqile' , 'senku_signDailyUrlKey_fenqile' ] ,
226
237
author : '@GideonSenku' ,
227
238
repo : 'https://github.com/chavyleung/scripts/tree/master/fenqile' ,
228
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/fenqile.png' ,
239
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/fenqile.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/fenqile.png' ]
229
240
} ,
230
241
{
231
242
id : 'fandeng' ,
232
243
name : '樊登读书' ,
233
- keys : [ 'senku_signurl_pandeng' , 'senku_signheader_pandeng' , 'senku_signbody_pandeng' ] ,
244
+ keys : [ 'senku_signurl_pandeng' , 'senku_signheader_pandeng' , 'senku_signbody_pandeng' ] ,
234
245
author : '@GideonSenku' ,
235
246
repo : 'https://github.com/chavyleung/scripts/tree/master/fandeng' ,
236
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/fandeng.png' ,
247
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/fandeng.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/fandeng.png' ]
237
248
} ,
238
249
{
239
250
id : 'dbsj' ,
240
251
name : '豆瓣时间' ,
241
- keys : [ 'senku_signurl_dbsj' , 'senku_signheader_dbsj' , 'senku_signbody_dbsj' ] ,
252
+ keys : [ 'senku_signurl_dbsj' , 'senku_signheader_dbsj' , 'senku_signbody_dbsj' ] ,
242
253
author : '@GideonSenku' ,
243
254
repo : 'https://github.com/chavyleung/scripts/tree/master/dbsj' ,
244
- icon : 'https://raw.githubusercontent.com/Orz-3/mini/master/dbsj.png' ,
245
- } ,
255
+ icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/dbsj.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/dbsj.png' ]
256
+ }
246
257
]
247
- sysapps . forEach ( ( app ) => {
248
- app . datas = Array . isArray ( app . datas ) ? app . datas : [ ]
249
- app . keys . forEach ( ( key ) => {
250
- app . datas . push ( { key, val : $ . getdata ( key ) } )
251
- } )
252
- Array . isArray ( app . settings ) &&
253
- app . settings . forEach ( ( setting ) => {
254
- const val = $ . getdata ( setting . id )
255
- if ( setting . type === 'boolean' ) {
256
- setting . val = val === null ? setting . val : val === 'true'
257
- } else if ( setting . type === 'int' ) {
258
- setting . val = val * 1 || setting . val
259
- } else {
260
- setting . val = val || setting . val
261
- }
258
+ sysapps
259
+ . sort ( ( a , b ) => a . id . localeCompare ( b . id ) )
260
+ . forEach ( ( app ) => {
261
+ app . datas = Array . isArray ( app . datas ) ? app . datas : [ ]
262
+ app . keys . forEach ( ( key ) => {
263
+ app . datas . push ( { key, val : $ . getdata ( key ) } )
262
264
} )
263
- } )
265
+ Array . isArray ( app . settings ) &&
266
+ app . settings . forEach ( ( setting ) => {
267
+ const val = $ . getdata ( setting . id )
268
+ if ( setting . type === 'boolean' ) {
269
+ setting . val = val === null ? setting . val : val === 'true'
270
+ } else if ( setting . type === 'int' ) {
271
+ setting . val = val * 1 || setting . val
272
+ } else {
273
+ setting . val = val || setting . val
274
+ }
275
+ } )
276
+ } )
264
277
return sysapps
265
278
}
266
279
280
+ function getUserCfgs ( ) {
281
+ const userCfgsStr = $ . getdata ( $ . KEY_userCfgs )
282
+ return userCfgsStr ? JSON . parse ( userCfgsStr ) : { }
283
+ }
284
+
267
285
function getUserApps ( ) {
268
286
return [ ]
269
287
}
@@ -305,7 +323,7 @@ function handleApi() {
305
323
}
306
324
}
307
325
// 保存当前会话
308
- if ( data . cmd === 'saveCurAppSession' ) {
326
+ else if ( data . cmd === 'saveCurAppSession' ) {
309
327
const app = data . val
310
328
const isExistsApp = getSystemApps ( ) . find ( ( _app ) => _app . id === app . id )
311
329
if ( isExistsApp ) {
@@ -369,6 +387,11 @@ function handleApi() {
369
387
$ . msg ( $ . name , $ . subt , $ . desc . join ( '\n' ) )
370
388
}
371
389
}
390
+ // 保存用户偏好
391
+ else if ( data . cmd === 'saveUserCfgs' ) {
392
+ const usercfgs = data . val
393
+ $ . setdata ( JSON . stringify ( usercfgs ) , $ . KEY_userCfgs )
394
+ }
372
395
}
373
396
374
397
function handleApp ( appId ) {
@@ -377,6 +400,7 @@ function handleApp(appId) {
377
400
sysapps : getSystemApps ( ) ,
378
401
userapps : getUserApps ( ) ,
379
402
syscfgs : getSystemCfgs ( ) ,
403
+ usercfgs : getUserCfgs ( ) ,
380
404
colors : getSystemThemes ( )
381
405
}
382
406
const curapp = appId ? box . sysapps . find ( ( app ) => app . id === appId ) : null
@@ -391,6 +415,7 @@ function handleHome() {
391
415
sysapps : getSystemApps ( ) ,
392
416
userapps : getUserApps ( ) ,
393
417
syscfgs : getSystemCfgs ( ) ,
418
+ usercfgs : getUserCfgs ( ) ,
394
419
colors : getSystemThemes ( )
395
420
} )
396
421
)
@@ -404,6 +429,7 @@ function printHtml(data, curapp = null) {
404
429
<head>
405
430
<title>BoxJs</title>
406
431
<meta charset="utf-8" />
432
+ <link rel="icon" href="https://raw.githubusercontent.com/chavyleung/scripts/master/BOXJS.png"/>
407
433
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet" />
408
434
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected] /css/materialdesignicons.min.css" rel="stylesheet" />
409
435
<link href="https://cdn.jsdelivr.net/npm/[email protected] /dist/vuetify.min.css" rel="stylesheet" />
@@ -440,16 +466,41 @@ function printHtml(data, curapp = null) {
440
466
</v-menu>
441
467
<v-btn icon @click="ui.curview = ui.bfview" v-else><v-icon>mdi-chevron-left</v-icon></v-btn>
442
468
<v-autocomplete :label="ui.curapp ? ui.curapp.name + ' ' + ui.curapp.author : 'chavy.box.js'" no-data-text="未实现" dense hide-details solo> </v-autocomplete>
443
- <v-app-bar-nav-icon @click="ui.drawer.show = true"></v-app-bar-nav-icon>
469
+ <v-btn icon @click="ui.drawer.show = true">
470
+ <v-avatar size="24">
471
+ <img :src="box.syscfgs.orz3.icon" :alt="box.syscfgs.orz3.repo" />
472
+ </v-avatar>
473
+ </v-btn>
444
474
</v-app-bar>
445
- <v-navigation-drawer v-model="ui.drawer.show" app temporary right> </v-navigation-drawer>
475
+ <v-navigation-drawer v-model="ui.drawer.show" app temporary right>
476
+ <v-list dense nav>
477
+ <v-list-item two-line dense @click="onLink(box.syscfgs.chavy.repo)">
478
+ <v-list-item-avatar>
479
+ <img src="https://avatars3.githubusercontent.com/u/29748519?s=460&u=392a19e85465abbcb1791c9b8b32184a16e6795e&v=4" />
480
+ </v-list-item-avatar>
481
+ <v-list-item-content>
482
+ <v-list-item-title>{{ box.syscfgs.chavy.id }}</v-list-item-title>
483
+ <v-list-item-subtitle>{{ box.syscfgs.chavy.repo }}</v-list-item-subtitle>
484
+ </v-list-item-content>
485
+ </v-list-item>
486
+ <v-divider></v-divider>
487
+ <v-list-item>
488
+ <v-list-item-content>
489
+ <v-switch label="透明图标" v-model="box.usercfgs.isTransparentIcons" @change="onIconChange"></v-switch>
490
+ </v-list-item-content>
491
+ <v-list-item-action @click="onLink(box.syscfgs.orz3.repo)">
492
+ <v-avatar size="32"><img :src="box.syscfgs.orz3.icon" :alt="box.syscfgs.orz3.repo" /></v-avatar>
493
+ </v-list-item-action>
494
+ </v-list-item>
495
+ </v-list>
496
+ </v-navigation-drawer>
446
497
<v-content>
447
498
<v-container fluid v-if="ui.curview === 'app'">
448
499
<v-card class="mx-auto" tile>
449
500
<v-list nav dense>
450
501
<v-subheader inset>内置应用 ({{ box.sysapps.length }})</v-subheader>
451
502
<v-list-item three-line dense v-for="(app, appIdx) in box.sysapps" :key="app.id" @click="goAppSessionView(app)">
452
- <v-list-item-avatar><v-img :src="app.icon "></v-img></v-list-item-avatar>
503
+ <v-list-item-avatar><v-img :src="app.icons[box.usercfgs.isTransparentIcons ? 0 : 1] "></v-img></v-list-item-avatar>
453
504
<v-list-item-content>
454
505
<v-list-item-title>{{ app.name }} ({{ app.id }})</v-list-item-title>
455
506
<v-list-item-subtitle>{{ app.repo }}</v-list-item-subtitle>
@@ -644,6 +695,12 @@ function printHtml(data, curapp = null) {
644
695
}
645
696
},
646
697
methods: {
698
+ onLink(link) {
699
+ window.open(link)
700
+ },
701
+ onIconChange() {
702
+ axios.post('/api', JSON.stringify({ cmd: 'saveUserCfgs', val: this.box.usercfgs }))
703
+ },
647
704
goAppSessionView(app) {
648
705
this.ui.bfview = this.ui.curview
649
706
this.ui.curapp = app
@@ -678,7 +735,7 @@ function printHtml(data, curapp = null) {
678
735
navigator.clipboard.readText().then((text) => {
679
736
this.ui.impSessionDialog.impval = ''
680
737
this.ui.impSessionDialog.impval = text
681
- });
738
+ })
682
739
},
683
740
onImpSession() {
684
741
const impjson = this.ui.impSessionDialog.impval
0 commit comments