4771 Commits

Author SHA1 Message Date
Thomas Lamprecht
ccf81a6f32 ui snapshot tree: avoid exception in delayd load when view is gone
If one switched through guest fast (e.g., keeping the down-arrow key
pressed) while staying on the snapshot panel, it could happen that
the previous view got already destroyed once the success callback of
the feature API request got executed.

Then the ExtJS ViewModels' set method got a "null" back from its
me.getStub(...) call, and tried to access members of that, resulting
in a TypeError exception.

Avoid that by checking if we're already destroyed or still around
before doing that call. During the time we are already in the
callback we shouldn't be able to get destroyed in parallel due to JS
single thread nature and no yield point here, so this is safe.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:43:20 +01:00
Thomas Lamprecht
e81acbc280 ui snapshot: improve template string usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:42:21 +01:00
Thomas Lamprecht
3a1b1df94f ui snapshot tree: add label when no new snapshot is possible
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:42:02 +01:00
Thomas Lamprecht
8adda6bef5 ui snapshot tree: express formulas more concisely
Use arrow functions to bring them in a more simple boolean expression
style. Further, we can reuse the "isSnapshot" formula in the
"canRollback" and "canRemove" ones.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:34:35 +01:00
Thomas Lamprecht
fce60ea5cb ui: follow up style fixes, don't cram expressions into one line
We do not want to have multiple expressions on the same line, if it'
really is an exception.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 19:31:54 +01:00
Dominik Csapak
64279ad199 fix #2572: gui: make snapshot panel visible for VM.Audit
with the now rewritten panels, this works as expected

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-30 18:01:38 +01:00
Dominik Csapak
ce2c0e3a41 gui: refator SnapshotTree
using the better View, ViewModel, Controller style,
while doing this, make it generic so that we can use it for qemu and lxc

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-30 18:01:38 +01:00
Dominik Csapak
2f6265ba7b gui: refactor snapshot window
using an Proxmox.window.Edit, which does many of the things we did
manually, also rewrite is in such way that we can use it for qemu
and lxc

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-30 18:01:38 +01:00
Thomas Lamprecht
2f8f874dd6 ui dc: move cluster name info into join button
Avoids another textfield while still giving the information to the
user.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 16:08:10 +01:00
Stefan Reiter
cd9b4ce4a7 gui/cluster: show cluster name from joinInfo in join dialog
To help a user identify if they put in the joinInfo for the correct
cluster.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-01-30 15:13:01 +01:00
Stefan Reiter
af3b6cb1df gui/cluster: validate cluster name length on create
API limits this to 15, validate in GUI as well for instant user
feedback.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-01-30 15:13:01 +01:00
Thomas Lamprecht
3b22301a94 ui: fix disk controllers sortByPreviousUsage iteration
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 13:38:31 +01:00
Thomas Lamprecht
bf6daacc24 bump version to 6.1-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 21:29:00 +01:00
Fabian Grünbichler
910ddb2315 www: add permissions button to userview
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:41:08 +01:00
Fabian Grünbichler
0463a35ed5 api/tasks: attribute token tasks to user
and store token ID in separate, currently unused member.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:28:16 +01:00
Thomas Lamprecht
27e9f8e4c6 d/control: bump version dependencies for libpve-http-server-perl
For new auth extract helper support

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 10:27:06 +01:00
Fabian Grünbichler
13b96dca05 pveproxy: use new cookie extraction method
we only care about the regular cookie case for the index.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:27:06 +01:00
Thomas Lamprecht
0154a4b2d3 d/control: bump version dependencies for pve-common
For allowtoken property support in schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 10:26:57 +01:00
Fabian Grünbichler
d1cdb17a37 rest_handler: implement 'allowtoken' property
to filter out API paths that are not available with API tokens for
security reasons, such as access control related endpoints.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:26:57 +01:00
Thomas Lamprecht
90f3f066e7 d/control: bump version dependencies for pve-access-control
for API token verification support.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 10:26:31 +01:00
Fabian Grünbichler
432e324cd4 auth_handler: handle API tokens
by verifying them via pve-access-control, as alternative to regular
tickets.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-28 21:14:51 +01:00
Fabian Grünbichler
2e686bfa62 www: add 'users' columns to Groups model
it's useful information that now gets returned by the API, so might as
well display it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-28 20:57:37 +01:00
Wolfgang Link
40cc6e5e10 Protect the user's tfa key setting.
If oath or U2F is set, it should not be possible to change it
in the GUI on the user edit window.
It disables the second factor, but leave the tfa key behind
in the file tfa.cfg.
The key in the tfa.cfg file is a problem when the user tries to recreate a key.
The old key must be deleted before a new one can be created.
2020-01-28 13:46:54 +01:00
Thomas Lamprecht
8595dbbd2c manager: startIPStore: status can be null/undef
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-27 19:09:10 +01:00
Alexandre Derumier
1b6e113767 API2: Network: add vlan-raw-device && vlan-id options.
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-25 16:02:06 +01:00
Dominik Csapak
572fdede86 gui: qemu: HardwareView: improve button disable code
this improves following behaviours:
* do not loop over items multiple times
  (we iterated one time extra for efidisk)
* do not check every item for cloudinit
  (we even checked non-disk types)
* make the counts more generic using an object
* also disable cloudinit button when you have one pending
* also disable serial/net button when at limit or the user has
  not the right priviliges

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-24 10:10:48 +01:00
Dominik Csapak
a1ebd306c2 gui: qemu HardwareView: specify hardware counts in Utils
this also fixes the issue that we only showed 4 hostpci devices in
the gui despite raising the limit in the backend to 16

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
4ae7739f9a ui: controller selector: use OSDefaults.getDefaults
it does the fallback for us already

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
6dc68a2694 ui: controller selector: refactor and cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
2f19df340a ui: avoid duplication of guest disc controller maxIDs definition
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-24 10:10:48 +01:00
Thomas Lamprecht
ce0d324563 ui: FW/Alias: whitespace/indentation fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-22 12:40:35 +01:00
Thomas Lamprecht
971b5f69d0 ui: FW/Alias: make grid flex
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-22 12:40:15 +01:00
Thomas Lamprecht
64daf1dc45 ui: FW/Alias: make edit window wider to fit IPv6 CIDR
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-22 12:39:58 +01:00
Stefan Reiter
f74a1f1811 Broadcast supported CPU flags
pvestatd will check if the KVM version has changed using
kvm_user_version (which automatically clears its cache if QEMU/KVM
updates), and if it has, query supported CPU flags and broadcast them as
key-value pairs to the cluster.

If detection fails, we clear the kv-store and set up a delay (120s), to not
try again too quickly.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-01-14 11:59:48 +01:00
Thomas Lamprecht
797535a8ee fix #2552: ui: allow to collapse notes panel from guest summary
Allow to collapse and expand the "Notes" panel on the virtual guests
summary panel.

Further add a browser setting to control the default behavior, one
can chose from:
 * expand on show (default)
 * collapse on show
 * collapse if there are no notes

This way users can make slightly better use of the available screen
space for the guest status.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Co-developed-by: Stefan Reiter <s.reiter@proxmox.com>
2020-01-14 11:13:42 +01:00
Thomas Lamprecht
62689235e2 network reload: check if recent enough PVE ifupdown2 version is present
We need a recent version *and* our patches on top of the vanilla
ifupdown2:
0001-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
0004-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch

So check for at least 1.2.8 and the pve string in the version output.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-14 11:00:26 +01:00
Alexandre Derumier
9014f6e55e api2 : network : add mtu
min 1280 to handle ipv6 && ipv4
max 65520 (infinibad support it)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-11 17:22:46 +01:00
Alexandre Derumier
ceabc2dd76 api2: network: add bond-primary option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-11 17:22:46 +01:00
Alexandre Derumier
8a53779717 ifupdown1: bridgevlan: add bridge-vids list support
like ifupdown2, support multiple values

iface vmbr0
   bridge-vids 2 4 5-10 70

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-11 17:22:46 +01:00
Thomas Lamprecht
2e6bba4872 ui: settings: use default-value functionallity from state manager
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-10 15:50:59 +01:00
Dominik Csapak
2e07aa8d74 fix #2334: gui/cloudinit: enable edit button only when editor is set
when a user does not have the right privileges for cloudinit (e.g.
VM.Config.Network), we do not set an editor, which results in a button
that does nothing when pressed

fix this by enabling the button only when there is an editor set

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-01-09 17:42:34 +01:00
Stefan Reiter
ef7c9dc901 ui/vnc: reload IFrame-embedded xtermjs on LXC startup
Same as with previous QEMU patch, avoids manual reload after starting a
container while the "Console" window is open.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-12-19 13:56:48 +01:00
Stefan Reiter
b4215471ac ui/lxc: cleanup pveSelNode to variable
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-12-19 13:56:48 +01:00
Thomas Lamprecht
aa54547678 followup: code cleanup/nitpicking
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-18 19:40:09 +01:00
Stefan Reiter
4ed9ed011d ui/vnc: reload IFrame-embedded noVNC on VM startup
Avoids having to do the 'Console' -> 'Summary' -> 'Console' dance
everytime the VM is started and the Console window is currently open.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-12-18 17:55:57 +01:00
Stefan Reiter
d5b3f512bd ui/vnc: whitespace cleanup
and formatting

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-12-18 17:55:57 +01:00
Stefan Reiter
22ee250893 ui/qemu: cleanup pveSelNode to variable
'vm' has been in use further down anyway, let's move it up.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-12-18 17:55:57 +01:00
Thomas Lamprecht
9bf061192f bump version to 6.1-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-16 15:38:50 +01:00
Thomas Lamprecht
393a6b54e1 followup: add a bit of context to error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-16 15:38:50 +01:00
Aaron Lauterer
978d16b604 API: OSD: Fix #2496 Check OSD Network
It's possible to have a situation where the cluster network (used for
inter-OSD traffic) is not configured on a node. The OSD can still be
created but can't communicate.

This check will abort the creation if there is no IP within the subnet
of the cluster network present on the node. If there is no dedicated
cluster network the public network is used as a failsafe even though
this situation should not occur.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2019-12-16 15:12:18 +01:00