Unverified Commit 0a36b3fd authored by Lemon-miaow's avatar Lemon-miaow
Browse files

feat(panel): add the server files page for the world-volume repair lever

The backend could list/read/write a stopped server's world volume since the
file-editor slice, but the panel had no entry, so the one repair path for a
server that will not boot (a wrong line in server.properties) was API-only.
New /servers/:name/files page: breadcrumb browser, editor dialog with the
base64 []byte codec, binary files open read-only, the stopped gate is owned
up front (with a stop action) instead of letting every call 409, and a
doorway card on the console. i18n files namespace + wire-shape tests.
parent 72c4aa38
Loading
Loading
Loading
Loading
+2 −0
Changes for panel/src/App.tsx: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import { ServersPage } from "@/pages/servers/ServersPage";
import { ServerConsole } from "@/pages/ServerConsole";
import { ServerPlayers } from "@/pages/ServerPlayers";
import { ServerBackups } from "@/pages/ServerBackups";
import { ServerFiles } from "@/pages/ServerFiles";
import { ServerLuckPerms } from "@/pages/ServerLuckPerms";
import { Account } from "@/pages/Account";
import { ImageAdmin } from "@/pages/admin/ImageAdmin";
@@ -54,6 +55,7 @@ export default function App() {
              <Route path="servers/:name" element={<ServerConsole />} />
              <Route path="servers/:name/players" element={<ServerPlayers />} />
              <Route path="servers/:name/backups" element={<ServerBackups />} />
              <Route path="servers/:name/files" element={<ServerFiles />} />
              <Route path="servers/:name/luckperms" element={<ServerLuckPerms />} />
              <Route path="submissions" element={<MySubmissionsPage />} />
              <Route path="account" element={<Account />} />
+4 −0
Changes for panel/src/i18n/index.ts: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import enErrors from "./resources/en-US/errors.json";
import enNavigation from "./resources/en-US/navigation.json";
import enBackups from "./resources/en-US/backups.json";
import enSubmissions from "./resources/en-US/submissions.json";
import enFiles from "./resources/en-US/files.json";
import zhCommon from "./resources/zh-CN/common.json";
import zhAuth from "./resources/zh-CN/auth.json";
import zhDashboard from "./resources/zh-CN/dashboard.json";
@@ -23,6 +24,7 @@ import zhErrors from "./resources/zh-CN/errors.json";
import zhNavigation from "./resources/zh-CN/navigation.json";
import zhBackups from "./resources/zh-CN/backups.json";
import zhSubmissions from "./resources/zh-CN/submissions.json";
import zhFiles from "./resources/zh-CN/files.json";

i18next
  .use(LanguageDetector)
@@ -41,6 +43,7 @@ i18next
        navigation: enNavigation,
        backups: enBackups,
        submissions: enSubmissions,
        files: enFiles,
      },
      "zh-CN": {
        common: zhCommon,
@@ -54,6 +57,7 @@ i18next
        navigation: zhNavigation,
        backups: zhBackups,
        submissions: zhSubmissions,
        files: zhFiles,
      },
    },
    fallbackLng: "en-US",
+23 −0
Changes for panel/src/i18n/resources/en-US/files.json: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "title": "Server Files",
  "back_to_console": "Back to console",
  "root": "World root",
  "up": "Up",
  "refresh": "Refresh",
  "col_name": "Name",
  "col_size": "Size",
  "col_modified": "Modified",
  "empty_dir_title": "This folder is empty",
  "empty_dir_hint": "Nothing has been written here yet.",
  "list_truncated": "The listing was truncated at the server's safety limit.",
  "stopped_required_title": "The server is running",
  "stopped_required_body": "Files can only be browsed or edited while the server is fully stopped — the world volume is single-attached to the running server. Stop it to continue.",
  "stop_server": "Stop server",
  "not_yours_title": "Not your server",
  "not_yours_body": "Only the owner or an admin can edit this server's files.",
  "binary_hint": "Binary file — opened read-only; saving non-text bytes through an editor could corrupt it.",
  "saved": "Saved {{path}}",
  "saving": "Saving…",
  "save": "Save",
  "too_large": "Exceeds the {{limit}} editor limit."
}
+2 −0
Changes for panel/src/i18n/resources/en-US/servers.json: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
  "luckperms_link_desc": "Manage player groups and fine-grained permission nodes.",
  "backups_link_title": "Backups & restore",
  "backups_link_desc": "View and restore world backups for this server.",
  "files_link_title": "Server files",
  "files_link_desc": "Browse and repair files in the world volume.",
  "players_back_to_console": "Back to console",
  "players_not_yours_title": "Not your server",
  "players_not_yours_body": "Only the owner or an admin can manage this server's players.",
+23 −0
Changes for panel/src/i18n/resources/zh-CN/files.json: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "title": "服务器文件",
  "back_to_console": "返回控制台",
  "root": "世界根目录",
  "up": "上级目录",
  "refresh": "刷新",
  "col_name": "名称",
  "col_size": "大小",
  "col_modified": "修改时间",
  "empty_dir_title": "此目录为空",
  "empty_dir_hint": "这里还没有写入任何内容。",
  "list_truncated": "列表已按服务器安全上限截断。",
  "stopped_required_title": "服务器正在运行",
  "stopped_required_body": "只有在服务器完全停止后才能浏览或编辑文件——世界卷被运行中的服务器独占挂载。请先停止服务器。",
  "stop_server": "停止服务器",
  "not_yours_title": "这不是你的服务器",
  "not_yours_body": "只有服务器所有者或管理员才能编辑其文件。",
  "binary_hint": "二进制文件——以只读方式打开;通过编辑器保存非文本字节可能损坏该文件。",
  "saved": "已保存 {{path}}",
  "saving": "保存中…",
  "save": "保存",
  "too_large": "超出编辑器 {{limit}} 上限。"
}
Loading