Commit Graph

539 Commits

Author SHA1 Message Date
Oguz Bektas
d1f37e222d node: add MTU column in NetworkView
hidden by default since it's an "advanced" setting

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2021-07-27 16:37:27 +02:00
Fabian Ebner
14247821fb add NodeInfoRepoStatus
adapted from PMG, because it has an additional fix to avoid setting
undefined in the view model, which still affects PBS (see pmg-gui
commit 774418f08b10c651357d11ccb161ac075e1ae905).

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-27 16:34:12 +02:00
Dominik Csapak
0dbcfb8c64 fix #3542: node task logs: query correct node for tasks in clusters
While refactoring, we forgot to replace the 'localhost' URL (which is
valid for PMG/PBS) with the actual nodename we have in Proxmox VE.

Do this by setting the correct URL in the viewModel right at the
start of the initComponent

We now also have the possibility to overwrite the url if we want

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-27 16:32:38 +02:00
Fabian Ebner
5e76f7302a node: repos: add online help
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-19 17:39:38 +02:00
Thomas Lamprecht
f0de3268af api-viewer: ensure path starts with slash
should always be the case, but this is now an assumption, so better
to ensure it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-19 17:38:25 +02:00
Dominik Csapak
6cc360f2b4 api-viewer: drop extra slash in api path
'endpoint' already begins with a slash, so drop it after /api2/json

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-19 17:32:23 +02:00
Fabian Grünbichler
8b06793b3d apt: match "Debian Backports" origin
some users might have that enabled, and we know it is from Debian and
not '?'

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-07-19 17:32:00 +02:00
Thomas Lamprecht
1820e77d5c add package version window
we want that component in all projects, PVE and PBS have the code
duplicated for now, as PMG is about to receive this too I rather want
to use the chance add add it here for actual reuse.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-19 16:58:27 +02:00
Thomas Lamprecht
d9c6e21492 service view: disable all buttons for masked/not-found/unknown services
at least if we have a unit state (atm only PVE and PMG report that)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:39:43 +02:00
Oguz Bektas
0c15c08eee service view: fix stale stop/restart button enabled behavior
fix an issue where the stop or restart button stays enabled for
elements in 'startOnlyServices' after switching selection from a
service that was not restricted to start-only

note: front-end change only as the backend already refused to stop a
start-only service.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:35:43 +02:00
Thomas Lamprecht
ae6a1cc908 service view: avoid showing not installed services as error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:35:36 +02:00
Thomas Lamprecht
7a17156d65 service view: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 18:15:55 +02:00
Stoiko Ivanov
66c5ceb848 acme: allow wildcards as domain
allow wildcard dns-names as defined in [0,1] (only the prefix '*.' in
front of a valid dns-name) as domain.

[0] https://tools.ietf.org/html/rfc8555#section-7.1.3
[1] https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-13 10:03:14 +02:00
Dominik Csapak
8d4faa8821 panel/AuthView: handle different baseUrls for configuring realms
we need that for pbs.

also give the option to use the type in the path, like in AuthEditBase

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-12 09:50:24 +02:00
Dominik Csapak
335633d208 window/AuthEditBase: handle differenc config api urls
necessary for pbs. also give an option to use the type as url path
e.g. /config/access/<TYPE>/<ID>

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-12 09:50:24 +02:00
Thomas Lamprecht
bc2b6fdd21 fixup schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-09 17:30:26 +02:00
Fabian Ebner
7c65b8bfe0 utils: add helper to format node's repository status
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-09 16:58:51 +02:00
Thomas Lamprecht
770b2612d5 auth view: actually use new schema module ...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-09 16:40:49 +02:00
Thomas Lamprecht
2908d35808 fixup new schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-09 16:21:27 +02:00
Thomas Lamprecht
5c085daf0b add schema and move authDomains there
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-09 16:11:19 +02:00
Dominik Csapak
8f30708d44 add generic OpenIDInputPanel
mostly copied from pve, but includes a realm displayeditfield
as well as the comment field

in contrast to the inputpanel in PVE, this is not extended
from a base input panel (where in pve the comment/realm/default/etc.
fields come from)

we do this, since not all products can define a default or tfa

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Dominik Csapak
c159449543 add panel/AuthView from PVE
added the following (necessary) changes:
* use Proxmox.Utils.authSchema
* omit the sync button/handler, but add a possibilty to add extra buttons
* check for an 'edit' property in the authSchema for enabling editing
* removed the onlineHelp property
* removed 'TFA' column (can be added by the caller)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Dominik Csapak
402964713a Utils: add authSchema from PVE and make it overrideable
like we do for the task_descriptions.
This way we can have a basic config that is true for all products
and override where necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Dominik Csapak
6a504e1995 add window/AuthEditBase from PVE
basically a straight copy, with the exception that it references
Proxmox.Utils.authSchema instead of PVE.Utils.authSchema

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-09 14:46:27 +02:00
Fabian Ebner
e455399aef node: repos: only show suites warning at the top if enabled repository is affected
The warning still shows up for the disabled repository itself, but
having a disabled repository with a bad suite is not problematic for
the configuration status as a whole.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-09 14:42:55 +02:00
Dominik Csapak
68152254af window/SafeDestroy: add taskDone and apiCallDone callbacks
like in edit window, so we can reacto to a successful task/api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-08 14:07:19 +02:00
Fabian Ebner
bfab8fc134 node: tasks: use helper to format status again
which avoids the all-caps "WARNINGS:" and uses the localized version.
The call was thrown out by the big overhaul in
9e059d560c.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-08 11:50:27 +02:00
Thomas Lamprecht
bb5511d569 network: use std remove button for confirm
alows to make the code simpler too, but we need to instantiate the
selection model explicitly, as we use a bit of a weird layout here to
be able to show the pending changes at the bottom, if any, so the
main gridpanel is not the parent of the toolbar buttons, so the
std-remove button does not automatically finds the selection model
when searching in the parent

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-06 20:55:56 +02:00
Thomas Lamprecht
99f3e147e4 code cleanups, inline more, use arrow-fns
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-06 20:54:59 +02:00
Dominik Csapak
abde5f2bad node/Tasks: add 'clear filter' button
that does two things,

show the user that some filters are active (even if filters are collapsed),
and let the user to reset the filters all at once

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-05 16:44:37 +02:00
Dominik Csapak
a86b1f26da node/Task: show errors on store load
since we use a buffered store on a grid, we cannot use our
normal monStoreErrors from Utils (The store on the grid is a memorystore
without our 'proxmox' proxy, and the store in the viewmodel is not
initialized yet in the init)

simply set the mask in the already existing 'updateLayout' function
which is exactly the right place for the buffered store load

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-05 16:44:37 +02:00
Dominik Csapak
12a6f6824f node/Tasks: deselect entries when filter changes
since we use a remotefilter on a bufferedstore, the only event where
we can check if the selected element is still there is the 'refresh'
event. Simply deselect if the seleceted element is not in the store

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-05 16:44:37 +02:00
Dominik Csapak
f00e321173 node/Task: remove leftover 'datastore' reference
this does nothing here, since the 'datastore' would be an
'extraFilter' defined in pbs itself

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-05 16:44:37 +02:00
Thomas Lamprecht
6bac17e394 node: repos: always skip "you get updates" on parsing error
As normally that means that the host does not gets updates, as most
apt use will fail too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 16:39:24 +02:00
Thomas Lamprecht
4227a5578a node: repos: improve repo-parsing error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 16:38:46 +02:00
Thomas Lamprecht
6c9af17882 node: repos: factor out addCritical into closure
now that there's more use for it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 16:38:16 +02:00
Dominik Csapak
25d17082b0 node/APTRepositories: make 'no pve repositories' an error
since we also show it as error in the node summary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-05 16:25:35 +02:00
Thomas Lamprecht
e1fc474412 bump version to 3.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 10:11:46 +02:00
Thomas Lamprecht
fb4bb95e9d utils: fix typo in variable name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 10:11:46 +02:00
Thomas Lamprecht
5b2485ace3 utils: updateColumnWidth: allow overriding tresholdWidth and make that more general
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 09:46:58 +02:00
Thomas Lamprecht
8b7e349a25 utils: column width handler: drop duplicate
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 09:34:32 +02:00
Thomas Lamprecht
76899da698 info widget: early return from update if text & value stayed the same
No need then and if we'd call into update we'd still generate new
elements which is annoying for debugging and extra DOM work we can
avoid.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-04 22:01:40 +02:00
Thomas Lamprecht
1d3d61ead9 markdown: extend blocked tags in sanitizer
not all of those are really problematic, but it's always easier to
start out stricter than required and see if any user even would use
those.

It seems that we should probably switch to a white-list approach...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-04 20:52:56 +02:00
Thomas Lamprecht
f2c4f9bdc2 markdown: make sanitizer more strict
The href, and in some browser also the src attrs on img, or a tags
can be made to execute JS rather easily, catch thoseand just remove
the attr if, after creating an URL object from it, it does not looks
like it's a http(s) request.

Further, filter out the style tag completely, as that can be misused
too, even if only to break cosmetics.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-04 20:06:28 +02:00
Thomas Lamprecht
71bc0913bd markdown: encode bad nodes HTML instead of pruning it
As pruning means content an user wrote into the box, even if with
malicious intend, gets hidden and that can be quite confusing..

So rather get the outerHTML, transform it with ExtJS's htmlEncode and
set it again.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-04 19:22:40 +02:00
Thomas Lamprecht
65f4704b62 node: repos: handle that components can be undefined
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-04 19:09:42 +02:00
Thomas Lamprecht
eb1fff8294 node: repo: use more stati-schema like code style to configure store
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 16:34:46 +02:00
Thomas Lamprecht
7705801f48 node: repo: use more stati-schema like code style to set grouping feature
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 16:21:17 +02:00
Thomas Lamprecht
faacb77fb4 node: repo: avoid using IDs on elements, as that breaks easily on clusters
Anything where more instances can exist, even if only for a very
short time, must NOT use `id` as that needs to be unique in all
current instances of components/elements of the whole gui.

Here it broke most of the gui when switching between node, as the new
nodes repo gui was instantiated before the old ones was completely
destroyed, so there where (at least) two elements with the same id ->
💥 boom.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 16:06:17 +02:00
Thomas Lamprecht
c7ca21b4b8 node: repo: health: drop br line-breaks, replaced by flex display
Firefox ignores them anyway but chrome adds them additionally, making
it look rather weird..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 00:09:09 +02:00
Thomas Lamprecht
96ecd62ac1 ui: repo status: adapt some warning/error gettexts
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 23:59:56 +02:00
Thomas Lamprecht
46231d0da2 ui: repo status: do not duplicate warning to health icon
It feels quite weird to have the last warning text duplicated, the
left health icon should be a very concise summary only.

allow one to force it by setting important, but that's not yet used
anywhere.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 23:58:27 +02:00
Thomas Lamprecht
fe787c8c12 fixup! ui: repo status: code cleanup/refactoring 2021-07-02 23:58:02 +02:00
Thomas Lamprecht
f411afb40c ui: repo status: adapt flex-ratio and center health vertically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 23:57:20 +02:00
Thomas Lamprecht
5267494a87 css: add centered-flex-column class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 23:56:19 +02:00
Thomas Lamprecht
df7def01a1 ui: repo status: code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 23:12:53 +02:00
Thomas Lamprecht
de73e0b3d8 add OpenID icon
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 21:58:09 +02:00
Dominik Csapak
5e0cecb7d5 node/APTRepositories: improve error/warning display
always show grid besides status, with the accumulated
stati/warnings/errors

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-02 16:28:53 +02:00
Dominik Csapak
f59d1076d7 node/APTRepositories: rework top status and error grid
instead of having a title bar and a seperate error grid,
add an always visible panel that displays the status (ok, warning, errors)
which also contains the error grid (if necessary, ala ceph summary)

this makes the panel more consistent to use and it is immediatly
visible if something is wrong

this also adds a test for the 'test' repositories, as well as a test
for not correctly configured suites

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-02 15:31:25 +02:00
Dominik Csapak
fbbe68fd69 Utils: add get_health_icon from PVE
we'll need it here too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-02 15:31:25 +02:00
Thomas Lamprecht
cd20320b7f utils: followup: fix base class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 15:17:47 +02:00
Thomas Lamprecht
e722f108aa ui: Utils: refactor userid parsing to Utils
Originally-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 15:06:26 +02:00
Thomas Lamprecht
e8c60b3215 utils: add getOpenIDRedirectionAuthorization: to avoid code-duplication
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 13:53:11 +02:00
Thomas Lamprecht
665b206b0f css: fix debian openlogo background-size for chrom* based browsers
The debian one higher than wide and it seems, contrary to my belief,
the background-size is not taken for both, height and width if only
one param is set, but rather the second paramet height then defaults
to `auto` which Firefox and Chromium handle different in this case.

Set both to make this fixed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 09:18:45 +02:00
Thomas Lamprecht
4fc57df439 fixup comment
forgot to save in vim when editing the comment before committing..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 08:09:39 +02:00
Thomas Lamprecht
0668981954 node: repo: highlight proxmox repos that are not producition-ready
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 08:04:39 +02:00
Thomas Lamprecht
58b7186065 node: repos: fix reversed validation on configured
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-01 10:49:25 +02:00
Fabian Ebner
d7aeb02f3e apt repos: use correct URL
so there is a 'result' property, which the window expects.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-01 10:46:22 +02:00
Thomas Lamprecht
824f997749 node: repos: fix add repo validator
isValid is a boolean not a callback, so won't really work and just
set the state once.

Use the `validator` and first call into the parents helper, then do
our logic and return a string  with an explanation in the expected
invalid case.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-01 10:43:12 +02:00
Thomas Lamprecht
f0966f2930 node: repos: fallback to "Other" for unknown origin
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:58:29 +02:00
Thomas Lamprecht
5a1fddb622 node: repos: use warning, not critical for suite-errors if disabled
As in that case it's actually safe, so rather show as warning, albeit
even info/notice like would probably be enough, but still, it is not
a configuration that is wanted permanently.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:47:57 +02:00
Thomas Lamprecht
205d2751f4 node: repos: fade text of disabled rows
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:47:20 +02:00
Thomas Lamprecht
5e9eb2456c node: repos: increase width of add-repo window + style cleanup
We have some longer descriptions so the default width looks crammed.

Also, avoid a intermediate variable which is only used once without
any change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:46:12 +02:00
Dominik Csapak
7f671fee58 APTRepositories: remove unecessary selection model
this is the default anyway, no reason to explicitely create it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-30 21:27:04 +02:00
Dominik Csapak
e71fc6e438 APTRepositories: make the Suites warnings inline errors
by iterating only once over the info array and adding them directly
to the records this way we can avoid iterating over the records
again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-30 21:27:04 +02:00
Dominik Csapak
003c49829d APTRepositories: change updating button text/state to viewcontroller
we already have a viewmodel we can use, and so the handler does
not have to navigate the component tree up/down

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-30 21:27:04 +02:00
Dominik Csapak
82071150f7 APTRepositories: make panel scrollable
so that it is still usable with many errors and/or repositories

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-30 21:27:04 +02:00
Dominik Csapak
d8b5cd80c8 APTRepositories: change separation style between panels
having double borders does not look so nice, separate them with a bit
of padding

also change the warning panel to a simple header

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-30 21:27:04 +02:00
Thomas Lamprecht
036f48c14d node: repos: render Origin logo for Debian & Proxmox
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:26:45 +02:00
Fabian Ebner
21860ea45c node: apt: spawn a window for adding repository
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 21:26:45 +02:00
Thomas Lamprecht
3dfb0b9a2b css: increase padding for Debian and Proxmox symbol logos
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:26:45 +02:00
Thomas Lamprecht
77d6d9929e images: use svgcleaner to reduce logo SVG sizes
Used svgcleaner[0] with the following safe[1] command:

```
svgcleaner INPUT.svg OUTPUT.svg --indent 1 --resolve-use no \
 --convert-shapes no --group-by-style no --join-arcto-flags no \
 --join-style-attributes no --remove-comments no --remove-declarations no \
 --remove-invisible-elements no --remove-metadata no \
 --remove-nonsvg-attributes no --remove-nonsvg-elements no \
 --remove-text-attributes no --remove-title no \
 --remove-unreferenced-ids no --trim-ids no --ungroup-groups no \
 --list-separator comma
```

Resulting size reductions:

Debian   22.51% smaller
Proxmox  51.00% smaller

Note that the Debian one had a small issue with a unused variable set
which I reported[2] and cleaned up manually for now.

[0]: https://github.com/RazrFalcon/svgcleaner
[1]: https://commons.wikimedia.org/wiki/User:JoKalliauer/Optimization#svgcleaner
[2]: https://github.com/RazrFalcon/svgcleaner/issues/240

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:26:45 +02:00
Thomas Lamprecht
259c29df9f add Debian and Proxmox symbol logos and css
also add a new 'pmx-itype-icon' helper class for the classic bg
repeat/position option to allow more easier reuse

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:26:45 +02:00
Thomas Lamprecht
a8ab1d9820 node: services: fix logic for displaying unit state
still hacky but at least works now ;-)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 21:26:45 +02:00
Thomas Lamprecht
03325cedcf buildsys: do not install css or images with executable flag
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 15:20:20 +02:00
Thomas Lamprecht
87c64c495e css: some markdown heading and paragraph font-size & padding tuning
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-30 14:21:50 +02:00
Fabian Ebner
d91987a558 apt repositories: replace OfficialHost with Origin
to adapt to the new backend behavior.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-30 13:41:21 +02:00
Thomas Lamprecht
6fc91fc698 node tasks: fixup overly-short comment lengths
The minimum "max length" should be 80cc, and 100cc is also fine.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 16:19:40 +02:00
Dominik Csapak
9e059d560c node/Tasks: merge improvements from PBS and make it more generic
this copies most of the task grid from pbs, but adds handling so that
users can add aribtrary filter fields

the filter fields always present are:
* since
* until
* task type
* task status

other filters fields can be added by giving an 'extraFilter' array
which must contain widget definitions that emit a 'change' event.
this is then used to update the filters for the api call

also you can add a 'preFilter' object, that sets the filter parameter
only once at the beginning

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 16:06:49 +02:00
Thomas Lamprecht
5995eddcc4 cbind mixin: also descend in elements with an cbind property
Not only into those with an xtype one, as we can either have a
implicit default xtype (e.g., in tbars for buttons, or set explicitly
via the `defaults` mechanism) or want to apply cbinds to stores or
other objects.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-25 08:42:44 +02:00
Thomas Lamprecht
03c4c65bab apt repos: move Official to the right & use checkbox to render enabled
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:57:33 +02:00
Thomas Lamprecht
3fc020f417 apt repos: add product config-option and rework warning renderer
product defaults to PVE. It is added in the warnings and should be
set by any instance correctly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:42:14 +02:00
Thomas Lamprecht
0e79ce21c1 apt repos: make add-repo a checked command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:40:54 +02:00
Thomas Lamprecht
994fe897b7 apt repos: style grouping headers a bit different
else the repo/header difference is not that big, and it gets a bit
hard to read as it feels a bit monotonic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:39:48 +02:00
Thomas Lamprecht
bb64cd0341 apt repos: make enable/disable text selection dependent
the size hack is copied over from pve-manager's qemu/HardwareView

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:38:34 +02:00
Thomas Lamprecht
af48de6bf8 apt repos: code/format cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 19:01:24 +02:00
Fabian Ebner
d76eedb46f add buttons for add/enable/disable
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:01:06 +02:00
Fabian Ebner
24313a9d80 add UI for APT repositories
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 16:01:06 +02:00
Thomas Lamprecht
89de7ec504 node/services: show masked and some unknown units as disabled (greyed out)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 15:55:00 +02:00
Thomas Lamprecht
b6eedbba04 node/services: disable start/stop for masked and unknown units-states
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 15:54:17 +02:00
Thomas Lamprecht
6607de47e8 node/services: optionally show unit/active states
show unit state by default for PVE, with a bit of an hack

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 15:53:32 +02:00
Thomas Lamprecht
ab34f5b215 node/service view: code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-22 14:40:34 +02:00
Dominik Csapak
17c320c831 panel/JournalView: fix flickering in journal livemode
it seems that something changed in extjs 7 which does not quite
restore the correct scroll position when the identical content is set
on a component. this means that sometimes, we update the text
with the identical one, but the scroll position is now off, only
to scroll back to the bottom

this causes a flickering everytime we do the api call.

instead, only update the component when the content really changed.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-22 12:46:26 +02:00
Thomas Lamprecht
f869d73e50 css: markdown: add some nicer blockquote styling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 18:08:06 +02:00
Thomas Lamprecht
a610dd9e32 parser: sanitize HTML: allow 'disabled', 'start', 'type' and 'checked' attributes
This makes check box lists like the following snipped work:

- [X] Done
- [ ] not done

Further allow the start attr, sometimes generated for ordered lists.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 17:37:38 +02:00
Thomas Lamprecht
d1c4a7389f css: markdown: add some nicer table styling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 16:24:27 +02:00
Thomas Lamprecht
51a2f11c6b integrate marked as markdown parser
Define our own, rather minimal interface so that we change the parser
under the hood if ever needed, I already did so once during
evaluating this, as first I checked out Snarkdown[0], which is really
nice for the few lines of code it needs, but is a bit to limited for
the use case.

Currently marked[1] is used, provided by the libjs-marked Debian
package.

For now statically link the marked parser in on built time to avoid
the need to add new directories to serve in our pve/pmg/pbs proxies.
This is a bit ugly but can be cleaned up afterwards transparently
too.

We sanitize the produced HTML ourselves (most MD JS parser/renderer
don't do that) by creating a real, but not active, DOM tree and
recursively prune bad nodes/attrs from it and let it spit out HTML
again at the end. While a tad inefficient it really won't matter for
our use case, as the notes/comments we render are only a few KiB of
text and it's done on the client side anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 15:19:29 +02:00
Aaron Lauterer
3d886f9422 ui: network: add columns for vlan-id and vlan-raw-device
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-06-15 14:43:58 +02:00
Thomas Lamprecht
142d5d2cdf combo grid: load: rework auto-selection and validity logic
We do not want to trigger an autoSelect if there's a value set, even
if it isn't found in the store, as that hides the fact that an (now)
invalid valid is configured from the user, which can be confusing if
something is not working, as when editing an object it seems like a
valid value is selected.

Further, if a value is set we mark the field as invalid from the
start, at least if it's neither disabled nor allowed to have a
value which is does not exists in the backing store.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-07 18:10:15 +02:00
Thomas Lamprecht
674895d354 combo grid: reformat/place comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-07 18:10:15 +02:00
Thomas Lamprecht
4957686b0d panel: disks: more static task window creation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:26:54 +02:00
Thomas Lamprecht
b0e33a3e2a buildsys: enforce eslint for api-viewer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:10:31 +02:00
Thomas Lamprecht
ac4fa7fee8 api-viewer: eslint fixes, code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:32 +02:00
Thomas Lamprecht
5eb59676c3 api-viewer: drop unused clicmdhash
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:06 +02:00
Thomas Lamprecht
8556628c93 api viewer: rename gloabl schema variable and tell eslint about it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:46:32 +02:00
Thomas Lamprecht
52428d6055 api viewer: eslint (auto) fixes + slight cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:51 +02:00
Thomas Lamprecht
2f80505306 don't shout: s/APIVIEWER/APIViewer/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:13 +02:00
Dominik Csapak
4ae75df35d add api-viewer source
so that we can reuse it across products
source was 'pbs' since that had the most features (http upgrade check)

a few changes to combine pve/pbs/pmg:
* use an optional 'cliusage' function it it exists to determine CLI usage
* check allowtoken for undefined to see if it is allowed or not
* use 'pmxapi' instead of pbs/pmg/pveapi
* rename all occurrences of 'pve' to 'pmx'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-02 13:44:37 +02:00
Dominik Csapak
53758e164a Toolkit: move defaultDownloadServerUrl override to panel/RRDChart
not all users of Toolkit.js have the charts lib loaded, which means
the class does not exist then.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-02 13:44:37 +02:00
Fabian Ebner
d453438aa0 disk list: add wipe disk button
which shows a confirm dialog with the most relevant information before actually
issuing the API call.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 13:19:42 +02:00
Fabian Ebner
e3a5040c55 disk list: move title bar initialization to initComponent
to conditionally add more buttons later on.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-02 13:19:42 +02:00
Thomas Lamprecht
557c45056c buildsys: touch incremental-lint in check target to avoid triggering twice
Without this the check and the, through the 'install' target
triggered, incremental lint target triggered a full eslint run.

Makes it similar to what PBS did from the beginning of eslint
inclusion..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-28 10:40:21 +02:00
Dominik Csapak
fe3a919417 panel/RRDChart: fix animation settings for highlight/marker
in extjs 7.0, the marker does not have the 'fx' property anymore,
but the now documented 'animation' property does not work as it seems.

instead set the animation settings directly on the chart. The only
downside is that this is now for *all* animations, not only the
fade in of the highlight. (the default duration is 500ms)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-28 07:56:23 +02:00
Dominik Csapak
a78ec00494 Toolkit: remove Datepicker fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
65ed0bf8b8 Toolkit: remove textarea fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
97b71d24a5 Toolkit: remove pie chart fix
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
10a6a6d5ef Toolkit: remove firefox touchscreen override
seems to be fixed, at least i could not reproduce here.
If users report this again, we can still revert it if necessary.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
9c1296e503 Toolkit: update focusJump override
upstream code changed a bit, update to current version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
d78eb5ec99 Toolkit: update overrides for scroll fixes
while some scrolling issues where fixed since 6.0.1, some where introduced,
namely:
* for firefox, the correct event to listen to is 'wheel' not 'mousewheel'
* the spinner scroll direction was incorrect
* the boxOverflow scroll direction was incorrect
* the boxOverflow scroll amount was too high

functions were copied from extjs source, eslintified, and adapted

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
fef7d02477 panel/RRDChart: fix legend/undoZoom
the legend is by default of type 'sprite', rever to 'dom'
but we now have to unset the '.legend', else on destruction
extjs tries to destroy it twice

also change the onAfterAnimation listener to 'redraw', since
the original event does not exist anymore, add a buffer to it
so that it is not that heavy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
ee4801472d css: add css changes for treelist
add a new class 'x-treelist-pve-nav' so that we can use
ui: 'pve-nav'
instead of
ui: 'nav'
which has some default styling we do not want

also overwrite the font to FontAwesome
(extjs 7.0 uses 'FontAwesome 5 Free' which we do not ship)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
322de5629f Toolkit: set clearPropertiesOnDestroy to false by default
instead of the upstream default of 'async'

we do this since it creates some problems with our callbacks which can
happen during component destruction. The upstream reasoning does not
really makes sense for us normally, since we do not keep any references
around for most things, and thus the garbage collector can claim it.

note that this is only for components, Ext.Base sets it to 'true' by
default and we do not change this since we normally do not extend
from non-components

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
518dd0b6d9 Toolkit: set download url for draw containers to '-'
so that there can be no privacy leak, since the default points
to senchas server

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Dominik Csapak
fba354621f data/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest
extjs 7.0 gives the responseType to the XMLHTTPRequest (which
is 'json' for a json reader), but that means that the response is
automatically decoded by the browser, with no means to get the original
return back

in our case, for successful api calls it would work, but some of our
errors are plain text, not json, so the decoded json object is 'null'
and we lose the error information

revert the type to 'undefined' which tells the browser not do do any
decoding

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-27 13:37:36 +02:00
Thomas Lamprecht
d00e8b940a object grid: line-wrap cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-23 16:24:51 +02:00
Thomas Lamprecht
52d3f3b019 object grid: improve/add to documentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-21 17:15:21 +02:00
Thomas Lamprecht
bc9ae6029f object grid: allow one to declaratively specify rows
So that users of this component do not necesacrrily need to add an
initComponent override and make the `me.add_XYZ_row()` there, but
instead can use something like:

  gridRows: [
    {
      xtype: 'text',
      name: 'http-proxy',
      text: gettext('HTTP proxy'),
      defaultValue: Proxmox.Utils.noneText,
      vtype: 'HttpProxy',
      deleteEmpty: true,
    },
  ],

I avoid using `rows` as config key as that is internally used for
quite a few things, and potentially some existing users (did not
checked all). We can still switch to that easily if it is deemed to
be better...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-21 17:15:03 +02:00
Thomas Lamprecht
f0f898d2dd object grid: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-21 16:38:37 +02:00
Lorenz Stechauner
32bb96f4c7 disk smart: fix non working smart value window
fix regression in refactor from commit 7eb1fb18ad

Reported in forum:
https://forum.proxmox.com/threads/gui-disks-tab-cant-showup-smart-values.89180/
https://forum.proxmox.com/threads/smart-values-bug-in-6-4-6.89179/

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-14 10:34:28 +02:00
Fabian Ebner
e2ecec942f disk list: factor out renderers for type and usage
to be re-used later.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-07 17:58:21 +02:00
Fabian Ebner
f38bbed7bf disk list: fix minor usage renderer issue
If there is extended information, the variable is overwritten anyways.
Avoid appending an extra space if there is no extended information.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-07 17:58:21 +02:00
Thomas Lamprecht
b46ad78c2d format/render size: allow one to specifiy if base 2 or 10 is desired
Storage capacity and usage seems to prefer the base ten (SI unit) use
(makes the capacity a bigger number) while memory (RAM) is normally
preferred to use base 2.

So allow both, mostly to allow consistent displaying of metrics.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-07 17:56:04 +02:00
Thomas Lamprecht
ce8289fc58 utils: code cleanup/refactoring
no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 10:27:19 +02:00
Thomas Lamprecht
ff7ee78453 disk smart: fix layout, enable autoscroll
`layout: fit` does not much on a leaf item node, it's for children
after all. So use it at top and enable autoscroll on the text
component.

Reported in the forum:
https://forum.proxmox.com/threads/gui-smart-details-cannot-be-scrolled-down.88566/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
7eb1fb18ad disk smart: code/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
18b79e39cf info widget: set default warning threshold to 75%
60% is just way to low, this probably could be 80% or even 85% too,
in huge setups that normally means that there's still a lot of
resources left, but be conservative for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
713a7f9379 info widget: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 09:39:47 +02:00
Thomas Lamprecht
fc0a18e6c2 utils: add comment note for task descriptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-30 14:10:55 +02:00
Fabian Ebner
9b4b243aa1 format task status: improve replace() usage
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
9865b73e56 format task status: rename variable
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Fabian Ebner
4294143f92 task status: create helper for formatting
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-23 14:37:35 +02:00
Lorenz Stechauner
df096ae3fc toolkit: update email regex for acme account
Email regex only allowed two domain parts.
(probably copy/paste error from PVE::Tools)
Now allowing multiple domain parts.

Reported in our community forum:
https://forum.proxmox.com/threads/wrong-email-validation-when-adding-acme-account.88074/

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-04-23 10:36:41 +02:00
Thomas Lamprecht
689fa8a52c status view: query and update pveInfoWidget too for now
we may want to replace them someday, at least with an intermediate
widget xtype for unified querying, but it's only going through the
local descendant, which is not that bad size-wise, so don't care..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 20:30:31 +02:00
Wolfgang Bumiller
ef7a8290db acme: separate flag to disable the 'domains=' array
PVE has 2 domain lists, PMG only 1 since it requires the
additional type.

In PBS I do not want to have 2 lists either, since it seems
rather inconvenient to have 2 different ways to access the
same list.

Currently we decide this based on whether we have multiple
certificate types, which in PBS we don't, so we need a
separate option for this.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-22 19:57:28 +02:00
Stefan Reiter
6f9f9c71b3 FileBrowser: show errors in messagebox and allow expand 'all'
If an error is received upon expanding a node, chances are the rest of
the tree is still valid (i.e. opening a partition fails because it
doesn't contain a supported filesystem). Only show an error box for the
user, but don't mask the component in that case. Additionally, disable
the download button.

Also support an archive set to 'all' to expand all children, useful for
initializing a file-restore VM on initial load.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +02:00
Stefan Reiter
c1c8cfa85b FileBrowser: support 'virtual'/'v' file type
Denotes objects like disks ".img.fidx" files, which shouldn't be
downloadable, but should still approximate a directory entry.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +02:00
Stefan Reiter
661faeedf5 Utils: add errorCallback to monStoreErrors
Call a function to decide if we want to mask the component. If the
callback returns true, we assume it has already handled the error (i.e.
shown a messagebox or similar) and skip masking.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 17:52:52 +02:00
Thomas Lamprecht
1334cdcabc utils: render_cpu: fix theoretical bug
seems almost like this came from a failed application of the rules of
de-morgan...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 17:48:41 +02:00
Thomas Lamprecht
9e663a6a64 utils: code cleanup and refactoring
Looks like more change than it actually is, see
`--word-diff=color --word-diff-regex='\w+'`.

The single semantic change is the added space in the render_cpu,
between the maxcpu value and CPU/s text

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 17:47:41 +02:00
Thomas Lamprecht
0d58bef75c node status view: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 15:32:27 +02:00
Dominik Csapak
b87d473347 panel: add StatusView from PVE
with 2 minor fixups:
* one lint error
* binding of the 'updateValues' function in the event
  (we want to avoid breaking this when used in a context where
  a controller exists, in that case using a string will only look in
  the controller and not in the component itself anymore, so use
  the function directly)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Dominik Csapak
d365540e14 Utils: refactor updateColumns from pve-manager
we want to reuse this in pbs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Dominik Csapak
bf147dccb8 bring over some icons from PVE
we want to reuse them in PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Dominik Csapak
ef3f1cfcc4 Utils: add several render functions from PVE
we need the 'render_cpu_model' and '*_usage' methods in PBS,
the rest are the dependencies

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-22 13:25:22 +02:00
Thomas Lamprecht
cca5fa0ad9 safe destroy: fix class alias
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 13:22:05 +02:00
Thomas Lamprecht
f2d18cd7b3 safe destroy: code/readability cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-22 12:47:54 +02:00
Fabian Ebner
1488907695 safe destroy: allow specifing additional items
to be used to add more checkboxes for PVE's guest destroy use case.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:39:44 +02:00
Fabian Ebner
2b1f7bb066 safe destroy: remove purge checkbox
To be replaced by generic additional items specified by the user of the window
or child class. AFAICS there are no existing users of this widget yet, so this
shouldn't break anything.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-22 12:39:44 +02:00
Thomas Lamprecht
9531c6594e rrd chart: fix y-axis segmentation when using powerOfTwo
The chart axis get initialized really, so changing the segmenter in
initComponent is not possible anymore, we can only alter the chart
base config in the constructor.

Luckily, the actual segmentation happens later, so we can pass a
flag to the y-axis and hook into the segmenter directly by creating
a new one derived from 'Ext.chart.axis.segmenter.Numeric'.

There we override the preferStep and exactStep methods to decide if
we want to calculate with base 10 or base 2.

So add a constructor to RRDChart and set the axis with the respective
segmenter, depending on the powerOfTwo config, up there initially.

Note: that makes overwriting the axes from a caller impossible, but
we do not use that anywhere, and we can control the more important
parts of the axes, like label or units already otherwise, so seems
not really required, and if, its not to hard to solve (either by
always using our new segmenter by default and handle the different
bases there directly, or by adding an explicit do not touch axes
config flag, or the like).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-17 19:20:53 +02:00
Thomas Lamprecht
4337ad5b74 rrd chart: add option to render values as power of two base
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:02:33 +02:00
Stoiko Ivanov
dcd5a0c61f toolkit: override email VType validation
ExtJS email validation regex has a length limit of 6 on the TLD.
This breaks some new gTLDs (e.g. .systems)

Override the validation function and verify against the EMAILRE from
PVE::Tools (used for 'e-mail' in JSONSchema)

Reported in our community forum:
https://forum.proxmox.com/threads/acme-account-register-dialog-does-not-accept-gtlds.87305/

Quickly tested (by using test@test.systems(|test)? on my test-installation)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-13 09:09:23 +02:00
Aaron Lauterer
95bba12dec window/edit: add option to disable reset button
Sometimes the reset button does not make sense and the isCreate option
does not fit as well because with it, the submit button will be enabled
right away instead of waiting for the form to be valid.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-04-13 09:08:29 +02:00
Thomas Lamprecht
fd8ed0d84f file browser: add config and comments for params, uper case URL
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-13 09:01:28 +02:00
Stefan Reiter
2a778ef98c FileBrowser: allow downloading root folder and simplify code
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 08:02:27 +02:00
Stefan Reiter
68b29adede FileBrowser: remove PBS dependencies
Don't construct any URLs locally, instead have them (and their static
parameters) be passed in. This removes the need to have the datastore.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 07:59:08 +02:00
Stefan Reiter
09195cb6f9 window: add FileBrowser
from proxmox-backup, only names changed

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-13 07:59:08 +02:00
Thomas Lamprecht
c5cade500a acme domains: fix ui-reload gettext + code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-28 16:54:51 +02:00
Thomas Lamprecht
08d092b679 certs: ui-reload: code cleanup and better gettext
there's no "GUI Server" in Proxmox projects..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-28 14:31:13 +02:00
Fabian Ebner
64d85d96b3 tasks: add warningsText
to avoid having capitalized 'WARNINGS' (especially since 'Error' is not) and
support different languages.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-24 07:01:55 +01:00
Thomas Lamprecht
9ae7fe04e2 panel/acme-domains: fix cyclic dependency in view model
A view model forumla cannot depend on itself, as that is a dependency
cycle.

In this specific case we can just drop the `hasUsage` forumla entry
completely, it is bogus as it was just returning its value, and that
is actually taken care of by the `hasUsage` data binding.

The debug build of ExtJS throws an exception on such cycles, the
release build does not cares to much and seems to do the right thing
already here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 17:26:29 +01:00
Thomas Lamprecht
106fe29ef2 utils: async api: reject with whole failure response and add helper to alert it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 11:26:17 +01:00
Thomas Lamprecht
ea2b3fd736 checkbox model: optimize ranged de/selections
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-23 11:03:56 +01:00
Thomas Lamprecht
1f628e9ca6 override deselection in CheckboxModel to improve performance
After the UI hang for tens of seconds for a few thousand elements got
deselected I investigated with Firefox developer tools performance
analysis, where the waterfall view showed that most of the time was
spent in array splicing.

Previously, all removed elements got removed on by one from the
`selected` Ext.util.Collection - which is basically an helper class
around arrays and objects, most of it may have become obsolete with
modern browsers. The single remove resulted into further splicing of
the array, and all in all it resulted in a dramatically increased
complexity, ~ O(n^3).

The "remove one by one" logic comes highly probably from the fact
that users can register a `beforedeselection` listener which can
block a removal of a specific record. But, that's not used by us and
not really something one would often need in practice, but still its
a documented feature of ExtJS grids we want to keep; so go for an
alternative.
So, override `doDeselect` and change the old removal logic to one
that first record those entries which got blocked from removal and
remove them in one go from the "to-be-removed" collection.

Before/After this patch on my FF 86.0.1 with my i9-9900K and
deselecting ~10k records went from ~40s to about 33 ms total, so for
that case we went 1000x faster.

The remaining time is now mostly spend in the event fire/handling
logic, but even with 50k records we spent <<500ms in total, so not
too bad and thus kept as is for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-22 16:47:04 +01:00
Thomas Lamprecht
c2c12542d7 utils: copy over async helpers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-22 16:17:56 +01:00
Wolfgang Bumiller
8915422f90 add ACME domain editing
Same deal, however, here the PVE code is has a little bug
where changing the plugin type of a domain makes it
disappear, so this also contains some fixups.

Additionally, this now also adds the ability to change a
domain's "usage" (smtp, api or both), so similar to the
uploadButtons info in the Certificates panel, we now have a
domainUsages info. If it is set, the edit window will show a
multiselect combobox, and the panel will show a usage
column.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
658bfdff32 add ACME plugin editing
Like with the account panel, the 'acmeUrl' base needs to be
specified, otherwise this is copied from PVE

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
5df894de26 add ACME account panel
Copied from PVE with URLs now being based on the 'acmeUrl'
property which should point to the acme/ root containing
/tos, /directories, etc.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
60fead29a8 add certificate panel
Again, initially copied from PVE but adapted so it can be
used by both. (PVE side still needs to be tested though.)

The 'nodename' property is optional (since on PMG we
currently don't expose them via the UI directly). Instead,
the certificate info URL is required and the 'uploadButtons'
need to be passed, which just contains the certificate
"name", id (filename), url, and whether it is deletable and
whether a GUI reload is required after changing it. If only
1 entry is passed, the button stays a regular button (that
way PVE should still look the same), whereas in PMG we have
a menu to select between API and SMTP certificates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
63be5c590f add ACME forms
Mostly copied from PVE, but the user needs to set the URL
property so their stores can load the data, whereas in PVE
this was hardcoded.

API selector:
  needs its url to point to the challenge-schema url

Acme Account selector:
  needs its url to point to the acme account index

Acme Plugin selector:
  needs its url to point to the plugin index

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
c0acd78475 add ACME related data models
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Wolfgang Bumiller
25680ef503 Utils: add ACME related utilities
copied from PVE with linter fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-16 12:25:58 +01:00
Dominik Csapak
8b38c9307b node/ServiceView: remove storeid
it's not needed anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-11 13:56:11 +01:00
Dominik Csapak
6732337cb9 data/*Store: drop storeid requirement
We never use that and it serves no purpose. It probably was meant to
be the upstream config 'storeId' which would add the store to the
Ext.StoreManager. This is unpractical though, since then the store
has to be explicitely destroyed, otherwise the StoreManager retains a
reference and the GC cannot remove the store.

Since donwstream users of the store can simply give the 'storeId'
property anyway if they need to be managed by the StoreManager, drop
the requirement here.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-11 13:56:11 +01:00
Thomas Lamprecht
757a2696e1 edit window: advanced: only show advanced fields on invalid temporary
makes no sense to permanently enable them, that makes for weird
experience.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 20:18:05 +01:00
Dominik Csapak
bbcc3b3c5c panel/DiskList: return empty text for status on partitions
instead of returning 'unknown'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-03-05 17:15:41 +01:00
Thomas Lamprecht
be3e4b4cb1 task viewer: increase height
500 px still fit nicely in our minimum requirements of "HD ready"
(1280 x 720 px) and for any slightly longer running task the extra
pixel are really nice, I frequently find myself resizing the height
immediately after a task window opens so lets up the default a bit...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 17:13:37 +01:00
Dominic Jäger
0174c45815 vlan edit: Match explicit values to name field
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Dominic Jäger
705f92a1e4 vlan edit: Set valid default name
Using find_next_iface_id we get a valid VLAN name.
This way, inserting a vlan raw device is still required (but everything that is
inserted so far is valid).

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Dominic Jäger
4ed84281a2 vlan edit: Move example from default value to tooltip
We usually choose default values that are valid input for the field.
interfaceX.1 is rejected by the API.

Instead, use a tooltip to demonstrate possible valid inputs for the field.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Dominic Jäger
418ec858aa vlan edit: Forbid blank vlan raw device
Users certainly have to insert a vlan raw device when the textfield is enabled.
Currently, they only see `invalid network interface name "` when submitting.
Forbidding the blank field shows the problem earlier.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Dominic Jäger
7bff067a38 vlan edit: Fix automatic field disabling
The regex are are created as literals (with // and not new RegExp).
Therefore
 - The old Vlan_match value with double \\  has matched e.g. vlan\ddd instead
   of e.g. vlan123 and
 - the old VlanInterface_match value with double \\ has matched e.g.
   \www\X\dddd instead of e.g. vmbr0.1234

This fixes automatically disabling the fields vlan-raw-device and vlan-id (VLAN
tag) in the VLAN edit window.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-02-09 13:45:11 +01:00
Fabian Ebner
98edb91665 move DiskList.js from grid/ to panel/
because it's a treepanel now.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-02-09 12:01:24 +01:00
Fabian Ebner
d9e5b6711e convert disk list to disk tree and conditionally include partitions
Assigning the store directly to the treepanel doesn't work, more manual
handling is needed. This is mostly based on what we do for PBS's datastore
content view. The store monitoring also needs to be changed slightly.

The buttons are restricted to work on disks only, based on the parent
attribute, that only partitions have.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-02-09 12:01:24 +01:00
Fabian Ebner
fef397f558 prune panel: make keep-last label text like the others
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-01-26 18:54:49 +01:00
Dominic Jäger
bcc48f062c input panel: Add drawing of layout
The drawing makes clear in a few seconds:
 - what columnT and columnB stand for
 - what additional containers and panels are created
 - to which of those the elements of column1, column2... go to

When you're in the JS debugger and lost overview of where in this
element hierarchy you are, you can quickly check xtype + layout. Then
consulting this drawing solves the mistery.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-01-26 18:54:49 +01:00
Dominik Csapak
0753b980c8 fix usage of findRecord
findRecord does not match exactly, but only at the beginning and
case insensitive, by default. Change all calls to be case sensiti
and an exactmatch (we never want the default behaviour afaics).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-01-26 18:54:18 +01:00
Dominik Csapak
938a7b9f55 grid/DiskList: restore info about ceph
previously we printed this ceph info, but it got lost during
refactoring to widget-toolkit, restore a slightly modified
version of the code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-01-26 18:53:32 +01:00
Thomas Lamprecht
fe8855e032 reader: JsonObject: cope with empty (null) return value
there may be cases where the backend serialization plumping code
makes it easier to return null instead of a emtpy object if a
(sub)property or whole config is not configured, as it's closer to
the truth (not configured == null, configured but empty would be {})

For objects this resulted in a exception, as the null value was tried
to be dereferenced, avoid that by defaulting to an empty object in
that case.
For arrays we already coped with that by luck, make that more
explicit to avoid future breakage.

Both result to a empty array being returned as values, which means
empty store and is deemed to be OK in that case.

The rowdef.required still applies and adds empty values though, this
could be argued to not be really fitting - for now lets keep it that
way, we could make this opt-in though if it shows that it is not
always correct.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-15 16:21:45 +01:00
Thomas Lamprecht
bf51bc492f reader: JsonObject: whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-15 16:17:35 +01:00
Dominic Jäger
0915cbb1fe ui: network: Remove bond-primary gettext
The corresponding option  in /etc/network/interfaces is exactly "bond-primary".
Translating this might easily make unclear what is meant.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-01-12 11:40:21 +01:00
Thomas Lamprecht
9de5e64e53 prune panel: allow to pass emptyText for keep-last
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 18:17:53 +01:00
Thomas Lamprecht
bdabc5633f prune field: use dirtychange event to hide/show clear-trigger
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 18:17:23 +01:00
Thomas Lamprecht
455f5fe5ed input panel: support convenience top column
mirrors columnB (column bottom) but is placed on the top, i.e.,
columnT.

One can no conveniently set the following layout:

  +-------------------------------------+
  |                                     |
  |               columnT               |
  |                                     |
  +------------------+------------------+
  |                  |                  |
  |                  |                  |
  |   column1        |   column2        |
  |                  |                  |
  |                  |                  |
  +------------------+------------------+
  |                                     |
  |               columnB               |
  |                                     |
  +-------------------------------------+

(4 columns should work too, but we do not use that anywhere FWICT)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 13:19:27 +01:00
Thomas Lamprecht
914070be3e fixup prune field usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-23 08:08:12 +01:00
Thomas Lamprecht
abbb481864 css: unify button icon font-size to 14px
in a central place, we already have some of those set in pve or pbs
css

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-22 18:12:59 +01:00
Thomas Lamprecht
8969bdadf6 edit window: url is optional if both loadUrl and submitUrl are set
but it cannot be the default identityFn in that case..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:03:18 +01:00
Thomas Lamprecht
8b1217145c edit window: add loadUrl to config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:03:18 +01:00
Thomas Lamprecht
4d07ee6cb9 edit window: add submitUrl config
Helps for those cases where the id is in the API path itself.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:03:18 +01:00
Thomas Lamprecht
9beeadc77a input panel: make advanced column check more flexible
allow that any of the three column/docked definitions can be set,
without setting the first one to an empty array to go in that if
branch.

Note, column2 works fine, but I did not greatly test a sole
advancedColumnB definition, so there may be still some improvements
for fixes - but at that point the user could also use advancedItems
to have full control.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:03:18 +01:00
Thomas Lamprecht
03ea6d7971 toolkit: drop old jslint control comments
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:03:18 +01:00
Thomas Lamprecht
04eb02d970 panel: add PruneInputPanel
over from PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:02:50 +01:00
Thomas Lamprecht
9b4b2e745b form: add PruneKeepField
over from PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:02:45 +01:00
Aaron Lauterer
71a084c2ff InputPanel: remove old code for useFieldContainer
`useFieldContainer` doesn't seem to be used anymore in any of our
products:
* PVE
* PMG
* PBS

it therefore can be considered dead code.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-11-19 12:39:00 +01:00
Aaron Lauterer
71d5316545 InputPanel: fix column scaling behavior
When scaling the browsers content either via the browser itself or
because the OS has a different scaling / DPI setting, it can happen that
not all columns have enough space next to each other and thus the last
column is moved further below.

This happens especially on chromium bases browsers (e.g. chrome, edge).

Changing the layout to use extjs HBOXes with flex instead of columns
solves works well.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-11-19 12:39:00 +01:00
Thomas Lamprecht
2622cc7cca buildsys: add lint incremental mode, use stricter check mode for full build
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-12 10:10:19 +01:00
Thomas Lamprecht
63ec56e5bc utils: get help info: fix normalization with multiple minuses
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-10 16:27:43 +01:00
Thomas Lamprecht
1f905769b1 Revert "Utils: fix help section normalization"
replaceAll is not supported by all browser we try to guarantee to
support.

This reverts commit f7b816a399.
2020-11-10 16:26:27 +01:00
Aaron Lauterer
f7b816a399 Utils: fix help section normalization
We need to replace all occurences when normalizing underscores or
dashes.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-11-10 11:53:29 +01:00
Dominik Csapak
5efbff97f8 comboGrid: set errorMask on store load failure
if there occured an error in the api call of the store, show this error
on the picker when opened, instead of just showing an empty picker

this makes it possible to see that there was an error while accessing the api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-09 08:01:11 +01:00
Thomas Lamprecht
6fb81c1519 enable ARIA again
we have everything updated to ExtJS 6.x since quite a bit, and some
quick checks on various components did not show any error - lets
enable this again.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-09 07:56:42 +01:00
Thomas Lamprecht
20bf242648 Revert "css: avoid inherit of font-size on .fa class, set to 14px"
this is not yet safe everywhere, makes some dashboard icons quite
small

This reverts commit 96ffa5693e.
2020-11-03 17:51:12 +01:00
Thomas Lamprecht
2c0a748f42 task type selector: add clear trigger
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-03 14:41:43 +01:00
Dominik Csapak
3571d71343 Utils: remove product specific task descriptions
we use 'override_task_descriptions' in the specific products to
add the ones that are not used everywhere

took the chance and sorted the remaining alphabetically

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-03 12:40:45 +01:00
Thomas Lamprecht
96ffa5693e css: avoid inherit of font-size on .fa class, set to 14px
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-03 12:40:14 +01:00
Thomas Lamprecht
16f2ad9717 buildsys: improve clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-02 07:41:30 +01:00
Thomas Lamprecht
7bb32b58d1 css: improve icon rendering
Font Awesome is intended to be used at 14px font-size, we set that
already over product specific CSS for some elements like buttons.

But, for tab panel icons and tree navigation views it was often
overruled by ExtJS to 13px which made look them quite blurry and even
the position was a bit off (to high when compared to the texts
baseline.

Fix that by overwriting the font-size to 14px of the
x-treelist-item-icon and x-tab-icon-el-default class, for the latter
improve the icon to text possition by setting a slight top margin.

Setting the color to black was already done by each product, so move
that over here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-31 09:58:18 +01:00
Dominik Csapak
050c168499 add form/TaskTypeSelector
for suggesting workery types when we want to filter by them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-30 18:19:33 +01:00
Thomas Lamprecht
57ba4cdcb3 make subscription status check compare lower case
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 14:18:42 +01:00
Fabian Grünbichler
b99a771b5f add PermissionView
copied from pve-manager, but handling both '1' and 'true' as propagate
values, and making the authentication ID name/parameter configurable.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-10-28 13:14:31 +01:00
Thomas Lamprecht
9244bb7242 edit window: add extraParams config
For passing some default params which are passed along automatically
when calling load and doing the submit.

Useful in PBS, as there we often have the snapshot ID in multiple
parameters, not included in the request path, required for various
API call.

The params take low precendence, and are overwritten by values in
form fields with the same name for submit, or explicit params passed
to load calls

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 13:12:03 +01:00
Thomas Lamprecht
1289d32611 edit window: whitespace/newline cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 12:53:52 +01:00
Thomas Lamprecht
ca204f31df window/edit: add autoLoadOptions to control API call
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-28 11:36:14 +01:00
Thomas Lamprecht
a9bea10488 HostPort vtype: improve error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-27 16:40:46 +01:00
Dominik Csapak
0f687dd7b5 InfoWidget: add setData, so that we can bind it
with a setData function that calls our updateValue, we can now use
viewModel bind to update those widgets

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-23 20:34:14 +02:00
Dominik Csapak
4b44709a83 InfoWidget: eslint fixes
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-23 20:34:14 +02:00
Dominik Csapak
9354dc13a2 add info widget from pve
we want to reuse that, so copy it here and rename it to pmxInfoWidget

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-23 20:34:14 +02:00
Dominik Csapak
98d894d85a improve multiselect behaviour for checkboxmodel
when using the mode 'MULTI' for the checkbox selection model,
clicking a row would deselect all others, only clicking exactly on the
checkbox would select multiple rows

this override makes the whole cell of the checkbox behave like the
checkbox. This minimizes misclicks from the user.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-23 13:24:45 +02:00
Thomas Lamprecht
31780db0bb eslint fixup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 13:24:20 +02:00
Dietmar Maurer
6221e40cdd implement and use systemd_unescape 2020-10-22 12:10:29 +02:00
Hannes Laimer
c63c63111f utils: add task description for directory removal
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Hannes Laimer
12159d2cbd safe-destroy: add possibility to show a small note
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Hannes Laimer
cbb36e759b safe-destroy: replace var with let/const
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Hannes Laimer
b8b160d6e4 safe-destroy: replace type with purgeable and taskName
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Hannes Laimer
90cb5fafad safe-destroy: eslint --fix
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Hannes Laimer
8d86570caa safe-destroy: move SafeDestroy from pve-manager here
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-10-22 08:48:46 +02:00
Dietmar Maurer
9427d6a988 correctly encode upid paramenter (use encodeURIComponent) 2020-10-22 08:48:14 +02:00
Thomas Lamprecht
abfc18575e add Korean as translation choice
it was recently contributed by 김 주철

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-15 13:25:20 +02:00
Dominik Csapak
5252b7f12b Toolkit: add HostPort vtype
for easy checking textfield for a single host:port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-01 10:09:50 +02:00
Dominik Csapak
a1d40d37ed Utils: improve matching groups of ip/host regexes
we only ever want to match the whole hostname/ip, never just some part of it
and we do not want to have the ':' as part of the port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-01 10:09:41 +02:00
Dominik Csapak
aa9607f128 fix autoscrolling on browser zoom
when browser zoom is activated, our scrollposition can be a little bit off
increase the boundary by a few pixels (5px are ~1/3 of a line)
so that the auto-scrolling still works

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-10-01 06:11:08 +02:00
Thomas Lamprecht
54dc3ab4de node tasks: add duration column, hide by default
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-29 10:15:41 +02:00
Thomas Lamprecht
8e3f2973a8 task viewer: render tokenid as part of username
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-29 09:46:02 +02:00
Dominik Csapak
0c3ade1d32 node/Tasks: improve scroller behaviour on datastore loading
when we have a fixed totalcount, the scrollbar behaves nicely,
but sometimes we do not have a fixed total, so the api will return
'+1' if there are more elments to load

when doing this, the scrollbar has a weird behaviour where it changes
size frequently the more one scrolls down.

instead, tell the grid to update its layout as soon as the store
prefetches the data, which triggers an update of the scrollbar

this still lets it jump around a little, but only once per load and
more consistent

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-09-29 09:15:26 +02:00
Fabian Grünbichler
c2ad526694 tasks: include API token ID if available
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-23 15:12:49 +02:00
Thomas Lamprecht
6127ba8883 language_map: add Dutch
Contributed-by: Jorren Schauwaert <jorren.schauwaert@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-27 14:53:06 +02:00
Thomas Lamprecht
998237fcd7 utils: order languages after rendered name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-27 14:52:44 +02:00
Thomas Lamprecht
3824e269c9 eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-26 20:20:41 +02:00
Thomas Lamprecht
a718654e76 utils: improve indentation and better check API result
to avoid dereferencing a null/undefined value.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-26 20:20:41 +02:00
Dominik Csapak
abd4706afe fix #2933: correct behaviour of initgpt button
fixes 4 issues:
* use correct /api2/ext url to get the 'success' parameter
* check 'used' property for 'unused' (pbs vs pve)
* use 'name' instead of 'devpath' for id
  (name always contains the correct id for the product,
  e.g. /dev/sdd for pve and sdd for pbs)
* add a reload in taskDone to reload the list of disks when the inti is done

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-20 17:32:03 +02:00
Thomas Lamprecht
2815c42893 service view: allow overwriting restart command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 16:09:01 +02:00
Thomas Lamprecht
77ff40e479 service view: refactor assembling API path
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 16:09:01 +02:00
Thomas Lamprecht
26f17eb15a displayedit: allow passing an explicit displayConfig
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 16:09:01 +02:00
Thomas Lamprecht
41cf4ae184 displayedit: allow binding editable and value
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 16:09:01 +02:00
Thomas Lamprecht
7f56fd0cb0 onlineHelp: try finding - and _ normalized blockid variants
allows easy support of both separation variants, commonly used in
asciidoc or sphinx.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-21 16:28:25 +02:00
Fabian Möller
4f3b2a9398 Add focusable pseudo class to edit windows defaultFocus
Restricting the defaultFocus of the edit windows to only focusable fields
ensures that windows like "PVE -> Virtual Machine -> Manage HA", which
has a first field of xtype "displayfield", receive focus upon opening.

This allows those windows to be closed with the ESC key, which only
works when an element inside has focus.

In newer versions of ExtJS (>= 6.2.0) this filter could be reduced to
"field:canfocus" or maybe even ":canfocus".
2020-07-09 14:10:17 +02:00
Thomas Lamprecht
b6d1735ae1 followup: s/storedUser/storedAuth/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 13:27:29 +02:00
Tim Marx
63252ab6ab adapt auth utils for proxmox token authentication
Signed-off-by: Tim Marx <t.marx@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 13:25:14 +02:00
Dominik Csapak
bde489e51c add window/ZFSDetail
inspired by pve's detail window, which used two sub components
(ZFSStatus, ZFSDevices; which were never used elsewhere)
combined into one self-contained window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-25 15:58:18 +02:00
Dominik Csapak
a57a5c770a add form/MultiDiskSelector
from pve's ZFSCreate window, refactored to be self-contained using
field mixin, as well as be configureable enough to be used by pve as
well as other products

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-25 15:58:18 +02:00
Dominik Csapak
f29e6a669e Utils: add render_zfs_health
from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-25 15:58:18 +02:00
Dominik Csapak
c9d603afff task viewer: show task endtime and duration in status
But only when the caller gives us the endtime, since the status API
call does not give us the endtime.

As we stop updating the store once a task isn't running anymore the
fallback to current unix utc timestamp doesn't needs an additional
check, the last one is shown static then.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[ Thomas: improve commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-16 13:22:59 +02:00
Dominik Csapak
402991a79d add DiskSmart window and DiskList from PVE
for use with other produts.

the models are now all prefixed with 'pmx' instead of pve, so they
should not conflict

includes some changes to the model for remapping some fields and
some small refactors (change to controller for the DiskList,
some cleanup of the initComponent of the DiskSmart window)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 11:34:37 +02:00
Dominik Csapak
4f0c076470 add DiskSelector from PVE
to be usable with other products.
also add a parameter 'typeProperty' to be able to configure
the backend property for the usage type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 11:34:37 +02:00
Dominik Csapak
b2d7d422ec format_duration_human: say <0.1s instead of 0s
if we get a duration of <=0.1s it should actually be somewhere
betweeen 0 and 0.1 so return <0.1s

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 09:56:23 +02:00
Dominik Csapak
b1d446d0b2 show Task warnings differently
tasks can now show also 'WARNINGS: <count>'
filter it out and provide a 'parse_task_status' function for easy reuse

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 09:55:17 +02:00
Dominik Csapak
66be1b8ac1 ProxmoxProxy: add duration fields for proxmox-tasks
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-06-16 09:55:17 +02:00
Thomas Lamprecht
82327aca09 networkedit: display MTU for OVS-bond interfaces too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-08 16:47:46 +02:00
Thomas Lamprecht
d2eb74c991 improve passing package version down
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 18:05:20 +02:00
Thomas Lamprecht
ecabd4379c 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>
2020-06-06 17:43:03 +02:00