54 Commits

Author SHA1 Message Date
Fabian Ebner
8d69854055 ui: snapshot tree: warn that current state is lost when confirming rollback
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-05-02 15:46:36 +02:00
Dominik Csapak
5f8b861c8e ui: resourcetree: move guest position on template creation
we sort templates at the end normally, but if we convert a guest to a
template, it was not moved in the tree

add it to the list of attributes that are checked for a move

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
2021-10-21 11:48:38 +02:00
Dominik Csapak
9fe1f9531f ui: tree/SnapshotTree: use beforedestroy instead of destroy
on extjs 7.0, this triggers when the handler is not available anymore,
so use the beforedestroy event instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 12:43:08 +02:00
Thomas Lamprecht
188bb756bd ui: snapshot tree: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 16:52:49 +02:00
Thomas Lamprecht
71acbfa71d ui: resource tree: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 14:00:59 +02:00
Thomas Lamprecht
f7fec5666f ui: eslint: enforce "no-extra-boolean-cast" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:43:40 +01:00
Thomas Lamprecht
df156f8ba1 ui: eslint: enforce "no-extra-parens" rule
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:42:36 +01:00
Thomas Lamprecht
8b520a2b6f ui: eslint: fix various spacing related issues
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:39:15 +01:00
Thomas Lamprecht
9beb47513e ui: eslint: fix trailing comma and comma related whitespaces errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:31:03 +01:00
Thomas Lamprecht
925ef9da87 ui: eslint: fix trailing spaces
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-19 17:29:55 +01:00
Thomas Lamprecht
e8a66c818a 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
f0c82f0f01 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
Alexandre Derumier
4b0c8805a3 sdn: fix zone icon in tree view
also add status icon:
  -pending (yellow triangle)
  -error (red cross)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-25 13:35:55 +02:00
Alexandre Derumier
a2acde2586 add sdn icons
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-26 12:17:53 +01:00
Alexandre Derumier
d8ffcb9333 add sdn gui
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-03-23 14:43:26 +01:00
Fabian Ebner
2425a0237d 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
02f319c78c 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
b6e98c4c03 ui snapshot tree: avoid another exception in delayd load when view is gone
similar story than commit ccf81a6f32ce2c40d0c13b498c544d7440a0f0d2
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
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
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
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
Thomas Lamprecht
d25c2edb60 js: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:44:43 +02:00
Thomas Lamprecht
5f1f944911 gui: tree: add lock information to tooltips
This was already proposed by Dominik[0], but it was was wished for a
faster backend backing of this[1], and as with most wishes one needs
to either be content with what's there or (try) to improve it one
self.. So with the IPCC approach proposed as backing for this I'd
like to add this again. It differs from [0] a bit, first it's rebased
as parts of the tooltip stuff got already applied[2].

I use "Config locked (<LOCK>)" as text for this, as it
1. Clarifies what the lock symbol means, which is always a good thing
   for tooltips
2. repeating the lock symbol here again would show the users three
   lock symbols at the same time if the VM was selected in the tree
   (the tree one, the VM config panel one, and this tool tip one)
   this is a bit much, so don't do it.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-February/035829.html
[1]: https://pve.proxmox.com/pipermail/pve-devel/2019-March/035930.html
[2]: https://pve.proxmox.com/pipermail/pve-devel/2019-March/036165.html

Co-developed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 21:28:53 +02:00
Dominik Csapak
413fc3e7fe gui: add lock to resource store and tree
add the lock to the css classes and to the columns, also check
the lock field for changed items

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-13 11:11:38 +02:00
Dominik Csapak
c239084b6a add tooltips to the tree
to give the user better feedback about the various icons (play, pause,
warning, error, etc) add a tooltip to the tree elements which
contain that information

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-26 08:50:19 +01:00
Thomas Lamprecht
4038c603dd fix #1358: ui: show clustername besides 'Datacenter' node, if available
If we get the cluster name (successful login with '/' Sys.Audit
permissions) then display it in the resource tree's root node.

This updated on login and all ticket refreshs (every 15 minutes).
I currently have no functionallity to refresh it actively on cluster
create over WebUI, as it's not a straight forward change there.
Further, this is something which does not changes often (in
production), and we cannot detect CLI or API triggered (from non-pve
clients) cluster creations anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 10:15:14 +01:00
Thomas Lamprecht
3d9d93f17a tree: prepare for ExtJS 6.2.0
Remove the expand/collapse hack needed for an earlier ExtJS version.

Further do not collapse the rootnode before restoring the state, it
may not be collapsible at this time, as it may be still seen as leaf
node, and thus throws exceptions with ExtJS 6.2.0

we fired the refresh to late for the store, i moved it up to fire
directly after we resume events on the store, i.e. when our store update
window is closed again. So it happens before applying the state and
expanding the rootnode.

see
https://pve.proxmox.com/pipermail/pve-devel/2018-February/030762.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-02-22 11:47:04 +01:00
Dominik Csapak
749fd4a5c6 show storage usage in tree
this adds a little usage indicator in the tree for all storage definitions,
so that one can easily see how much of a storage is used

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-13 14:51:07 +01:00
Dominik Csapak
dc9d74b1a8 whitespace cleanup
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
beeadf93f6 improve tree/grid icons
we improve the icons in the tree and the resource grid by
differentiating between cluster online/offline status and no rrd data

when we have no rrd data from a node/storage, instead of showing a
red x (which is scary) even if the node is reachable by corosync (which
confused quite a bit of people, because we show all nodes as online in
the datacenter summary), we show the node/storage with a '?'

this signals that something is wrong with this node, even if we can
reach it via cluster methods

this rewrite of the logic includes a refactoring of the method
of getting the icon, because we want the same icons in the tree and the
grid, and an optimization on how we use the css classes
(introducing a x-grid-custom-icon class)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
0078417710 fix reselection on vm/ct migrate in gui
there were a number of problems in how we reselected vms when they
migrated and selected:

we relied on the data in the configpanel to be static, but since
pveselnode is a reference, it actually changes when the resourcestore
changes
also, handling the reselection as a response to the statusstore failure
is very inconsistent, because we know exactly when a vm moves node in
the tree

this patch removes the whole configpanel vm migration code,
and lets the tree handle it
for this, we have to check if we have to reselect the entry,
deselect it manually and after the treeupdate reselect it

also in the right click selection check we have to check if it is
already selected, else the next selection will get canceled

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-23 13:01:12 +02:00
Dominik Csapak
85e09e1bb8 fix regression in gui when migrating guests
with using suspend/resumeEvents the reselection of vms when migrating,
was not working correctly, fixing this by resuming before selecting

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-22 12:24:43 +02:00
Dominik Csapak
2614f0f762 add suspend/resume events to updateTree
this makes adding/modifying a large number of items a lot faster

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-04 07:00:16 +02:00
Dietmar Maurer
aadd1a1f52 ResourceTree.js: return value in selectById
So that automation tools can see success.
2016-11-11 15:52:52 +01:00
Dominik Csapak
0bbd2ad671 show ha error state in tree and resource grid
with this patch, vms in an ha error state get an icon (reusing the node
offline icon) to indicate the error

in the resource grid, we also add the icon, and have an additional
column where we can display the ha state

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 09:35:05 +02:00
Dominik Csapak
181fb4d254 open vm console on doubleclick in tree
with this patch you can open the console of a guest
with a simple doubleclick in the tree

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-07-21 13:10:49 +02:00
Dominik Csapak
250a9ca7d9 set focus on tree after selecting a node
this is useful when using the new search field,
or when double clicking in the search tab,
since it focuses the item in the tree and lets
the treepanel scroll to the item

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-29 14:32:36 +02:00
Dominik Csapak
cb1520673b fix right click selection in tree
in my commit 2e1eb55afc743d6c8fd186cb227d1667fbedb585
i introduced a bug with that an item gets selected
in the tree when you right click on it

also fix the function parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-31 12:23:06 +02:00
Dominik Csapak
2e1eb55afc move cmdmenu function and use it in poolmemberlist
we had the function for the cmdmenu at two
different places (resourcetree and resourcegrid)

move it to PVE.Utils to reuse code, and
also use it in pool members list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-20 07:30:21 +02:00
Dominik Csapak
7342ce3d89 fix #979: check always for migrated vm
we only checked for grouping attributes for moved vms,
but this is only true in server view

e.g. in pool view the grouping attributes is pool
and the item is not reselected, resulting in a "file not found"
error (it looks for the conf on the wrong node)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-06 09:28:15 +02:00
Dominik Csapak
0d301cf73a fix lint errors
jslint does not like trailing commas and assignments
of the form "x = !(expression)"

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-03 06:07:19 +02:00
Dominik Csapak
14986f7491 jslint: remove trailing commas
before ECMA5 trailing commas in arrays and objects
are forbidden

in jslint this is an error and cannot be deactivated

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-29 17:06:34 +02:00
Dominik Csapak
1b51cd2a29 jslint: fix type confusion and property access
fix various type confusion, for example:
items: {} and items: []
style: string and style: {}

also fix object['property'] access with
object.property

also fix /=/ with either '=' or /\=/ where appropriate
(/=/ can be confused with /= according to jslint)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-29 17:06:23 +02:00
Dominik Csapak
c36d5b7f79 disable selecting when right clicking in tree
ext4 would not select a tree item on right click,
ext6 does this, so we have to save which
mousebutton was clicked and react accordingly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-29 09:14:09 +02:00
Dominik Csapak
8bd07dc8d9 mark item as changed when status is different
to detect changes from running->paused and reverse,
since this is now reflected by the icons

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-11 13:03:44 +02:00
Dominik Csapak
3ceaef87d8 add new icons to grid and tree
we set new icons for the tree and grid
changes:
* new icons
* wider type column (bigger icons)
* use arrows true (uses arrows instead of +/- and gets rid of the
  ugly lines in the tree)
* datacenter has icon instead of folder open/close
* "folder view" gets type icons for folders

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-11 11:49:59 +02:00
Dominik Csapak
5b0eb0481a prevent contextmenu on lxc templates
since we do not support lxc templates on the gui yet,
prepare the correct contextmenu call, but comment it out

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-05 15:34:40 +02:00
Dietmar Maurer
6ff38900fa reduce translation overhead 2016-04-05 11:10:52 +02:00