diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index cdd035ef92..44fe596f17 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -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, diff --git a/apps/app-frontend/src/pages/hosting/manage/Index.vue b/apps/app-frontend/src/pages/hosting/manage/Index.vue index 030f74a7e3..1274afbe3b 100644 --- a/apps/app-frontend/src/pages/hosting/manage/Index.vue +++ b/apps/app-frontend/src/pages/hosting/manage/Index.vue @@ -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`, }) } }, diff --git a/apps/app-frontend/src/pages/hosting/manage/World.vue b/apps/app-frontend/src/pages/hosting/manage/Instance.vue similarity index 66% rename from apps/app-frontend/src/pages/hosting/manage/World.vue rename to apps/app-frontend/src/pages/hosting/manage/Instance.vue index fe52492c50..703c5eb42c 100644 --- a/apps/app-frontend/src/pages/hosting/manage/World.vue +++ b/apps/app-frontend/src/pages/hosting/manage/Instance.vue @@ -1,5 +1,5 @@ - + @@ -7,10 +7,10 @@ - + diff --git a/apps/app-frontend/src/pages/hosting/manage/Instances.vue b/apps/app-frontend/src/pages/hosting/manage/Instances.vue new file mode 100644 index 0000000000..496583f641 --- /dev/null +++ b/apps/app-frontend/src/pages/hosting/manage/Instances.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/app-frontend/src/pages/hosting/manage/Worlds.vue b/apps/app-frontend/src/pages/hosting/manage/Worlds.vue deleted file mode 100644 index 3df6f264ee..0000000000 --- a/apps/app-frontend/src/pages/hosting/manage/Worlds.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/apps/app-frontend/src/pages/hosting/manage/index.js b/apps/app-frontend/src/pages/hosting/manage/index.js index 635f13efeb..cd94272097 100644 --- a/apps/app-frontend/src/pages/hosting/manage/index.js +++ b/apps/app-frontend/src/pages/hosting/manage/index.js @@ -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 } diff --git a/apps/app-frontend/src/providers/setup/server-install-content.ts b/apps/app-frontend/src/providers/setup/server-install-content.ts index 7b82793a85..000bafb025 100644 --- a/apps/app-frontend/src/providers/setup/server-install-content.ts +++ b/apps/app-frontend/src/providers/setup/server-install-content.ts @@ -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 } diff --git a/apps/app-frontend/src/routes.js b/apps/app-frontend/src/routes.js index 2d133f0079..025c6231f7 100644 --- a/apps/app-frontend/src/routes.js +++ b/apps/app-frontend/src/routes.js @@ -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' }], diff --git a/apps/frontend/src/composables/use-server-install-content.ts b/apps/frontend/src/composables/use-server-install-content.ts index 3c27837c9c..fc91cbb548 100644 --- a/apps/frontend/src/composables/use-server-install-content.ts +++ b/apps/frontend/src/composables/use-server-install-content.ts @@ -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 } diff --git a/apps/frontend/src/locales/en-US/index.json b/apps/frontend/src/locales/en-US/index.json index 7f8512f105..980001bf39 100644 --- a/apps/frontend/src/locales/en-US/index.json +++ b/apps/frontend/src/locales/en-US/index.json @@ -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" diff --git a/apps/frontend/src/middleware/server-world-tabs.global.ts b/apps/frontend/src/middleware/server-instance-tabs.global.ts similarity index 73% rename from apps/frontend/src/middleware/server-world-tabs.global.ts rename to apps/frontend/src/middleware/server-instance-tabs.global.ts index 2a740b7dea..761373af1f 100644 --- a/apps/frontend/src/middleware/server-world-tabs.global.ts +++ b/apps/frontend/src/middleware/server-instance-tabs.global.ts @@ -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 }) }) diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds.vue b/apps/frontend/src/pages/hosting/manage/[id]/instances.vue similarity index 100% rename from apps/frontend/src/pages/hosting/manage/[id]/worlds.vue rename to apps/frontend/src/pages/hosting/manage/[id]/instances.vue diff --git a/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id].vue b/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id].vue new file mode 100644 index 0000000000..b0f0f867b6 --- /dev/null +++ b/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id].vue @@ -0,0 +1,11 @@ + + + + + + + diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/backups.vue b/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/backups.vue similarity index 100% rename from apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/backups.vue rename to apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/backups.vue diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/files.vue b/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/files.vue similarity index 100% rename from apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/files.vue rename to apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/files.vue diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/index.vue b/apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/index.vue similarity index 100% rename from apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id]/index.vue rename to apps/frontend/src/pages/hosting/manage/[id]/instances/[instance_id]/index.vue diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds/index.vue b/apps/frontend/src/pages/hosting/manage/[id]/instances/index.vue similarity index 73% rename from apps/frontend/src/pages/hosting/manage/[id]/worlds/index.vue rename to apps/frontend/src/pages/hosting/manage/[id]/instances/index.vue index 5305138f0a..4c34cae24b 100644 --- a/apps/frontend/src/pages/hosting/manage/[id]/worlds/index.vue +++ b/apps/frontend/src/pages/hosting/manage/[id]/instances/index.vue @@ -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({ - + diff --git a/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id].vue b/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id].vue deleted file mode 100644 index 357dc14f4a..0000000000 --- a/apps/frontend/src/pages/hosting/manage/[id]/worlds/[world_id].vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/packages/ui/src/components/servers/ServerManageStats.vue b/packages/ui/src/components/servers/ServerManageStats.vue index 47247646c6..4fac584ef7 100644 --- a/packages/ui/src/components/servers/ServerManageStats.vue +++ b/packages/ui/src/components/servers/ServerManageStats.vue @@ -191,8 +191,8 @@ const metrics = computed(() => { chartOptions: null as ReturnType | null, series: null as { name: string; data: number[] }[] | null, link: worldId.value - ? `/hosting/manage/${encodeURIComponent(serverId)}/worlds/${encodeURIComponent(worldId.value)}/files` - : `/hosting/manage/${encodeURIComponent(serverId)}/worlds`, + ? `/hosting/manage/${encodeURIComponent(serverId)}/instances/${encodeURIComponent(worldId.value)}/files` + : `/hosting/manage/${encodeURIComponent(serverId)}/instances`, } if (props.loading) { diff --git a/packages/ui/src/components/servers/admonitions/ServerPanelAdmonitions.vue b/packages/ui/src/components/servers/admonitions/ServerPanelAdmonitions.vue index 749d77d615..de7e6c210d 100644 --- a/packages/ui/src/components/servers/admonitions/ServerPanelAdmonitions.vue +++ b/packages/ui/src/components/servers/admonitions/ServerPanelAdmonitions.vue @@ -59,7 +59,7 @@ const isOnFilesTab = computed(() => route.path.includes('/files')) const isOnContentTab = computed( () => route.path.includes('/content') || - (!!route.params.world_id && !isOnFilesTab.value && !route.path.includes('/backups')), + (!!route.params.instance_id && !isOnFilesTab.value && !route.path.includes('/backups')), ) const bannerCoversInstalling = computed( diff --git a/packages/ui/src/components/servers/worlds/WorldCard.vue b/packages/ui/src/components/servers/instances/InstanceCard.vue similarity index 90% rename from packages/ui/src/components/servers/worlds/WorldCard.vue rename to packages/ui/src/components/servers/instances/InstanceCard.vue index 9b202ff204..223bad2729 100644 --- a/packages/ui/src/components/servers/worlds/WorldCard.vue +++ b/packages/ui/src/components/servers/instances/InstanceCard.vue @@ -76,7 +76,7 @@ {{ world.name }} - {{ formatMessage(messages.newWorldInstance) }} + {{ formatMessage(messages.newInstance) }} @@ -85,7 +85,7 @@ - {{ formatMessage(messages.createWorld) }} + {{ formatMessage(messages.createInstance) }} @@ -172,12 +172,12 @@ - {{ formatMessage(messages.editWorld) }} + {{ formatMessage(messages.editInstance) }} @@ -203,44 +203,44 @@ import { truncatedTooltip } from '#ui/utils' import { commonMessages } from '#ui/utils/common-messages' const messages = defineMessages({ - newWorldInstance: { - id: 'servers.manage.worlds.card.empty-description', - defaultMessage: 'New world instance', + newInstance: { + id: 'servers.manage.instances.card.empty-description', + defaultMessage: 'New instance', }, - createWorld: { - id: 'servers.manage.worlds.card.create', - defaultMessage: 'Create world', + createInstance: { + id: 'servers.manage.instances.card.create', + defaultMessage: 'Create instance', }, active: { - id: 'servers.manage.worlds.card.active', + id: 'servers.manage.instances.card.active', defaultMessage: 'Active', }, none: { - id: 'servers.manage.worlds.card.none', + id: 'servers.manage.instances.card.none', defaultMessage: 'None', }, installedContent: { - id: 'servers.manage.worlds.card.installed-content', + id: 'servers.manage.instances.card.installed-content', defaultMessage: 'Installed content', }, lastActive: { - id: 'servers.manage.worlds.card.last-active', + id: 'servers.manage.instances.card.last-active', defaultMessage: 'Last active', }, created: { - id: 'servers.manage.worlds.card.created', + id: 'servers.manage.instances.card.created', defaultMessage: 'Created', }, - editWorld: { - id: 'servers.manage.worlds.card.edit', - defaultMessage: 'Edit world', + editInstance: { + id: 'servers.manage.instances.card.edit', + defaultMessage: 'Edit instance', }, - worldSettings: { - id: 'servers.manage.worlds.card.settings', - defaultMessage: 'World settings', + instanceSettings: { + id: 'servers.manage.instances.card.settings', + defaultMessage: 'Instance settings', }, notTrackedYet: { - id: 'servers.manage.worlds.card.not-tracked-yet', + id: 'servers.manage.instances.card.not-tracked-yet', defaultMessage: 'Not tracked yet', }, }) diff --git a/packages/ui/src/layouts/shared/server-settings/pages/properties.vue b/packages/ui/src/layouts/shared/server-settings/pages/properties.vue index 96653f2328..ac765d7f04 100644 --- a/packages/ui/src/layouts/shared/server-settings/pages/properties.vue +++ b/packages/ui/src/layouts/shared/server-settings/pages/properties.vue @@ -319,8 +319,8 @@ const advancedActionTooltip = computed(() => ) const filesTabLink = computed(() => worldId.value - ? `/hosting/manage/${encodeURIComponent(serverId)}/worlds/${encodeURIComponent(worldId.value)}/files?path=/&editing=server.properties` - : `/hosting/manage/${encodeURIComponent(serverId)}/worlds`, + ? `/hosting/manage/${encodeURIComponent(serverId)}/instances/${encodeURIComponent(worldId.value)}/files?path=/&editing=server.properties` + : `/hosting/manage/${encodeURIComponent(serverId)}/instances`, ) const serverSettings = injectServerSettings(null) diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/index.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/index.vue index a0432aef9f..993ecce39c 100644 --- a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/index.vue +++ b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/index.vue @@ -93,8 +93,8 @@ @@ -632,9 +632,9 @@ const messages = defineMessages({ id: 'servers.manage.nav.overview', defaultMessage: 'Overview', }, - worldsNav: { - id: 'servers.manage.nav.worlds', - defaultMessage: 'Worlds', + instancesNav: { + id: 'servers.manage.nav.instances', + defaultMessage: 'Instances', }, errorDismissingNotice: { id: 'servers.manage.notice.dismiss-error', @@ -769,14 +769,14 @@ const { data: serverFull } = useQuery({ }) const worldId = computed(() => { - const routeWorldId = getRouteParam(route.params.world_id) - if (routeWorldId) return routeWorldId + const routeInstanceId = getRouteParam(route.params.instance_id) + if (routeInstanceId) return routeInstanceId if (!serverFull.value) return null const activeWorld = serverFull.value.worlds.find((w) => w.is_active) return activeWorld?.id ?? serverFull.value.worlds[0]?.id ?? null }) -const isWorldDetailRoute = computed(() => !!getRouteParam(route.params.world_id)) +const isInstanceDetailRoute = computed(() => !!getRouteParam(route.params.instance_id)) const activeWorldName = computed(() => { if (!serverFull.value) return null const activeWorld = serverFull.value.worlds.find((world) => world.is_active) @@ -789,7 +789,7 @@ function getRouteParam(param: string | string[] | undefined): string | null { } function getWorldPath(targetWorldId: string) { - return `/hosting/manage/${encodeURIComponent(props.serverId)}/worlds/${encodeURIComponent(targetWorldId)}` + return `/hosting/manage/${encodeURIComponent(props.serverId)}/instances/${encodeURIComponent(targetWorldId)}` } const { handleWsBackupProgress, busyReasons: backupsBusy } = useServerBackupsQueue( @@ -1051,8 +1051,8 @@ const navLinks = computed(() => [ subpages: [], }, { - label: formatMessage(messages.worldsNav), - href: `/hosting/manage/${encodeURIComponent(props.serverId)}/worlds`, + label: formatMessage(messages.instancesNav), + href: `/hosting/manage/${encodeURIComponent(props.serverId)}/instances`, icon: WorldIcon, subpages: [], }, @@ -1476,7 +1476,7 @@ const copyServerDebugInfo = () => { const openInstallLog = () => { const filesPath = worldId.value ? `${getWorldPath(worldId.value)}/files` - : `/hosting/manage/${encodeURIComponent(props.serverId)}/worlds` + : `/hosting/manage/${encodeURIComponent(props.serverId)}/instances` const url = `${filesPath}?editing=${encodeURIComponent(errorLogFile.value)}` window.history.pushState({}, '', url) window.dispatchEvent(new PopStateEvent('popstate')) diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/backups.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/backups.vue similarity index 99% rename from packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/backups.vue rename to packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/backups.vue index d6381322f7..8508e37d15 100644 --- a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/backups.vue +++ b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/backups.vue @@ -386,7 +386,7 @@ const error = computed(() => { }) const refetch = () => query.refetch() -/** Until world exists we cannot fetch; `isLoading` is false while the query is disabled, which would flash empty state. */ +/** Until the instance exists we cannot fetch; `isLoading` is false while the query is disabled, which would flash empty state. */ const backupsReadyPending = computed( () => !worldId.value || (query.data.value === undefined && !query.error.value), ) diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/content.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/content.vue similarity index 100% rename from packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/content.vue rename to packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/content.vue diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/files.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/files.vue similarity index 100% rename from packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/files.vue rename to packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/files.vue diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/index.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/index.vue similarity index 87% rename from packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/index.vue rename to packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/index.vue index c94fbb892d..6878b28436 100644 --- a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/[world-id]/index.vue +++ b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/[instance-id]/index.vue @@ -2,11 +2,11 @@ - {{ formatMessage(messages.allWorlds) }} + {{ formatMessage(messages.allInstances) }} @@ -23,10 +23,10 @@ - + @@ -78,9 +78,9 @@ interface Tab { } const messages = defineMessages({ - allWorlds: { - id: 'servers.manage.world.all-worlds', - defaultMessage: 'All worlds', + allInstances: { + id: 'servers.manage.instance.all-instances', + defaultMessage: 'All instances', }, contentNav: { id: 'servers.manage.nav.content', @@ -95,16 +95,16 @@ const messages = defineMessages({ defaultMessage: 'Backups', }, worldFallbackName: { - id: 'servers.manage.world.fallback-name', - defaultMessage: 'World', + id: 'servers.manage.instance.fallback-name', + defaultMessage: 'Instance', }, lastActive: { - id: 'servers.manage.world.last-active', + id: 'servers.manage.instance.last-active', defaultMessage: 'Last active {time}', }, - worldSettings: { - id: 'servers.manage.world.settings', - defaultMessage: 'World settings', + instanceSettings: { + id: 'servers.manage.instance.settings', + defaultMessage: 'Instance settings', }, }) @@ -121,9 +121,11 @@ const { data: serverFull } = useQuery({ staleTime: 30_000, }) -const worldsPath = computed(() => `/hosting/manage/${encodeURIComponent(serverId)}/worlds`) +const instancesPath = computed(() => `/hosting/manage/${encodeURIComponent(serverId)}/instances`) const worldPath = computed(() => - worldId.value ? `${worldsPath.value}/${encodeURIComponent(worldId.value)}` : worldsPath.value, + worldId.value + ? `${instancesPath.value}/${encodeURIComponent(worldId.value)}` + : instancesPath.value, ) const currentWorld = computed(() => { @@ -193,7 +195,7 @@ watch( () => [serverFull.value, currentWorld.value, worldId.value] as const, ([full, world, id]) => { if (full && id && !world) { - router.replace(worldsPath.value) + router.replace(instancesPath.value) } }, { immediate: true }, diff --git a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/index.vue b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/index.vue similarity index 93% rename from packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/index.vue rename to packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/index.vue index 44d8f787ec..9b51bc07cb 100644 --- a/packages/ui/src/layouts/wrapped/hosting/manage/[id]/worlds/index.vue +++ b/packages/ui/src/layouts/wrapped/hosting/manage/[id]/instances/index.vue @@ -6,12 +6,12 @@ > - [ }, { icon: GlobeIcon, - title: formatMessage(messages.configureWorldTitle), - description: formatMessage(messages.configureWorldDescription), + title: formatMessage(messages.configureInstanceTitle), + description: formatMessage(messages.configureInstanceDescription), }, { icon: UsersIcon, diff --git a/packages/ui/src/layouts/wrapped/index.ts b/packages/ui/src/layouts/wrapped/index.ts index f740a010e0..87da023a93 100644 --- a/packages/ui/src/layouts/wrapped/index.ts +++ b/packages/ui/src/layouts/wrapped/index.ts @@ -2,9 +2,9 @@ export { default as ServersManageAccessPage } from './hosting/manage/[id]/access export { default as ServersManageRootLayout } from './hosting/manage/[id]/index.vue' export { default as ServerOnboardingPanelPage } from './hosting/manage/[id]/onboarding.vue' export { default as ServersManageOverviewPage } from './hosting/manage/[id]/overview.vue' -export { default as ServersManageBackupsPage } from './hosting/manage/[id]/worlds/[world-id]/backups.vue' -export { default as ServersManageContentPage } from './hosting/manage/[id]/worlds/[world-id]/content.vue' -export { default as ServersManageFilesPage } from './hosting/manage/[id]/worlds/[world-id]/files.vue' -export { default as ServersManageWorldRootLayout } from './hosting/manage/[id]/worlds/[world-id]/index.vue' -export { default as ServersManageWorldsPage } from './hosting/manage/[id]/worlds/index.vue' +export { default as ServersManageBackupsPage } from './hosting/manage/[id]/instances/[instance-id]/backups.vue' +export { default as ServersManageContentPage } from './hosting/manage/[id]/instances/[instance-id]/content.vue' +export { default as ServersManageFilesPage } from './hosting/manage/[id]/instances/[instance-id]/files.vue' +export { default as ServersManageInstanceRootLayout } from './hosting/manage/[id]/instances/[instance-id]/index.vue' +export { default as ServersManageInstancesPage } from './hosting/manage/[id]/instances/index.vue' export { default as ServersManagePageIndex } from './hosting/manage/index.vue' diff --git a/packages/ui/src/locales/en-US/index.json b/packages/ui/src/locales/en-US/index.json index 49d0279811..6f860720de 100644 --- a/packages/ui/src/locales/en-US/index.json +++ b/packages/ui/src/locales/en-US/index.json @@ -4670,8 +4670,8 @@ "servers.manage.nav.overview": { "defaultMessage": "Overview" }, - "servers.manage.nav.worlds": { - "defaultMessage": "Worlds" + "servers.manage.nav.instances": { + "defaultMessage": "Instances" }, "servers.manage.new-server-button": { "defaultMessage": "New server" @@ -4766,50 +4766,50 @@ "servers.manage.websocket.reconnecting": { "defaultMessage": "Hang on, we're reconnecting to your server." }, - "servers.manage.world.all-worlds": { - "defaultMessage": "All worlds" + "servers.manage.instance.all-instances": { + "defaultMessage": "All instances" }, - "servers.manage.world.fallback-name": { - "defaultMessage": "World" + "servers.manage.instance.fallback-name": { + "defaultMessage": "Instance" }, - "servers.manage.world.last-active": { + "servers.manage.instance.last-active": { "defaultMessage": "Last active {time}" }, - "servers.manage.world.settings": { - "defaultMessage": "World settings" + "servers.manage.instance.settings": { + "defaultMessage": "Instance settings" }, - "servers.manage.worlds.card.active": { + "servers.manage.instances.card.active": { "defaultMessage": "Active" }, - "servers.manage.worlds.card.create": { - "defaultMessage": "Create world" + "servers.manage.instances.card.create": { + "defaultMessage": "Create instance" }, - "servers.manage.worlds.card.created": { + "servers.manage.instances.card.created": { "defaultMessage": "Created" }, - "servers.manage.worlds.card.edit": { - "defaultMessage": "Edit world" + "servers.manage.instances.card.edit": { + "defaultMessage": "Edit instance" }, - "servers.manage.worlds.card.empty-description": { - "defaultMessage": "New world instance" + "servers.manage.instances.card.empty-description": { + "defaultMessage": "New instance" }, - "servers.manage.worlds.card.installed-content": { + "servers.manage.instances.card.installed-content": { "defaultMessage": "Installed content" }, - "servers.manage.worlds.card.last-active": { + "servers.manage.instances.card.last-active": { "defaultMessage": "Last active" }, - "servers.manage.worlds.card.none": { + "servers.manage.instances.card.none": { "defaultMessage": "None" }, - "servers.manage.worlds.card.not-tracked-yet": { + "servers.manage.instances.card.not-tracked-yet": { "defaultMessage": "Not tracked yet" }, - "servers.manage.worlds.card.settings": { - "defaultMessage": "World settings" + "servers.manage.instances.card.settings": { + "defaultMessage": "Instance settings" }, - "servers.manage.worlds.slot-name": { - "defaultMessage": "World #{index}" + "servers.manage.instances.slot-name": { + "defaultMessage": "Instance #{index}" }, "servers.manage.your-servers-title": { "defaultMessage": "Your servers" @@ -5042,11 +5042,11 @@ "servers.setup.onboarding.step.choose.title": { "defaultMessage": "Choose what to play" }, - "servers.setup.onboarding.step.configure-world.description": { - "defaultMessage": "Set up your world just like singleplayer. Choose your gamemode and world seed." + "servers.setup.onboarding.step.configure-instance.description": { + "defaultMessage": "Set up your instance just like singleplayer. Choose your gamemode and world seed." }, - "servers.setup.onboarding.step.configure-world.title": { - "defaultMessage": "Configure your world" + "servers.setup.onboarding.step.configure-instance.title": { + "defaultMessage": "Configure your instance" }, "servers.setup.onboarding.step.invite-friends.description": { "defaultMessage": "Share your server with friends by copying the address and letting them know which mods they'll need to join." diff --git a/packages/ui/src/stories/servers/InstanceCard.stories.ts b/packages/ui/src/stories/servers/InstanceCard.stories.ts new file mode 100644 index 0000000000..a6faee84ed --- /dev/null +++ b/packages/ui/src/stories/servers/InstanceCard.stories.ts @@ -0,0 +1,53 @@ +import type { Meta, StoryObj } from '@storybook/vue3-vite' + +import InstanceCard from '../../components/servers/instances/InstanceCard.vue' + +const meta = { + title: 'Servers/InstanceCard', + component: InstanceCard, + parameters: { + layout: 'padded', + }, + render: (args) => ({ + components: { InstanceCard }, + setup() { + return { args } + }, + template: '', + }), +} satisfies Meta + +export default meta + +type Story = StoryObj + +export const Active: Story = { + args: { + world: { + type: 'world', + id: 'demo-world', + name: 'Cobbletown', + active: true, + gameVersion: '1.20.4', + loaderLabel: 'Fabric 0.16.6', + linkedModpack: { + name: 'Cobblemon Official', + iconUrl: null, + link: null, + }, + installedContentCount: 47, + lastActiveAt: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(), + createdAt: new Date(Date.now() - 197 * 24 * 60 * 60 * 1000).toISOString(), + }, + }, +} + +export const Empty: Story = { + args: { + world: { + type: 'empty', + id: 'empty-instance-slot', + name: 'Instance #2', + }, + }, +} diff --git a/packages/ui/src/stories/servers/ServerPanelAdmonitions.stories.ts b/packages/ui/src/stories/servers/ServerPanelAdmonitions.stories.ts index d6b5c9257c..d69d939102 100644 --- a/packages/ui/src/stories/servers/ServerPanelAdmonitions.stories.ts +++ b/packages/ui/src/stories/servers/ServerPanelAdmonitions.stories.ts @@ -25,7 +25,7 @@ const meta = { setup() { const router = useRouter() onMounted(() => { - router.replace('/hosting/manage/demo-server/worlds/demo-world') + router.replace('/hosting/manage/demo-server/instances/demo-world') }) const server = ref({
- {{ formatMessage(messages.newWorldInstance) }} + {{ formatMessage(messages.newInstance) }}