Compare commits

...

4 commits

Author SHA1 Message Date
c0046975a2 update 2024-07-28 20:07:00 +08:00
d288a54108 update 2024-07-28 20:06:52 +08:00
9ba81c36cb update 2024-07-28 18:53:42 +08:00
966b76b829 update 2024-07-28 18:45:25 +08:00
6 changed files with 35 additions and 13 deletions

View file

@ -1 +1,2 @@
VITE_API_BASE_URL= 'http://localhost:8080' VITE_API_BASE_URL= 'http://localhost:8080'
VITE_METER_SITE = ''

View file

@ -0,0 +1 @@
VITE_METER_SITE = 'k5.vicicode.com,k5.vicicode.cn,k5.lhw711.cn,mm.md,k5.mm.md'

View file

@ -35,7 +35,7 @@
window.TextDecoder = TextDecoder; window.TextDecoder = TextDecoder;
// //
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'){ if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){
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;
}); });
fetch('https://myip.ipip.net/json').then(e=>e.json()).then(e=>{ if(location.hostname === 'k5.vicicode.com'){
if(e.data.location[0] == '中国' && location.hostname != 'k5.vicicode.cn'){ fetch('/cdn-cgi/trace').then(e=>e.text()).then(e=>{
if(!(localStorage.getItem('cnNotice') && parseInt(localStorage.getItem('cnNotice') ?? '') > new Date().getTime() - 604800000)){ if(e.indexOf('loc=CN') !== -1){
DialogPlugin.confirm({ DialogPlugin.confirm({
header: '提示', header: '提示',
body: '🚀 国内用户推荐访问国内镜像以获得极速体验~', body: '🚀 国内用户推荐访问国内镜像以获得极速体验~',
@ -91,6 +91,7 @@
} }
}) })
} }
} })
}) }
</script> </script>

View file

@ -39,7 +39,7 @@ app.use(i18n);
app.use(globalComponents); app.use(globalComponents);
app.use(directive); app.use(directive);
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'){ if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){
app.use(VueMatomo, { app.use(VueMatomo, {
host: '//analytics.vicicode.com', host: '//analytics.vicicode.com',
siteId: 2, siteId: 2,

View file

@ -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,也可以自定义秒数
}, 15000); }, 60000);
}; };
} }

View file

@ -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 :precision="6" v-model="state.lng" /> <a-input-number ref="lngRef" :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 :precision="6" v-model="state.lat" /> <a-input-number ref="latRef" :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 :precision="0" v-model="state.alt" /> <a-input-number ref="altRef" :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 { reactive, nextTick, onMounted, onUnmounted } from 'vue'; import { ref, 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,6 +108,10 @@ 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,
@ -165,8 +169,23 @@ 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)
}) })