diff --git a/pkg/storaged/legacy-vdo/legacy-vdo.jsx b/pkg/storaged/legacy-vdo/legacy-vdo.jsx index 546c43466aa..7da4f6a62d4 100644 --- a/pkg/storaged/legacy-vdo/legacy-vdo.jsx +++ b/pkg/storaged/legacy-vdo/legacy-vdo.jsx @@ -25,7 +25,7 @@ import { Alert } from "@patternfly/react-core/dist/esm/components/Alert/index.js import { Card, CardBody } from '@patternfly/react-core/dist/esm/components/Card/index.js'; import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js"; -import { block_short_name, get_active_usage, teardown_active_usage, fmt_size, decode_filename, reload_systemd } from "../utils.js"; +import { block_name, get_active_usage, teardown_active_usage, fmt_size, decode_filename, reload_systemd } from "../utils.js"; import { dialog_open, SizeSlider, BlockingMessage, TeardownMessage, init_teardown_usage } from "../dialog.jsx"; @@ -140,7 +140,7 @@ export function make_legacy_vdo_page(parent, vdo, backing_block, next_card) { title: cockpit.format(_("VDO device $0"), vdo.name), next: next_card, page_location: ["vdo", vdo.name], - page_name: block_short_name(backing_block), + page_name: block_name(backing_block), page_size: vdo.logical_size, job_path: backing_block.path, component: VDODetails, diff --git a/pkg/storaged/mdraid/mdraid-disk.jsx b/pkg/storaged/mdraid/mdraid-disk.jsx index 803bdd17192..542f9225644 100644 --- a/pkg/storaged/mdraid/mdraid-disk.jsx +++ b/pkg/storaged/mdraid/mdraid-disk.jsx @@ -26,7 +26,7 @@ import { CardBody } from "@patternfly/react-core/dist/esm/components/Card/index. import { DescriptionList } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js"; import { StorageCard, StorageDescription, new_card, register_crossref } from "../pages.jsx"; -import { block_short_name, fmt_size, mdraid_name } from "../utils.js"; +import { block_name, fmt_size, mdraid_name } from "../utils.js"; const _ = cockpit.gettext; @@ -37,7 +37,7 @@ export function make_mdraid_disk_card(next, backing_block, content_block) { const disk_card = new_card({ title: _("MDRAID disk"), next, - location: mdraid_block ? block_short_name(mdraid_block) : (mdraid ? mdraid_name(mdraid) : null), + location: mdraid_block ? block_name(mdraid_block) : (mdraid ? mdraid_name(mdraid) : null), component: MDRaidDiskCard, props: { backing_block, content_block, mdraid } }); diff --git a/pkg/storaged/mdraid/mdraid.jsx b/pkg/storaged/mdraid/mdraid.jsx index a64780853cc..ed353eb3586 100644 --- a/pkg/storaged/mdraid/mdraid.jsx +++ b/pkg/storaged/mdraid/mdraid.jsx @@ -34,7 +34,7 @@ import { } from "../pages.jsx"; import { make_block_page } from "../block/create-pages.jsx"; import { - block_short_name, mdraid_name, encode_filename, decode_filename, + block_name, mdraid_name, encode_filename, decode_filename, fmt_size, fmt_size_long, get_active_usage, teardown_active_usage, get_available_spaces, prepare_available_spaces, reload_systemd, should_ignore, @@ -203,7 +203,7 @@ export function make_mdraid_page(parent, mdraid) { title: _("MDRAID device"), next: null, page_location: ["mdraid", mdraid.UUID], - page_name: block ? block_short_name(block) : mdraid_name(mdraid), + page_name: block ? block_name(block) : mdraid_name(mdraid), page_icon: VolumeIcon, page_category: PAGE_CATEGORY_VIRTUAL, page_size: mdraid.Size, diff --git a/pkg/storaged/pages.jsx b/pkg/storaged/pages.jsx index 4eb782971f5..102a921a098 100644 --- a/pkg/storaged/pages.jsx +++ b/pkg/storaged/pages.jsx @@ -38,7 +38,7 @@ import { Spinner } from "@patternfly/react-core/dist/esm/components/Spinner/inde import { DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js"; import { Flex, FlexItem } from "@patternfly/react-core/dist/esm/layouts/Flex/index.js"; -import { decode_filename, block_short_name, fmt_size } from "./utils.js"; +import { decode_filename, block_name, fmt_size } from "./utils.js"; import { StorageButton, StorageBarMenu, StorageMenuItem, StorageSize } from "./storage-controls.jsx"; import { MultipathAlert } from "./multipath.jsx"; import { JobsPanel } from "./jobs-panel.jsx"; @@ -228,7 +228,7 @@ export function new_card({ }) { if (page_block) { page_location = [block_location(page_block)]; - page_name = block_short_name(page_block); + page_name = block_name(page_block); page_size = page_block.Size; job_path = page_block.path; } diff --git a/pkg/storaged/partitions/initialize-disk-dialog.jsx b/pkg/storaged/partitions/initialize-disk-dialog.jsx index b0e1d4d2a1c..0954d89cf48 100644 --- a/pkg/storaged/partitions/initialize-disk-dialog.jsx +++ b/pkg/storaged/partitions/initialize-disk-dialog.jsx @@ -22,7 +22,7 @@ import client from "../client"; import { dialog_open, - SelectOneRadioVertical, + SelectOneRadio, BlockingMessage, TeardownMessage, init_teardown_usage } from "../dialog.jsx"; @@ -48,8 +48,9 @@ export function initialize_disk_dialog(block) { Title: cockpit.format(_("Initialize $0 for partitions"), block_name(block)), Teardown: TeardownMessage(usage), Fields: [ - SelectOneRadioVertical("type", _("Type"), + SelectOneRadio("type", _("Type"), { + vertical: true, value: "gpt", choices: [ { value: "gpt", title: _("Modern (GPT)") }, diff --git a/pkg/storaged/utils.js b/pkg/storaged/utils.js index 51b082fd120..41fcc82ffe2 100644 --- a/pkg/storaged/utils.js +++ b/pkg/storaged/utils.js @@ -238,12 +238,12 @@ export function validate_fsys_label(label, type) { } } -export function block_name(block) { +export function block_long_name(block) { return decode_filename(block.PreferredDevice); } -export function block_short_name(block) { - return block_name(block).replace(/^\/dev\//, ""); +export function block_name(block) { + return block_long_name(block).replace(/^\/dev\//, ""); } export function mdraid_name(mdraid) { @@ -340,7 +340,7 @@ export function get_block_link_parts(client, path) { location = ["vdo", vdo.name]; link = cockpit.format(_("VDO device $0"), vdo.name); } else { - location = [block_short_name(block)]; + location = [block_name(block)]; if (client.drives[block.Drive]) link = drive_name(client.drives[block.Drive]); else