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