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: "",
|
||||||
ssh_private_key_passphrase: "",
|
ssh_private_key_passphrase: "",
|
||||||
password: "",
|
password: "",
|
||||||
media_root: "",
|
|
||||||
path_prefix: "",
|
|
||||||
notes: "",
|
notes: "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -373,22 +371,9 @@ function MachineEditor({
|
|||||||
<div className="col-span-12">
|
<div className="col-span-12">
|
||||||
<SectionLabel
|
<SectionLabel
|
||||||
title="Monitoring / Files"
|
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>
|
||||||
<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 && (
|
{isLocal && (
|
||||||
<div className="col-span-12 md:col-span-6">
|
<div className="col-span-12 md:col-span-6">
|
||||||
<FormField label="Local hint">
|
<FormField label="Local hint">
|
||||||
@@ -1031,12 +1016,10 @@ export function Settings() {
|
|||||||
username: machine.username,
|
username: machine.username,
|
||||||
key_directory: "",
|
key_directory: "",
|
||||||
key_name: "",
|
key_name: "",
|
||||||
path_prefix: "",
|
|
||||||
ssh_key_id: machine.ssh_key_id,
|
ssh_key_id: machine.ssh_key_id,
|
||||||
ssh_private_key: "",
|
ssh_private_key: "",
|
||||||
ssh_private_key_passphrase: "",
|
ssh_private_key_passphrase: "",
|
||||||
password: "",
|
password: "",
|
||||||
media_root: machine.media_root,
|
|
||||||
notes: machine.notes,
|
notes: machine.notes,
|
||||||
},
|
},
|
||||||
machine,
|
machine,
|
||||||
@@ -1093,11 +1076,8 @@ export function Settings() {
|
|||||||
</FormField>
|
</FormField>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<FormField label="Media root">
|
<FormField label="Local hint">
|
||||||
<Input
|
<Input value="Uses the API host directly" disabled />
|
||||||
value={selectedMachine.media_root || "localhost"}
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
</FormField>
|
</FormField>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1117,12 +1097,10 @@ export function Settings() {
|
|||||||
username: selectedMachine.username,
|
username: selectedMachine.username,
|
||||||
key_directory: "",
|
key_directory: "",
|
||||||
key_name: "",
|
key_name: "",
|
||||||
path_prefix: "",
|
|
||||||
ssh_key_id: selectedMachine.ssh_key_id,
|
ssh_key_id: selectedMachine.ssh_key_id,
|
||||||
ssh_private_key: "",
|
ssh_private_key: "",
|
||||||
ssh_private_key_passphrase: "",
|
ssh_private_key_passphrase: "",
|
||||||
password: "",
|
password: "",
|
||||||
media_root: selectedMachine.media_root,
|
|
||||||
notes: selectedMachine.notes,
|
notes: selectedMachine.notes,
|
||||||
},
|
},
|
||||||
selectedMachine,
|
selectedMachine,
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ function machineFixture(
|
|||||||
ssh_private_key_set: false,
|
ssh_private_key_set: false,
|
||||||
ssh_private_key_passphrase_set: false,
|
ssh_private_key_passphrase_set: false,
|
||||||
password_set: false,
|
password_set: false,
|
||||||
media_root: "",
|
|
||||||
path_prefix: "",
|
|
||||||
notes: "",
|
notes: "",
|
||||||
...overrides,
|
...overrides,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ function machineFixture(
|
|||||||
ssh_private_key_set: false,
|
ssh_private_key_set: false,
|
||||||
ssh_private_key_passphrase_set: false,
|
ssh_private_key_passphrase_set: false,
|
||||||
password_set: false,
|
password_set: false,
|
||||||
media_root: "",
|
|
||||||
path_prefix: "",
|
|
||||||
notes: "",
|
notes: "",
|
||||||
...overrides,
|
...overrides,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ function localMachine(
|
|||||||
ssh_private_key_set: false,
|
ssh_private_key_set: false,
|
||||||
ssh_private_key_passphrase_set: false,
|
ssh_private_key_passphrase_set: false,
|
||||||
password_set: false,
|
password_set: false,
|
||||||
media_root: "/mnt/media",
|
|
||||||
path_prefix: "",
|
|
||||||
notes: "Primary node",
|
notes: "Primary node",
|
||||||
...overrides,
|
...overrides,
|
||||||
} as MonitoringMachine;
|
} as MonitoringMachine;
|
||||||
|
|||||||
@@ -170,8 +170,6 @@ export interface MonitoringMachine {
|
|||||||
ssh_private_key_set: boolean;
|
ssh_private_key_set: boolean;
|
||||||
ssh_private_key_passphrase_set: boolean;
|
ssh_private_key_passphrase_set: boolean;
|
||||||
password_set: boolean;
|
password_set: boolean;
|
||||||
media_root: string;
|
|
||||||
path_prefix: string;
|
|
||||||
notes: string;
|
notes: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,8 +188,6 @@ export interface MonitoringMachineInput {
|
|||||||
ssh_private_key: string;
|
ssh_private_key: string;
|
||||||
ssh_private_key_passphrase: string;
|
ssh_private_key_passphrase: string;
|
||||||
password: string;
|
password: string;
|
||||||
media_root: string;
|
|
||||||
path_prefix: string;
|
|
||||||
notes: string;
|
notes: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user