mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-15 21:36:16 +08:00
renovate/main-npm-qs-vulnerability
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6e0e0237ef |
feat: use the SUSE Virtualization product name on Prime (#1202)
* feat: switch the product name with Rancher Prime Use a [[Harvester]] token for the product name in the translations, so Rancher 2.16 fills it from the l10n global that harvester-manager registers: SUSE Virtualization on Rancher Prime, Harvester otherwise. Rancher before 2.16 shows the tokens as written, so on those hosts (and standalone) the extension resolves them to Harvester itself. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * feat: switch the standalone product name with the server flavor Standalone has no Rancher Prime, so register the [[Harvester]] l10n global from the server-flavor setting instead: SUSE Virtualization on prime, Harvester otherwise. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: point the network policy banner to the documentation Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * feat: use the SUSE theme in standalone Prime Standalone Prime kept the harvester brand and only overrode the primary colour, so the rest of the palette and the fonts didn't match Rancher Prime. Switch the ui-brand setting to suse in the store when the server flavor is prime, which makes the shell load the SUSE theme. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: keep the SUSE theme after a brand setting change event The watcher also reads the setting's value, so a change from the server loaded into the same object switches the brand back to suse. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> --------- Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> |
||
|
|
d6f6f7c54c |
chore(deps): bump @rancher/shell to 3.0.14 (#1208)
* chore(deps): bump @rancher/shell to 3.0.14 3.0.14 resolves [[name]] tokens in translations from values registered as l10n globals, which the standalone UI needs to pick the product name. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: save cloud-config template edits with @rancher/shell 3.0.14 The YamlEditor of shell 3.0.14 no longer emits onChanges, so editing a template saved its old cloud config. Copy the text from update:value, which both shell versions emit. Jest transforms @replit/codemirror-vim-core, an ESM-only dependency of the new YamlEditor, like the dashboard does. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: keep the YAML editor heights with CodeMirror 6 The min-height rules targeted the CodeMirror 5 element, so the editors shrank to their text. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: reject IP ranges the network settings don't support The CIDR check of @rancher/shell 3.0.14 also accepts short forms such as 10.1/16, extra parts and IPv6, so the VM migration, RWX and storage network settings saved them. Use a strict IPv4 CIDR check of our own. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: keep the look of the file selector buttons The FileSelector of @rancher/shell 3.0.14 no longer takes button classes and renders a medium secondary button. Pass the variant and size that match the previous primary and secondary buttons. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: keep Enter in a migration wizard field on the same step The Wizard of @rancher/shell 3.0.14 renders its step headers as submit buttons, so Enter in a text field clicked the first one and jumped back to step 1. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: show the created message after a restore, upgrade or upload Since @rancher/shell 3.0.14, save() no longer shows the message for resources with a generated name; callers show it with notifyGeneratedName(). Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * refactor: fold the logging output buffer with the CodeMirror 6 helpers The YAML editor of @rancher/shell 3.0.14 is CodeMirror 6, and its CodeMirror 5 methods are deprecated. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: keep the shell's table views off in standalone @rancher/shell 3.0.14 turns its table views on for every list in the standalone UI, as the server has no ui-configurable-tables feature and the default is on. The table views drop the filters the lists put in the table header, which also left the Images list empty. Add the feature, disabled, to the management store in standalone only. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: reject zero-padded octets in IP ranges Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> --------- Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> |
||
|
|
2f72f25b6e |
feat: improve VNC console with a version gate, in-use screen and confirmations (#1195)
* feat: improve vnc console Signed-off-by: Andy Lee <andy.lee@suse.com> * fix: keep VNC console retries from kicking the active session Builds on "feat: improve vnc console" (#1147) by Andy Lee. - Keep retrying with preserveSession after a failed reconnect attempt, so a displaced console waits for the other session to be released instead of failing immediately or taking the console back. - Close the RFB socket when noVNC asks for credentials, so a failed console does not hold the VNC session. - Restore Custom Shortcut Keys, which were removed in #1147. - Add unit tests for the console reconnect behavior. Related: harvester/harvester#10420 Signed-off-by: Alejandro Bonilla <abonilla@suse.com> * fix: expose VNC quality and compression settings - Add 0-9 sliders for the JPEG quality and compression level, which were already passed to noVNC but could not be changed. - Mark the connection status as a polite live region so screen readers announce connection changes. Related: harvester/harvester#10420 Signed-off-by: Alejandro Bonilla <abonilla@suse.com> * fix: gate VNC session protection by version and rework the in-use screen - Add the vncPreserveSession feature flag for Harvester v1.7.0, the first release whose KubeVirt (1.6.3) honours preserveSession. Without it the console connects as before, offers no Take Over and does not reconnect on its own after the session drops, so two open consoles no longer keep kicking each other out. - Replace the error page with a short card that says when the console is in use, and confirm Take Over in a modal instead of window.confirm. - Keep the overlay text readable on its dark background. - Show "Connected (view only)", translate the Ctrl+Alt+Del label and remove unused translation keys. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * feat: show whether the VNC console has keyboard focus noVNC hides the canvas focus outline, so nothing showed where typing would go. Draw a ring around the console while it has focus, show a toolbar hint ("Typing goes to the virtual machine" / "Click the console to type"), focus the console when it connects and return focus to it after sending keys from the toolbar. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * feat: confirm Ctrl+Alt+Del and Soft Reboot in the VNC console Both buttons can restart the virtual machine with one click: Soft Reboot always, and Ctrl+Alt+Del on most Linux guests. Ask in a modal first, as the VM list already does for Soft Reboot, and return focus to the console after. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * fix: return focus to the VNC console after its confirm modal closes The modal gave focus back to the toolbar button that opened it, so typing did not reach the console until it was clicked again. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> * refactor: drop the VNC keyboard focus hint from the toolbar The ring around the console already shows when it has keyboard focus. Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com> Signed-off-by: Alejandro Bonilla <abonilla@suse.com> Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com> Co-authored-by: Andy Lee <andy.lee@suse.com> Co-authored-by: Alejandro Bonilla <abonilla@suse.com> |
||
|
|
5406c08f76 |
perf: speed up the VM list with many VMs (#1189)
* perf: speed up the VM list with many VMs The VM list scanned whole store lists for every row and re-evaluated the same values per row on every render and sort. With several hundred VMs this blocked the browser on sorting and on every VM update. Performance: - look up launcher pods and migrations through shared indexes (namespace/name -> resource) instead of scanning per row; the indexes are computed per store list, so they stay in sync with in-place store updates - use the same migration lookup (getLatestMigration) in the VM model and on the VM detail page - look up PVCs, PVs, VMIs and restore backups by id - merge VMs and VMIs with a Set - evaluate the VM state once when sorting by state - check the unschedulable condition before the pod based state checks - cache feature flag results and per-schema/per-setting values that are the same for every row Bug fixes: - the launcher pod map was never rebuilt, because the store keeps the same array - pods, volumes and migrations of a VM with the same name in another namespace could be picked up The order of the volumes of a VM (vm.volumes) now follows the VM spec instead of the store order. Nothing depends on it. Measured in a synthetic setup, 100 rows per page, sorting by state (Chrome, dev build): - ~490 VMs, ~500 PVCs/PVs: 1.9 s -> 1.0 s - ~490 VMs, 600 PVs, 200 migrations: 6.0 s -> 0.7 s, main thread blocked during VM updates 78% -> 32% With few volumes the gain is much smaller (8-20%). Related to: https://github.com/harvester/harvester/issues/9513 Signed-off-by: Volker Theile <vtheile@suse.com> * fix: read VM data from the store of the resource instead of a fixed one The migrations of a VMI and the migration badge of the state column were read from the hardcoded `harvester` store. In the Rancher explorer (embedded and standalone) the data is loaded into the `cluster` store, so a running migration was shown neither in the VM state nor as badge. The VM model remembered the store of the current product in a module variable on first use and never updated it. The same model is used in the Harvester product (`harvester` store) and in the Rancher explorer (`cluster` store), and Rancher keeps the page loaded when going from the explorer of a Harvester cluster to Virtualization Management and into the Harvester product. The VM list then read the VMIs, launcher pods, volumes and restores from the wrong store, and running VMs were shown as Starting until the page was reloaded. Read the data from the store the resource lives in (`this.$getters`, in the formatter the store of the current product). In the Harvester product this is still the `harvester` store, so nothing changes there. Not covered: volume details like the lock icon of encrypted volumes. The explorer uses the generic Rancher PVC model, which does not know them, and settings based checks (feature flags, backup target) are not loaded there either. Related to: https://github.com/harvester/harvester/issues/11882 Signed-off-by: Volker Theile <vtheile@suse.com> --------- Signed-off-by: Volker Theile <vtheile@suse.com> |
||
|
|
71141b257a |
feat: Add a unit test target (jest) to the UI extension and run it in CI (#1192)
- Introduce test targets. - Adding additional tests. Related to: https://github.com/harvester/harvester/issues/11892 Signed-off-by: Volker Theile <vtheile@suse.com> |