1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix(tags): at most 12 characters; "…" does not move the columns

- A new or renamed tag has at most 12 characters (computes.models.TAG_LENGTH,
  a validator: the column keeps 32, so names made before the limit stay
  usable until renamed and the migration changes no SQL); the tag box
  offers no longer name.
- The tags "…" shows in a table's cell go below the others within the
  cell's width as it is, so the list's columns no longer move.
This commit is contained in:
catborise 2026-11-19 09:34:07 +03:00
parent 0e711ec058
commit bc1894e4d8
12 changed files with 115 additions and 78 deletions

View file

@ -8,14 +8,15 @@ document.querySelectorAll("select[data-searchable]").forEach(function (select) {
});
// A <select multiple data-tags>: the tags there are, and a new one typed (the
// server checks it), in lower case as the tags are kept: "Prod" is "prod".
// server checks it), in lower case as the tags are kept: "Prod" is "prod";
// a new one of at most 12 characters (computes.models.TAG_LENGTH).
document.querySelectorAll("select[data-tags]").forEach(function (select) {
new TomSelect(select, {
create: function (input) {
return {value: input.toLowerCase(), text: input.toLowerCase()};
},
createFilter: function (input) {
return /^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$/.test(input) && !this.options[input.toLowerCase()];
return /^[A-Za-z0-9][A-Za-z0-9._-]{0,11}$/.test(input) && !this.options[input.toLowerCase()];
},
persist: false,
render: {