This commit is contained in:
Silent YANG 2024-08-04 13:58:59 +08:00
parent 444ae4d71c
commit 19783d8a9f
5 changed files with 44 additions and 1 deletions

View file

@ -144,6 +144,7 @@ export default {
'menu.firmware': 'Firmware Store',
'menu.channel': 'Channel Share',
'global.use': 'Use',
'global.download': 'Download',
'tool.ssbpatch': 'LOSEHU S Firmware SI4732 SSB Patch',
'tool.writessbpatch': 'SSB Patch Write',
'global.login': 'Login',

View file

@ -144,6 +144,7 @@ export default {
'menu.firmware': '固件市场',
'menu.channel': '信道分享',
'global.use': '使用',
'global.download': '下载',
'tool.ssbpatch': 'LOSEHU S 版固件 SI4732 单边带补丁',
'tool.writessbpatch': '写入单边带补丁',
'global.login': '登录',

View file

@ -29,6 +29,7 @@
</a-list-item-meta>
<template #actions>
<a-link @click="onStar(item.id)">👍</a-link>
<a-link @click="iDownload('https://k6.vicicode.cn/wsapi/download?id=' + item.id, item.title)">{{$t('global.download')}}</a-link>
<a-link @click="useFirmware('https://k6.vicicode.cn/wsapi/download?id=' + item.id)">{{$t('global.use')}}</a-link>
</template>
</a-list-item>
@ -210,6 +211,18 @@
});
}
const iDownload = (url: any, name: any) => {
fetch(url).then(e=>e.blob()).then(blob=>{
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = name + '.xlsx';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
</script>
<script lang="ts">

View file

@ -29,6 +29,7 @@
</a-list-item-meta>
<template #actions>
<a-link @click="onStar(item.id)">👍</a-link>
<a-link @click="iDownload('https://k6.vicicode.cn/wsapi/download?id=' + item.id, item.title)">{{$t('global.download')}}</a-link>
<a-link @click="useFirmware('https://k6.vicicode.cn/wsapi/download?id=' + item.id + '&n=/' + item.title)">{{$t('global.use')}}</a-link>
</template>
</a-list-item>
@ -210,6 +211,18 @@
});
}
const iDownload = (url: any, name: any) => {
fetch(url).then(e=>e.blob()).then(blob=>{
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = name;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
</script>
<script lang="ts">

View file

@ -10,7 +10,10 @@
<a-radio v-for="subItem in state.disMatrix[item]" :value="subItem[0]"
:disabled="subItem[1]">{{ state.disName[item].get(subItem[0]) }}</a-radio>
</a-radio-group>
<a-button type="primary" @click="useFirmware">{{ $t('diy.generate') }}</a-button>
<div>
<a-button type="primary" @click="useFirmware">{{ $t('diy.generate') }}</a-button>&nbsp;&nbsp;
<a-link @click="iDownload">{{$t('global.download')}}</a-link>
</div>
</t-space>
</a-card>
</a-col>
@ -36,6 +39,18 @@ const useFirmware = () => {
});
}
const iDownload = () => {
fetch('https://k6.vicicode.cn/diyapi/LOSEHU' + state.flag.join('') + '.bin?v=' + (new Date()).getTime()).then(e=>e.blob()).then(blob=>{
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = "LOSEHU-CUSTOM-" + state.flag.join('') + ".bin";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
const state: {
versions: any,
flag: any,