11const $ = new Env ( 'BoxJs' )
22$ . domain = '8.8.8.8'
33
4- $ . version = '0.2.4 '
4+ $ . version = '0.3.0 '
55$ . versionType = 'beta'
66$ . KEY_sessions = 'chavy_boxjs_sessions'
77$ . KEY_versions = 'chavy_boxjs_versions'
@@ -657,7 +657,24 @@ function printHtml(data, curapp = null, curview = 'app') {
657657 </v-list>
658658 </v-menu>
659659 <v-btn icon @click="ui.curview = ui.bfview" v-else><v-icon>mdi-chevron-left</v-icon></v-btn>
660- <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>
661678 <v-btn icon @click="ui.drawer.show = true">
662679 <v-avatar size="26">
663680 <img :src="box.syscfgs.orz3.icon" :alt="box.syscfgs.orz3.repo" />
@@ -1239,6 +1256,7 @@ function printHtml(data, curapp = null, curview = 'app') {
12391256 curappTabs: { curtab: 'sessions' },
12401257 curappSessions: null,
12411258 overlay: { show: false },
1259+ autocomplete: { curapp: null },
12421260 editProfileDialog: { show: false, bak: '' },
12431261 impGlobalBakDialog: { show: false, bak: '' },
12441262 reloadConfirmDialog: { show: false, title: '操作成功', message: '是否马上刷新页面?' },
@@ -1256,6 +1274,13 @@ function printHtml(data, curapp = null, curview = 'app') {
12561274 }
12571275 },
12581276 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+ },
12591284 appcnt: function () {
12601285 let cnt = 0
12611286 cnt += Array.isArray(this.box.sysapps) ? this.box.sysapps.length : 0
@@ -1369,6 +1394,9 @@ function printHtml(data, curapp = null, curview = 'app') {
13691394 }
13701395 },
13711396 methods: {
1397+ appfilter(item, queryText, itemText) {
1398+ return item.id.includes(queryText) || item.name.includes(queryText)
1399+ },
13721400 onLink(link) {
13731401 window.open(link)
13741402 },
0 commit comments