refactor(settings): remove dead machine path fields from frontend
Slice 2 of jellyfin-service-registry. Removes the machine-level media_root/path_prefix fields from the frontend now that the backend no longer stores them. - types/index.ts: dropped media_root/path_prefix from MonitoringMachine and MonitoringMachineInput. - pages/Settings.tsx: removed the media_root form input, the read-only "Media root" detail (replaced with a local-hint field mirroring the editor), and media_root/path_prefix from emptyMachine() and both edit-handler reset mappings; updated the section description. - tests: removed media_root/path_prefix from Settings/Media/FileBrowser test fixtures. npm run build (tsc -b + vite) clean; 0 lint errors; 72 tests pass.
This commit is contained in:
@@ -122,8 +122,6 @@ function emptyMachine(
|
||||
ssh_private_key: "",
|
||||
ssh_private_key_passphrase: "",
|
||||
password: "",
|
||||
media_root: "",
|
||||
path_prefix: "",
|
||||
notes: "",
|
||||
};
|
||||
}
|
||||
@@ -373,22 +371,9 @@ function MachineEditor({
|
||||
<div className="col-span-12">
|
||||
<SectionLabel
|
||||
title="Monitoring / Files"
|
||||
description="Media root and path mapping used by monitoring and browsing. Saving a monitoring machine also starts its collector automatically."
|
||||
description="Enable monitoring and file browsing for this machine."
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 md:col-span-6">
|
||||
<FormField label="Media root">
|
||||
<Input
|
||||
value={draft.media_root}
|
||||
onChange={(e) =>
|
||||
setDraft((current) => ({
|
||||
...current,
|
||||
media_root: e.target.value,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormField>
|
||||
</div>
|
||||
{isLocal && (
|
||||
<div className="col-span-12 md:col-span-6">
|
||||
<FormField label="Local hint">
|
||||
@@ -1031,12 +1016,10 @@ export function Settings() {
|
||||
username: machine.username,
|
||||
key_directory: "",
|
||||
key_name: "",
|
||||
path_prefix: "",
|
||||
ssh_key_id: machine.ssh_key_id,
|
||||
ssh_private_key: "",
|
||||
ssh_private_key_passphrase: "",
|
||||
password: "",
|
||||
media_root: machine.media_root,
|
||||
notes: machine.notes,
|
||||
},
|
||||
machine,
|
||||
@@ -1093,11 +1076,8 @@ export function Settings() {
|
||||
</FormField>
|
||||
</>
|
||||
) : (
|
||||
<FormField label="Media root">
|
||||
<Input
|
||||
value={selectedMachine.media_root || "localhost"}
|
||||
disabled
|
||||
/>
|
||||
<FormField label="Local hint">
|
||||
<Input value="Uses the API host directly" disabled />
|
||||
</FormField>
|
||||
)}
|
||||
</div>
|
||||
@@ -1117,12 +1097,10 @@ export function Settings() {
|
||||
username: selectedMachine.username,
|
||||
key_directory: "",
|
||||
key_name: "",
|
||||
path_prefix: "",
|
||||
ssh_key_id: selectedMachine.ssh_key_id,
|
||||
ssh_private_key: "",
|
||||
ssh_private_key_passphrase: "",
|
||||
password: "",
|
||||
media_root: selectedMachine.media_root,
|
||||
notes: selectedMachine.notes,
|
||||
},
|
||||
selectedMachine,
|
||||
|
||||
@@ -28,8 +28,6 @@ function machineFixture(
|
||||
ssh_private_key_set: false,
|
||||
ssh_private_key_passphrase_set: false,
|
||||
password_set: false,
|
||||
media_root: "",
|
||||
path_prefix: "",
|
||||
notes: "",
|
||||
...overrides,
|
||||
};
|
||||
|
||||
@@ -32,8 +32,6 @@ function machineFixture(
|
||||
ssh_private_key_set: false,
|
||||
ssh_private_key_passphrase_set: false,
|
||||
password_set: false,
|
||||
media_root: "",
|
||||
path_prefix: "",
|
||||
notes: "",
|
||||
...overrides,
|
||||
};
|
||||
|
||||
@@ -51,8 +51,6 @@ function localMachine(
|
||||
ssh_private_key_set: false,
|
||||
ssh_private_key_passphrase_set: false,
|
||||
password_set: false,
|
||||
media_root: "/mnt/media",
|
||||
path_prefix: "",
|
||||
notes: "Primary node",
|
||||
...overrides,
|
||||
} as MonitoringMachine;
|
||||
|
||||
@@ -170,8 +170,6 @@ export interface MonitoringMachine {
|
||||
ssh_private_key_set: boolean;
|
||||
ssh_private_key_passphrase_set: boolean;
|
||||
password_set: boolean;
|
||||
media_root: string;
|
||||
path_prefix: string;
|
||||
notes: string;
|
||||
}
|
||||
|
||||
@@ -190,8 +188,6 @@ export interface MonitoringMachineInput {
|
||||
ssh_private_key: string;
|
||||
ssh_private_key_passphrase: string;
|
||||
password: string;
|
||||
media_root: string;
|
||||
path_prefix: string;
|
||||
notes: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user