Fix skeleton sticking around on back, add new server indicator
This commit is contained in:
parent
4e093131f3
commit
d3d0c8c523
@ -43,7 +43,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else class="min-h-[20px]"></div>
|
<div v-else class="min-h-[20px]"></div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="isConfiguring"
|
||||||
|
class="flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-brand"
|
||||||
|
>
|
||||||
|
<SparklesIcon class="size-5 shrink-0" /> New server
|
||||||
|
</div>
|
||||||
<UiServersServerInfoLabels
|
<UiServersServerInfoLabels
|
||||||
|
v-else
|
||||||
:server-data="{ game, mc_version, loader, loader_version, net }"
|
:server-data="{ game, mc_version, loader, loader_version, net }"
|
||||||
:show-game-label="showGameLabel"
|
:show-game-label="showGameLabel"
|
||||||
:show-loader-label="showLoaderLabel"
|
:show-loader-label="showLoaderLabel"
|
||||||
@ -73,7 +80,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ChevronRightIcon, HammerIcon, LockIcon } from "@modrinth/assets";
|
import { ChevronRightIcon, LockIcon, SparklesIcon } from "@modrinth/assets";
|
||||||
import type { Project, Server } from "~/types/servers";
|
import type { Project, Server } from "~/types/servers";
|
||||||
|
|
||||||
const props = defineProps<Partial<Server>>();
|
const props = defineProps<Partial<Server>>();
|
||||||
@ -106,4 +113,5 @@ if (import.meta.server && projectData.value?.icon_url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const iconUrl = computed(() => projectData.value?.icon_url || undefined);
|
const iconUrl = computed(() => projectData.value?.icon_url || undefined);
|
||||||
|
const isConfiguring = computed(() => props.flows?.intro);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -102,6 +102,7 @@
|
|||||||
:mc_version="server.mc_version"
|
:mc_version="server.mc_version"
|
||||||
:upstream="server.upstream"
|
:upstream="server.upstream"
|
||||||
:net="server.net"
|
:net="server.net"
|
||||||
|
:flows="server.flows"
|
||||||
/>
|
/>
|
||||||
<LazyUiServersServerListingSkeleton v-if="isPollingForNewServers" />
|
<LazyUiServersServerListingSkeleton v-if="isPollingForNewServers" />
|
||||||
</ul>
|
</ul>
|
||||||
@ -133,6 +134,7 @@ interface ServerResponse {
|
|||||||
servers: Server[];
|
servers: Server[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const hasError = ref(false);
|
const hasError = ref(false);
|
||||||
const isPollingForNewServers = ref(false);
|
const isPollingForNewServers = ref(false);
|
||||||
@ -179,6 +181,7 @@ const checkForNewServers = async () => {
|
|||||||
if (JSON.stringify(previousServerList.value) !== JSON.stringify(serverList.value)) {
|
if (JSON.stringify(previousServerList.value) !== JSON.stringify(serverList.value)) {
|
||||||
isPollingForNewServers.value = false;
|
isPollingForNewServers.value = false;
|
||||||
clearInterval(intervalId);
|
clearInterval(intervalId);
|
||||||
|
router.replace({ query: {} });
|
||||||
} else if (refreshCount.value >= 5) {
|
} else if (refreshCount.value >= 5) {
|
||||||
isPollingForNewServers.value = false;
|
isPollingForNewServers.value = false;
|
||||||
clearInterval(intervalId);
|
clearInterval(intervalId);
|
||||||
|
|||||||
@ -104,6 +104,9 @@ export interface Server {
|
|||||||
version_id: string;
|
version_id: string;
|
||||||
};
|
};
|
||||||
motd: string;
|
motd: string;
|
||||||
|
flows: {
|
||||||
|
intro?: boolean;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Stats {
|
export interface Stats {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user