- Blank custom api url
- Collapsing .pl-item without art
This commit is contained in:
Shiny Nematoda 2022-09-21 11:24:41 +00:00
parent 2b33070a8a
commit 170b4a1f27
No known key found for this signature in database
GPG key ID: 6506D50F5613A42D
7 changed files with 124 additions and 96 deletions

View file

@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { getJson } from '@/scripts/fetch.js';
import { SUPPORTED_LOCALES, useI18n } from '@/stores/misc.js';
@ -53,6 +53,22 @@ function getStoreBool(key, ele) {
ele.value = getStore(key) || true;
}
const verifyApi = computed(() =>
hypInstances.value
.map(i => i.api_url.replace('https://', '').replace('http://'))
.includes(getStore('api') || 'hyperpipeapi.onrender.com'),
),
verifyPipedApi = computed(() =>
instances.value
.map(i => i.api_url.replace('https://', ''))
.includes(getStore('pipedapi') || 'pipedapi.kavin.rocks'),
),
verifyAuthApi = computed(() =>
instances.value
.map(i => i.api_url.replace('https://', ''))
.includes(getStore('authapi') || 'pipedapi.kavin.rocks'),
);
onMounted(() => {
getStoreBool('next', next);
});
@ -143,6 +159,10 @@ onMounted(() => {
:value="i.api_url.replace('https://', '').replace('http://', '')">
{{ i.name }}
</option>
<option v-if="!verifyApi">
{{ getStore('api') || 'hyperpipeapi.onrender.com' }}
</option>
</select>
<div class="table-wrap">
@ -174,9 +194,13 @@ onMounted(() => {
<option
v-for="i in instances"
:key="i.name"
:value="i.api_url.replace('https://', '').replace('http://', '')">
:value="i.api_url.replace('https://', '')">
{{ i.name.replace('Official', 'Default') }}
</option>
<option v-if="!verifyPipedApi">
{{ getStore('pipedapi') || 'pipedapi.kavin.rocks' }}
</option>
</select>
<h3>{{ t('instances.auth') }}</h3>
@ -188,9 +212,13 @@ onMounted(() => {
<option
v-for="i in instances"
:key="i.name"
:value="i.api_url.replace('https://', '').replace('http://', '')">
:value="i.api_url.replace('https://', '')">
{{ i.name.replace('Official', 'Default') }}
</option>
<option v-if="!verifyAuthApi">
{{ getStore('authapi') || 'pipedapi.kavin.rocks' }}
</option>
</select>
<div class="table-wrap">