Line data Source code
1 : /*
2 : * Copyright (C) 2023 Red Hat, Inc.
3 : * SPDX-License-Identifier: LGPL-2.1-or-later
4 : */
5 :
6 113 : import cockpit from "cockpit";
7 :
8 : import { format_disk } from "./format-disk-dialog.jsx";
9 :
10 113 : const _ = cockpit.gettext;
11 :
12 112 : export function partitionable_block_actions(block, tag) {
13 102 : const excuse = block.ReadOnly ? _("Device is read-only") : null;
14 :
15 112 : return [
16 112 : (block.Size > 0
17 112 : ? {
18 112 : title: _("Create partition table"),
19 17 : action: () => format_disk(block),
20 112 : danger: true,
21 112 : excuse,
22 112 : tag
23 112 : }
24 15 : : null)
25 112 : ];
26 112 : }
|