mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
Compare commits
No commits in common. "c0046975a261a53bb03255a9341ea8abec1b2ebd" and "b9d650c237e2053e0e8a43daebeb4e492cda2d6a" have entirely different histories.
c0046975a2
...
b9d650c237
6 changed files with 13 additions and 35 deletions
|
@ -1,2 +1 @@
|
||||||
VITE_API_BASE_URL= 'http://localhost:8080'
|
VITE_API_BASE_URL= 'http://localhost:8080'
|
||||||
VITE_METER_SITE = ''
|
|
|
@ -1 +0,0 @@
|
||||||
VITE_METER_SITE = 'k5.vicicode.com,k5.vicicode.cn,k5.lhw711.cn,mm.md,k5.mm.md'
|
|
13
src/App.vue
13
src/App.vue
|
@ -35,7 +35,7 @@
|
||||||
window.TextDecoder = TextDecoder;
|
window.TextDecoder = TextDecoder;
|
||||||
|
|
||||||
// 遥测
|
// 遥测
|
||||||
if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){
|
if(location.hostname == 'k5.vicicode.com' || location.hostname == 'k5.vicicode.cn' || location.hostname == 'k5.lhw711.cn' || location.hostname == 'mm.md' || location.hostname == 'k5.mm.md'){
|
||||||
const aegis = new Aegis({
|
const aegis = new Aegis({
|
||||||
id: 'yr5DeslJkz3Qn20jg0', // 上报 id
|
id: 'yr5DeslJkz3Qn20jg0', // 上报 id
|
||||||
reportApiSpeed: true, // 接口测速
|
reportApiSpeed: true, // 接口测速
|
||||||
|
@ -73,9 +73,9 @@
|
||||||
return lang;
|
return lang;
|
||||||
});
|
});
|
||||||
|
|
||||||
if(location.hostname === 'k5.vicicode.com'){
|
fetch('https://myip.ipip.net/json').then(e=>e.json()).then(e=>{
|
||||||
fetch('/cdn-cgi/trace').then(e=>e.text()).then(e=>{
|
if(e.data.location[0] == '中国' && location.hostname != 'k5.vicicode.cn'){
|
||||||
if(e.indexOf('loc=CN') !== -1){
|
if(!(localStorage.getItem('cnNotice') && parseInt(localStorage.getItem('cnNotice') ?? '') > new Date().getTime() - 604800000)){
|
||||||
DialogPlugin.confirm({
|
DialogPlugin.confirm({
|
||||||
header: '提示',
|
header: '提示',
|
||||||
body: '🚀 国内用户推荐访问国内镜像以获得极速体验~',
|
body: '🚀 国内用户推荐访问国内镜像以获得极速体验~',
|
||||||
|
@ -91,7 +91,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,7 +39,7 @@ app.use(i18n);
|
||||||
app.use(globalComponents);
|
app.use(globalComponents);
|
||||||
app.use(directive);
|
app.use(directive);
|
||||||
|
|
||||||
if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){
|
if(location.hostname == 'k5.vicicode.com' || location.hostname == 'k5.vicicode.cn' || location.hostname == 'k5.lhw711.cn' || location.hostname == 'mm.md' || location.hostname == 'k5.mm.md'){
|
||||||
app.use(VueMatomo, {
|
app.use(VueMatomo, {
|
||||||
host: '//analytics.vicicode.com',
|
host: '//analytics.vicicode.com',
|
||||||
siteId: 2,
|
siteId: 2,
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Updater {
|
||||||
this.newScript = this.parserScript(newHtml);
|
this.newScript = this.parserScript(newHtml);
|
||||||
this.compare(this.oldScript, this.newScript)
|
this.compare(this.oldScript, this.newScript)
|
||||||
//这边给的是默认值15000,也可以自定义秒数
|
//这边给的是默认值15000,也可以自定义秒数
|
||||||
}, 60000);
|
}, 15000);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,13 +35,13 @@
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label-col-style="{ width: '25%' }" field="lng" :label="$t('tool.longitude')">
|
<a-form-item :label-col-style="{ width: '25%' }" field="lng" :label="$t('tool.longitude')">
|
||||||
<a-input-number ref="lngRef" :precision="6" v-model="state.lng" />
|
<a-input-number :precision="6" v-model="state.lng" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label-col-style="{ width: '25%' }" field="lat" :label="$t('tool.latitude')">
|
<a-form-item :label-col-style="{ width: '25%' }" field="lat" :label="$t('tool.latitude')">
|
||||||
<a-input-number ref="latRef" :precision="6" v-model="state.lat" />
|
<a-input-number :precision="6" v-model="state.lat" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label-col-style="{ width: '25%' }" field="alt" :label="$t('tool.altitude')">
|
<a-form-item :label-col-style="{ width: '25%' }" field="alt" :label="$t('tool.altitude')">
|
||||||
<a-input-number ref="altRef" :precision="0" v-model="state.alt" />
|
<a-input-number :precision="0" v-model="state.alt" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label-col-style="{ width: '25%' }" label="">
|
<a-form-item :label-col-style="{ width: '25%' }" label="">
|
||||||
<a-space>
|
<a-space>
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, nextTick, onMounted, onUnmounted } from 'vue';
|
import { reactive, nextTick, onMounted, onUnmounted } from 'vue';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import { eeprom_write, eeprom_reboot, eeprom_init, hexReverseStringToUint8Array, stringToUint8Array } from '@/utils/serial.js';
|
import { eeprom_write, eeprom_reboot, eeprom_init, hexReverseStringToUint8Array, stringToUint8Array } from '@/utils/serial.js';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
@ -108,10 +108,6 @@ const { loading, setLoading } = useLoading(true);
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
const lngRef : any = ref(null)
|
|
||||||
const latRef : any = ref(null)
|
|
||||||
const altRef : any = ref(null)
|
|
||||||
|
|
||||||
const state: {
|
const state: {
|
||||||
uuid: string,
|
uuid: string,
|
||||||
qrcode: string,
|
qrcode: string,
|
||||||
|
@ -169,23 +165,8 @@ const state: {
|
||||||
onMounted(async ()=>{
|
onMounted(async ()=>{
|
||||||
const rst = await (await fetch('https://mirror.ghproxy.com/https://raw.githubusercontent.com/palewire/ham-satellite-database/main/data/amsat-active-frequencies.json')).text()
|
const rst = await (await fetch('https://mirror.ghproxy.com/https://raw.githubusercontent.com/palewire/ham-satellite-database/main/data/amsat-active-frequencies.json')).text()
|
||||||
state.freqDb = JSON.parse(rst)
|
state.freqDb = JSON.parse(rst)
|
||||||
|
|
||||||
state.lng = parseFloat(localStorage.getItem('myLng') || '0')
|
|
||||||
state.lat = parseFloat(localStorage.getItem('myLat') || '0')
|
|
||||||
state.alt = parseFloat(localStorage.getItem('myAlt') || '0')
|
|
||||||
|
|
||||||
await lngRef.value.$forceUpdate()
|
|
||||||
await latRef.value.$forceUpdate()
|
|
||||||
await altRef.value.$forceUpdate()
|
|
||||||
state.lng = parseFloat(lngRef.value.inputRef.modelValue || '0')
|
|
||||||
state.lat = parseFloat(latRef.value.inputRef.modelValue || '0')
|
|
||||||
state.alt = parseFloat(altRef.value.inputRef.modelValue || '0')
|
|
||||||
|
|
||||||
state.timer = setInterval(()=>{
|
state.timer = setInterval(()=>{
|
||||||
state.dt = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })
|
state.dt = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })
|
||||||
localStorage.setItem('myLng', state.lng.toString());
|
|
||||||
localStorage.setItem('myLat', state.lat.toString());
|
|
||||||
localStorage.setItem('myAlt', state.alt.toString());
|
|
||||||
}, 1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue