public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH cluster/qemu-server/container/wt/manager v9] add tags to ui
Date: Mon, 14 Nov 2022 10:43:44 +0100	[thread overview]
Message-ID: <20221114094404.1241050-1-d.csapak@proxmox.com> (raw)

this series brings the already existing 'tags' for ct/vms to the gui:
* tags can be edited in the status toolbar of the guest
* existing tags will be shown in the tree/global search/resource grids
* when editing a tag, a list of tags will be shown
* by default, the color is (consistently) autogenerated based on the
  text
* that color can be overriden in datacenter -> options (cluster wide)
  (edit window for browser local storage is TBD)
* by default, the text color is either white or black, depending which
  provides the greater contrast (according to SAPC)
* this text color can also be overridden
* there are multiple shapes available for the tree
* implements some permission control in datacenter.cfg with
  'user-tag-access' and 'privileged-tags' with that it's possible to have
  better control over what tags a user can actually add to its guests
  i intentionally left out the gui for those for now, but they shouldn't
  be that hard to add, should we go this way

some notes:
* noticed that on firefox in linux, something is off with the
  font-rendering, the text is weirdly aligned. not only with my tags,
  but also in the regular buttons, etc. but with the editing of the
  tags it's noticable. on a windows 10 machine i don't have the problem
  with firefox (and chrome/chromium is ok also on linux)
* the privileged tags/user-tag-access editing is very basic, but imho
  functional. if we want to have it 'fancier' please tell ;)
* maybe having the allowed tags in the 'ui-options' is not the
  completely right place, but we only use it in the ui, and i did not
  want to add another api call we have to call after logging in
  (imho it's border-line already with)

changes from v8:
* renamed datacenter.cfg fields according to thomas input
* reworked the 'get_user_admin_tags' function to 'get_allowed_tags'
  which now also checks the appropriate permissions and only returns
  the allowed tags for the given user. (in list context also returns
  the admin tags and if 'freeform' is allowed so that users can
  check the privileges properly). this list is also added to the
  'ui-options' api call, since we'll use it for showing tag suggestions
* included the missing css styles in the appropriate patches
* changed the styling of tags while editings (emulate a textfield) to
  make it clearer it's ready for editing
* changed the color of the 'add tag' field
* added a gui for editing the privileged tags and the user-tag-access
  field
* imroved wording + description
* improved commit messages
* changed how we collect the taglist for the tag picker
* mention the tags in the privilige check
* added the allowed tags to the ui-options

changes from v7:
* rebase on master
* changed admin tags from special syntax to datacenter.cfg option
* add 'user-tag-privleges' option and according api permission checks
* fixed some small bugs with permission checks (e.g. now we check
  the tag count, so that users cannot add tags multiple times that
  already exist but they have no privileges for)
* completely reworked the form/Tag and form/TagEdit, their
  implmementation is now much cleaner imho (squashed the drag&drop
  changes into the intial patches)
* squashed some patches together that fit together
* fixed some drag&drop bugs, so it should now work much better

(omitted older changelog)

Dominik Csapak (4):
  add CFS_IPC_GET_GUEST_CONFIG_PROPERTIES method
  Cluster: add get_guest_config_properties
  datacenter.cfg: add option for tag-style
  datacenter.cfg: add tag rights control to the datacenter config

 data/PVE/Cluster.pm          |  27 ++++++
 data/PVE/DataCenterConfig.pm | 144 ++++++++++++++++++++++++++++
 data/src/cfs-ipc-ops.h       |   2 +
 data/src/server.c            |  64 +++++++++++++
 data/src/status.c            | 177 ++++++++++++++++++++++++-----------
 data/src/status.h            |   3 +
 6 files changed, 361 insertions(+), 56 deletions(-)

-- 
2.30.2

From 4a1d0a9927aa9531cc34aa395519d5142449cfe8 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Mon, 14 Nov 2022 09:57:56 +0100
Subject: [PATCH qemu-server v9 0/1] *** SUBJECT HERE ***

*** BLURB HERE ***

Dominik Csapak (1):
  api: update: improve tag privilege check

 PVE/API2/Qemu.pm | 53 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 52 insertions(+), 1 deletion(-)

-- 
2.30.2

From 8ab86c7a7a176062b78d3027351116bf86b4596c Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Mon, 14 Nov 2022 09:58:04 +0100
Subject: [PATCH container v9 0/1] *** SUBJECT HERE ***

*** BLURB HERE ***

Dominik Csapak (1):
  check_ct_modify_config_perm: improve tag privilege check

 src/PVE/LXC.pm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

-- 
2.30.2

From 96116645c7539c3cf0d2de23f9400fbefd4a2cc9 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Mon, 14 Nov 2022 09:58:12 +0100
Subject: [PATCH widget-toolkit v9 0/2] *** SUBJECT HERE ***

*** BLURB HERE ***

Dominik Csapak (2):
  add tag related helpers
  Toolkit: add override for Ext.dd.DragDropManager

 src/Toolkit.js       | 16 ++++++++
 src/Utils.js         | 88 ++++++++++++++++++++++++++++++++++++++++++++
 src/css/ext6-pmx.css | 45 ++++++++++++++++++++++
 3 files changed, 149 insertions(+)

-- 
2.30.2

From 07ea30d3efa2758fc8f026ef1bc3f1ea2b4d63b6 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Mon, 14 Nov 2022 09:58:20 +0100
Subject: [PATCH manager v9 00/12] *** SUBJECT HERE ***

*** BLURB HERE ***

Dominik Csapak (12):
  api: /cluster/resources: add tags to returned properties
  api: add /ui-options api call
  ui: call '/ui-options' and save the result in PVE.UIOptions
  ui: parse and save tag infos from /ui-options
  ui: add form/TagColorGrid
  ui: add PVE.form.ListField
  ui: dc/OptionView: add editors for tag settings
  ui: add form/Tag
  ui: add form/TagEdit.js
  ui: {lxc,qemu}/Config: show Tags and make them editable
  ui: tree/ResourceTree: show Tags in tree
  ui: add tags to ResourceGrid and GlobalSearchField

 PVE/API2.pm                            |  56 ++++
 PVE/API2/Cluster.pm                    |   9 +-
 www/css/ext6-pve.css                   |  52 ++++
 www/manager6/Makefile                  |   4 +
 www/manager6/Utils.js                  |  92 ++++++-
 www/manager6/Workspace.js              |   2 +
 www/manager6/data/ResourceStore.js     |   7 +
 www/manager6/dc/OptionView.js          | 204 +++++++++++++-
 www/manager6/form/GlobalSearchField.js |  20 +-
 www/manager6/form/ListField.js         | 165 ++++++++++++
 www/manager6/form/Tag.js               | 233 ++++++++++++++++
 www/manager6/form/TagColorGrid.js      | 357 +++++++++++++++++++++++++
 www/manager6/form/TagEdit.js           | 321 ++++++++++++++++++++++
 www/manager6/grid/ResourceGrid.js      |   1 +
 www/manager6/lxc/Config.js             |  36 ++-
 www/manager6/qemu/Config.js            |  35 ++-
 www/manager6/tree/ResourceTree.js      |  10 +-
 17 files changed, 1586 insertions(+), 18 deletions(-)
 create mode 100644 www/manager6/form/ListField.js
 create mode 100644 www/manager6/form/Tag.js
 create mode 100644 www/manager6/form/TagColorGrid.js
 create mode 100644 www/manager6/form/TagEdit.js

-- 
2.30.2





             reply	other threads:[~2022-11-14  9:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  9:43 Dominik Csapak [this message]
2022-11-14  9:43 ` [pve-devel] [PATCH cluster v9 1/4] add CFS_IPC_GET_GUEST_CONFIG_PROPERTIES method Dominik Csapak
2022-11-14 13:15   ` Wolfgang Bumiller
2022-11-14  9:43 ` [pve-devel] [PATCH cluster v9 2/4] Cluster: add get_guest_config_properties Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH cluster v9 3/4] datacenter.cfg: add option for tag-style Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH cluster v9 4/4] datacenter.cfg: add tag rights control to the datacenter config Dominik Csapak
2022-11-14 13:32   ` Wolfgang Bumiller
2022-11-14  9:43 ` [pve-devel] [PATCH qemu-server v9 1/1] api: update: improve tag privilege check Dominik Csapak
2022-11-14 13:37   ` Wolfgang Bumiller
2022-11-15  8:34   ` Aaron Lauterer
2022-11-14  9:43 ` [pve-devel] [PATCH container v9 1/1] check_ct_modify_config_perm: " Dominik Csapak
2022-11-14 13:37   ` Wolfgang Bumiller
2022-11-14  9:43 ` [pve-devel] [PATCH widget-toolkit v9 1/2] add tag related helpers Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH widget-toolkit v9 2/2] Toolkit: add override for Ext.dd.DragDropManager Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 01/12] api: /cluster/resources: add tags to returned properties Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 02/12] api: add /ui-options api call Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 03/12] ui: call '/ui-options' and save the result in PVE.UIOptions Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 04/12] ui: parse and save tag infos from /ui-options Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 05/12] ui: add form/TagColorGrid Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 06/12] ui: add PVE.form.ListField Dominik Csapak
2022-11-14  9:43 ` [pve-devel] [PATCH manager v9 07/12] ui: dc/OptionView: add editors for tag settings Dominik Csapak
2022-11-14  9:44 ` [pve-devel] [PATCH manager v9 08/12] ui: add form/Tag Dominik Csapak
2022-11-14  9:44 ` [pve-devel] [PATCH manager v9 09/12] ui: add form/TagEdit.js Dominik Csapak
2022-11-14  9:44 ` [pve-devel] [PATCH manager v9 10/12] ui: {lxc, qemu}/Config: show Tags and make them editable Dominik Csapak
2022-11-14  9:44 ` [pve-devel] [PATCH manager v9 11/12] ui: tree/ResourceTree: show Tags in tree Dominik Csapak
2022-11-14  9:44 ` [pve-devel] [PATCH manager v9 12/12] ui: add tags to ResourceGrid and GlobalSearchField Dominik Csapak
2022-11-14 17:20 ` [pve-devel] [PATCH cluster/qemu-server/container/wt/manager v9] add tags to ui Aaron Lauterer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114094404.1241050-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal