| 1 |
/* |
| 2 |
* Copyright (C) 2024 Red Hat, Inc. |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
import cockpit from "cockpit"; |
| 7 |
import client from "../client"; |
| 8 |
|
| 9 |
import { format_dialog } from "./format-dialog.jsx"; |
| 10 |
|
| 11 |
const _ = cockpit.gettext; |
| 12 |
|
| 13 |
export function std_format_action(backing_block, content_block) { |
| 14 |
const excuse = backing_block.ReadOnly ? _("Device is read-only") : null; |
| 15 |
|
| 16 |
return { |
| 17 |
title: _("Format"), |
| 18 |
action: () => format_dialog(client, backing_block.path), |
| 19 |
excuse, |
| 20 |
danger: true |
| 21 |
}; |
| 22 |
} |