]> git.proxmox.com Git - proxmox-widget-toolkit.git/log
proxmox-widget-toolkit.git
3 years agocleanly separate sources from package build, move to own folder
Thomas Lamprecht [Sat, 6 Jun 2020 15:35:28 +0000 (17:35 +0200)]
cleanly separate sources from package build, move to own folder

compared result with `diffoscope`, saw now difference

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agouse eslint and execute as check target
Thomas Lamprecht [Sat, 6 Jun 2020 15:20:50 +0000 (17:20 +0200)]
use eslint and execute as check target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd pbs to upload target
Thomas Lamprecht [Sat, 6 Jun 2020 15:20:30 +0000 (17:20 +0200)]
add pbs to upload target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomake eslint 100% happy
Thomas Lamprecht [Sat, 6 Jun 2020 15:15:42 +0000 (17:15 +0200)]
make eslint 100% happy

lots of churn and changes but will allow to enforce linting again in
the build system.

Also switch over from var to let.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosome more eslint fixes
Thomas Lamprecht [Sat, 6 Jun 2020 13:05:48 +0000 (15:05 +0200)]
some more eslint fixes

manually adapted after eslint --fix call due to our damn weird
indentation scheme

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoeslint fixes all over the place
Thomas Lamprecht [Sat, 6 Jun 2020 13:01:33 +0000 (15:01 +0200)]
eslint fixes all over the place

all autofixed by eslint with a slightly reduced base config rule set
to avoid rules which may give some undesired results in our code
base.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: some eslint fixes and refactoring
Thomas Lamprecht [Sat, 6 Jun 2020 11:52:17 +0000 (13:52 +0200)]
utils: some eslint fixes and refactoring

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: some eslint fixes
Thomas Lamprecht [Sat, 6 Jun 2020 11:52:17 +0000 (13:52 +0200)]
utils: some eslint fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotask description: use 'Backup Job' if no id is set
Thomas Lamprecht [Fri, 5 Jun 2020 13:09:35 +0000 (15:09 +0200)]
task description: use 'Backup Job' if no id is set

We set the id for vzdump tasks only for single VM/CT backups, so if
it's undefined we got a job for sure.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoformat task description: avoid printing undefined ID
Thomas Lamprecht [Fri, 5 Jun 2020 12:51:44 +0000 (14:51 +0200)]
format task description: avoid printing undefined ID

fixes and regression for backup jobs which seems to get from empty
string to undefined ID in PVE 6.x - whyever...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.2-7
Thomas Lamprecht [Thu, 4 Jun 2020 16:20:20 +0000 (18:20 +0200)]
bump version to 2.2-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorrd: only move legend to header if both exists
Thomas Lamprecht [Thu, 4 Jun 2020 16:19:16 +0000 (18:19 +0200)]
rrd: only move legend to header if both exists

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobutton: make xtype of parent configurable
Dominik Csapak [Thu, 4 Jun 2020 10:32:02 +0000 (12:32 +0200)]
button: make xtype of parent configurable

to get the selection model of the parent, we use by default the xtype
'grid', but sometimes we want to use something else (e.g. 'treepanel')

to be flexible we make this configurable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobump version to 2.2-6
Thomas Lamprecht [Wed, 3 Jun 2020 09:43:43 +0000 (11:43 +0200)]
bump version to 2.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: add updateColumnWidth helper from PVE
Thomas Lamprecht [Fri, 29 May 2020 17:31:02 +0000 (19:31 +0200)]
utils: add updateColumnWidth helper from PVE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorrd charts: add legend to header for better space usage
Thomas Lamprecht [Fri, 29 May 2020 17:16:18 +0000 (19:16 +0200)]
rrd charts: add legend to header for better space usage

Docking the legend to the bottom took space away from the chart, and
was the just used as the simplest solution when it was implemented.

The panel header has enough spaces for any reasonable number of
different series in a chart, so move it there.

Drop then the legend toggle tool from the header as it isn't required
anymore..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorrd charts: cleanup
Thomas Lamprecht [Fri, 29 May 2020 17:15:52 +0000 (19:15 +0200)]
rrd charts: cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorrd charts: render 3 decimal points for small values
Thomas Lamprecht [Fri, 29 May 2020 17:15:08 +0000 (19:15 +0200)]
rrd charts: render 3 decimal points for small values

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocss: reduce chart legends space impact
Thomas Lamprecht [Fri, 29 May 2020 12:14:26 +0000 (14:14 +0200)]
css: reduce chart legends space impact

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.2-5
Thomas Lamprecht [Thu, 28 May 2020 16:36:40 +0000 (18:36 +0200)]
bump version to 2.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoformat_duration_short: rename to format_duration_human and change semantics a bit
Thomas Lamprecht [Thu, 28 May 2020 16:31:21 +0000 (18:31 +0200)]
format_duration_short: rename to format_duration_human and change semantics a bit

The rationale is that things like 11.4d or 22.6h is hard to parse for
humans (base 10 to base 60 or base 24 conversion). So try to emulate
what a human would tell another human to pass a duration information
along with reasonable good but not high accuracy.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoUtils: add duration format/render
Dominik Csapak [Thu, 28 May 2020 11:02:50 +0000 (13:02 +0200)]
Utils: add duration format/render

from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agocss: add icon colors
Dominik Csapak [Thu, 28 May 2020 11:02:51 +0000 (13:02 +0200)]
css: add icon colors

from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoimprove error extraction for monStoreErrors
Dominik Csapak [Tue, 26 May 2020 09:55:10 +0000 (11:55 +0200)]
improve error extraction for monStoreErrors

by printing the whole error body when it cannot be parsed as JSON

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoform/display edit: use the 'fit' layout to avoid width glitch
Thomas Lamprecht [Tue, 26 May 2020 16:26:52 +0000 (18:26 +0200)]
form/display edit: use the 'fit' layout to avoid width glitch

As else we get some issues with inner field adding some space on
outer fieldcontainer, which let a mix of "normal" fields and this one
appear asymmetrical.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoJournalView: avoid null dereference on quick tab switch
Thomas Lamprecht [Tue, 26 May 2020 08:13:04 +0000 (10:13 +0200)]
JournalView: avoid null dereference on quick tab switch

the updateView method can be called through an XHR request callback,
which may get triggered once the user switched already over to
another panel and viewmodel isn't valid (or did not get valid at the
first place) anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.2-4
Thomas Lamprecht [Mon, 25 May 2020 17:04:16 +0000 (19:04 +0200)]
bump version to 2.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agotask history: better default column width
Thomas Lamprecht [Mon, 25 May 2020 16:56:56 +0000 (18:56 +0200)]
task history: better default column width

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agonode/tasks: eslint fixes
Thomas Lamprecht [Mon, 25 May 2020 16:37:10 +0000 (18:37 +0200)]
node/tasks: eslint fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: task history: handle running tasks
Thomas Lamprecht [Mon, 25 May 2020 16:32:00 +0000 (18:32 +0200)]
ui: task history: handle running tasks

normally this is used as strict task history, meaning no running
tasks included. But we can have running tasks in PBS here, so at
least avoid that they're shown as error.

Also add a refresh button as a simple workaround to the auto-refresh
problem, which isn't straightforward to solve with the buffered
reader we have here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: task descriptions: allow to use functions
Thomas Lamprecht [Mon, 25 May 2020 16:27:18 +0000 (18:27 +0200)]
utils: task descriptions: allow to use functions

Useful if we need to split the ID, or do some more complex rendering
for a task type.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoutils: task descriptions: allow to add/override entries
Thomas Lamprecht [Mon, 25 May 2020 16:20:24 +0000 (18:20 +0200)]
utils: task descriptions: allow to add/override entries

Allows having only the common ones here, and more special ones in the
per product code. Sometimes there are simple worker IDs which can
have a very different meaning for one product, with this that clash
can be resolved in a standardized way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: network: make CIDR & gateway column broader by default
Thomas Lamprecht [Mon, 25 May 2020 16:14:12 +0000 (18:14 +0200)]
ui: network: make CIDR & gateway column broader by default

ensuring they fit at least always a full IPv4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoui: network: code cleanup
Thomas Lamprecht [Mon, 25 May 2020 16:13:34 +0000 (18:13 +0200)]
ui: network: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorender_upid: fallback to worker_{id,type}
Thomas Lamprecht [Mon, 25 May 2020 13:11:56 +0000 (15:11 +0200)]
render_upid: fallback to worker_{id,type}

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocss: add proxmox-invalid-row class
Thomas Lamprecht [Mon, 25 May 2020 14:46:48 +0000 (16:46 +0200)]
css: add proxmox-invalid-row class

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreturn cookie again in authOK
Dominik Csapak [Mon, 25 May 2020 11:46:54 +0000 (13:46 +0200)]
return cookie again in authOK

the calling code did require that authOK returns the cookie if
there is a valid one

make it now very explicit that the cookie gets returned instead
of using implicit short-circuit behaviour

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agofix #2758: reject 'tfa' cookies
Dominik Csapak [Mon, 25 May 2020 08:35:02 +0000 (10:35 +0200)]
fix #2758: reject 'tfa' cookies

return false on authOK when the ticket is a tfa ticket
(starts with PVE:tfa!)

when a user now loads the page with only a tfa ticket, it shows the
login window again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobump version to 2.2-3
Thomas Lamprecht [Fri, 22 May 2020 11:08:16 +0000 (13:08 +0200)]
bump version to 2.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agowindow: edit: eslint fixes
Thomas Lamprecht [Fri, 22 May 2020 11:08:07 +0000 (13:08 +0200)]
window: edit: eslint fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agowindow: edit: call setValue on all fields
Thomas Lamprecht [Fri, 22 May 2020 11:01:01 +0000 (13:01 +0200)]
window: edit: call setValue on all fields

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agowindow password edit: refactor to more schematic code
Thomas Lamprecht [Fri, 22 May 2020 09:27:28 +0000 (11:27 +0200)]
window password edit: refactor to more schematic code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoPendingObjectGrid: mark pending changes as orange
Thomas Lamprecht [Fri, 22 May 2020 07:37:51 +0000 (09:37 +0200)]
PendingObjectGrid: mark pending changes as orange

as red is commonly associated with an error, which pending changes
ain't. But, they should be clearly visible - so use darkorange

3 years agoadd pmxRoleSelector
Dominik Csapak [Tue, 19 May 2020 14:48:36 +0000 (16:48 +0200)]
add pmxRoleSelector

copied+refactored from pve-manager
for use with other projects

also show privs now in the combobox

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoinput panel: call setValue on all fields
Thomas Lamprecht [Tue, 19 May 2020 19:17:22 +0000 (21:17 +0200)]
input panel: call setValue on all fields

Fixes the displayedit field and makes some rarer case much easier to
do. Normally we only need this if there are two viewmodel synced
fields, where only one is enabled at a time..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodisplayedit: fixup to correct version
Thomas Lamprecht [Tue, 19 May 2020 19:14:51 +0000 (21:14 +0200)]
displayedit: fixup to correct version

it seems I made an error and applied an older version..
Apply the correct one[0] with Dominiks comment addressed[1].

[0]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043037.html
[1]: https://pve.proxmox.com/pipermail/pve-devel/2020-April/043043.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.2-2
Thomas Lamprecht [Mon, 18 May 2020 15:27:05 +0000 (17:27 +0200)]
bump version to 2.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd Realm model and RealmComboBox
Dominik Csapak [Fri, 15 May 2020 08:19:26 +0000 (10:19 +0200)]
add Realm model and RealmComboBox

copied from pve-manager, with adaptions for modern js
(let, parameter destructuring,...)

and dropped the not needed 'needOTP' method

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoadd PMX.image.Logo
Dominik Csapak [Fri, 15 May 2020 08:19:25 +0000 (10:19 +0200)]
add PMX.image.Logo

copied from pmg-gui, adapted to be able to set a custom url prefix
when we want to use something other than '/pve2'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agowindow/Edit: read digest also from top level response
Dominik Csapak [Fri, 15 May 2020 08:19:24 +0000 (10:19 +0200)]
window/Edit: read digest also from top level response

we want to have the digest in the top level object, like:
{
    data: { /* the real data */ },
    digest: "fa123asf123123123", // the digest
}

instead of in the data itself, so read it preferably from there
(with fallback to stay compatible)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobump version to 2.1-8
Thomas Lamprecht [Thu, 7 May 2020 14:59:50 +0000 (16:59 +0200)]
bump version to 2.1-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodiff store: set autoDestroyRstore by default to true for rstore configs
Thomas Lamprecht [Thu, 7 May 2020 10:54:06 +0000 (12:54 +0200)]
diff store: set autoDestroyRstore by default to true for rstore configs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodata/DiffStore: auto-create the rstore if its just a config
Dominik Csapak [Thu, 7 May 2020 08:27:06 +0000 (10:27 +0200)]
data/DiffStore: auto-create the rstore if its just a config

when rstore is not instanciated but only a config,
auto-create it with its type

this allows us to configure an diff/rstore combination completely
declaratively like this:

store: {
    type: 'diff',
    autoDestroy: true,
    autoDestroyRstore: true,
    rstore: {
type: 'update',
model: 'some-model',
autoStart: true,
interval: 5000,
    },
},

the only thing we have to be careful about is to either
do a manual 'stopUpdate' somewhere, or use the 'autoDestroyRstore' flag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodata/DiffStore: add autoDestroyRstore flag
Dominik Csapak [Thu, 7 May 2020 08:27:05 +0000 (10:27 +0200)]
data/DiffStore: add autoDestroyRstore flag

when this flag is set, the diffstore will automatically try to destroy
the rstore when it is destroyed itself

for this we have to move the rstore into the object (instead of using a closure)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agobump version to 2.1-7
Thomas Lamprecht [Wed, 6 May 2020 15:15:04 +0000 (17:15 +0200)]
bump version to 2.1-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd missing htmlEncodes
Dominik Csapak [Thu, 30 Apr 2020 14:03:57 +0000 (16:03 +0200)]
add missing htmlEncodes

username can include some special characters, so we have
to escape them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agodrop unused comment
Thomas Lamprecht [Tue, 5 May 2020 12:50:51 +0000 (14:50 +0200)]
drop unused comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agowindow/LanguageEdit: make window non-resizable
Dominik Csapak [Mon, 27 Apr 2020 14:40:27 +0000 (16:40 +0200)]
window/LanguageEdit: make window non-resizable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agocbind: allow methods in cbindData
Thomas Lamprecht [Mon, 4 May 2020 16:19:01 +0000 (18:19 +0200)]
cbind: allow methods in cbindData

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoUtils: add 'auth-realm-sync-test' to task descriptions
Dominik Csapak [Thu, 9 Apr 2020 14:10:43 +0000 (16:10 +0200)]
Utils: add 'auth-realm-sync-test' to task descriptions

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 2.1-6
Thomas Lamprecht [Fri, 24 Apr 2020 16:47:24 +0000 (18:47 +0200)]
bump version to 2.1-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoDateTimeField: implement set{Max, Min}Value
Dominik Csapak [Fri, 24 Apr 2020 13:57:52 +0000 (15:57 +0200)]
DateTimeField: implement set{Max, Min}Value

this sets the max/min value for the underlying date and time fields,
and allowing to only change the value respecting both current date
and time fields
e.g.
if the new maxValue is 2020-10-10 12:00
and the current value is 2020-10-09 15:00
do not allow to set the date to 2020-10-10
and vice versa (if the new limit is on the same day, limit the time range)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agomonStoreErrors: refactor out and render param exception errors
Thomas Lamprecht [Fri, 24 Apr 2020 14:59:13 +0000 (16:59 +0200)]
monStoreErrors: refactor out and render param exception errors

adapt the .x-mask-msg-text class to center the text, as else this
looks not to nice..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 2.1-5
Thomas Lamprecht [Mon, 20 Apr 2020 08:44:38 +0000 (10:44 +0200)]
bump version to 2.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoStdRemoveButton: code cleanup
Thomas Lamprecht [Sat, 18 Apr 2020 17:27:24 +0000 (19:27 +0200)]
StdRemoveButton: code cleanup

most done by eslint --fix, a bit tinkered manually though

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoStdRemoveButton: enable by default if no selection model
Thomas Lamprecht [Sat, 18 Apr 2020 17:26:18 +0000 (19:26 +0200)]
StdRemoveButton: enable by default if no selection model

As in that case we normally want it to be enabled from the start, as
no selection model is there and so we cannot wait until one item is
selected until we enable it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoStdRemoveButton: getUrl: fallback to baseurl if no selModel is set
Thomas Lamprecht [Sat, 18 Apr 2020 17:12:51 +0000 (19:12 +0200)]
StdRemoveButton: getUrl: fallback to baseurl if no selModel is set

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobutton: don't auto set selection model if explicitly set to false
Thomas Lamprecht [Sat, 18 Apr 2020 17:10:12 +0000 (19:10 +0200)]
button: don't auto set selection model if explicitly set to false

while one could use `selModel: null` to achieve this it feels really
weird that `selModel: false` could result in a selection model being
auto searched and set

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agowindow/Edit: accept bodyPadding from config
Dominik Csapak [Thu, 9 Apr 2020 14:10:42 +0000 (16:10 +0200)]
window/Edit: accept bodyPadding from config

this is sometimes useful, e.g. when using a tabpanel in an edit window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agowindow/Language Edit: use view controller
Thomas Lamprecht [Fri, 17 Apr 2020 15:57:59 +0000 (17:57 +0200)]
window/Language Edit: use view controller

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd LanguageEditWindow
Dominik Csapak [Fri, 17 Apr 2020 11:23:35 +0000 (13:23 +0200)]
add LanguageEditWindow

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 2.1-4
Thomas Lamprecht [Thu, 16 Apr 2020 16:05:42 +0000 (18:05 +0200)]
bump version to 2.1-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoUpdateStore: fix 'undefined' interval
Dominik Csapak [Wed, 15 Apr 2020 14:30:34 +0000 (16:30 +0200)]
UpdateStore: fix 'undefined' interval

in some cases, we provide a config with interval set to 'undefined',
which gets happily applied to the config, but gets interpreted as '0'
when actually starting the task, resulting in constant api requests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoform: add Proxmox.form.field.DisplayEdit
Thomas Lamprecht [Tue, 31 Mar 2020 16:14:36 +0000 (18:14 +0200)]
form: add Proxmox.form.field.DisplayEdit

This allows to write our often used:

> {
>     xtype: me.isCreate ? 'someEditableField' : 'displayfield',
>     ...
> }

In a more schematic way, as it can now be controlled by either our
CBind mixin or ExtJS native data binding.

Use a Field container to add both, they editable and they display,
variants of a form field. As default use "textfield" for the editable
and "displayfield" xtype for the read only one.

Pass all but the editConfig and editable members of our initial
config to the display field, allow further to configure the editable
field with an editConfig object, which overwrites the config
properties inherited from the displayConfig/parent config.

This gives full control while not enforcing to specify anything extra
for most default cases.

Enforce initial state of the fields even if the databinding would
handle it to avoid glitches after first render for simple boolean expression
cases.

> {
>     xtype: 'pmxDisplayEditField',
>     cbind: {
>         editable: '{isCreate}',
>     },
>     name: 'tokenid',
>     fieldLabel: gettext('Token ID'),
>     value: me.tokenid,
>     allowBlank: false,
> }

Here, cbind could also be a bind or a native boolean expression.

For something else than a texfield one would use the editConfig, e.g.:
> {
>     ....
>     editConfig: {
>         xtype: 'pveUserSelector',
>         allowBlank: false,
>     },
> },

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoopen picker for all comboboxes on focus, even if they are editable
Dominik Csapak [Thu, 16 Apr 2020 11:13:46 +0000 (13:13 +0200)]
open picker for all comboboxes on focus, even if they are editable

when a combobox was editable, a click inside did not open the picker,
but it would if the combobox was not editable.

Since this is
 1. Inconsistent
 2. Inconvenient (the user has to specifically press the arrow)

we already had this implemented for our ComboGrid, but not for
regular comboboxes

This patch moves the code for this to an override for ComboBox, which
our ComboGrid then inherits (so we do not need it there anymore)

while at it, do some non-significant code-cleanup
 * whitespace fixes
 * don't shadow 'me' in the focus callback
 * fix typo in comment

Originally this was implemented in pve-manager, commit
851c032d69ad5ae23725dd1add9e4084ebc12650

https://git.proxmox.com/?p=pve-manager.git;a=commitdiff;h=851c032d69ad5ae23725dd1add9e4084ebc12650

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Originally-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoutils: add 'auth-realm-sync' task description
Thomas Lamprecht [Fri, 3 Apr 2020 07:33:52 +0000 (09:33 +0200)]
utils: add 'auth-realm-sync' task description

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoupdate store: move store parameter into config, use getter/setter
Thomas Lamprecht [Fri, 3 Apr 2020 06:50:39 +0000 (08:50 +0200)]
update store: move store parameter into config, use getter/setter

this allows to drop setting the default values and ensures that when
interval is updated it actually effects the used update frequency.

Anything which was saved in "me" before, for example me.autoStart, is
still there and gets also updated on a me.setIsStopped(), so there
should be no effects on code using internals.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoupdate store: refactor do modern syntax
Thomas Lamprecht [Fri, 3 Apr 2020 06:49:43 +0000 (08:49 +0200)]
update store: refactor do modern syntax

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoform: add Proxmox.form.field.ExpireDate
Thomas Lamprecht [Tue, 31 Mar 2020 12:50:34 +0000 (14:50 +0200)]
form: add Proxmox.form.field.ExpireDate

Behaves like a 'datefield' but treats the 0/empty value as "never",
and sets all defaults for behaving like one would expect from a date
expire field.

This allows to replaces hacks (e.g. [0]) from our various expire date
fields, mostly in PVE/PMG user accounts, and also for the soon to be
applied API token gui.

[0]: https://git.proxmox.com/?p=pve-manager.git;a=blob;f=www/manager6/dc/UserEdit.js;h=40c4044fd9364c9bcb8787507068378ed9936f67;hb=806edfe19f049f07db2628c68e4e5702bbedd9d7#l159

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoobject grid: allow to pass online help to row editors
Thomas Lamprecht [Tue, 31 Mar 2020 13:04:25 +0000 (15:04 +0200)]
object grid: allow to pass online help to row editors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAdd Ar to Languages map - Login page
Moayad Almalat [Tue, 18 Feb 2020 12:46:51 +0000 (13:46 +0100)]
Add Ar to Languages map - Login page

Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
4 years agoadd capitalized NoneText
Dominik Csapak [Wed, 5 Feb 2020 10:59:00 +0000 (11:59 +0100)]
add capitalized NoneText

we want this in some cases

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoComboGrid: fix validation for !allowBlank disabled fields
Stefan Reiter [Mon, 3 Feb 2020 14:14:42 +0000 (15:14 +0100)]
ComboGrid: fix validation for !allowBlank disabled fields

Used in "Add USB to VM" dialog for example.

This was broken before 15206214d9 "ComboGrid: fix on-load validation for blank
values" (only the one you enabled first was validated, the other always showed
as valid), and afterwards too, but in a different way (both are now immediately
marked invalid until you select and unselect them) - which is how I noticed.

With this the validation now works correctly.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agobump version to 2.1-3
Thomas Lamprecht [Thu, 30 Jan 2020 16:49:50 +0000 (17:49 +0100)]
bump version to 2.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoindentation cleanup
Thomas Lamprecht [Thu, 30 Jan 2020 16:50:16 +0000 (17:50 +0100)]
indentation cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonet/node: add some "hint" for VLAN add window
Thomas Lamprecht [Thu, 30 Jan 2020 16:36:43 +0000 (17:36 +0100)]
net/node: add some "hint" for VLAN add window

The three naming schemes are not ideal, but well here we are for now.
Add some hint to explain what one can do with which version - try to
keep it rather short. It's not ideal but hopefully better than
nothing :)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode/net: add onlineHelp reference to interface add windows
Thomas Lamprecht [Thu, 30 Jan 2020 16:24:36 +0000 (17:24 +0100)]
node/net: add onlineHelp reference to interface add windows

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode/net: move MTU to advanced section
Thomas Lamprecht [Thu, 30 Jan 2020 16:23:01 +0000 (17:23 +0100)]
node/net: move MTU to advanced section

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode/net: fix indentation a bit
Thomas Lamprecht [Thu, 30 Jan 2020 15:30:19 +0000 (16:30 +0100)]
node/net: fix indentation a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd vlan interface support
Alexandre Derumier [Tue, 28 Jan 2020 10:24:45 +0000 (11:24 +0100)]
add vlan interface support

vlan-raw-device && vlan-id field are only
enabled if interface name is different than interfaceX.Y

I have added a listener on iface,
to enable them live if user want a custom name for vlan interface

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 years agoComboGrid: fix on-load validation for blank values
Stefan Reiter [Wed, 29 Jan 2020 10:27:18 +0000 (11:27 +0100)]
ComboGrid: fix on-load validation for blank values

Commit f32aa3df74 fixed marking multi-select fields with where the store
did not contain a valid value after loading.

However, it introduced a bug for single-select fields where the value
(before the store-load) was explicitly set to be empty (when that should
be invalid because of allowBlank === false).

Fix the logic to correctly detect all scenarios (with def being the
value selected before the store loaded, i.e. undefined or an empty
array):

  !allowBlank &&
    ( def is an array but empty || def is not an array and falsy )

Also use correct error message (localized by ExtJS itself).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agowindow: edit: allow to set submit text for data binding
Thomas Lamprecht [Thu, 30 Jan 2020 14:54:08 +0000 (15:54 +0100)]
window: edit: allow to set submit text for data binding

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocbind: allow to pass "formula" function in binding
Thomas Lamprecht [Thu, 30 Jan 2020 14:51:50 +0000 (15:51 +0100)]
cbind: allow to pass "formula" function in binding

can often ve useful and doesn't hurts, somewhat similar to ExtJS
forumlas in viemodels, but inline.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agomixin cbind: avoid undefined cbindData access
Thomas Lamprecht [Thu, 23 Jan 2020 12:42:02 +0000 (13:42 +0100)]
mixin cbind: avoid undefined cbindData access

Else we can fail at the first fallback check in getConfigValue while
we still have the possibility to have the cbinded key available in
"me" (initial config).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocbind: handle properties with undefined value in cloneTemplateObject
Thomas Lamprecht [Wed, 15 Jan 2020 12:09:56 +0000 (13:09 +0100)]
cbind: handle properties with undefined value in cloneTemplateObject

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonetworkedit: add mtu field
Alexandre Derumier [Fri, 10 Jan 2020 02:55:09 +0000 (03:55 +0100)]
networkedit: add mtu field

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 years agonetworkedit: bond: add bond-primary field
Alexandre Derumier [Fri, 10 Jan 2020 02:55:08 +0000 (03:55 +0100)]
networkedit: bond: add bond-primary field

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 years agofix Firefox spinner scroller
Thomas Lamprecht [Sat, 11 Jan 2020 14:58:11 +0000 (15:58 +0100)]
fix Firefox spinner scroller

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 2.1-2
Thomas Lamprecht [Tue, 17 Dec 2019 11:02:59 +0000 (12:02 +0100)]
bump version to 2.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotask viewer: add new taks_id field as optional row entry
Thomas Lamprecht [Tue, 17 Dec 2019 11:00:46 +0000 (12:00 +0100)]
task viewer: add new taks_id field as optional row entry

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>