chore: rename worlds -> instances

This commit is contained in:
Calum H. (IMB11)
2026-06-26 17:09:22 +01:00
parent f799e6f67e
commit f097409b92
33 changed files with 227 additions and 172 deletions
+6 -6
View File
@@ -496,7 +496,7 @@ const sidebarOverlayScrollbarsOptions = Object.freeze({
})
router.beforeEach(async (to) => {
const redirect = await resolveLegacyServerWorldTabRedirect(to)
const redirect = await resolveLegacyServerInstanceTabRedirect(to)
if (redirect) return redirect
})
@@ -531,7 +531,7 @@ function onSuspensePending() {
suspenseToken = loading.begin()
}
async function resolveLegacyServerWorldTabRedirect(to) {
async function resolveLegacyServerInstanceTabRedirect(to) {
if (!['ServerManageContent', 'ServerManageFiles', 'ServerManageBackups'].includes(to.name)) {
return null
}
@@ -541,14 +541,14 @@ async function resolveLegacyServerWorldTabRedirect(to) {
const tabPath =
to.name === 'ServerManageFiles' ? '/files' : to.name === 'ServerManageBackups' ? '/backups' : ''
const worldsPath = `/hosting/manage/${encodeURIComponent(serverId)}/worlds`
const instancesPath = `/hosting/manage/${encodeURIComponent(serverId)}/instances`
try {
const serverFull = await tauriApiClient.archon.servers_v1.get(serverId)
const world = serverFull.worlds.find((item) => item.is_active) ?? serverFull.worlds[0]
if (world) {
return {
path: `${worldsPath}/${encodeURIComponent(world.id)}${tabPath}`,
path: `${instancesPath}/${encodeURIComponent(world.id)}${tabPath}`,
query: to.query,
hash: to.hash,
replace: true,
@@ -556,7 +556,7 @@ async function resolveLegacyServerWorldTabRedirect(to) {
}
} catch {
return {
path: worldsPath,
path: instancesPath,
query: to.query,
hash: to.hash,
replace: true,
@@ -564,7 +564,7 @@ async function resolveLegacyServerWorldTabRedirect(to) {
}
return {
path: worldsPath,
path: instancesPath,
query: to.query,
hash: to.hash,
replace: true,
@@ -93,7 +93,7 @@ watch(
breadcrumbs.setName('Server', server.name)
breadcrumbs.setContext({
name: server.name,
link: `/hosting/manage/${serverId.value}/worlds`,
link: `/hosting/manage/${serverId.value}/instances`,
})
}
},
@@ -1,5 +1,5 @@
<template>
<ServersManageWorldRootLayout>
<ServersManageInstanceRootLayout>
<RouterView v-slot="{ Component }">
<template v-if="Component">
<Suspense>
@@ -7,10 +7,10 @@
</Suspense>
</template>
</RouterView>
</ServersManageWorldRootLayout>
</ServersManageInstanceRootLayout>
</template>
<script setup lang="ts">
import { ServersManageWorldRootLayout } from '@modrinth/ui'
import { ServersManageInstanceRootLayout } from '@modrinth/ui'
import { RouterView } from 'vue-router'
</script>
@@ -0,0 +1,7 @@
<script setup lang="ts">
import { ServersManageInstancesPage } from '@modrinth/ui'
</script>
<template>
<ServersManageInstancesPage />
</template>
@@ -1,7 +0,0 @@
<script setup lang="ts">
import { ServersManageWorldsPage } from '@modrinth/ui'
</script>
<template>
<ServersManageWorldsPage />
</template>
@@ -3,8 +3,8 @@ import Backups from './Backups.vue'
import Content from './Content.vue'
import Files from './Files.vue'
import Index from './Index.vue'
import Instance from './Instance.vue'
import Instances from './Instances.vue'
import Overview from './Overview.vue'
import World from './World.vue'
import Worlds from './Worlds.vue'
export { Access, Backups, Content, Files, Index, Overview, World, Worlds }
export { Access, Backups, Content, Files, Index, Instance, Instances, Overview }
@@ -252,7 +252,7 @@ export function createServerInstallContent(opts: {
if (serverFlowFrom.value === 'reset-server') {
return `/hosting/manage/${sid}?openSettings=installation`
}
return getServerWorldContentPath(sid, effectiveServerWorldId.value)
return getServerInstanceContentPath(sid, effectiveServerWorldId.value)
})
const serverBackLabel = computed(() => {
if (serverFlowFrom.value === 'onboarding') return 'Back to setup'
@@ -424,7 +424,7 @@ export function createServerInstallContent(opts: {
if (isInstallingQueuedServerInstalls.value) return false
if (!serverId || !worldId) {
handleError(new Error('No server world is available for install.'))
handleError(new Error('No server instance is available for install.'))
return false
}
@@ -556,7 +556,7 @@ export function createServerInstallContent(opts: {
if (serverFlowFrom.value === 'onboarding') {
await client.archon.servers_v1.endIntro(sid)
await router.push(getServerWorldContentPath(sid, wid))
await router.push(getServerInstanceContentPath(sid, wid))
return
}
@@ -571,8 +571,8 @@ export function createServerInstallContent(opts: {
serverContentProjectIds.value = new Set([...serverContentProjectIds.value, id])
}
function getServerWorldContentPath(serverId: string, worldId: string | null) {
const base = `/hosting/manage/${encodeURIComponent(serverId)}/worlds`
function getServerInstanceContentPath(serverId: string, worldId: string | null) {
const base = `/hosting/manage/${encodeURIComponent(serverId)}/instances`
return worldId ? `${base}/${encodeURIComponent(worldId)}` : base
}
+9 -9
View File
@@ -58,24 +58,24 @@ export default new createRouter({
},
},
{
path: 'worlds',
name: 'ServerManageWorlds',
component: Hosting.Worlds,
path: 'instances',
name: 'ServerManageInstances',
component: Hosting.Instances,
meta: {
breadcrumb: [{ name: '?Server' }],
},
},
{
path: 'worlds/:world_id',
name: 'ServerManageWorld',
component: Hosting.World,
path: 'instances/:instance_id',
name: 'ServerManageInstance',
component: Hosting.Instance,
meta: {
breadcrumb: [{ name: '?Server' }],
},
children: [
{
path: '',
name: 'ServerManageWorldContent',
name: 'ServerManageInstanceContent',
component: Hosting.Content,
meta: {
breadcrumb: [{ name: '?Server' }],
@@ -83,7 +83,7 @@ export default new createRouter({
},
{
path: 'files',
name: 'ServerManageWorldFiles',
name: 'ServerManageInstanceFiles',
component: Hosting.Files,
meta: {
breadcrumb: [{ name: '?Server' }],
@@ -91,7 +91,7 @@ export default new createRouter({
},
{
path: 'backups',
name: 'ServerManageWorldBackups',
name: 'ServerManageInstanceBackups',
component: Hosting.Backups,
meta: {
breadcrumb: [{ name: '?Server' }],
@@ -65,7 +65,7 @@ const messages = defineMessages({
},
noServerWorld: {
id: 'discover.install.error.no-server-world',
defaultMessage: 'No server world is available for install.',
defaultMessage: 'No server instance is available for install.',
},
backToSetup: {
id: 'discover.install.back-to-setup',
@@ -662,7 +662,7 @@ export function useServerInstallContent({
if (fromContext.value === 'onboarding') {
await client.archon.servers_v1.endIntro(currentServerId.value)
queryClient.invalidateQueries({ queryKey: ['servers', 'detail', currentServerId.value] })
navigateTo(getServerWorldContentPath(currentServerId.value, currentWorldId.value ?? null))
navigateTo(getServerInstanceContentPath(currentServerId.value, currentWorldId.value ?? null))
} else {
navigateTo(`/hosting/manage/${currentServerId.value}?openSettings=installation`)
}
@@ -678,11 +678,11 @@ export function useServerInstallContent({
if (fromContext.value === 'onboarding') return `/hosting/manage/${id}?resumeModal=setup-type`
if (fromContext.value === 'reset-server')
return `/hosting/manage/${id}?openSettings=installation`
return getServerWorldContentPath(id, currentWorldId.value)
return getServerInstanceContentPath(id, currentWorldId.value)
})
function getServerWorldContentPath(serverId: string, worldId: string | null) {
const base = `/hosting/manage/${encodeURIComponent(serverId)}/worlds`
function getServerInstanceContentPath(serverId: string, worldId: string | null) {
const base = `/hosting/manage/${encodeURIComponent(serverId)}/instances`
return worldId ? `${base}/${encodeURIComponent(worldId)}` : base
}
+3 -3
View File
@@ -1956,7 +1956,7 @@
"message": "Cancel reset"
},
"discover.install.error.no-server-world": {
"message": "No server world is available for install."
"message": "No server instance is available for install."
},
"discover.install.error.unsupported-content-type": {
"message": "This content type cannot be installed to a server from Discover."
@@ -3938,8 +3938,8 @@
"servers.manage.content.title": {
"message": "Content - {serverName} - Modrinth"
},
"servers.manage.worlds.meta.title": {
"message": "Worlds - {server} - Modrinth"
"servers.manage.instances.meta.title": {
"message": "Instances - {server} - Modrinth"
},
"servers.notice.actions": {
"message": "Actions"
@@ -6,7 +6,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
const serverId = decodeURIComponent(match[1])
const tab = match[2]
const worldsPath = `/hosting/manage/${encodeURIComponent(serverId)}/worlds`
const instancesPath = `/hosting/manage/${encodeURIComponent(serverId)}/instances`
const tabPath = tab === 'content' ? '' : `/${tab}`
const auth = await useAuth()
@@ -24,7 +24,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
if (world) {
return navigateTo(
{
path: `${worldsPath}/${encodeURIComponent(world.id)}${tabPath}`,
path: `${instancesPath}/${encodeURIComponent(world.id)}${tabPath}`,
query: to.query,
hash: to.hash,
},
@@ -32,9 +32,9 @@ export default defineNuxtRouteMiddleware(async (to) => {
)
}
} catch {
return navigateTo({ path: worldsPath, query: to.query, hash: to.hash }, { replace: true })
return navigateTo({ path: instancesPath, query: to.query, hash: to.hash }, { replace: true })
}
}
return navigateTo({ path: worldsPath, query: to.query, hash: to.hash }, { replace: true })
return navigateTo({ path: instancesPath, query: to.query, hash: to.hash }, { replace: true })
})
@@ -0,0 +1,11 @@
<script setup lang="ts">
import { ServersManageInstanceRootLayout } from '@modrinth/ui'
const route = useNativeRoute()
</script>
<template>
<ServersManageInstanceRootLayout>
<NuxtPage :route="route" />
</ServersManageInstanceRootLayout>
</template>
@@ -3,7 +3,7 @@ import {
commonMessages,
defineMessages,
injectModrinthServerContext,
ServersManageWorldsPage,
ServersManageInstancesPage,
useVIntl,
} from '@modrinth/ui'
@@ -12,8 +12,8 @@ const { formatMessage } = useVIntl()
const messages = defineMessages({
title: {
id: 'servers.manage.worlds.meta.title',
defaultMessage: 'Worlds - {server} - Modrinth',
id: 'servers.manage.instances.meta.title',
defaultMessage: 'Instances - {server} - Modrinth',
},
})
@@ -26,5 +26,5 @@ useHead({
</script>
<template>
<ServersManageWorldsPage />
<ServersManageInstancesPage />
</template>
@@ -1,11 +0,0 @@
<script setup lang="ts">
import { ServersManageWorldRootLayout } from '@modrinth/ui'
const route = useNativeRoute()
</script>
<template>
<ServersManageWorldRootLayout>
<NuxtPage :route="route" />
</ServersManageWorldRootLayout>
</template>