luci-base: actions title for actions buttons group
authorPaul Donald <redacted>
Mon, 2 Feb 2026 17:40:26 +0000 (18:40 +0100)
committerPaul Donald <redacted>
Mon, 2 Feb 2026 19:10:50 +0000 (20:10 +0100)
Customizable title.

Signed-off-by: Paul Donald <redacted>
modules/luci-base/htdocs/luci-static/resources/form.js

index 0464b9ef71e4e698080f2cfed4497a664b31e101..b2a0ca5f7a3b859fce1469739d0c46fb68ff7ecc 100644 (file)
@@ -2474,6 +2474,15 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
         * @default null
         */
 
+       /**
+        * Set a custom text for the actions column header row when actions buttons
+        * are present.
+        *
+        * @name LuCI.form.TableSection.prototype#actionstitle
+        * @type string|function
+        * @default null
+        */
+
        /**
         * Specify a maximum amount of columns to display. By default, one table
         * column is rendered for each child option of the form section element.
@@ -2715,10 +2724,13 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
                                        dom.content(trEl.lastElementChild, opt.title);
                        }
 
-                       if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
+                       if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
+                               const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
+                               const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
                                trEl.appendChild(E('th', {
                                        'class': 'th cbi-section-table-cell cbi-section-actions'
-                               }));
+                               }, (actionsTitle !== undefined) ? actionsTitle : null));
+                       }
 
                        trEls.appendChild(trEl);
                }
@@ -2742,10 +2754,13 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
                                                (typeof(opt.width) == 'number') ? `${opt.width}px` : opt.width;
                        }
 
-                       if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
+                       if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
+                               const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
+                               const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
                                trEl.appendChild(E('th', {
                                        'class': 'th cbi-section-table-cell cbi-section-actions'
-                               }));
+                               }, (actionsTitle !== undefined) ? actionsTitle : null));
+                       }
 
                        trEls.appendChild(trEl);
                }
git clone https://git.99rst.org/PROJECT