Commit Graph

28 Commits

Author SHA1 Message Date
Thomas Lamprecht
a0b5aa9096 ui: data/ResourceStore: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-17 20:03:47 +02:00
Dominik Csapak
1bd7bcdbf1 ui: Utils: use render functions from widget-toolkit
they live there now, so we can delete them here and use the ones from
widget-toolkit instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 18:34:34 +02:00
Alexandre Derumier
a62ee73073 fixes #3066: resourcestore: add vm hostcpu/hostmem fields
This add new fields with cpu/mem percent usage of vms,
relative to host maxcpu/maxmem.

Currently, we can't sort easily most consumming vm on a host.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2021-02-06 15:16:22 +01:00
Thomas Lamprecht
53e3ea8488 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
8058410f40 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
f6710aac38 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
3bbce3b8cd drop jslint lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:11:47 +02:00
Thomas Lamprecht
2ae20617aa ui: ha: add name of service to resource grid
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 20:03:53 +01:00
Dominik Csapak
6284a48ad1 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
Wolfgang Link
934182317d Add function guestNode
This function extracts the node where the guest resists.
2018-11-22 08:50:32 +01:00
Wolfgang Link
01532f8dcc Add function storageIsShared
This function extracts the shared flag of the storage state.
2018-11-22 08:50:32 +01:00
Thomas Lamprecht
56a353b9e7 use RestProxy from widget toolkit
Split PVE specific models, which where not moved to the general
widget toolkit, in a separate folder: data/models/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:38 +01:00
Dominik Csapak
e7ade592e3 use Proxmox.Utils instead of PVE.Utils
some function are now in Proxmox.Utils instead, so we have to use that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-25 13:36:38 +01:00
Dominik Csapak
0c7c0d6bcf use UpdateStore from widget toolkit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-25 13:36:37 +01:00
Dominik Csapak
03f18f5e0b add a new status column in the resourcestore
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:27:07 +01:00
Dominik Csapak
cf73d1efc9 optimize 'text' field in resourcestore
instead of doing a lot of string comparisons, we first check
the type with the most objects (vms/cts) via number operation

and in all other cases, we can simply use the type as property index

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-04 09:28:15 +02:00
Dominik Csapak
2abb517fcc optimize resourcestore field collection
instead of doing weird if/elsif checks with nonsensical logic

we simply check the 3 properties we want (namely convert,calculate and
defaultValue) and add them to our field definition.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-04 06:59:54 +02:00
Dominik Csapak
ec8273637d optimize 'running' field
we do not need to check for qemu/lxc/node because the other types
do not have an uptime value

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-04 06:55:22 +02:00
Thomas Lamprecht
c9329af1ca VMSelctor: add HA state and allow to filter with it
This allows also to filter after HA states, so one may bulk control
HA managed services more easily or do bulk actions just on unmanaged
VMs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 09:01:05 +01:00
Thomas Lamprecht
818dfc5c46 PVEResource store: respect defaulValue of elements
If we explicitly set a fields defaultValue we really want it in the
Model.

Also needed for a further patch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 09:00:29 +01:00
Thomas Lamprecht
3a8c89c2f8 ResourceStore: fix typo s/Colum/Columns/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-03-16 08:59:41 +01:00
Dominik Csapak
2b2fe160f5 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
Thomas Lamprecht
d9e0293926 add getNodes function to PVEResource store
Add the getNodes function to the periodically asynchronous updated
PVEResource store. This allows a component to get the node data
directly, without making an API call and waiting that it's finished,
the data is also up to date.

A usage example would be:

var data = PVE.data.ResourceStore.getNodes();

var store = Ext.create('Ext.data.Store', {
    fields: [ 'node', 'mem', 'cpu', ... ], // or a model
    data: data,
    proxy: {
	type: 'memory',
	reader: {type: 'json'}
    },
    ...
});

I'll use it in a later patch to avoid two asynchrony store loads
where I'd have logic in place for the case that either one finishes
first, this function helps me to avoid such logic while achieving
the same functionallity.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-07 08:29:22 +02:00
Dominik Csapak
22f2f9d6c0 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
0be88ae197 remove trailing whitespaces
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-20 09:37:06 +02:00
Dominik Csapak
728f1b97e6 fix #143: add disk/mem percent sort
previously, we had a disk/memory usage column in the resource grid,
whose raw data were the bytes used, but we added a renderer
to display it as percentage

with this, the columns sorted by bytes and not by percentage,
which made the column rather confusing

with this patch, we add a real percentage column (where the
data is a float from 0 to 1) so it sorts correctly

also make the old columns show the used size in B/KiB/etc.
by default we still only show the percentage column

since the disk usage part was always zero with qemu guests,
leave it empty there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-20 09:36:23 +02:00
Dominik Csapak
b1d8e73d15 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
Dietmar Maurer
bac5bd135c rename manager5 to manager6 2016-01-22 11:24:10 +01:00