Commit Graph

301 Commits

Author SHA1 Message Date
Thomas Lamprecht
8886099fa5 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>
2020-04-18 19:26:22 +02:00
Thomas Lamprecht
842203fd0a StdRemoveButton: getUrl: fallback to baseurl if no selModel is set
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-18 19:16:25 +02:00
Thomas Lamprecht
791f4ae3fb 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>
2020-04-18 19:16:25 +02:00
Dominik Csapak
271171f81a 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>
2020-04-18 19:05:52 +02:00
Thomas Lamprecht
eb23099741 window/Language Edit: use view controller
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-17 17:57:59 +02:00
Dominik Csapak
7029d72ad2 add LanguageEditWindow
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-17 16:10:17 +02:00
Thomas Lamprecht
7a3bb07a8d bump version to 2.1-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-16 18:06:09 +02:00
Dominik Csapak
d4c342fb73 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>
2020-04-16 17:59:30 +02:00
Thomas Lamprecht
a46c2eb11f 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>
2020-04-16 15:33:18 +02:00
Dominik Csapak
5003213241 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>
2020-04-16 14:39:38 +02:00
Thomas Lamprecht
e1b9384897 utils: add 'auth-realm-sync' task description
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-03 09:33:52 +02:00
Thomas Lamprecht
4a2f360d45 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>
2020-04-03 08:53:21 +02:00
Thomas Lamprecht
94f1770488 update store: refactor do modern syntax
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-03 08:53:21 +02:00
Thomas Lamprecht
4645c3d413 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>
2020-03-31 18:13:20 +02:00
Thomas Lamprecht
7d16f8b34c object grid: allow to pass online help to row editors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-31 18:13:20 +02:00
Moayad Almalat
9dc4b04bba Add Ar to Languages map - Login page
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2020-02-18 14:09:10 +01:00
Dominik Csapak
cb30fbfa19 add capitalized NoneText
we want this in some cases

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-02-05 20:23:39 +01:00
Stefan Reiter
6f5e0ea655 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>
2020-02-05 08:40:45 +01:00
Thomas Lamprecht
97cdcd2836 bump version to 2.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 17:50:25 +01:00
Thomas Lamprecht
68689d7374 indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 17:50:25 +01:00
Thomas Lamprecht
1aaba242fb 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>
2020-01-30 17:36:47 +01:00
Thomas Lamprecht
25f37cbf9f node/net: add onlineHelp reference to interface add windows
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 17:24:41 +01:00
Thomas Lamprecht
5c833deffe node/net: move MTU to advanced section
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 17:23:01 +01:00
Thomas Lamprecht
ea7da80cda node/net: fix indentation a bit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 17:22:03 +01:00
Alexandre Derumier
8aefd47ceb 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>
2020-01-30 16:14:30 +01:00
Stefan Reiter
15206214d9 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>
2020-01-30 16:14:03 +01:00
Thomas Lamprecht
4e78d7190d window: edit: allow to set submit text for data binding
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-30 15:54:09 +01:00
Thomas Lamprecht
149851638d 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>
2020-01-30 15:52:06 +01:00
Thomas Lamprecht
1d5e523aa0 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>
2020-01-23 13:43:29 +01:00
Thomas Lamprecht
f27b0f68e3 cbind: handle properties with undefined value in cloneTemplateObject
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-23 13:43:29 +01:00
Alexandre Derumier
aedaf2b6f1 networkedit: add mtu field
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-13 18:37:33 +01:00
Alexandre Derumier
b154853a74 networkedit: bond: add bond-primary field
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-13 18:37:33 +01:00
Thomas Lamprecht
30076ed6cc fix Firefox spinner scroller
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-11 15:59:03 +01:00
Thomas Lamprecht
ba1ba9471d bump version to 2.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-17 12:02:59 +01:00
Thomas Lamprecht
21efafeb99 task viewer: add new taks_id field as optional row entry
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-17 12:00:51 +01:00
Dietmar Maurer
890d561b67 parse_task_upid: Allow additional (optional) task_id field
We need that if tasks runs inside multi-threaded applications (several
tasks inside one process).
2019-12-17 11:51:46 +01:00
Thomas Lamprecht
8a2837f408 task descriptions: add CT push/pull and HA shutdown
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-06 13:39:42 +01:00
Thomas Lamprecht
407871d8f8 bump version to 2.0-10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 13:00:32 +01:00
Thomas Lamprecht
16c0a0b570 Ext.Msg: switch from depreacated msg to message property
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 12:58:50 +01:00
Thomas Lamprecht
4beef5c455 node network: adapt pending changes diff text
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 12:13:09 +01:00
Thomas Lamprecht
03e93db5d5 node network: disable revert button if there are no changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 12:07:06 +01:00
Thomas Lamprecht
1cf31d6bac node network: add separators in top bar
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 12:06:42 +01:00
Thomas Lamprecht
2877ddea0b ask for confirmation before hot-applying network changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 12:06:05 +01:00
Dominik Csapak
21cd6c09e2 NetworkView: add apply config button
when the host has ifupdown2 installed, we can hot apply the config
add a button to do this

if the user does not meet the requirements, the api call
will show why and throw an error (without changing anything)

the button has to be enabled via 'showApplyBtn', because for now,
we do not want it for pmg

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-26 10:11:30 +01:00
Dominik Csapak
f32aa3df74 ComboGrid: correctly set/mark multiSelect fields
in fields with 'multiSelect: true', we get an array as value instead
of a string, but a check of !![] results in true (since an array
is an object), so we have to explicitely check for arraylength
in 'setValue' (for correctly showing the trigger) and in the
load handler (to not set an empty field wrongfully to invalid)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-25 18:42:04 +01:00
Dominik Csapak
013cbd6425 fix #2421: ComboGrid: correctly validate multiSelect variant
on multiSelect we have to check the values that is in the values
array, but we get the 'displaystring' in the validator so we
have to get the 'real' value (aka the underlying array of values)
before checking if they are in the store

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-25 18:18:43 +01:00
Thomas Lamprecht
ceca281f92 bump version to 2.0-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:28:16 +01:00
Oguz Bektas
d1dc9b56e7 add reboot for containers into task description table
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-11-14 12:10:56 +01:00
Tim Marx
35eec238b2 fix comboBox validation when forceSelection is true
Prevent the comboBox from displaying a validation error although
forceSelection is true. If you change a valid selection by removing
characters manually and click somewhere else, the comboBox restores
the selection with the previous value. The validation logic then
checked the restored value, but couldn't find it in the store,
because the store is still filtered with the erroneous query.

We now clear the local filter before the actual check to prevent
this.

[Thomas]:
This was fixed in the 6.2 based GPL release of ExtJS, and can be seen
as backport.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-25 17:43:23 +02:00
Thomas Lamprecht
23446ca9f2 bump version to 2.0-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-10 17:05:10 +02:00