tui: add notices for zfs/btrfs bootdisk and their caveats

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This commit is contained in:
Christoph Heiss 2023-06-14 09:41:19 +02:00
parent 95c490081d
commit 7f273738d7

View File

@ -6,7 +6,7 @@ use crate::options::{
use cursive::{ use cursive::{
theme::Effect, theme::Effect,
view::{Nameable, Resizable, ViewWrapper}, view::{Nameable, Resizable, ViewWrapper},
views::{Button, Dialog, DummyView, LinearLayout, NamedView, SelectView, TextView}, views::{Button, Dialog, DummyView, LinearLayout, NamedView, Panel, SelectView, TextView},
Cursive, View, Cursive, View,
}; };
use std::{cell::RefCell, marker::PhantomData, rc::Rc}; use std::{cell::RefCell, marker::PhantomData, rc::Rc};
@ -283,6 +283,14 @@ impl<T: View> MultiDiskOptionsView<T> {
} }
} }
fn top_panel(mut self, view: impl View) -> Self {
self.view = LinearLayout::vertical()
.child(Panel::new(view))
.child(self.view);
self
}
fn get_disks(&mut self) -> Option<Vec<Disk>> { fn get_disks(&mut self) -> Option<Vec<Disk>> {
let mut disks = vec![]; let mut disks = vec![];
let disk_form = self let disk_form = self
@ -324,7 +332,8 @@ impl BtrfsBootdiskOptionsView {
let view = MultiDiskOptionsView::new( let view = MultiDiskOptionsView::new(
disks, disks,
FormView::new().child("hdsize", DiskSizeEditView::new().content(options.disk_size)), FormView::new().child("hdsize", DiskSizeEditView::new().content(options.disk_size)),
); )
.top_panel(TextView::new("Btrfs integration is a technology preview!").center());
Self { view } Self { view }
} }
@ -377,9 +386,12 @@ impl ZfsBootdiskOptionsView {
.child("copies", IntegerEditView::new().content(options.copies)) .child("copies", IntegerEditView::new().content(options.copies))
.child("hdsize", DiskSizeEditView::new().content(options.disk_size)); .child("hdsize", DiskSizeEditView::new().content(options.disk_size));
Self { let view = MultiDiskOptionsView::new(disks, inner)
view: MultiDiskOptionsView::new(disks, inner), .top_panel(TextView::new(
} "ZFS is not compatible with hardware RAID controllers, for details see the documentation."
).center());
Self { view }
} }
fn get_values(&mut self) -> Option<(Vec<Disk>, ZfsBootdiskOptions)> { fn get_values(&mut self) -> Option<(Vec<Disk>, ZfsBootdiskOptions)> {