Koozali.org: home of the SME Server

Software installer page - combo box height...

Offline julianop

  • *
  • 61
  • +0/-0
Software installer page - combo box height...
« on: June 16, 2018, 07:04:11 PM »
How can I change the height of the combo box from which I select packages to install?

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Software installer page - combo box height...
« Reply #1 on: June 16, 2018, 08:50:29 PM »
Note: This change will NOT survive a server update.

Code: [Select]
cd /etc/e-smith/web/functions
#
# create a backup of the original yum function
cp yum yum~
#
# add [size="10"] to the select windows on all yum functions
# (don't do this more than once...)
sed -i s/multiple\=\"1\"/multiple\=\"1\"\ size\=\"10\"/ yum
#
# set the setuid bit for the edited version of the yum function
chmod u+s yum

The updater will use the new select window size (10 in this example) the next time you load the page.

Undo these changes using:
Code: [Select]
cd /etc/e-smith/web/functions
cp -y yum~ yum
chmod u+s yum

Explanation:
server-manager uses FormMagick to generate the various configuration screens.

The "sed -i" command above is adding a "size" declaration to each of the "select" windows in the "yum" panel.  Each of these select windows already includes [multiple="1"] to indicate the multi-select is supported; we're adding [size="10"].

"chmod u+s" sets the setuid bit for the edited version of the yum panel; without this server-manager throws an internal server error.

Quote from: diff -u /etc/e-smith/web/functions/yum~  /etc/e-smith/web/functions/yum
--- /etc/e-smith/web/functions/yum~     2018-06-16 14:30:00.065526258 -0400
+++ /etc/e-smith/web/functions/yum      2018-06-16 14:38:35.728250134 -0400
@@ -138,7 +138,7 @@
        post-event="do_yum('update')">

         <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedPackages"
             value="get_names('updates','package')"
             options="get_options('updates','package')">
@@ -161,7 +161,7 @@
        </field>

         <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedGroups"
            display="non_empty('available','group')"
             options="get_options('available','group')">
@@ -170,7 +170,7 @@
         </field>

         <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedPackages"
            display="non_empty('available','packages')"
             options="get_options('available','package')">
@@ -193,7 +193,7 @@
        </field>

         <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedGroups"
            display="non_empty('installed','group')"
             options="get_options('installed','group')">
@@ -202,7 +202,7 @@
         </field>

         <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedPackages"
            display="non_empty('installed','package')"
             options="get_options('installed','package')">
@@ -237,7 +237,7 @@
         </field>

        <field
-            type="select" multiple="1"
+            type="select" multiple="1" size="10"
             id="SelectedRepositories"
             options="get_repository_options()"
             value="get_repository_current_options()">

Offline julianop

  • *
  • 61
  • +0/-0
Re: Software installer page - combo box height...
« Reply #2 on: June 16, 2018, 09:32:56 PM »
Note: This change will NOT survive a server update.

Code: [Select]
cd /etc/e-smith/web/functions
#
# create a backup of the original yum function
cp yum yum~
#
# add [size="10"] to the select windows on all yum functions
# (don't do this more than once...)
sed -i s/multiple\=\"1\"/multiple\=\"1\"\ size\=\"10\"/ yum
#
# set the setuid bit for the edited version of the yum function
chmod u+s yum

The updater will use the new select window size (10 in this example) the next time you load the page.

Undo these changes using:
Code: [Select]
cd /etc/e-smith/web/functions
cp -y yum~ yum
chmod u+s yum

Explanation:
server-manager uses FormMagick to generate the various configuration screens.

The "sed -i" command above is adding a "size" declaration to each of the "select" windows in the "yum" panel.  Each of these select windows already includes [multiple="1"] to indicate the multi-select is supported; we're adding [size="10"].

"chmod u+s" sets the setuid bit for the edited version of the yum panel; without this server-manager throws an internal server error.

Thank you for this most helpful information, and for the excellent description of its operation. It did exactly what I wanted.

I've made a copy of the updated file and taken note of the command executed, so I can reinstate it (after doing a diff to identify any other changes, of course) after any upgrade. I don't do much command line work these days, so writing it down saves the strain on the memory.