diff --git a/docker.labelInjector.plg b/docker.labelInjector.plg index a00bb62..4d3e6ab 100644 --- a/docker.labelInjector.plg +++ b/docker.labelInjector.plg @@ -12,6 +12,11 @@ +###2024.10.29 +!!!! BREAKING CHANGE !!!! +- Changed the way the default labels are stored. +- If any of your exisiting default labels use ` -> " Going forward these must be escaped \` -> " + ###2024.10.05 - Fix visibility of changes in the summary when dark mode - Add remove all button during edit mode diff --git a/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/docker.labelInjector.Docker.page b/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/docker.labelInjector.Docker.page index 66ff7b3..4eb2399 100644 --- a/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/docker.labelInjector.Docker.page +++ b/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/docker.labelInjector.Docker.page @@ -14,6 +14,7 @@ Icon="server" "> + "> - + + { return !!value && value !== '' && value.includes('=') }, - removeItems: true, - removeItemButton: true, - removeItemButtonAlignLeft: false, - editItems: true, - allowHTML: false, - allowHtmlUserInput: false, - duplicateItemsAllowed: true, - delimiter: ',', - paste: true, - searchEnabled: true, - searchChoices: true, - searchFloor: 1, - searchResultLimit: 4, - searchFields: ['label', 'value'], - position: 'auto', - resetScrollPosition: true, - shouldSort: true, - shouldSortItems: false, - shadowRoot: null, - placeholder: true, - placeholderValue: null, - searchPlaceholderValue: null, - prependValue: null, - appendValue: null, - renderSelectedChoices: 'auto', - loadingText: 'Loading...', - noResultsText: 'No results found', - noChoicesText: 'No choices to choose from', - itemSelectText: 'Press to select', - uniqueItemText: 'Only unique values can be added', customAddItemText: 'Only values containing "=" can be added, i.e `LABEL_A=VALUE_A', - addItemText: (value) => { - return `Press Enter to add "${value}"`; - }, - removeItemIconText: () => `Remove item`, - removeItemLabelText: (value) => `Remove item: ${value}`, - maxItemText: (maxItemCount) => { - return `Only ${maxItemCount} values can be added`; - }, - valueComparer: (value1, value2) => { - return value1 === value2; - }, - classNames: { - containerOuter: ['choices'], - containerInner: ['choices__inner'], - input: ['choices__input'], - inputCloned: ['choices__input--cloned'], - list: ['choices__list'], - listItems: ['choices__list--multiple'], - listSingle: ['choices__list--single'], - listDropdown: ['choices__list--dropdown'], - item: ['choices__item'], - itemSelectable: ['choices__item--selectable'], - itemDisabled: ['choices__item--disabled'], - itemChoice: ['choices__item--choice'], - description: ['choices__description'], - placeholder: ['choices__placeholder'], - group: ['choices__group'], - groupHeading: ['choices__heading'], - button: ['choices__button'], - activeState: ['is-active'], - focusState: ['is-focused'], - openState: ['is-open'], - disabledState: ['is-disabled'], - highlightedState: ['is-highlighted'], - selectedState: ['is-selected'], - flippedState: ['is-flipped'], - loadingState: ['is-loading'], - notice: ['choices__notice'], - addChoice: ['choices__item--selectable', 'add-choice'], - noResults: ['has-no-results'], - noChoices: ['has-no-choices'], - }, - // Choices uses the great Fuse library for searching. You - // can find more options here: https://fusejs.io/api/options.html - fuseOptions: { - includeScore: true - }, - labelId: '', - callbackOnInit: null, - callbackOnCreateTemplates: null, - appendGroupInSearch: false, }); -}) +}); diff --git a/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/scripts/docker.js b/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/scripts/docker.js index 1263548..93cd178 100644 --- a/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/scripts/docker.js +++ b/src/docker.labelInjector/usr/local/emhttp/plugins/docker.labelInjector/scripts/docker.js @@ -42,24 +42,24 @@ function addLabels() { $('div.spinner.fixed').hide(); data = JSON.parse(data) const hasUpdates = data.containers.length > 0 - let updates = '
';
+            let updates = ['
'];
             if (hasUpdates) {
-                updates = updates + `

Note: The templates have been updated, this is just an FYI modal at the moment

` - updates = updates + `

Note: if you leave this page the label will not be applied until you edit and save the container/s in question

` - updates = updates + `

Note: Performing this action will also update the container at this time

` - updates = updates + `

Once you press okay the changes will be applied one by one

` + updates.push("

Note: The templates have been updated, this is just an FYI modal at the moment

") + updates.push("

Note: if you leave this page the label will not be applied until you edit and save the container/s in question

") + updates.push("

Note: Performing this action will also update the container at this time

") + updates.push("

Once you press okay the changes will be applied one by one

") Object.entries(data.updates).forEach(([container, changes]) => { - updates = updates + `

${container} changes:

${changes.join("")}`; + updates.push(`

${container} changes:

${changes.join("")}`); }); } else { - updates = updates + `

No Containers returned any changes in labels, nothing to be applied

` + updates.push("

No Containers returned any changes in labels, nothing to be applied

") } - updates = updates + "
" + updates.push("
") swal({ title: "Summary of Updates", - text: updates, + text: updates.join(""), html: true, closeOnConfirm: false, }, function () { @@ -94,7 +94,7 @@ function labelForm() {
  • When empty values are provided the label will be removed or ignored if not found
  • Existing tags will be replaced
  • Spaces will be replaced with a -
  • -
  • To use quotes in an options use \` Otherwise the option fails to save
  • +
  • To use quotes in an options use and escaped backtick \\\` Otherwise the option fails to save
  • The following special values are available replacement of values or keys: