From 585243e7c376f7c39e57b6077a2d60b023d6ef31 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 4 Dec 2024 17:45:31 +0100 Subject: [PATCH] UI/disk: remove dreprecated disk hook --- pkgs/webview-ui/app/src/api/disk.ts | 37 ----------------------------- 1 file changed, 37 deletions(-) delete mode 100644 pkgs/webview-ui/app/src/api/disk.ts diff --git a/pkgs/webview-ui/app/src/api/disk.ts b/pkgs/webview-ui/app/src/api/disk.ts deleted file mode 100644 index 37ad908fb..000000000 --- a/pkgs/webview-ui/app/src/api/disk.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { QueryClient } from "@tanstack/query-core"; -import { get_inventory } from "./inventory"; - -export const instance_name = (machine_name: string) => - `${machine_name}-single-disk` as const; - -export async function set_single_disk_id( - client: QueryClient, - base_path: string, - machine_name: string, - disk_id: string, -) { - const r = await get_inventory(client, base_path); - if (r.status === "error") { - return r; - } - if (!r.data.services) { - return new Error("No services found in inventory"); - } - const inventory = r.data; - inventory.services = inventory.services || {}; - inventory.services["single-disk"] = inventory.services["single-disk"] || {}; - - inventory.services["single-disk"][instance_name(machine_name)] = { - meta: { - name: instance_name(machine_name), - }, - roles: { - default: { - machines: [machine_name], - config: { - device: `/dev/disk/by-id/${disk_id}`, - }, - }, - }, - }; -}