mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-21 11:25:56 +00:00
preview: a new server goes straight on to the modular core
The install used the stable image and left the preview core for a later update, so a fresh Modules Preview server showed every module as built in and no Plugin SDK. install_new now applies the preview update right after the base install (same signed update and module build every server takes); a failure leaves the classic core and the done screen says so, and modules that did not build are listed. A hand-picked package and Docker keep the old behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6723a7eda1
commit
3866e219ce
5 files changed
+122
-9
No files matched your search
@@ -267,6 +267,12 @@ const en = {
|
||||
"install.step.unpacking": "Unpacking",
|
||||
"install.step.database": "Preparing database",
|
||||
"install.step.finishing": "Finishing",
|
||||
"install.step.modularCore": "Installing the modular core and building modules",
|
||||
"install.modularCoreHint": "This step compiles the modules on this computer and can take several minutes.",
|
||||
"install.classicCoreTitle": "The server stays on the classic core",
|
||||
"install.classicCoreText": "The server is installed and works, but the modular core did not go on, so its modules are built into the core. You can try again from Updates.",
|
||||
"install.modulesOffTitle": "Some modules were switched off",
|
||||
"install.modulesOffText": "The modular core is installed, but these modules did not build on this computer. The server works without them; they are tried again on the next update.",
|
||||
"install.doneTitle": "Your server is ready",
|
||||
"install.doneText": "Everything is installed. Start it from the next screen.",
|
||||
"install.open": "OPEN MY SERVER",
|
||||
|
||||
@@ -251,6 +251,12 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"install.step.unpacking": "Распаковка",
|
||||
"install.step.database": "Подготовка базы данных",
|
||||
"install.step.finishing": "Завершение",
|
||||
"install.step.modularCore": "Установка модульного ядра и сборка модулей",
|
||||
"install.modularCoreHint": "На этом шаге модули компилируются на вашем компьютере, это может занять несколько минут.",
|
||||
"install.classicCoreTitle": "Сервер остался на классическом ядре",
|
||||
"install.classicCoreText": "Сервер установлен и работает, но модульное ядро не встало, поэтому модули встроены в ядро. Можно повторить из раздела «Обновления».",
|
||||
"install.modulesOffTitle": "Часть модулей выключена",
|
||||
"install.modulesOffText": "Модульное ядро установлено, но эти модули не собрались на этом компьютере. Сервер работает без них; при следующем обновлении сборка повторится.",
|
||||
"install.doneTitle": "Ваш сервер готов",
|
||||
"install.doneText": "Всё установлено. Запустите сервер на следующем экране.",
|
||||
"install.open": "ОТКРЫТЬ МОЙ СЕРВЕР",
|
||||
|
||||
+1
-1
@@ -798,7 +798,7 @@ export const api = {
|
||||
accountSetAccess: (id: string, name: string, level: number) => invoke<void>("account_set_access", { id, name, level }),
|
||||
accountRename: (id: string, name: string, newName: string, password: string) => invoke<void>("account_rename", { id, name, newName, password }),
|
||||
accountDelete: (id: string, name: string) => invoke<void>("account_delete", { id, name }),
|
||||
installNew: (dest: string, pkg?: string, gameData?: string) => invoke<ServerSummary>("install_new", { dest, package: pkg ?? null, gameData: gameData ?? null }),
|
||||
installNew: (dest: string, pkg?: string, gameData?: string) => invoke<ServerSummary & { preview_core_error: string | null; modules_off: string[] }>("install_new", { dest, package: pkg ?? null, gameData: gameData ?? null }),
|
||||
cancelInstall: () => invoke<void>("cancel_install"),
|
||||
createAccount: (id: string, username: string, password: string, administrator: boolean) =>
|
||||
invoke<void>("create_account", { id, username, password, administrator }),
|
||||
|
||||
@@ -16,6 +16,7 @@ const STEP_KEYS: Record<string, Key> = {
|
||||
Unpacking: "install.step.unpacking",
|
||||
"Preparing database": "install.step.database",
|
||||
Finishing: "install.step.finishing",
|
||||
"Installing the modular core": "install.step.modularCore",
|
||||
};
|
||||
|
||||
type Phase = "choose" | "installing" | "done";
|
||||
@@ -32,6 +33,8 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void;
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
const [pkg, setPkg] = useState("");
|
||||
const [installed, setInstalled] = useState<ServerSummary | null>(null);
|
||||
const [classicCore, setClassicCore] = useState<string | null>(null);
|
||||
const [modulesOff, setModulesOff] = useState<string[]>([]);
|
||||
const [showDetails, setShowDetails] = useState(false);
|
||||
// What this computer installs. A repack (Windows) needs nothing more than a folder; Docker (Linux) also needs the game data
|
||||
// folder and a package, and Docker itself.
|
||||
@@ -87,8 +90,10 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void;
|
||||
setPhase("installing");
|
||||
setStep({ step: "Preparing your server", percent: 0, detail: null });
|
||||
try {
|
||||
const s = await api.installNew(dest, pkg.trim() || undefined, docker ? gameData.trim() : undefined);
|
||||
const { preview_core_error, modules_off, ...s } = await api.installNew(dest, pkg.trim() || undefined, docker ? gameData.trim() : undefined);
|
||||
setInstalled(s);
|
||||
setClassicCore(preview_core_error);
|
||||
setModulesOff(modules_off);
|
||||
setPhase("done");
|
||||
} catch (e) {
|
||||
setError(asUiError(e));
|
||||
@@ -112,6 +117,7 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void;
|
||||
<div className="h-full rounded-full bg-gold transition-[width] duration-300" style={{ width: `${step.percent}%` }} />
|
||||
</div>
|
||||
{step.detail && <p className="mt-2 text-xs text-muted">{step.detail}</p>}
|
||||
{step.step === "Installing the modular core" && <p className="mt-2 text-xs text-muted">{t("install.modularCoreHint")}</p>}
|
||||
</Card>
|
||||
{step.step === "Downloading server" && (
|
||||
<Button className="mt-4 self-start" variant="ghost" size="sm" onClick={() => void api.cancelInstall()}>
|
||||
@@ -130,6 +136,20 @@ export function InstallServer(props: { canCancel: boolean; onCancel: () => void;
|
||||
</div>
|
||||
<h1 className="mt-5 text-2xl font-semibold">{t("install.doneTitle")}</h1>
|
||||
<p className="mt-1 text-muted">{t("install.doneText")}</p>
|
||||
{classicCore && (
|
||||
<Card className="mt-6 border-warn/40 p-4 text-left" role="alert">
|
||||
<p className="font-medium text-warn">{t("install.classicCoreTitle")}</p>
|
||||
<p className="mt-1 text-sm text-muted">{t("install.classicCoreText")}</p>
|
||||
<pre className="selectable mt-2 max-h-32 overflow-auto whitespace-pre-wrap rounded bg-black/40 p-2 text-xs">{classicCore}</pre>
|
||||
</Card>
|
||||
)}
|
||||
{modulesOff.length > 0 && (
|
||||
<Card className="mt-6 border-warn/40 p-4 text-left" role="alert">
|
||||
<p className="font-medium text-warn">{t("install.modulesOffTitle")}</p>
|
||||
<p className="mt-1 text-sm text-muted">{t("install.modulesOffText")}</p>
|
||||
<pre className="selectable mt-2 max-h-32 overflow-auto whitespace-pre-wrap rounded bg-black/40 p-2 text-xs">{modulesOff.join("\n")}</pre>
|
||||
</Card>
|
||||
)}
|
||||
<Button className="mt-8" variant="primary" size="xl" onClick={() => void props.onDone(installed)}>
|
||||
{t("install.open")}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user