mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
Compare commits
4 commits
030a17fddb
...
c5fea2c79e
Author | SHA1 | Date | |
---|---|---|---|
c5fea2c79e | |||
10f74db5a5 | |||
d10bc7f354 | |||
c6e917f1b9 |
6 changed files with 19161 additions and 1585 deletions
17382
package-lock.json
generated
Normal file
17382
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -23,9 +23,11 @@
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"chinese-s2t": "^1.0.0",
|
"chinese-s2t": "^1.0.0",
|
||||||
"dayjs": "^1.11.5",
|
"dayjs": "^1.11.5",
|
||||||
|
"dompurify": "^3.1.7",
|
||||||
"echarts": "^5.4.0",
|
"echarts": "^5.4.0",
|
||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-squirrel-startup": "^1.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
"marked": "^14.1.2",
|
||||||
"mitt": "^3.0.0",
|
"mitt": "^3.0.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.23",
|
||||||
|
@ -52,6 +54,7 @@
|
||||||
"@electron-forge/maker-zip": "^7.2.0",
|
"@electron-forge/maker-zip": "^7.2.0",
|
||||||
"@electron-forge/plugin-auto-unpack-natives": "^7.2.0",
|
"@electron-forge/plugin-auto-unpack-natives": "^7.2.0",
|
||||||
"@rabbitholesyndrome/electron-forge-maker-portable": "^0.2.0",
|
"@rabbitholesyndrome/electron-forge-maker-portable": "^0.2.0",
|
||||||
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/lodash": "^4.14.186",
|
"@types/lodash": "^4.14.186",
|
||||||
"@types/mockjs": "^1.0.7",
|
"@types/mockjs": "^1.0.7",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
|
|
|
@ -67,8 +67,9 @@
|
||||||
<br>
|
<br>
|
||||||
{{ item.desc }}
|
{{ item.desc }}
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 40%; margin: auto; text-align: center;">
|
<div style="width: 50%; margin: auto; text-align: center;">
|
||||||
<t-tag>{{ item.create_time_text }}</t-tag>
|
<t-tag>{{ item.create_time_text }}</t-tag>
|
||||||
|
<t-link theme="primary" hover="color" @click="onET(item.id)">编辑</t-link>
|
||||||
<t-link theme="primary" hover="color" @click="onDT(item.id)">删除</t-link>
|
<t-link theme="primary" hover="color" @click="onDT(item.id)">删除</t-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
id: 0,
|
||||||
title: '',
|
title: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
firmware: []
|
firmware: []
|
||||||
|
@ -176,6 +178,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const showUpload = () => {
|
const showUpload = () => {
|
||||||
|
formData.id = 0
|
||||||
formData.title = ''
|
formData.title = ''
|
||||||
formData.desc = ''
|
formData.desc = ''
|
||||||
formData.firmware = []
|
formData.firmware = []
|
||||||
|
@ -190,6 +193,7 @@
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(formData.id === 0){
|
||||||
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
|
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
|
||||||
'title': formData.title,
|
'title': formData.title,
|
||||||
'desc': formData.desc,
|
'desc': formData.desc,
|
||||||
|
@ -199,10 +203,36 @@
|
||||||
'ba-user-token': userStore.accountId
|
'ba-user-token': userStore.accountId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
await axios.post("https://k5ws.vicicode.cn/api/channel/edit?server=1", {
|
||||||
|
'id': formData.id,
|
||||||
|
'title': formData.title,
|
||||||
|
'desc': formData.desc,
|
||||||
|
'data': formData.firmware[0].url ?? formData.firmware[0].response.data.file.url
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
'ba-user-token': userStore.accountId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
state.showUpload = false;
|
state.showUpload = false;
|
||||||
showPanel()
|
showPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onET = async (id: any) => {
|
||||||
|
formData.id = id
|
||||||
|
formData.title = state.myList.filter((e: any)=>e.id == id)[0].title
|
||||||
|
formData.desc = state.myList.filter((e: any)=>e.id == id)[0].desc
|
||||||
|
formData.firmware = [
|
||||||
|
{
|
||||||
|
name: state.myList.filter((e: any)=>e.id == id)[0].title,
|
||||||
|
status: 'success',
|
||||||
|
url: state.myList.filter((e: any)=>e.id == id)[0].file
|
||||||
|
}
|
||||||
|
]
|
||||||
|
state.showUpload = true
|
||||||
|
}
|
||||||
|
|
||||||
const onDT = async (id: any) => {
|
const onDT = async (id: any) => {
|
||||||
await axios.post("https://k5ws.vicicode.cn/api/channel/del?server=1", {
|
await axios.post("https://k5ws.vicicode.cn/api/channel/del?server=1", {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
|
|
@ -18,6 +18,11 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
<a-row :gutter="20" align="stretch" style="margin-top: 10px;">
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-card style="padding: 20px;" class="general-card" v-html="state.readme"></a-card>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -26,6 +31,8 @@ import { reactive, onMounted, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { marked } from 'marked';
|
||||||
|
import DOMPurify from 'dompurify';
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -56,13 +63,15 @@ const state: {
|
||||||
flag: any,
|
flag: any,
|
||||||
disMatrix: any,
|
disMatrix: any,
|
||||||
disName: any,
|
disName: any,
|
||||||
showSort: any
|
showSort: any,
|
||||||
|
readme: any
|
||||||
} = reactive({
|
} = reactive({
|
||||||
versions: [],
|
versions: [],
|
||||||
flag: [],
|
flag: [],
|
||||||
disMatrix: [],
|
disMatrix: [],
|
||||||
disName: [],
|
disName: [],
|
||||||
showSort: [],
|
showSort: [],
|
||||||
|
readme: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => [...state.flag], () => { updateMatrix() })
|
watch(() => [...state.flag], () => { updateMatrix() })
|
||||||
|
@ -116,6 +125,19 @@ onMounted(async () => {
|
||||||
state.versions = JSON.parse(versions)
|
state.versions = JSON.parse(versions)
|
||||||
updateMatrix()
|
updateMatrix()
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
if(t('menu.dashboard') == 'CPS'){
|
||||||
|
state.readme = DOMPurify.sanitize(await marked.parse(await (await fetch('https://k5.vicicode.cn/diyapi/README_en.md?v=' + (new Date()).getTime())).text()))
|
||||||
|
}else{
|
||||||
|
state.readme = DOMPurify.sanitize(await marked.parse(await (await fetch('https://k5.vicicode.cn/diyapi/README.md?v=' + (new Date()).getTime())).text()))
|
||||||
|
}
|
||||||
|
state.readme = state.readme.replaceAll('href="./README_en.md"', '')
|
||||||
|
state.readme = state.readme.replaceAll('href="./README.md"', '')
|
||||||
|
state.readme = state.readme.replaceAll('losehu/uv-k5-firmware-chinese/blob/main/payment/show.png', 'losehu/uv-k5-firmware-chinese/blob/main/payment/show.png?raw=true')
|
||||||
|
state.readme = state.readme.replaceAll('/images/c1.JPG', 'https://github.com/losehu/uv-k5-firmware-custom/blob/main/images/c1.JPG?raw=true')
|
||||||
|
state.readme = state.readme.replaceAll('/images/c2.JPG', 'https://github.com/losehu/uv-k5-firmware-custom/blob/main/images/c2.JPG?raw=true')
|
||||||
|
state.readme = state.readme.replaceAll('/images/c3.JPG', 'https://github.com/losehu/uv-k5-firmware-custom/blob/main/images/c3.JPG?raw=true')
|
||||||
|
state.readme = state.readme.replaceAll('/images/c4.JPG', 'https://github.com/losehu/uv-k5-firmware-custom/blob/main/images/c4.JPG?raw=true')
|
||||||
|
state.readme = state.readme.replaceAll('a href', 'a target="_blank" href')
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
<Breadcrumb :items="[$t('menu.list'), $t('bl')]" />
|
<Breadcrumb :items="[$t('menu.list'), $t('bl')]" />
|
||||||
<a-card class="general-card" :loading="loading">
|
<a-card class="general-card" :loading="loading">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div style="color: red; font-weight: bold;">⚠:实验性功能 使用可能会损坏手台</div>
|
<div style="color: red; font-weight: bold;">
|
||||||
|
⚠:实验性功能 使用可能会损坏手台
|
||||||
|
<span style="font-size: 0.9rem;">【使用说明:<t-link theme="primary" href="https://github.com/losehu/uv-k5-bootloader-custom/releases" target="_blank">https://github.com/losehu/uv-k5-bootloader-custom/releases</t-link>】</span>
|
||||||
|
</div>
|
||||||
{{ $t('bl') }} {{ $t('global.onStart') }}
|
{{ $t('bl') }} {{ $t('global.onStart') }}
|
||||||
</template>
|
</template>
|
||||||
<a-row style="margin-bottom: 16px">
|
<a-row style="margin-bottom: 16px">
|
||||||
|
|
Loading…
Reference in a new issue