Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 7e9b84b

Browse files
thewander02ChecksumDev
authored andcommitted
chore: finalize pre-remote switch
yes this key is long since changed.
1 parent 17322ea commit 7e9b84b

23 files changed

+377
-307
lines changed

Diff for: apps/app-frontend/src/components/ui/servers/LoaderIcon.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@
169169
</template>
170170

171171
<script setup lang="ts">
172-
import { LoaderIcon } from "@modrinth/assets";
172+
import { LoaderIcon } from '@modrinth/assets'
173173
174174
defineProps({
175175
loader: {
176176
type: String,
177-
default: "",
177+
default: '',
178178
},
179-
});
179+
})
180180
</script>

Diff for: apps/app-frontend/src/components/ui/servers/PoweredByPyro.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
</template>
77

88
<script setup lang="ts">
9-
import { PyroIcon } from "@modrinth/assets";
9+
import { PyroIcon } from '@modrinth/assets'
1010
</script>

Diff for: apps/app-frontend/src/components/ui/servers/PyroLoading.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
</template>
1212

1313
<script setup lang="ts">
14-
import { ref, onMounted } from "vue";
15-
import { PyroIcon } from "@modrinth/assets";
14+
import { ref, onMounted } from 'vue'
15+
import { PyroIcon } from '@modrinth/assets'
1616
17-
const showLoading = ref(false);
17+
const showLoading = ref(false)
1818
1919
onMounted(() => {
2020
setTimeout(() => {
21-
showLoading.value = true;
22-
}, 5000);
23-
});
21+
showLoading.value = true
22+
}, 5000)
23+
})
2424
</script>
2525

2626
<style>

Diff for: apps/app-frontend/src/components/ui/servers/ServerInstallStatusPill.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
</template>
3636

3737
<script setup lang="ts">
38-
import { XIcon } from "@modrinth/assets";
38+
import { XIcon } from '@modrinth/assets'
3939
40-
export type StatusState = "Installing" | "Failed";
40+
export type StatusState = 'Installing' | 'Failed'
4141
4242
defineProps<{
43-
state: StatusState;
44-
}>();
43+
state: StatusState
44+
}>()
4545
</script>

Diff for: apps/app-frontend/src/store/websocket.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ export const useWebSocketStore = defineStore('webSocket', () => {
183183
}
184184
}
185185

186-
async function sendPowerAction(auth: SessionToken, serverId: string, action: 'restart' | 'start' | 'stop' | 'kill') {
186+
async function sendPowerAction(
187+
auth: SessionToken,
188+
serverId: string,
189+
action: 'restart' | 'start' | 'stop' | 'kill',
190+
) {
187191
const connection = getOrCreateConnection(serverId)
188192
const actionName = action.charAt(0).toUpperCase() + action.slice(1)
189193
console.log(`${actionName}ing server ${serverId}`)

Diff for: apps/app-frontend/src/types/servers.ts

+103-103
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,145 @@
11
export interface Mod {
2-
id: string;
3-
filename: string;
2+
id: string
3+
filename: string
44
modrinth_ids: {
5-
project_id: string;
6-
version_id: string;
7-
};
5+
project_id: string
6+
version_id: string
7+
}
88
}
99

1010
interface License {
11-
id: string;
12-
name: string;
13-
url: string;
11+
id: string
12+
name: string
13+
url: string
1414
}
1515

1616
interface DonationUrl {
17-
id: string;
18-
platform: string;
19-
url: string;
17+
id: string
18+
platform: string
19+
url: string
2020
}
2121

2222
interface GalleryItem {
23-
url: string;
24-
featured: boolean;
25-
title: string;
26-
description: string;
27-
created: string;
28-
ordering: number;
23+
url: string
24+
featured: boolean
25+
title: string
26+
description: string
27+
created: string
28+
ordering: number
2929
}
3030

3131
export interface Project {
32-
slug: string;
33-
title: string;
34-
description: string;
35-
categories: string[];
36-
client_side: "required" | "optional";
37-
server_side: "required" | "optional";
38-
body: string;
39-
status: "approved" | "pending" | "rejected";
40-
requested_status: "approved" | "pending" | "rejected";
41-
additional_categories: string[];
42-
issues_url: string;
43-
source_url: string;
44-
wiki_url: string;
45-
discord_url: string;
46-
donation_urls: DonationUrl[];
47-
project_type: "mod" | "resourcepack" | "map" | "plugin";
48-
downloads: number;
49-
icon_url: string;
50-
color: number;
51-
thread_id: string;
52-
monetization_status: "monetized" | "non-monetized";
53-
id: string;
54-
team: string;
55-
body_url: string | null;
56-
moderator_message: string | null;
57-
published: string;
58-
updated: string;
59-
approved: string;
60-
queued: string;
61-
followers: number;
62-
license: License;
63-
versions: string[];
64-
game_versions: string[];
65-
loaders: string[];
66-
gallery: GalleryItem[];
32+
slug: string
33+
title: string
34+
description: string
35+
categories: string[]
36+
client_side: 'required' | 'optional'
37+
server_side: 'required' | 'optional'
38+
body: string
39+
status: 'approved' | 'pending' | 'rejected'
40+
requested_status: 'approved' | 'pending' | 'rejected'
41+
additional_categories: string[]
42+
issues_url: string
43+
source_url: string
44+
wiki_url: string
45+
discord_url: string
46+
donation_urls: DonationUrl[]
47+
project_type: 'mod' | 'resourcepack' | 'map' | 'plugin'
48+
downloads: number
49+
icon_url: string
50+
color: number
51+
thread_id: string
52+
monetization_status: 'monetized' | 'non-monetized'
53+
id: string
54+
team: string
55+
body_url: string | null
56+
moderator_message: string | null
57+
published: string
58+
updated: string
59+
approved: string
60+
queued: string
61+
followers: number
62+
license: License
63+
versions: string[]
64+
game_versions: string[]
65+
loaders: string[]
66+
gallery: GalleryItem[]
6767
}
6868

6969
export interface Version extends Project {
70-
project_id: string;
70+
project_id: string
7171
}
7272

7373
export interface ServerBackup {
74-
id: string;
75-
name: string;
76-
created_at: string;
74+
id: string
75+
name: string
76+
created_at: string
7777
}
7878

7979
export interface Server {
80-
server_id: string;
81-
name: string;
82-
state: string;
80+
server_id: string
81+
name: string
82+
state: string
8383
net: {
84-
ip: string;
85-
port: number;
86-
domain: string;
87-
};
88-
modpack: string | null;
89-
modpack_id: string | null;
90-
project: Project | null;
91-
backups: ServerBackup[];
92-
game: string;
93-
loader: string | null;
94-
loader_version: string | null;
95-
mc_version: string | null;
96-
mods: Mod[];
97-
backup_quota: number;
98-
used_backup_quota: number;
84+
ip: string
85+
port: number
86+
domain: string
87+
}
88+
modpack: string | null
89+
modpack_id: string | null
90+
project: Project | null
91+
backups: ServerBackup[]
92+
game: string
93+
loader: string | null
94+
loader_version: string | null
95+
mc_version: string | null
96+
mods: Mod[]
97+
backup_quota: number
98+
used_backup_quota: number
9999
}
100100

101101
export interface WSAuth {
102-
url: string;
103-
token: string;
102+
url: string
103+
token: string
104104
}
105105

106-
export type ServerState = "running" | "stopped" | "crashed";
106+
export type ServerState = 'running' | 'stopped' | 'crashed'
107107
export type WebsocketEventType =
108-
| "log"
109-
| "auth"
110-
| "stats"
111-
| "power-state"
112-
| "auth-expiring"
113-
| "auth-incorrect"
114-
| (string & {});
108+
| 'log'
109+
| 'auth'
110+
| 'stats'
111+
| 'power-state'
112+
| 'auth-expiring'
113+
| 'auth-incorrect'
114+
| (string & {})
115115

116116
export interface WSEvent {
117-
event: WebsocketEventType;
118-
message: string;
119-
state: ServerState;
117+
event: WebsocketEventType
118+
message: string
119+
state: ServerState
120120
}
121121

122122
export interface Servers {
123-
servers: Server[];
123+
servers: Server[]
124124
}
125125

126126
export interface Stats {
127127
current: {
128-
cpu_percent: number;
129-
ram_usage_bytes: number;
130-
ram_total_bytes: number;
131-
storage_usage_bytes: number;
132-
storage_total_bytes: number;
133-
};
128+
cpu_percent: number
129+
ram_usage_bytes: number
130+
ram_total_bytes: number
131+
storage_usage_bytes: number
132+
storage_total_bytes: number
133+
}
134134
past: {
135-
cpu_percent: number;
136-
ram_usage_bytes: number;
137-
ram_total_bytes: number;
138-
storage_usage_bytes: number;
139-
storage_total_bytes: number;
140-
};
135+
cpu_percent: number
136+
ram_usage_bytes: number
137+
ram_total_bytes: number
138+
storage_usage_bytes: number
139+
storage_total_bytes: number
140+
}
141141
graph: {
142-
cpu: number[];
143-
ram: number[];
144-
};
142+
cpu: number[]
143+
ram: number[]
144+
}
145145
}

Diff for: apps/frontend/nuxt.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,12 @@ export default defineNuxtConfig({
324324
rateLimitKey: process.env.RATE_LIMIT_IGNORE_KEY ?? globalThis.RATE_LIMIT_IGNORE_KEY,
325325
pyroBaseUrl: process.env.PYRO_BASE_URL,
326326
prodOverride: process.env.PROD_OVERRIDE,
327+
masterKey: process.env.PYRO_MASTER_KEY,
327328
public: {
328329
apiBaseUrl: getApiUrl(),
329330
pyroBaseUrl: process.env.PYRO_BASE_URL,
330331
prodOverride: process.env.PROD_OVERRIDE,
332+
masterKey: process.env.PYRO_MASTER_KEY,
331333
siteUrl: getDomain(),
332334
production: isProduction(),
333335
featureFlagOverrides: getFeatureFlagOverrides(),

Diff for: apps/frontend/src/components/ui/servers/ServerGameLabel.vue

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<template>
22
<div v-if="game" class="flex flex-row items-center gap-2">
33
<GameIcon aria-hidden="true" class="size-5 text-secondary" />
4-
<span class="text-sm font-semibold">
4+
<NuxtLink
5+
:to="serverId ? `/servers/manage/${serverId}/options/loader` : ''"
6+
class="text-sm font-semibold"
7+
:class="serverId ? 'hover:underline' : ''"
8+
>
59
{{ game[0].toUpperCase() + game.slice(1) }} {{ mcVersion }}
6-
</span>
10+
</NuxtLink>
711
</div>
812
</template>
913

@@ -14,4 +18,7 @@ defineProps<{
1418
game: string;
1519
mcVersion: string;
1620
}>();
21+
22+
const route = useNativeRoute();
23+
const serverId = route.params.id as string;
1724
</script>

Diff for: apps/frontend/src/components/ui/servers/ServerListing.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@
5656
:loader="loader!"
5757
:loader-version="loader_version ?? ''"
5858
/>
59-
<UiServersServerModLabel v-if="showModLabel" :mods="mods || []" />
59+
<UiServersServerSubdomainLabel
60+
v-if="showSubdomainLabel"
61+
:subdomain="props.net?.domain ?? ''"
62+
/>
6063
</div>
6164
</div>
6265
</NuxtLink>
6366
</template>
6467

6568
<script setup lang="ts">
66-
import { computed, ref } from "vue";
6769
import { ChevronRightIcon } from "@modrinth/assets";
6870
import type { StatusState } from "./ServerInstallStatusPill.vue";
6971
import type { Project, Server } from "~/types/servers";
@@ -81,7 +83,7 @@ const status = computed(() => ({
8183
8284
const showGameLabel = computed(() => !!props.game);
8385
const showLoaderLabel = computed(() => !!props.loader);
84-
const showModLabel = computed(() => (props.mods?.length ?? 0) > 0);
86+
const showSubdomainLabel = computed(() => !!props.net?.domain);
8587
8688
const { data: projectData } = await useLazyAsyncData<Project>(
8789
`server-project-${props.server_id}`,

0 commit comments

Comments
 (0)