master
yutent 2023-01-14 16:54:11 +08:00
parent e13ea89048
commit b0972667c4
3 changed files with 55 additions and 49 deletions

View File

@ -7,7 +7,7 @@
<title>{{title}}</title> <title>{{title}}</title>
<meta name="keywords" content="{{keywords}}"> <meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}"> <meta name="description" content="{{description}}">
<link rel="stylesheet" href="//esm.js.io/@bytedo/wcui/dist/css/reset-basic.css"> <link rel="stylesheet" href="//jscdn.ink/@bytedo/wcui/dist/css/reset-basic.css">
<script async src="//esm.tool/es-module-shims.wasm.js"></script> <script async src="//esm.tool/es-module-shims.wasm.js"></script>
<script type="importmap">{{importmap}}</script> <script type="importmap">{{importmap}}</script>
</head> </head>

View File

@ -8,10 +8,10 @@ import { createApp } from 'vue'
import '@/assets/app.scss' import '@/assets/app.scss'
import '//esm.js.io/@bytedo/wcui/dist/layer/index.js' import '//jscdn.ink/@bytedo/wcui/dist/layer/index.js'
import '//esm.js.io/@bytedo/wcui/dist/form/switch.js' import '//jscdn.ink/@bytedo/wcui/dist/form/switch.js'
import '//esm.js.io/@bytedo/wcui/dist/form/radio.js' import '//jscdn.ink/@bytedo/wcui/dist/form/radio.js'
import '//esm.js.io/@bytedo/wcui/dist/form/button.js' import '//jscdn.ink/@bytedo/wcui/dist/form/button.js'
import App from './app.vue' import App from './app.vue'

View File

@ -6,7 +6,9 @@
<section class="field"> <section class="field">
<span class="label">订阅地址</span> <span class="label">订阅地址</span>
<wc-input class="full" v-model="remote.link"></wc-input> <wc-input class="full" v-model="remote.link"></wc-input>
<wc-button type="info" :disabled="!remote.link" @click="updateRemote"></wc-button> <wc-button type="info" :disabled="!remote.link" @click="updateRemote"
>更新</wc-button
>
</section> </section>
<wc-scroll class="scroll"> <wc-scroll class="scroll">
@ -40,7 +42,10 @@ export default {
let txt = '' let txt = ''
let names = ['DIRECT'] let names = ['DIRECT']
this.remote.list = data.split('\n').map(it => { this.remote.list = data
.trim()
.split('\n')
.map(it => {
let tmp = decodeURIComponent(it).split('#') let tmp = decodeURIComponent(it).split('#')
let tmp2 = new URL(tmp[0]) let tmp2 = new URL(tmp[0])
let protocol = tmp2.protocol.slice(0, -1) let protocol = tmp2.protocol.slice(0, -1)
@ -74,11 +79,11 @@ export default {
} }
names.push(`"${info.name}"`) names.push(`"${info.name}"`)
txt += ` - { name: ${info.name}, type: ${info.type}, server: ${info.server}, port: ${ txt += ` - { name: ${info.name}, type: ${info.type}, server: ${
info.port info.server
}, password: ${info.password}, udp: true, ${info.type === 'ss' ? 'cipher' : 'sni'}: ${ }, port: ${info.port}, password: ${info.password}, udp: true, ${
info.type === 'ss' ? info.cipher : info.sni info.type === 'ss' ? 'cipher' : 'sni'
}}\n` }: ${info.type === 'ss' ? info.cipher : info.sni}}\n`
return [info.name, info.type] return [info.name, info.type]
}) })
@ -95,15 +100,16 @@ export default {
return return
} }
window // window
.fetch(this.remote.link) // .fetch(this.remote.link)
.then(r => r.text()) // .then(r => r.text())
.then(r => { // .then(r => {
r = atob(r).trim() // r = atob(r).trim()
let r = sessionStorage.getItem('temp')
layer.toast('订阅更新成功', 'success') layer.toast('订阅更新成功', 'success')
this.parseBookData(r) this.parseBookData(r)
}) // })
} }
} }
} }