|
100 | 100 | <div |
101 | 101 | v-else-if="serverList.length === 0 && !isPollingForNewServers" |
102 | 102 | key="empty" |
103 | | - class="flex h-full flex-col items-center justify-center gap-8" |
| 103 | + class="flex h-full flex-col items-center justify-center gap-8 grow max-h-[1100px]" |
104 | 104 | > |
105 | | - <img |
106 | | - src="https://cdn.modrinth.com/servers/excitement.webp" |
107 | | - alt="" |
108 | | - class="max-w-[360px]" |
109 | | - style=" |
110 | | - mask-image: radial-gradient(97% 77% at 50% 25%, #d9d9d9 0, hsla(0, 0%, 45%, 0) 100%); |
111 | | - " |
112 | | - /> |
113 | | - <h1 class="m-0 text-contrast">You don't have any servers yet!</h1> |
114 | | - <p class="m-0">Modrinth Hosting is a new way to play modded Minecraft with your friends.</p> |
115 | | - <ButtonStyled size="large" type="standard" color="brand"> |
116 | | - <AutoLink v-if="isNuxt" to="/servers#plan">Create a server</AutoLink> |
117 | | - <button v-else :disabled="!canOpenPurchaseModal" @click="openPurchaseModal"> |
118 | | - Create a server |
119 | | - </button> |
120 | | - </ButtonStyled> |
| 105 | + <ServerListEmpty @click-new-server="openPurchaseModal" @click-sign-in="handleSignIn" /> |
121 | 106 | </div> |
122 | 107 |
|
123 | 108 | <div v-else key="list"> |
|
189 | 174 | <div v-else-if="isLoading" class="flex h-full items-center justify-center"> |
190 | 175 | <p class="text-contrast"><LoaderCircleIcon class="size-5 animate-spin" /></p> |
191 | 176 | </div> |
192 | | - <div v-else-if="searchInput">No servers found.</div> |
193 | | - <div v-else><ServerListEmpty /></div> |
| 177 | + <div v-else>No servers found.</div> |
194 | 178 | </div> |
195 | 179 | </Transition> |
196 | 180 | </div> |
@@ -440,8 +424,10 @@ watch([fetchError, serverResponse], ([error, response]) => { |
440 | 424 | }) |
441 | 425 |
|
442 | 426 | const serverList = computed<Archon.Servers.v0.Server[]>(() => { |
443 | | - if (!serverResponse.value) return [] |
444 | | - return serverResponse.value.servers |
| 427 | + return [] |
| 428 | +
|
| 429 | + // if (!serverResponse.value) return [] |
| 430 | + // return serverResponse.value.servers |
445 | 431 | }) |
446 | 432 |
|
447 | 433 | const searchInput = ref('') |
@@ -472,14 +458,12 @@ function filesExpired(server: Archon.Servers.v0.Server): boolean { |
472 | 458 | } |
473 | 459 |
|
474 | 460 | const filteredData = computed<Archon.Servers.v0.Server[]>(() => { |
475 | | - return [] |
476 | | -
|
477 | | - // const base = !searchInput.value.trim() |
478 | | - // ? introToTop(serverList.value) |
479 | | - // : fuse.value |
480 | | - // ? introToTop(fuse.value.search(searchInput.value).map((result) => result.item)) |
481 | | - // : [] |
482 | | - // return base.filter((server) => !filesExpired(server)) |
| 461 | + const base = !searchInput.value.trim() |
| 462 | + ? introToTop(serverList.value) |
| 463 | + : fuse.value |
| 464 | + ? introToTop(fuse.value.search(searchInput.value).map((result) => result.item)) |
| 465 | + : [] |
| 466 | + return base.filter((server) => !filesExpired(server)) |
483 | 467 | }) |
484 | 468 |
|
485 | 469 | // Start polling only after initial data is available so the baseline is correct |
@@ -536,6 +520,10 @@ function openPurchaseModal() { |
536 | 520 | purchaseModal.value.show('quarterly') |
537 | 521 | } |
538 | 522 |
|
| 523 | +function handleSignIn() { |
| 524 | + router.push({ name: 'login', query: { redirect: '/hosting/manage' } }) |
| 525 | +} |
| 526 | +
|
539 | 527 | const { data: subscriptions } = useQuery({ |
540 | 528 | queryKey: ['billing', 'subscriptions'], |
541 | 529 | queryFn: () => client.labrinth.billing_internal.getSubscriptions(), |
|
0 commit comments