Skip to content

Commit 28fd969

Browse files
committed
Merge branch 'master' of https://github.com/chavyleung/scripts
2 parents d74f412 + 2f43fd5 commit 28fd969

5 files changed

Lines changed: 174 additions & 148 deletions

File tree

‎box/chavy.boxjs.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@
6161
"author": "@chavyleung",
6262
"repo": "https://github.com/chavyleung/scripts/tree/master/gdoil",
6363
"icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/gdoil.png", "https://raw.githubusercontent.com/Orz-3/task/master/gdoil.png"]
64+
},
65+
{
66+
"id": "feng",
67+
"name": "威锋网",
68+
"settings": [{ "id": "chavy_accounts_feng", "name": "威锋账号", "val": "", "type": "textarea", "placeholder": "账号,密码 (回车) 账号,密码", "autoGrow": true, "rows": 5, "desc": "以英文逗号分隔账号与密码, 回车添加多个账号" }],
69+
"keys": [],
70+
"author": "@chavyleung",
71+
"repo": "https://github.com/chavyleung/scripts/tree/master/feng",
72+
"icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/feng.png", "https://raw.githubusercontent.com/Orz-3/task/master/feng.png"]
6473
}
6574
]
6675
}

‎box/release/box.release.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.3.0",
5+
"tags": ["beta"],
6+
"author": "@chavyleung",
7+
"icon": "https://avatars3.githubusercontent.com/u/29748519",
8+
"repo": "https://github.com/chavyleung",
9+
"notes": [
10+
{
11+
"name": "新增",
12+
"descs": ["全局搜索"]
13+
}
14+
]
15+
},
16+
{
17+
"version": "0.2.4",
18+
"tags": ["beta"],
19+
"author": "@chavyleung",
20+
"icon": "https://avatars3.githubusercontent.com/u/29748519",
21+
"repo": "https://github.com/chavyleung",
22+
"notes": [
23+
{
24+
"name": "优化",
25+
"descs": ["帮助页面样式", "订阅链接多余空格&换行等字符"]
26+
}
27+
]
28+
},
329
{
430
"version": "0.2.2",
531
"tags": ["beta"],

‎box/switcher/box.switcher.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function execSwitch() {
4040
const isNewRound = curSessionIdx + 1 === app.sessions.length
4141
const nextSessionIdx = isNewRound ? 0 : curSessionIdx + 1
4242
const nextSession = app.sessions[nextSessionIdx]
43-
nextSession.datas.forEach((_data) => $.setdata(_data.val, _data.key) || true)
43+
nextSession.datas.forEach((_data) => $.setdata([undefined, null, 'undefined', 'null', ''].includes(_data.val) ? '' : _data.val, _data.key))
4444
curSessions[appId] = nextSession.id
4545
$.desc.push(`${curSession.appName}: ${curSession.name} => #${nextSessionIdx + 1} ${nextSession.name} ${isNewRound ? '(新一轮)' : ''}`)
4646
})

‎chavy.box.js‎

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const $ = new Env('BoxJs')
22
$.domain = '8.8.8.8'
33

4-
$.version = '0.2.2'
4+
$.version = '0.3.0'
55
$.versionType = 'beta'
66
$.KEY_sessions = 'chavy_boxjs_sessions'
77
$.KEY_versions = 'chavy_boxjs_versions'
@@ -323,7 +323,7 @@ async function getAppSubs() {
323323
const sub = usercfgs.appsubs[subIdx]
324324
subActs.push(
325325
new Promise((resolve) => {
326-
$.get({ url: sub.url }, (err, resp, data) => {
326+
$.get({ url: sub.url.replace(/[ ]|[\r\n]/g, '') }, (err, resp, data) => {
327327
try {
328328
const respsub = JSON.parse(data)
329329
if (Array.isArray(respsub.apps)) {
@@ -396,8 +396,7 @@ function getSessions() {
396396
async function getVersions() {
397397
let vers = []
398398
await new Promise((resolve) => {
399-
// const verurl = 'https://github.com/chavyleung/scripts/raw/master/box/release/box.release.json'
400-
const verurl = 'https://gist.github.com/chavyleung/e1f1021391143c961d925bcdc21dca24/raw/4185a281c1861ceadd870ca55a497077ae6fefc2/box.release.json'
399+
const verurl = 'https://github.com/chavyleung/scripts/raw/master/box/release/box.release.json'
401400
$.get({ url: verurl }, (err, resp, data) => {
402401
try {
403402
const _data = JSON.parse(data)
@@ -658,7 +657,24 @@ function printHtml(data, curapp = null, curview = 'app') {
658657
</v-list>
659658
</v-menu>
660659
<v-btn icon @click="ui.curview = ui.bfview" v-else><v-icon>mdi-chevron-left</v-icon></v-btn>
661-
<v-autocomplete :label="ui.curapp ? ui.curapp.name + ' ' + ui.curapp.author : 'BoxJs - v' + box.syscfgs.version" no-data-text="未实现" dense hide-details solo> </v-autocomplete>
660+
<v-autocomplete v-model="ui.autocomplete.curapp" :items="apps" :filter="appfilter" :menu-props="{ closeOnContentClick: true, overflowY: true }" :label="ui.curapp ? ui.curapp.name + ' ' + ui.curapp.author : 'BoxJs - v' + box.syscfgs.version" no-data-text="未实现" dense hide-details solo>
661+
<template v-slot:item="{ item }">
662+
<v-list-item @click="goAppSessionView(item)">
663+
<v-list-item-avatar>
664+
<img :src="item.icons[box.usercfgs.isTransparentIcons ? 0 : 1]">
665+
</v-list-item-avatar>
666+
<v-list-item-content>
667+
<v-list-item-title>{{ item.name }} ({{ item.id }})</v-list-item-title>
668+
<v-list-item-subtitle>{{ item.repo }}</v-list-item-subtitle>
669+
<v-list-item-subtitle>{{ item.author }}</v-list-item-subtitle>
670+
</v-list-item-content>
671+
<v-list-item-action>
672+
<v-btn icon v-if="item.isFav" @click.stop="onFav(item)"><v-icon color="yellow darken-2">mdi-star</v-icon></v-btn>
673+
<v-btn icon v-else @click.stop="onFav(item)"><v-icon color="grey">mdi-star-outline</v-icon></v-btn>
674+
</v-list-item-action>
675+
</v-list-item>
676+
</template>
677+
</v-autocomplete>
662678
<v-btn icon @click="ui.drawer.show = true">
663679
<v-avatar size="26">
664680
<img :src="box.syscfgs.orz3.icon" :alt="box.syscfgs.orz3.repo" />
@@ -1121,9 +1137,11 @@ function printHtml(data, curapp = null, curview = 'app') {
11211137
</v-expand-transition>
11221138
<v-bottom-sheet v-model="ui.versheet.show" hide-overlay scrollable>
11231139
<v-card flat scrollable>
1124-
<v-subheader>
1140+
<v-subheader class="my-4">
11251141
<v-btn text @click="ui.versheet.show = false, ui.updatesheet.show = true">升级教程</v-btn>
11261142
<v-spacer></v-spacer>
1143+
<v-btn text>新版本</v-btn>
1144+
<v-spacer></v-spacer>
11271145
<v-btn text @click="ui.versheet.show = false">朕, 知道了!</v-btn>
11281146
</v-subheader>
11291147
<v-card-text>
@@ -1238,6 +1256,7 @@ function printHtml(data, curapp = null, curview = 'app') {
12381256
curappTabs: { curtab: 'sessions' },
12391257
curappSessions: null,
12401258
overlay: { show: false },
1259+
autocomplete: { curapp: null },
12411260
editProfileDialog: { show: false, bak: '' },
12421261
impGlobalBakDialog: { show: false, bak: '' },
12431262
reloadConfirmDialog: { show: false, title: '操作成功', message: '是否马上刷新页面?' },
@@ -1255,6 +1274,13 @@ function printHtml(data, curapp = null, curview = 'app') {
12551274
}
12561275
},
12571276
computed: {
1277+
apps: function () {
1278+
const apps = []
1279+
apps.push(...this.box.sysapps)
1280+
this.box.appsubs.forEach((sub, subIdx) => apps.push(...sub.apps))
1281+
apps.sort((a, b) => a.id.localeCompare(b.id))
1282+
return apps
1283+
},
12581284
appcnt: function () {
12591285
let cnt = 0
12601286
cnt += Array.isArray(this.box.sysapps) ? this.box.sysapps.length : 0
@@ -1368,6 +1394,9 @@ function printHtml(data, curapp = null, curview = 'app') {
13681394
}
13691395
},
13701396
methods: {
1397+
appfilter(item, queryText, itemText) {
1398+
return item.id.includes(queryText) || item.name.includes(queryText)
1399+
},
13711400
onLink(link) {
13721401
window.open(link)
13731402
},

0 commit comments

Comments
 (0)