Commit Graph

10 Commits

Author SHA1 Message Date
Thomas Lamprecht
e41a172b63 ui: snapshot tree: add separator between rollback and edit button
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 14:00:07 +01:00
Moayad Almalat
97f8afffd4 close #3114: ui: snapshots: switch Edit and Remove Button & add warning logo
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2020-11-23 13:57:40 +01:00
Fabian Ebner
7fb02366e0 Hide 'Include RAM' when VM isn't running
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-02-06 22:31:39 +01:00
Dominik Csapak
c16c13020d gui: tree/SnapshotTree: fix gettext invocation
our gettext extractor cannot handle such statements to extract the
gettext, so change it to two gettexts

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-02-05 20:23:17 +01:00
Thomas Lamprecht
87ae19d1ee ui snapshot tree: avoid another exception in delayd load when view is gone
similar story than commit 9cc4958f5a
We cannot really assert anything about the state of me (the view) and
consorts if me.destroyed is true, just early return.

We can get here because this is a delayed task, i.e., async,
everything can happen in between triggering it and receiving the
actual callback, so guard!

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 20:06:16 +01:00
Thomas Lamprecht
9cc4958f5a 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
e1af138576 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
b9c780c5a8 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
9a6b894fcc 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
5b1b9360eb 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