Commit Graph

288 Commits

Author SHA1 Message Date
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
Christoph Heiss
4a8f0a1c50 tui: run rustfmt
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 08:42:59 +02:00
Christoph Heiss
c070637464 tui: simplify test-mode evaluation
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 08:30:02 +02:00
Christoph Heiss
1936156eee tui: drop unneeded parameter from InstallerBackgroundView::new()
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 08:09:29 +02:00
Christoph Heiss
0cdcf336a2 tui: drop useless gitattributes file
Since the cargo lockfile was removed from the repo in 74e3a21, this
became useless.

Fixes: 74e3a21 ("tui: remove cargo lockfile")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 07:52:34 +02:00
Christoph Heiss
5e6eca8489 gitignore: merge TUI .gitignore into top-level
Since the TUI was put into a top-level workspace, the `target` folder
and lockfile exist too on that level.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-21 07:50:13 +02:00
Thomas Lamprecht
1d594e1d2f tui: avoid using domain as FQDN, hard-code product as workaround
Using the product is actually fine, but we should derive it from the
ISO env, not hard-coding "pve", but for now ok enough.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 21:36:23 +02:00
Thomas Lamprecht
beb25c36a6 tui: fix passing disk selection, use index
Currently the installer depends on the index to derive the selected
disks, so use that instead of a wishing-how-it-could-be approach.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 21:07:04 +02:00
Thomas Lamprecht
a8fbe0ff55 add Finished UI² message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 21:02:53 +02:00
Thomas Lamprecht
9a2d64977f tui: disk view: partition sizes are in GB
The proxinstall takes a GB float here and multiplies it up to KB for
most parts, which is then passed to various tools, passing bytes here
makes this go bonkers and try to create a 4 EiB swap partition.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 18:15:01 +02:00
Thomas Lamprecht
23632414c2 tui: lvm: crudely fix calculation mismatch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 18:14:09 +02:00
Thomas Lamprecht
5ad2f28c8d tui: use plain Proxmox ascii figlet in header
If, one would need to write the full product name, and as that is
already written in the "inner" dialogue header, lets just drop it
from the outer.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 18:12:48 +02:00
Christoph Heiss
3285f0ad2f tui: add initial implementation of low-level installer transport
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 16:07:15 +02:00
Christoph Heiss
deebe07fa7 tui: make yes_no_dialog() accept a callback for negative responses too
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 16:07:15 +02:00
Christoph Heiss
c97b9971af tui: add back disk sorting
This was accidentally removed with below commit.

Fixes: 4532cff ("run env: replace lsblk with hd_list but fix it up a bit")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 16:07:15 +02:00
Christoph Heiss
e2a1e0c2e7 tui: add "abort" button to installation progress screen
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 16:07:15 +02:00
Christoph Heiss
cb1f20b034 tui: adapt install config serialization to proper format
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 16:07:15 +02:00
Wolfgang Bumiller
66249b5b3a tui: include disk model in disk list
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-20 14:00:00 +02:00
Wolfgang Bumiller
4532cff472 run env: replace lsblk with hd_list but fix it up a bit
Instead of lsblk we use the original `hd_list` to be closer
to what we originally had.
However, from the PVE codebase I copied over the use of the
`E: DEVNAME` property to find the `/dev` node like (since
some weird devices can have '!' in /sys with '/' in /dev),
drop the check for `/sys/block/$d/dev`, and provide both the
`/dev` and `/sys/block` path in the output array.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-20 14:00:00 +02:00
Christoph Heiss
7e68e30ee3 tui: use total memory info from runtime env
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
c7d3d928f7 tui: use network domain as default administrator email domain
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
81039264f2 tui: fix parsing of FQDNs directly from runtime env info
The JSON deserializer always expects to return an owned string.

Fixes: 7762d12 ("tui: directly parse domain name from runtime env info")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
994c4ff0a7 tui: add better error handling to BootdiskOptions::get_values()
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
fccf6bb019 tui: fix unbounded size of advanced bootdisk dialog
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
0e42d278a8 tui: use country from runtime env info for default timezone and layout
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
efdd5d6f06 tui: use available network interfaces from runtime env info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
eb9780b410 tui: directly parse gateway IP address from runtime env info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
fdf237b080 tui: bootdisk: sort disks alphabetically
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
5dd6b6edb2 tui: directly parse disks from runtime env info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
8bdbd4aa16 tui: directly parse domain name from runtime env info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
0118e7907d tui: use IpAddr type for deserializing ip addresses directly
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
c0e8726e17 tui: directly parse network interface addresses from runtime env info
This then allows to skip 2 levels of if-lets later on.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
08ad8ed63c tui: move installer logo into background and to the top
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-20 11:09:39 +02:00
Christoph Heiss
170ab052a1 tui: limit FloatEditView to 2 decimal places
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 15:09:53 +02:00
Christoph Heiss
d4d0f2bfee tui: error out if no harddisks were detected
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 15:09:53 +02:00
Christoph Heiss
706cdb2afd tui: round disk sizes when displaying
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Christoph Heiss
beec6a1754 tui: drop now-obsolete cargo config
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Wolfgang Bumiller
b5aa2ddfe3 tui: use network info
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Christoph Heiss
f7bd21a637 tui: left-align cell values in summary view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Christoph Heiss
25e0af5812 tui: calculate default swap size for LVM installs based on system memory
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Christoph Heiss
80f54e90ae tui: fix minimum free LVM space default
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Christoph Heiss
429718b894 tui: add option to leave some disks unselected in RAID setups
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Christoph Heiss
d85180edf3 tui: rename raid levels 0/1 to align with GUI installer
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Christoph Heiss
4f2295a739 tui: simplify installer data path construction
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-19 13:39:31 +02:00
Wolfgang Bumiller
2473d5dc2e tui: load runtime info, use disks
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-19 13:27:53 +02:00
Wolfgang Bumiller
066b9360ac tui: add runtime info serde structure
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-19 13:27:53 +02:00
Wolfgang Bumiller
282ea9c559 tui: no need to have './' fallible
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-16 13:32:54 +02:00
Wolfgang Bumiller
03888174fb tui: only count exact example email address as invalid
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-16 13:32:54 +02:00
Wolfgang Bumiller
32368ac302 tui: properly group imports
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-16 13:32:54 +02:00
Wolfgang Bumiller
52f80858e6 tui: dependencies: group our own crates separately
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-16 13:32:54 +02:00
Christoph Heiss
c66dfa8e7d tui: add preliminary final install config serialization
Not fleshed out and rather crude; can/should be tweaked as necessary.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 13:30:32 +02:00
Christoph Heiss
ea15ca43bb tui: read and save reboot-after-install checkbox into options
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 13:28:30 +02:00
Christoph Heiss
fbfd1838a6 tui: rename SetupInfo::product_cfg -> ::config
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 13:10:52 +02:00
Christoph Heiss
81f9348c14 tui: add preliminary install progress dialog
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 12:58:41 +02:00
Christoph Heiss
82cc9fc480 tui: fix bootdisk dialog for zfs/btrfs
This was broken when adding the usage caveats at the top of the advanced
dialog; the wrong child views were selected.

Fixes: 7f27373 ("tui: add notices for zfs/btrfs bootdisk and their caveats")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 12:18:01 +02:00
Christoph Heiss
1353d6cf91 tui: implement both PartialOrd and Ord for KeyboardMapping
Otherwise, clippy (correctly) complains that you should always implement
both if you implement one.

Fixes: 86dac56 ("tui: use whole keyboard mapping in select view as value")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 12:09:17 +02:00
Christoph Heiss
5b9842244f tui: apply keyboard layout immediately after selecting it
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 11:51:24 +02:00
Christoph Heiss
86dac562e8 tui: use whole keyboard mapping in select view as value
Thus all its values can easily be used later on. Involves making
`KeyboardMapping` partial-orderable, just use the human-readable name
here (as that's what displayed to the user).

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 11:49:55 +02:00
Christoph Heiss
cae155237b tui: make test mode indicator into global installer state
This will later be needed in other parts of the installer as well.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 11:47:45 +02:00
Christoph Heiss
6ab6af4cb3 tui: track previous screens so that that each is only created once
Until now, if the user navigated back and then forward again, the screen
would be constructed & added again to the stack. This would result in
missing values and broken "Previous" button behaviour.

Fix it by tracking their screen ids and simply switch to them as needed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:49:24 +02:00
Christoph Heiss
b107a892a8 tui: display proper keyboard layout name in summary
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:22:35 +02:00
Christoph Heiss
06908b6ff7 tui: implement proper keyboard layout selection
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:12:13 +02:00
Christoph Heiss
4e61d6cc83 tui: save user-selected country in options
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:04:14 +02:00
Christoph Heiss
e1a11f794b tui: move timezone dialog into custom view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:04:14 +02:00
Christoph Heiss
67c8d5d079 tui: rename LocaleInfo::country -> ::countries
It's a map of all the countries, thus make the name plural too to match
its content.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-15 10:04:14 +02:00
Christoph Heiss
90c0ea37be tui: display correct logo & title depending on product info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 12:53:58 +02:00
Christoph Heiss
d445e54aa3 tui: ignore testdir here as well
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 12:53:58 +02:00
Christoph Heiss
a6e00ea66d tui: rename InstallerData -> InstallerState
It was kind of ambigous anyway - naming is hard.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 12:53:58 +02:00
Christoph Heiss
4296d2004c tui: implement initial parsing for setup & locale info
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 12:53:58 +02:00
Christoph Heiss
7f273738d7 tui: add notices for zfs/btrfs bootdisk and their caveats
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
95c490081d tui: introduce proper type for handling FQDNs
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
74e3a21e4a tui: remove cargo lockfile
We don't commit that anywhere; so remove it here as well.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
130fb96a09 tui: add simple system cpu/memory check, similar to gui installer
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
b82fff5d48 tui: add some more field validation checks
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
b977af78c3 tui: fix target bootdisk display for zfs/btrfs
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
ce0b586528 tui: drop some unneeded type annotations
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
78eda7b55f tui: drop now-obsolete form types
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
66baa275b4 tui: rewrite bootdisk & fstype selector to use FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
d36c96af33 tui: rewrite zfs & btrfs bootdisk options dialog using FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
cd6d2d240a tui: rewrite LVM bootdisk dialog using FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
617f25340b tui: rewrite network dialog using new FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
15832d1872 tui: rewrite password using new FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
767843f940 tui: rewrite timezone dialog using new FormView
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
26cdaacff4 tui: introduce new FormView compomenent to unify all form inputs
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
e95f4f1a2d tui: error out in network dialog if option retrieval failed
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
ef4957e89a tui: implement password dialog options retrieval and validation
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
ee1437bbfc tui: refactor and unify btrfs and zfs bootdisk options view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
56a304d59f tui: implement btrfs bootdisk selection option
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
2a344f499d tui: format disk size as GiB for now, instead of bytes
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
2a65d9f46e tui: fix disksize-input unit
Previously, the size was displayed in MiB, although it should have been
GiB.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
7393ed8840 tui: implement zfs bootdisk selection option
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
2d6187f192 tui: implement FormInputViewGetValue for custom NumericEditViews
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
ed191e60dd tui: refactor bootdisk dialog; advanced options into separate dialog
This also reworks the whole installer state. The main type is now
`InstallerData`, which holds info about the machine (such as info about
the disks), as well as all the user options.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
36c6b9bddd tui: make FormInputViewGetValue<SelectView> fully generic
`SelectView` can hold values of other types than string.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
13c919bb2a tui: refactor some option bits
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
af0dfe0e72 tui: move bootdisk dialog into own module
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
de0e2eaa6a tui: combine all use directives into one block
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
6cff279466 tui: add rustdoc for CidrAddress type
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
a04201354d tui: add proper IPv6 support to CidrAddress
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
8807d54726 tui: add top content padding for all installer views
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Christoph Heiss
75c7c30362 tui: add README describing some debugging specifics
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00