| 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 { |
| 9 |
StorageCard, new_page, new_card |
| 10 |
} from "../pages.jsx"; |
| 11 |
|
| 12 |
import { lvol_delete } from "./block-logical-volume.jsx"; |
| 13 |
import { lvm2_create_snapshot_action } from "./volume-group.jsx"; |
| 14 |
|
| 15 |
const _ = cockpit.gettext; |
| 16 |
|
| 17 |
export function make_inactive_logical_volume_page(parent, vgroup, lvol, next_card) { |
| 18 |
const inactive_card = new_card({ |
| 19 |
title: _("Inactive logical volume"), |
| 20 |
next: next_card, |
| 21 |
page_location: ["vg", vgroup.Name, lvol.Name], |
| 22 |
page_name: lvol.Name, |
| 23 |
page_size: lvol.Size, |
| 24 |
component: StorageCard, |
| 25 |
actions: [ |
| 26 |
{ title: _("Activate"), action: () => lvol.Activate({}) }, |
| 27 |
lvm2_create_snapshot_action(lvol), |
| 28 |
{ title: _("Delete"), action: () => lvol_delete(lvol, inactive_card), danger: true }, |
| 29 |
] |
| 30 |
}); |
| 31 |
|
| 32 |
new_page(parent, inactive_card); |
| 33 |
} |