No description
Find a file
Shan Shaji 732ecf5edd chore: bump version to v1.9.2 (49)
Release notes
- allow dark and tint mode icon in iOS.
- minor UI improvements on the login page.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
Link: https://lore.proxmox.com/20251118161338.47922-1-s.shaji@proxmox.com
2025-11-18 17:17:59 +01:00
android fix: android: unable to open spice file with aSpice client 2025-11-12 06:45:09 +01:00
assets transform android splash screen logo to vector 2021-12-28 09:50:38 +01:00
debian d/install: update to new build target output paths 2021-03-19 16:34:38 +01:00
ios chore: ios: delete asset catalogue files in favor of icon composer file 2025-11-12 10:08:48 +01:00
lib fix: dart-analyze: remove deprecated props and use RadioGroup 2025-09-26 10:55:52 +02:00
linux upgrade dependencies basing of current flutter 3.35 & dart 3.9 2025-09-23 14:35:43 +02:00
macos update gitignore 2025-02-19 13:58:19 +01:00
test fix widget test 2024-04-11 12:37:44 +02:00
web update web platform files 2025-02-19 14:04:32 +01:00
windows update gitignore 2025-02-19 13:58:19 +01:00
.gitignore gitignore: add generated dart files 2025-04-24 19:26:19 +02:00
.metadata update .metadata 2025-02-19 14:04:32 +01:00
analysis_options.yaml update .metadata 2025-02-19 14:04:32 +01:00
Makefile deb: fixup makefile 2020-09-22 15:46:02 +02:00
pubspec.lock chore: ios: update the minimum iOS version to 13 and update .xcscheme 2025-10-17 09:44:57 +02:00
pubspec.yaml chore: bump version to v1.9.2 (49) 2025-11-18 17:17:59 +01:00
README.md fix typos 2025-05-21 13:30:11 +02:00

pve_flutter_frontend

Frontend for Proxmox Virtual Environment

Setup How-To

Get Flutter

See: https://flutter.dev/docs/get-started/install/linux#install-flutter-manually

Make flutter doctor as happy as possible. Note you may need to tell it where chromium is located, e.g., with export CHROME_EXECUTABLE=/usr/bin/chromium

Get Path-Dependencies

Most dependencies can be served from pub.dev, but the frontend also depends on to local path dependencies maintained by Proxmox.

So, in the parent folder clone both, the API client library (pure dart package) and the login manager, serving as a base for Proxmox api2 projects.

cd .. git clone git://git.proxmox.com/git/flutter/proxmox_dart_api_client.git cd proxmox_dart_api_client flutter pub get flutter packages pub run build_runner build --delete-conflicting-outputs

cd .. git clone git://git.proxmox.com/git/flutter/proxmox_login_manager.git cd proxmox_login_manager flutter pub get flutter packages pub run build_runner build --delete-conflicting-outputs

Now you have made the local dependencies and their dependencies available, and built the generated (data) model code for each.

Run the App

Linux native

Due to the biometric secret integration you also need libsecret-1:

apt install libsecret-1-dev

With the dependencies setup you should cd back into this directory (pve_flutter_frontend repository root) and also generate the model code once:

flutter packages pub run build_runner build --delete-conflicting-outputs

Note: the --delete-conflicting-outputs option is normally not required, but can come in handy during development trial/error coding.

To actually run it you can do:

flutter run -d linux

Build errors

If there's an error during build use the verbose -v flag, to make flutter tell you what's actually going on. Quick remedies are then often rebuilding the models, build from clean state, upgrade or downgrade flutter to the last known working version - as we use latest master we sometimes run actually into bugs. Or if you made code changes resulting in an error, well duh, fix those.

Web build infos

You'll need some sort workaround for CORS in order to serve the flutter frontend from your local dev machine, which will enable some convenient features, like hot reload, automatic builds on changes...

This is required as CORS boundaries are any change in tuples, and chrome will forbid even cross site requests to localhost on a different port.

Disable CORS in chrome/ium

Create a small shell script, lets name it chrome-no-cors.sh, with the following content:

#!/bin/sh
mkdir -p /tmp/chrome || true
/usr/bin/chromium --disable-features=CrossOriginOpenerPolicy,CrossOriginEmbedderPolicy --disable-web-security --user-data-dir="/tmp/chrome" $*

Then chmod +x chrome-no-cors.sh it and adapt the CHROME_EXECUTABLE env variable:

 export CHROME_EXECUTABLE="$(realpath chrome-no-cors.sh)"

Now you can start the web based build normally:

$ flutter run -d chrome --web-port=35000

NOTE: without setting a fixed port flutter uses a random one, as chrome binds certificate exceptions and local browser storage to a (protocol, host, port) tuple, this means that we'd lose all saved settings etc. every time else

Use reverse proxy to allow connections to PVE and the App over the same port

Launch App in Chrome: $ flutter run -d chrome --web-port 42000

nginx snippets:

location / {

if ( $query_string ~ "console" ) {
	proxy_pass https://<clusterip>:8006;
}
proxy_pass http://127.0.0.1:42000;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;

}

location /xterm { proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_pass https://:8006; }

location /api2 { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_pass https://:8006; }

Misc.

To upgrade the proxmox_api_client dependency execute: $ flutter packages upgrade

To build the model classes use: $ flutter packages pub run build_runner build

If you want to login without typing your password for your Test-Cluster, add this to the main function:

var apiClient = await proxclient.authenticate("root@pam", "yourpassword");

Android vector drawables

Android does support vector drawables, but not SVGs directly. They need to be converted to the Android specific subset of SVG and are stored as xml files.

One way to do that is to use the Asset Studio which is part of Android Studio. In your (dummy) project, right click in the tree view on app -> New -> Vector Asset.

There are other options, but they have some caveats themselves.

Will be masked, see figure 2 in https://developer.android.com/guide/topics/ui/splash-screen The drawable therefore needs to account for that by being quite a bit bigger. The assets/images/android_launch_background_template.svg file is useful to size the logo / icon accordingly.

Screenshots Android

adb shell settings put global sysui_demo_allowed 1

Build tooling upgrades

In general, updates should be done in the order of:

  1. Android Studio
  2. Flutter
  3. Plugins

and then select a gradle and android gradle plugin version which are compatible with each other and the other parts.

To do this correctly, it's necessary to check the respective release notes and compatibility tables/matrices.

Upgrade Flutter

to upgrade flutter itself, just run

flutter upgrade

check https://docs.flutter.dev/release/release-notes for breaking changes and migration information

Upgrade Android Studio

Depends on the method you installed, on Linux with tarballs, normally the new version is downloaded/extracted again, and it will automatically detect & migrate old settings and configuration files on first start.

The Android Studio version determines which Gradle/AGP version you can use. Check the respective release notes for Gradle/AGP versions: https://developer.android.com/studio/releases

Gradle/Android Gradle Plugin (AGP)

Compatibility depends on the Android Studio, Flutter and plugins. Can be changed in Android Studio under File -> Project Structure -> Project

When selected, Android Studio will automatically download/build them, and change the entries in the android/build.gradle file.

See https://developer.android.com/build/releases/gradle-plugin for AGP/Gradle compatibility.

Upgrade Kotlin

Compatibility depends on Flutter plugins and Gradle, check https://docs.gradle.org/current/userguide/compatibility.html

To change the used kotlin version, edit it in the android/build.gradle file manually.