Commit Graph

56 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
baed2b7c41 fix #2574: ui: permission-path selector: push each unique path only once
In clusters a storage was pushed as many times as there are nodes
using it. Ensure we only push a path once, do this with a memory
oriented solution, i.e., build a extra object to remember what we
already pushed. This is preferred over a me.findExact call as it's a
o(n) vs o(n^2) solution compute wise and we make the user wait if
this would need long, so reducing compute time over memory use is
here a good choice - even if we will seldom run into situations where
this actually will make a difference with such small data counts.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-24 02:10:50 +02:00
Thomas Lamprecht
d6d084dc14 ui: some eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-24 02:09:40 +02:00
Dominik Csapak
2892e74479 ui: remove Realm model and RealmComboBox
and use it from widget-toolkit

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-18 18:42:16 +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
b55e7f5ad9 ui: permissions: allow to select root path '/' directly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-25 10:18:12 +02:00
Dominik Csapak
3b1cb257eb indentation fixes
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-25 17:24:49 +02:00
René Jochum
cd84df4c6e fix #1499 Implement a combobox for Permissions paths
Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-05-25 17:19:07 +02:00
Dominik Csapak
0f74857efe add missing idProperty for pve-domains model
without this, we could not delete realms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-03-12 15:19:06 +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
Thomas Lamprecht
9cb193cf8c use ObjectStore from widget toolkit
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
Thomas Lamprecht
b97ad4656d use TimezoneStore from widget toolkit
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
Thomas Lamprecht
eaa018d71e use DiffStore from widget toolkit
The alias stayed the same (store.diff) so we need to change direct
usage of 'PVE.data.DiffStore' only.

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
1774f14804 create some models
we want to use the getId method of some records, but for this
we need that the records are defined as an instance of a model,
so we create some and use them

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
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
0926feeeb4 use JsonObject from widget toolkit
same xtype/alias, so there is nothing to do except remove it from
pve-manager

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
5536d678cb use RRDChart and RRDStore from widget toolkit
also remove old unused RRDView

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
8bb85b71cc add rrd models
they will be used with the rrdstore

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
e2c2bf5e50 fix updateStore destroy
the store never fires/gets a destroy event, thus it
never stops the load_task and never unqueues itself in case
the store gets destroyed but not explicitely stopped

with overriding the destroy method, this works now as intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-16 07:09:18 +02: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
0c8d740228 fix diffstore issue with clusterlog
extjs cannot "convert" and id from other fields, so the ids in the
diffstore and the realstore are different and we re-add every element on
every update

to mitigate this, we generate the id (which is "uid:hostname") in the
backend, and simply use it in the frontend

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-10 11:09:46 +01:00
Dominik Csapak
4501139482 load the diffstore on init
if the rstore in the diffstore is already loaded at the time of
the instantiation, load the data instantly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-12-22 09:44:24 +01:00
Dominik Csapak
45998f0d69 add an alias to the diffstore
to use it declarative like this:

store : {
    type: 'diff'
}

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-12-22 09:43:16 +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
6897aeb307 fix surviving update store
when a load of an update store was ongoing and stopUpdate
was called, the task could not be canceled, and the store
would remain indefinitely

this patch sets 'isStopped' of the store on stopUpdate
and checks it on the next update and stopping it then

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-07-07 08:15:14 +02:00
Dominik Csapak
91535f2ba7 htmlEncode some comment fields
this adds Ext.String.htmlEncode as renderer
for some comment/description fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-09 17:40:03 +02:00
Dominik Csapak
f51fdaa6a8 fix wrong message after subscription upload
since extjs5 Store.snapshot does not exist anymore,
we didnt remove filtered records

this lead to the fact, that the 'message' record did
not get removed and a "no subscription file" message
was shown directly after uploading a key

to get also the filtered records in the store
we use store.getData().getSource()

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-20 12:05:50 +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
Dominik Csapak
921324b6e1 use new rrd graphs on storage summary pages
this was missing before
also fix styling error (style takes not a single string parameter)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-03-31 17:17:40 +02:00
Dominik Csapak
b549494539 ext6migrate: add RRDStore class and RRDChart
this patch adds two classes for the charts:

RRDStore:

based on our updatestore, but specialized on our rrddata output
it converts the percentage (cpu) and the time (from unix to milliseconds)

also it handles the changes for the timeframe and cf

it sets a default reload of 30seconds

RRDChart:

based on Ext.chart.CartesianChart,
with specialized options for our rrd graphs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-03-31 10:38:28 +02:00