11const $ = new Env ( 'BoxJs' )
22$ . domain = '8.8.8.8'
33
4- $ . version = '0.5.4 '
4+ $ . version = '0.5.6 '
55$ . versionType = 'beta'
66$ . KEY_sessions = 'chavy_boxjs_sessions'
77$ . KEY_versions = 'chavy_boxjs_versions'
@@ -72,76 +72,20 @@ function getSystemCfgs() {
7272 { id : 'QuanX' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/none/quanX.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/quantumultx.png' ] } ,
7373 { id : 'Loon' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/none/loon.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/loon.png' ] }
7474 ] ,
75- chavy : {
76- id : 'Chavy Scripts' ,
77- icon : 'https://avatars3.githubusercontent.com/u/29748519' ,
78- repo : 'https://github.com/chavyleung/scripts'
79- } ,
80- senku : {
81- id : 'GideonSenku' ,
82- icon : 'https://avatars1.githubusercontent.com/u/39037656' ,
83- repo : 'https://github.com/GideonSenku'
84- } ,
85- orz3 : {
86- id : 'Orz-3' ,
87- icon : 'https://raw.githubusercontent.com/Orz-3/task/master/Orz-3.png' ,
88- repo : 'https://github.com/Orz-3/'
89- } ,
90- contributors : [
91- { id : 'danchaw' , icon : 'https://avatars1.githubusercontent.com/u/33873206?s=60&v=4' , repo : 'https://github.com/danchaw' } ,
92- { id : '0x959' , icon : 'https://avatars3.githubusercontent.com/u/42092849?s=60&v=4' , repo : 'https://github.com/0x959' } ,
93- { id : 'lcandy2' , icon : 'https://avatars1.githubusercontent.com/u/45784494?s=60&v=4' , repo : 'https://github.com/lcandy2' } ,
94- { id : 'lowking' , icon : 'https://avatars0.githubusercontent.com/u/33308659?s=60&v=4' , repo : 'https://github.com/lowking' } ,
95- { id : 'chouchoui' , icon : 'https://avatars1.githubusercontent.com/u/14866249?s=60&v=4' , repo : 'https://github.com/chouchoui' } ,
96- { id : 'evilbutcher' , icon : 'https://avatars1.githubusercontent.com/u/62224738?s=60&v=4' , repo : 'https://github.com/evilbutcher' } ,
97- { id : 'eegod' , icon : 'https://avatars0.githubusercontent.com/u/9635792?s=60&v=4' , repo : 'https://github.com/eegod' } ,
98- { id : 'KaytZ' , icon : 'https://avatars2.githubusercontent.com/u/17397324?s=60&v=4' , repo : 'https://github.com/KaytZ' }
99- ] ,
100- boxjs : {
101- id : 'BoxJs' ,
102- show : false ,
103- icon : 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' ,
104- icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/box.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' ] ,
105- repo : 'https://github.com/chavyleung/scripts'
106- }
75+ chavy : { id : 'Chavy Scripts' , icon : 'https://avatars3.githubusercontent.com/u/29748519' , repo : 'https://github.com/chavyleung/scripts' } ,
76+ senku : { id : 'GideonSenku' , icon : 'https://avatars1.githubusercontent.com/u/39037656' , repo : 'https://github.com/GideonSenku' } ,
77+ orz3 : { id : 'Orz-3' , icon : 'https://raw.githubusercontent.com/Orz-3/task/master/Orz-3.png' , repo : 'https://github.com/Orz-3/' } ,
78+ boxjs : { id : 'BoxJs' , show : false , icon : 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/box.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' ] , repo : 'https://github.com/chavyleung/scripts' } ,
79+ contributors : [ ]
10780 }
10881}
10982
11083function getSystemApps ( ) {
11184 const sysapps = [
112- {
113- id : '52poje' ,
114- name : '吾爱破解' ,
115- keys : [ 'CookieWA' ] ,
116- author : '@NobyDa' ,
117- repo : 'https://github.com/NobyDa/Script/blob/master/52pojie-DailyBonus/52pojie.js' ,
118- icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/52pj.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/52pj.png' ]
119- } ,
120- {
121- id : 'iQIYI' ,
122- name : '爱奇艺' ,
123- keys : [ 'CookieQY' ] ,
124- author : '@NobyDa' ,
125- repo : 'https://github.com/NobyDa/Script/blob/master/iQIYI-DailyBonus/iQIYI.js' ,
126- icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/iQIYI.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/iQIYI.png' ]
127- } ,
128- {
129- id : 'txnews' ,
130- name : '腾讯新闻' ,
131- keys : [ 'sy_signurl_txnews' , 'sy_cookie_txnews' , 'sy_signurl_txnews2' , 'sy_cookie_txnews2' ] ,
132- author : '@Sunert' ,
133- repo : 'https://github.com/Sunert/Scripts/blob/master/Task/txnews.js' ,
134- icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/txnews.png' ]
135- } ,
136- {
137- id : 'BoxSwitcher' ,
138- name : '会话切换' ,
139- keys : [ ] ,
140- settings : [ { id : 'CFG_BoxSwitcher_isSilent' , name : '静默运行' , val : false , type : 'boolean' , desc : '切换会话时不发出系统通知!' } ] ,
141- author : '@chavyleung' ,
142- repo : 'https://github.com/chavyleung/scripts/blob/master/box/switcher/box.switcher.js' ,
143- icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/box.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' ]
144- }
85+ { id : '52poje' , name : '吾爱破解' , keys : [ 'CookieWA' ] , author : '@NobyDa' , repo : 'https://github.com/NobyDa/Script/blob/master/52pojie-DailyBonus/52pojie.js' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/52pj.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/52pj.png' ] } ,
86+ { id : 'iQIYI' , name : '爱奇艺' , keys : [ 'CookieQY' ] , author : '@NobyDa' , repo : 'https://github.com/NobyDa/Script/blob/master/iQIYI-DailyBonus/iQIYI.js' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/iQIYI.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/iQIYI.png' ] } ,
87+ { id : 'txnews' , name : '腾讯新闻' , keys : [ 'sy_signurl_txnews' , 'sy_cookie_txnews' , 'sy_signurl_txnews2' , 'sy_cookie_txnews2' ] , author : '@Sunert' , repo : 'https://github.com/Sunert/Scripts/blob/master/Task/txnews.js' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/txnews.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/txnews.png' ] } ,
88+ { id : 'BoxSwitcher' , name : '会话切换' , keys : [ ] , settings : [ { id : 'CFG_BoxSwitcher_isSilent' , name : '静默运行' , val : false , type : 'boolean' , desc : '切换会话时不发出系统通知!' } ] , author : '@chavyleung' , epo : 'https://github.com/chavyleung/scripts/blob/master/box/switcher/box.switcher.js' , icons : [ 'https://raw.githubusercontent.com/Orz-3/mini/master/box.png' , 'https://raw.githubusercontent.com/Orz-3/task/master/box.png' ] }
14589 ]
14690 sysapps . sort ( ( a , b ) => a . id . localeCompare ( b . id ) )
14791 wrapapps ( sysapps )
@@ -277,14 +221,9 @@ function getSessions() {
277221
278222async function getVersions ( ) {
279223 let vers = [ ]
280- // 如果启用了修复功能, 则直接返回, 不发送检查版本请求
281- // const usercfgs = getUserCfgs()
282- // if (['true', true].includes(usercfgs.isFixVPN)) {
283- // return vers
284- // }
285224 await new Promise ( ( resolve ) => {
286225 setTimeout ( resolve , 1000 )
287- const verurl = `https://cdn.jsdelivr.net/gh/ chavyleung/scripts@ ${ $ . version } /box/release/box.release.json`
226+ const verurl = `https://gitee.com/ chavyleung/scripts/raw/master /box/release/box.release.json`
288227 $ . get ( { url : verurl } , ( err , resp , data ) => {
289228 try {
290229 const _data = JSON . parse ( data )
@@ -299,20 +238,6 @@ async function getVersions() {
299238 return vers
300239}
301240
302- function getSystemThemes ( ) {
303- return [
304- { id : '' , name : '默认' } ,
305- { id : 'red' , name : '红色' } ,
306- { id : 'pink' , name : '粉红' } ,
307- { id : 'purple' , name : '紫色' } ,
308- { id : 'blue' , name : '蓝色' } ,
309- { id : 'light-blue' , name : '浅蓝' } ,
310- { id : 'brown' , name : '棕色' } ,
311- { id : 'grey' , name : '灰色' } ,
312- { id : 'blue-grey' , name : '蓝灰' }
313- ]
314- }
315-
316241async function handleApi ( ) {
317242 const data = JSON . parse ( $request . body )
318243 // 保存会话
@@ -519,8 +444,7 @@ async function getBoxData() {
519444 appsubs : getAppSubs ( ) ,
520445 syscfgs : getSystemCfgs ( ) ,
521446 usercfgs : getUserCfgs ( ) ,
522- globalbaks : getGlobalBaks ( ) ,
523- colors : getSystemThemes ( )
447+ globalbaks : getGlobalBaks ( )
524448 }
525449 const apps = [ ]
526450 apps . push ( ...box . sysapps )
@@ -1037,7 +961,7 @@ function printHtml(data, curapp = null, curview = 'app') {
1037961 </v-expansion-panel>
1038962 </v-expansion-panels>
1039963 </v-container>
1040- <v-container fluid v-if="ui.curview === 'appsession'">
964+ <v-container fluid v-else- if="ui.curview === 'appsession'">
1041965 <v-card class="mx-auto mb-4">
1042966 <template v-if="Array.isArray(ui.curapp.settings)">
1043967 <v-subheader v-if="Array.isArray(ui.curapp.settings)">
@@ -1183,7 +1107,7 @@ function printHtml(data, curapp = null, curview = 'app') {
11831107 </v-card>
11841108 </v-dialog>
11851109 </v-container>
1186- <v-container fluid v-if="ui.curview === 'sub'">
1110+ <v-container fluid v-else- if="ui.curview === 'sub'">
11871111 <v-card class="mx-auto" v-if="appsubs.length > 0">
11881112 <v-list nav dense>
11891113 <v-subheader inset>
@@ -1254,7 +1178,7 @@ function printHtml(data, curapp = null, curview = 'app') {
12541178 </v-card>
12551179 </v-dialog>
12561180 </v-container>
1257- <v-container fluid v-if="ui.curview === 'my'">
1181+ <v-container fluid v-else- if="ui.curview === 'my'">
12581182 <v-card class="mx-auto">
12591183 <v-card-title class="headline">
12601184 {{ box.usercfgs.name ? box.usercfgs.name : '大侠, 留个名字吧!' }}
@@ -1544,6 +1468,9 @@ function printHtml(data, curapp = null, curview = 'app') {
15441468 }
15451469 },
15461470 computed: {
1471+ fullscreen: function() {
1472+ return window.navigator.standalone
1473+ },
15471474 darkMode: function() {
15481475 const isSysDark = window.matchMedia('(prefers-color-scheme: dark)').matches
15491476 let isDark = !this.box.usercfgs.isLight
@@ -1984,9 +1911,21 @@ function printHtml(data, curapp = null, curview = 'app') {
19841911 },
19851912 onGoToRepo(url) {
19861913 window.open(url)
1914+ },
1915+ getContributors() {
1916+ const url = 'https://api.github.com/repos/chavyleung/scripts/contributors'
1917+ axios.get(url).then((resp) => {
1918+ this.box.syscfgs.contributors = []
1919+ resp.data.forEach((contributor) => {
1920+ if ([29748519, 39037656].includes(contributor.id)) return
1921+ const {login: id, html_url: repo, avatar_url: icon} = contributor
1922+ this.box.syscfgs.contributors.push({id, repo, icon})
1923+ })
1924+ })
19871925 }
19881926 },
19891927 mounted: function () {
1928+ this.getContributors()
19901929 this.$vuetify.theme.dark = this.darkMode
19911930 if (this.ui.curapp) {
19921931 this.goAppSessionView(this.ui.curapp)
0 commit comments