add readme about losehu firmware

This commit is contained in:
Silent YANG 2024-10-11 16:58:40 +08:00
parent c6e917f1b9
commit d10bc7f354
4 changed files with 19112 additions and 1574 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

@ -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,14 @@ 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')
})
</script>

3282
yarn.lock

File diff suppressed because it is too large Load diff