Commit Graph

331 Commits

Author SHA1 Message Date
Thomas Lamprecht
88725b272a css: add proxmox-invalid-row class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-25 16:46:48 +02:00
Dominik Csapak
2561610c8e 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>
2020-05-25 13:51:30 +02:00
Dominik Csapak
ac6184986c 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>
2020-05-25 10:42:58 +02:00
Thomas Lamprecht
eaa0fcbd77 bump version to 2.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:08:16 +02:00
Thomas Lamprecht
4b5c6b3ff1 window: edit: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:08:07 +02:00
Thomas Lamprecht
b24601aff5 window: edit: call setValue on all fields
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 13:01:01 +02:00
Thomas Lamprecht
18a6f207ef window password edit: refactor to more schematic code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 11:27:28 +02:00
Thomas Lamprecht
6dc34e5525 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
2020-05-22 09:38:30 +02:00
Dominik Csapak
9a3c1cb408 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>
2020-05-19 21:19:26 +02:00
Thomas Lamprecht
50e8bf4419 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>
2020-05-19 21:17:25 +02:00
Thomas Lamprecht
a307714b53 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>
2020-05-19 21:14:52 +02:00
Thomas Lamprecht
809603790a bump version to 2.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-18 17:27:05 +02:00
Dominik Csapak
0391dee1a2 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>
2020-05-18 17:03:32 +02:00
Dominik Csapak
82014ef6f1 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>
2020-05-18 17:03:32 +02:00
Dominik Csapak
8ae2f8c8b1 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>
2020-05-18 17:03:32 +02:00
Thomas Lamprecht
d8f909e10a bump version to 2.1-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 17:00:10 +02:00
Thomas Lamprecht
50fea44c68 diff store: set autoDestroyRstore by default to true for rstore configs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 12:54:06 +02:00
Dominik Csapak
eb54b1142e 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>
2020-05-07 12:47:20 +02:00
Dominik Csapak
65277f6a2e 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>
2020-05-07 12:47:20 +02:00
Thomas Lamprecht
86811eaa27 bump version to 2.1-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-06 17:15:04 +02:00
Dominik Csapak
92d1c20df7 add missing htmlEncodes
username can include some special characters, so we have
to escape them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-06 16:55:25 +02:00
Thomas Lamprecht
dcc46d6d81 drop unused comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-05 14:50:51 +02:00
Dominik Csapak
8b16d98cc4 window/LanguageEdit: make window non-resizable
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-04 18:19:08 +02:00
Thomas Lamprecht
91e77fa904 cbind: allow methods in cbindData
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-04 18:19:01 +02:00
Dominik Csapak
8ae40b73f1 Utils: add 'auth-realm-sync-test' to task descriptions
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 19:28:50 +02:00
Thomas Lamprecht
64eb4dc44f bump version to 2.1-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-24 18:47:24 +02:00
Dominik Csapak
731df80da0 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>
2020-04-24 17:02:31 +02:00
Thomas Lamprecht
dca21e597e 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>
2020-04-24 16:59:55 +02:00
Thomas Lamprecht
c6cf52f197 bump version to 2.1-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-20 10:44:38 +02:00
Thomas Lamprecht
1f315ec805 StdRemoveButton: code cleanup
most done by eslint --fix, a bit tinkered manually though

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-18 19:33:37 +02:00
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