Commit Graph

288 Commits

Author SHA1 Message Date
Christoph Heiss
4d77586296 tui: do not center EULA text
Brings it in line with the GUI installer.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-21 13:11:50 +01:00
Stoiko Ivanov
8f0e9ab0f9 tui: fix interface sort order
Currently, when multiple NICs are present in a system the TUI
sometimes selects the wrong interface (not the one that has the
default gateway/dhcp lease)

I assume this is due to HashMap's values yielding an iterator in
arbitrary order

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 [ TL: avoid intermediate vector, reuse the SelectView's iter()]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 19:31:26 +01:00
Stefan Sterz
851a1e98b2 tui: bootdisk zfs config: add a maximum value to the copies option
according to `man zfsprops` the copies option can only be 1, 2, or 3.
limit the field to 3 just like we do for the GTK based UI, as setting
higher options can't work anyway.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ TL: fleece in note that we already limit this in the GTK UI ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 17:40:30 +01:00
Christoph Heiss
28a55aea9a tui: install progress: use ok/cancel as button text for installer prompt
The GTK installer/UI module in the low-level installer does the same.
Messages used with this are worded for this, using yes/no instead can be
quite confusing (e.g.
Proxmox::Install::ask_existing_vg_rename_or_abort())

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-17 17:08:29 +01:00
Christoph Heiss
89c1351612 tui: fix changing between non-LVM and LVM filesystem in bootdisk chooser
Happens due to a force-unwrap() under the false assumption that the
disk for LVM configurations always exists when switching to a LVM
filesystem.
This fails spectacularly with a panic when switching from e.g. Btrfs to
ext4 in the filesystem chooser.

Fixes: eda9fa0 ("fix #4856: tui: bootdisk: use correct defaults in advanced dialog")
Reported-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-17 13:18:35 +01:00
Christoph Heiss
091c64a753 low-level, tui: count down auto-reboot timeout
The GUI installer already has the same functionality, with this the TUI
installer gains the same. It is a nice touch anyway, primarily to
indicate to the user that the installer is not frozen or similar.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
c0517345f6 tui: install_progress: handle errors in ui message loop more gracefully
This at least gives _some_ feedback to the user he can potentially
report or try to address, instead of a single, hardcoded message.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
4c808a1ba6 tui: install_progress: split out prompt logic into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
7d09f0ab0d tui: install_progress: split out reboot handling into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
923be7633c tui: install_progress: split out low-level installer spawing into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
c59da6c816 tui: install_progress: move progress task into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
dba905bfa5 tui: move install progress dialog into own view module
While at it, convert it to a proper `View`-impl, instead of a functional
component.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
eda9fa0c6c fix #4856: tui: bootdisk: use correct defaults in advanced dialog
The size of the install disk was set to the size of the first disk,
regardless of what disk was selected. This only happened if the advanced
options dialog was never opened, and only a disk was selected in the
main bootdisk dialog.

Properly solving this involved restructuring the LVM advanced bootdisk
dialog, to also hold the selected disks, like the ZFS and Btrfs dialogs.
In addition to that, the `BootdiskOptionsRef` needs quite some passing
around, to cover all the cases, since the dialog also needs to be
"reentrant-safe".

I tested (among other things):
  * Only select disk, don't open the advanced dialog, go to summary,
    then back to the bootdisk dialog -> selected disk should be kept
  * Select disk, open advanced dialog but leave everything as is, go to
    summary, then go back again -> selected disk should be kept
  * Same as previous, but change the "Total size" for the disk, go to
    summary and back -> selected disk and size should be kept
  * Same as previous, but additionally change filesystem to XFS -> disk,
    filesystem and size should be kept
  * Same as previous, but then create a ZFS RAID, go to summary & back,
    ZFS RAID should be kept with all parameters
  * etc ..

Further I also verified that the correct disk size(s) get written into
the setup structure for the low-level installer.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:47:03 +01:00
Christoph Heiss
d81cffcbb4 tui: bootdisk: refactor Rc<RefCell<..>> type into custom type
Will be used/passed around quite a lot of times due to future changes,
so simplify it a bit.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:47:03 +01:00
Christoph Heiss
521dfff583 tui: bootdisk: expose arc_max ZFS option for PVE installations
To set the maximum value for arc_max accordingly, simply pass down
`RuntimeInfo` directly instead of the disks array to the views.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
13490d13b6 common: add ZFS arc_max installer setup option
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
0f39ba9300 tui: fix same "Administrator" typo in password and summary view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:39:35 +01:00
Christoph Heiss
e8a7b9ba86 tui: bootdisk: simplify product handling by passing the config directly
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-06 15:48:18 +01:00
Christoph Heiss
801f5a283b tui: views: add optional suffix label for NumericEditViews
Most of the churn here is due to changing the inner view from an
`EditView` to a `LinearLayout`. Also prompted the introduction of two
small helpers .inner() and .inner_mut() to simplify things everywhere
else in the view.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-06 15:47:29 +01:00
Christoph Heiss
5716113910 tui: fix clippy warning
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-03 12:52:56 +01:00
Christoph Heiss
feea90d471 tui, common: run rustfmt
While at it, move rustfmt.toml to the repo root, to share it with the
other crate.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-03 12:52:56 +01:00
Aaron Lauterer
c16d6893ec tui: remove unused read_json function
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:40 +01:00
Aaron Lauterer
9a8485808f tui: use installer_setup from common cate
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:38 +01:00
Aaron Lauterer
b2dfe0ba07 tui: remove now unused utils.rs
all it did moved to the common crate

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:30 +01:00
Aaron Lauterer
86c48f76f0 tui: switch to common crate
by switching dependencies and deleting doubled code to avoid ambiguities
within the same scope.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:26 +01:00
Aaron Lauterer
41f2a23371 tui-installer: add dependency for new common crate
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:24 +01:00
Christoph Heiss
2789d95b71 tui: remove obsolete, global SetupInfo state
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-25 19:03:13 +02:00
Christoph Heiss
e14adfe3a3 tui: bootdisk: pass down product info to advanced dialog
Enables the advanced and LVM dialog to determine what options (max
root/data size and Btrfs RAIDs) by itself, without needing to resort to
the global `setup_info()` function.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-25 19:03:13 +02:00
Christoph Heiss
2f0b4f7c9b tui: refactor NetworkOptions to have a defaults_from() function
This aligns it with the other constructors for options struct by
introducing a `::defaults_from()` function.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-25 19:03:13 +02:00
Christoph Heiss
9f73c54b87 tui: add some tests for NetworkInfo -> NetworkOptions conversion
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [ TL: merge fix for missing state member when declaring a Interface
   struct in a test on master ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-20 17:12:53 +02:00
Christoph Heiss
ce01876bbc tui: use hostname from run env if available
This now tries to use the hostname from the DHCP lease if it was set,
falling back to the product name as before.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-20 12:31:22 +02:00
Thomas Lamprecht
89dfa5c9f1 tui: fix interface sorting
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-19 14:19:06 +02:00
Thomas Lamprecht
55e5c9cdc9 tui: show interface UP state as filled circle
like we do in the GTK UI since recently, there we also color the
filled circle green, but with current cursive crate version this
doesn't seem to be easy, at least not without breaking its theming a
bit (e.g., by just using ANSI escape codes), so just use the circle
for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-19 14:18:40 +02:00
Thomas Lamprecht
5c4501655a add interface state to run-time environment
making this slowly compatible with our battle-proven ifaces entry..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-19 13:34:37 +02:00
Christoph Heiss
a56e078abb tui: honor test mode flag when starting low-level install session
Even if the installer is run in release mode, the test-mode flag should
be honored on whether to start a test-installation or not.

The test mode is always forced on in debug builds, so the cfg()
conditionals can be dropped.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-09-20 15:38:46 +02:00
Christoph Heiss
c733cb3b26 tui: fix search domain parsing from runtime environment info
Commit 55dc67c ("tui: fix FQDN validation") mostly fixed FQDN
validation, but missed a case when the search domain only has one
component.

As Fqdn::from() requires at least two components to pass validation, the
search domain parsing from the runtime environment info provided by the
low-level installer failed. This resulted in that the network dialog
defaulted to "<product>.example.invalid" as FQDN, instead of
"<product>.<searchdomain>" as it should.

Fixes: 55dc67c ("tui: fix FQDN validation")
Reported-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:38:14 +02:00
Christoph Heiss
fea97303fd tui: disallow legacy BIOS boot from 4Kn disks for all filesystems
The GUI installer already has the same rules in place, not allowing to
boot from 4Kn disks when booting in legacy BIOS mode. The TUI installer
currently only checks that for ZFS RAIDs, so extend that check to all
filesystem configurations.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:31:57 +02:00
Christoph Heiss
749572552d tui: setup: handle missing disk block size gracefully
As that value can indeed be undefined, handle that (edge-)case
gracefully. There is only one place where it is checked, in the ZFS RAID
setup dialog. Aligns it with how the low-level installer handles that
case too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:19:56 +02:00
Christoph Heiss
b37e1a92e3 tui: setup: fix disk size for 4Kn block devices
This can be tested by creating a block device with 4K sectorsize using
the following QEMU args:
  -device virtio-blk,drive=testdrive4k,logical_block_size=4096,physical_block_size=4096
  -drive file=/path/to/4k-testdisk.img,if=none,id=testdrive4k

The 4k-testdisk.img was created with:
  qemu-img create -f qcow2 /path/to/4k-testdisk.img 16G

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:19:53 +02:00
Christoph Heiss
b50f7dc1be tui: network: select matching NIC for IP configuration
Instead of always just selecting an essentially random NIC (depending on
the enumeration), use the correct one for the rest of the
(DHCP-obtained) IP configuration.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:19:52 +02:00
Christoph Heiss
fe64752d13 tui: password: include minimum password length in error message
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:19:51 +02:00
Christoph Heiss
a3f04ea016 tui: drop some leftover, commented-out code
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-08-23 10:19:49 +02:00
Christoph Heiss
055a59dd7a tui: add tests for RAID setup checks
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Christoph Heiss
ed37980fec tui: add RAID setup checks for ZFS/Btrfs
This adds early checks when setting up ZFS and Btrfs RAIDs, such as
minimum number of disks in the RAID, mirror sizes and legacy BIOS
compatibility.

The same rules as the GUI uses are applied, which unfortunaly means that
this logic is essentially duplicated between the GUI and TUI.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Christoph Heiss
597d10f6ee tui: improve bootdisk dialog error handling
Now we don't just fail silently, but instead give the user/developer
some indication what went wrong.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Christoph Heiss
ee1ae82500 tui: deserialize boot type and disk blocksize from runtime env info
This is needed later on to check whether a RAID setup is compatible with
BIOS and 4Kn disks, in particular ZFS.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Christoph Heiss
4f2c43eef7 tui: simplify duplicate disk checking logic
This reduces the logic from O(n^2) to O(n), which is always a good
thing.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Christoph Heiss
69f162a6c9 tui: fix small typo in error message
Fixes: 994c4ff ("tui: add better error handling to BootdiskOptions::get_values()")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-21 13:45:35 +02:00
Christoph Heiss
55dc67ca39 tui: fix FQDN validation
Add checks to ensure that:
 * It is actually has a hostname, not just a domain name
 * Properly check if the hostname is purely numeric, which was
   broken/different to how the GUI installer does it

The custom error type also allows for easier future adaptions, as the
changes can be entirely contained to the `Fqdn` type.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-21 13:45:10 +02:00
Christoph Heiss
8c9af1e7a3 tui: use EULA path from ISO info instead of hard-coding
.. in the same fashion as the GUI installer.
See also proxinstall:create_intro_view() for reference.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-15 23:41:34 +02:00
Christoph Heiss
2379338ce5 tui: add "Deselect all" button to zfs/btrfs raid disk select
Another puzzle piece in the quest to align the TUI installer more to
its GUI counterpart.

Like the GUI installer, it will only be shown if >3 disks are
detected on the system.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-13 16:07:04 +02:00
Christoph Heiss
9e5cf6b6e9 tui: fix clippy warnings
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-13 16:06:57 +02:00
Noel Ullreich
f9960aa743 tui: don't abort install if min ram requirement is not met
If the minimum requirements are not met, the TUI installer will create a
popup notifying you that the install might not work and then exits the
installer.
While the GUI also creates such a popup, it will not exit the installer.
This patch adapts the behavior of the GUI: the TUI creates a popup
warning you that min spec is not met but doesn't abort the install.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
 [T: fix conflict in context and drop intermediate variable ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-13 16:02:50 +02:00
Christoph Heiss
a6d1f315a9 tui: fix incorrect scrolling of form view contents
See the inline comment for what & why.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-13 15:51:02 +02:00
Christoph Heiss
636da45e9d tui: check hvm support through runtime env info instead of open-coding
As the runtime environment now exports that info, use it. In turn, this
allows us to drop the dependency on `proxmox-sys`, as that check was its
only user.

The dependency graph drops from 107 to 88 crates from this, which
definitively is a nice change.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-13 15:48:02 +02:00
Stefan Sterz
cc655f8b9d tui: persist disk selection for zfs and btrfs
previously the disk selection was reset if the advanced options
dialogue was re-opened. this commit adapts the behavior to restore
the previous selection.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-27 16:44:50 +02:00
Thomas Lamprecht
5ed7f4951f tui: block & notify if same disk gets selected twice
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-27 14:58:55 +02:00
Thomas Lamprecht
e77ab7d0d9 tui: only show warning for missing hyper-visor CPU flags for PVE
that feature isn't useful for neither Proxmox Mail Gateway nor
Proxmox Backup Server

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-27 11:17:44 +02:00
Thomas Lamprecht
6719eda6b5 tui: hide max-vz and max-root inputs if product isn't PVE
like we do in the GTK based installer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-26 21:38:50 +02:00
Thomas Lamprecht
a96dc91688 tui: boot disks: filter out Btrfs if setup info disallows it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-26 19:08:03 +02:00
Wolfgang Bumiller
f57b120627 tui: rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 16:01:31 +02:00
Wolfgang Bumiller
13f9bbae33 tui: use product for default hostname
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 16:01:31 +02:00
Wolfgang Bumiller
3f0477a811 tui: make ProxmoxProduct Copy
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 16:01:31 +02:00
Wolfgang Bumiller
fabd468edc tui: add global 'setup_info'
This is basically "installer information" and will is used
for things such as default values for which we do not want
to pass around all the data.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 16:01:31 +02:00
Thomas Lamprecht
c9482d0e38 disk selection: save both, order and disk id
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-22 16:46:33 +02:00
Maximiliano Sandoval
e1eb2ac947 tui: do not auto reboot on failures
Otherwise the user only has 5 seconds to see the error message before
the machine reboots.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2023-06-22 15:30:53 +02:00
Thomas Lamprecht
41f03d9036 tui: add some info to uknown UI messages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-22 15:18:40 +02:00
Christoph Heiss
49d2f85044 tui: disable automatic text wrapping for form labels
This just causes weird layouts; such that labels and inputs do not line
up anymore.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-22 14:36:28 +02:00
Christoph Heiss
45082a3c1c tui: wrap multi-disk selection in scrollable view
If lots of disks are present and the available screen size is rather
small, it might be impossible for users to properly set all disks as
they want.

Fix it by making the view scrollable.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-22 14:36:28 +02:00
Stefan Sterz
f28043332a tui: switch to f64 for disk sizes
previously the tui used `u64` internally to represent the disk size.
since the perl-based installer expects GiB as floats and that is also
what is displayed in the tui that meant a lot of converting back and
forth. it also lead to an error where the disk sizes that were set
seemed to not have been persisted, even though the sizes were
correctly set. this commit refactors the installer to convert the size
once in the beginning and then stick to `f64`.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-22 14:34:24 +02:00
Thomas Lamprecht
fcb51d7391 tui: avoid actively focusing start-install button on summary
it's just safer to make the user look at the summary and avoid that a
stray enter hits of the installation.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 18:39:30 +02:00
Dominik Csapak
1d8fcd721a tui: focus next button by default
except the password dialog, since the user must provide input

to do that, we have to set the focus index on all relevant views

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-21 18:28:24 +02:00
Stefan Hanreich
99a7fcf1fe tui: improve ipv6 handling
* fix detection of ipv6 addresses
* change input for CIDR to allow integers up until 128

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-06-21 17:35:21 +02:00
Thomas Lamprecht
97e1524df3 fix duplicate deserialize_invalid_value_as_none
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 15:16:22 +02:00
Dominik Csapak
298a4de044 tui: verify email with basic regex
regex copied from perl gui installer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: add missing librust-regex-1+default-dev B-D ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 15:14:15 +02:00
Dominik Csapak
d09fe568b9 tui: always use mail@example.invalid as default email address
like the gui installer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-21 15:11:32 +02:00
Christoph Heiss
0fd882c301 tui: forward stray messages from low-level installer to stderr
After eaa7d41 - which directs all stderr from the TUI to tty2 - this can
be safely done without interrupting the TUI.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 15:09:19 +02:00
Christoph Heiss
638479b904 tui: implement auto-reboot after installation
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 15:09:11 +02:00
Christoph Heiss
73574fee14 tui: do not fail completely on invalid domain names
Since we already handly non-present domain names, invalid names can be
handled the same way, as not to completely fail the installation.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 15:09:06 +02:00
Wolfgang Bumiller
3fbd1dc9da tui: fix ability to type commas
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-21 15:07:39 +02:00
Christoph Heiss
859e3478a8 tui: clamp max LVM disk size to size of selected disk
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 14:25:07 +02:00
Christoph Heiss
cdba54ce86 tui: remove underline-effect from advanced disk setup titles
While this might look at it should it terminal emulators, in a raw tty
this can have different effects; e.g. being a bright blue/green and
nearly unreadable. For now, just remove the effect completely, the
semantics are still very much clear.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 14:25:06 +02:00
Christoph Heiss
7111932dcc tui: implement auto-reboot after installation
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 13:17:46 +02:00
Christoph Heiss
f81ba3edf2 tui: rename reboot option to autoreboot, to better align with GUI
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 13:17:46 +02:00
Christoph Heiss
e730b3fee4 tui: use non-slanted logo
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 13:17:45 +02:00
Christoph Heiss
a84f277b00 tui: make reboot-after-install checkbox default to enabled
Aligns it with the GUI installer.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:52:43 +02:00
Christoph Heiss
d2b13ba7a1 tui: use correct index when retrieving DNS server address from view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:34:51 +02:00
Christoph Heiss
93f4fdfa2c tui: refresh summary view if it is switched back to
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:20:41 +02:00
Christoph Heiss
082f3a703d tui: make HVM extension not being present a non-fatal warning
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:20:41 +02:00
Christoph Heiss
f1df0957fa tui: assume that the installer is run from the repo root in debug mode
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:20:41 +02:00
Christoph Heiss
f0751a962f tui: do not fail completely on invalid domain names
Since we already handly non-present domain names, invalid names can be
handled the same way, as not to completely fail the installation.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:20:41 +02:00
Christoph Heiss
a5eeb44377 tui: allow one-part FQDNs/domains
Otherwise, the user would be blocked from continuing the the installer,
instead just being presented with an error.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 12:20:41 +02:00
Thomas Lamprecht
5ea718f66d run env: make addresses optional, include all interfaces
Similar to our actual battle proven get_ip_config, but as the TUI
uses this one, and switching to it rather more risk, make just
addresses optional, add skip for "lo" loopback and don't skip ifaces
that aren't UP in the current helper.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 11:54:41 +02:00
Wolfgang Bumiller
e12667524d tui: slight FloatEditView improvement
with this you can type without removing the decimal places, but if
you type inside the decimal places it'll just move the cursor to the
end and do nothing

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 11:23:11 +02:00
Christoph Heiss
c6f81714a1 tui: only focus summary table if it can be scrolled
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 10:35:13 +02:00
Christoph Heiss
79ae84dea9 tui: set detected keyboard layout at installer launch
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 10:26:07 +02:00
Christoph Heiss
00268c0cb8 tui: make auto-deteced routes optional
If, for some reason, the network is not properly configured (due to
e.g. no DHCP server being present on the network), there will be no
routes in the runtime environment as well. So do not depend on that,
otherwise the installer fails at the start.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 09:31:50 +02:00
Christoph Heiss
cc82d42e8d tui: skip serializing empty fields for install config
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 09:22:56 +02:00
Christoph Heiss
409fc0fdb0 tui: make disk swap-, max-root-, max-data- and min-lvm-free-size optional
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 09:21:53 +02:00
Christoph Heiss
7cfaf5608e tui: allow numeric & disk size edit views to be empty
Bit of a retro-fit I guess, could maybe get improved in the future.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 09:20:59 +02:00