Add server selection on wish importer
parent
1857fee004
commit
53d305d5c8
|
@ -17,6 +17,8 @@
|
||||||
import { readSave, updateSave } from '../stores/saveManager';
|
import { readSave, updateSave } from '../stores/saveManager';
|
||||||
import { getAccountPrefix } from '../stores/account';
|
import { getAccountPrefix } from '../stores/account';
|
||||||
import { submitWishTally } from '../functions/wishTally';
|
import { submitWishTally } from '../functions/wishTally';
|
||||||
|
import Select from './Select.svelte';
|
||||||
|
import { server } from '../stores/server';
|
||||||
|
|
||||||
export let processFirstTimePopup;
|
export let processFirstTimePopup;
|
||||||
export let closeModal;
|
export let closeModal;
|
||||||
|
@ -459,8 +461,23 @@
|
||||||
updateSave(`${prefix}${path}`, data);
|
updateSave(`${prefix}${path}`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const servers = [
|
||||||
|
{ label: 'Asia/TW/HK/MO', value: 'Asia' },
|
||||||
|
{ label: 'America', value: 'America' },
|
||||||
|
{ label: 'Europe', value: 'Europe' },
|
||||||
|
];
|
||||||
|
|
||||||
|
function updateServer() {
|
||||||
|
if (selectedServer === null) return;
|
||||||
|
server.set(selectedServer.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
let selectedServer = null;
|
||||||
|
$: selectedServer, updateServer();
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
detectPlatform();
|
detectPlatform();
|
||||||
|
selectedServer = servers.find((e) => e.value === $server);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -510,7 +527,11 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<p class="mt-4">{$t('wish.import.importNotice1')}</p>
|
<div class="mt-4 md:mt-2 text-gray-400 flex flex-col md:flex-row md:items-center">
|
||||||
|
<p class="ml-4 md:ml-0">{$t('wish.import.server')}</p>
|
||||||
|
<Select className="w-48" bind:selected={selectedServer} options={servers} placeholder={$t('settings.server')} />
|
||||||
|
</div>
|
||||||
|
<p class="mt-1">{$t('wish.import.importNotice1')}</p>
|
||||||
<p class="mb-1">{$t('wish.import.importNotice2')}</p>
|
<p class="mb-1">{$t('wish.import.importNotice2')}</p>
|
||||||
<p class="text-red-300 mb-1">{$t('wish.import.importNotice3')}</p>
|
<p class="text-red-300 mb-1">{$t('wish.import.importNotice3')}</p>
|
||||||
<p class="font-semibold">{$t('wish.import.saveData')}</p>
|
<p class="font-semibold">{$t('wish.import.saveData')}</p>
|
||||||
|
@ -583,10 +604,8 @@
|
||||||
>
|
>
|
||||||
CORS</a
|
CORS</a
|
||||||
>{$t('wish.import.faqs.a4.1')}
|
>{$t('wish.import.faqs.a4.1')}
|
||||||
<a
|
<a class="text-primary hover:underline" href="https://github.com/MadeBaruna/paimon-moe-api" target="_blank"
|
||||||
class="text-primary hover:underline"
|
>{$t('wish.import.faqs.a4.2')}</a
|
||||||
href="https://github.com/MadeBaruna/paimon-moe-api"
|
|
||||||
target="_blank">{$t('wish.import.faqs.a4.2')}</a
|
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<p class="text-white font-semibold mt-4">{$t('wish.import.faqs.q5')}</p>
|
<p class="text-white font-semibold mt-4">{$t('wish.import.faqs.q5')}</p>
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
"timeout": "Connection timeout, please wait a moment and try again later",
|
"timeout": "Connection timeout, please wait a moment and try again later",
|
||||||
"invalidData": "Invalid data returned from API, try again later",
|
"invalidData": "Invalid data returned from API, try again later",
|
||||||
"success": "Import success 😀!",
|
"success": "Import success 😀!",
|
||||||
|
"server": "Select your server:",
|
||||||
"wishTallyCheck": "Submit pity for global wish tally",
|
"wishTallyCheck": "Submit pity for global wish tally",
|
||||||
"wishTally": "We are doing a global wish tally! You can submit your wish tally to participate. All pity data will be aggregated to know what is the average pity of paimon.moe users.",
|
"wishTally": "We are doing a global wish tally! You can submit your wish tally to participate. All pity data will be aggregated to know what is the average pity of paimon.moe users.",
|
||||||
"wishTallyCollected": [
|
"wishTallyCollected": [
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
"timeout": "Connection timeout, tunggu sebentar dan coba lagi nanti",
|
"timeout": "Connection timeout, tunggu sebentar dan coba lagi nanti",
|
||||||
"invalidData": "Invalid data dikembalikan dari API, coba lagi nanti",
|
"invalidData": "Invalid data dikembalikan dari API, coba lagi nanti",
|
||||||
"success": "Import berhasil 😀!",
|
"success": "Import berhasil 😀!",
|
||||||
|
"server": "Pilih server mu:",
|
||||||
"wishTallyCheck": "Submit pity untuk perhitungan pity global",
|
"wishTallyCheck": "Submit pity untuk perhitungan pity global",
|
||||||
"wishTally": "Kita sedang melakukan perhitungan pity global! Kamu bisa mensubmit pity mu untuk berpartisipasi. Semua data pity akan dikumpulkan untuk mengetahui berapa pity rata-rata pengguna paimon.moe.",
|
"wishTally": "Kita sedang melakukan perhitungan pity global! Kamu bisa mensubmit pity mu untuk berpartisipasi. Semua data pity akan dikumpulkan untuk mengetahui berapa pity rata-rata pengguna paimon.moe.",
|
||||||
"wishTallyCollected": [
|
"wishTallyCollected": [
|
||||||
|
|
Loading…
Reference in New Issue