Compare commits

..

4 commits

Author SHA1 Message Date
c5fea2c79e edit func of channel share 2024-10-11 18:00:39 +08:00
10f74db5a5 fix more bug 2024-10-11 17:18:07 +08:00
d10bc7f354 add readme about losehu firmware 2024-10-11 16:58:40 +08:00
c6e917f1b9 update notice 2024-10-11 16:35:50 +08:00
6 changed files with 19161 additions and 1585 deletions

17382
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -23,9 +23,11 @@
"axios": "^0.24.0",
"chinese-s2t": "^1.0.0",
"dayjs": "^1.11.5",
"dompurify": "^3.1.7",
"echarts": "^5.4.0",
"electron-squirrel-startup": "^1.0.0",
"lodash": "^4.17.21",
"marked": "^14.1.2",
"mitt": "^3.0.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.23",
@ -52,6 +54,7 @@
"@electron-forge/maker-zip": "^7.2.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.2.0",
"@rabbitholesyndrome/electron-forge-maker-portable": "^0.2.0",
"@types/dompurify": "^3.0.5",
"@types/lodash": "^4.14.186",
"@types/mockjs": "^1.0.7",
"@types/nprogress": "^0.2.0",

View file

@ -67,8 +67,9 @@
<br>
{{ item.desc }}
</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>&nbsp;
<t-link theme="primary" hover="color" @click="onET(item.id)">编辑</t-link>&nbsp;
<t-link theme="primary" hover="color" @click="onDT(item.id)">删除</t-link>
</div>
</div>
@ -147,6 +148,7 @@
})
const formData = reactive({
id: 0,
title: '',
desc: '',
firmware: []
@ -176,6 +178,7 @@
}
const showUpload = () => {
formData.id = 0
formData.title = ''
formData.desc = ''
formData.firmware = []
@ -190,19 +193,46 @@
});
return;
}
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
'title': formData.title,
'desc': formData.desc,
'data': formData.firmware[0].response.data.file.url
}, {
headers: {
'ba-user-token': userStore.accountId
}
})
if(formData.id === 0){
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
'title': formData.title,
'desc': formData.desc,
'data': formData.firmware[0].response.data.file.url
}, {
headers: {
'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;
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) => {
await axios.post("https://k5ws.vicicode.cn/api/channel/del?server=1", {
'id': id,

View file

@ -18,6 +18,11 @@
</a-card>
</a-col>
</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>
</template>
@ -26,6 +31,8 @@ import { reactive, onMounted, watch } from 'vue';
import { useRouter } from 'vue-router';
import useLoading from '@/hooks/loading';
import { useI18n } from 'vue-i18n';
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const router = useRouter()
const { t } = useI18n();
@ -56,13 +63,15 @@ const state: {
flag: any,
disMatrix: any,
disName: any,
showSort: any
showSort: any,
readme: any
} = reactive({
versions: [],
flag: [],
disMatrix: [],
disName: [],
showSort: [],
readme: ''
})
watch(() => [...state.flag], () => { updateMatrix() })
@ -116,6 +125,19 @@ onMounted(async () => {
state.versions = JSON.parse(versions)
updateMatrix()
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>

View file

@ -3,7 +3,10 @@
<Breadcrumb :items="[$t('menu.list'), $t('bl')]" />
<a-card class="general-card" :loading="loading">
<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') }}
</template>
<a-row style="margin-bottom: 16px">

3282
yarn.lock

File diff suppressed because it is too large Load diff