[pve-devel] [PATCH http-server 3/3] formatter: html: update to bootstrap 5
Dominik Csapak
d.csapak at proxmox.com
Thu Jun 5 10:07:32 CEST 2025
On 6/4/25 19:33, Thomas Lamprecht wrote:
> Am 03.06.25 um 15:04 schrieb Dominik Csapak:
>> this makes a few changes necessary, but not too much:
>> * include the different directory for bootstrap5
>> * use different navbar markup
>> * different classes for navbar container + items
>> * add classes to pre tag since it's not styled anymore in newer
>> bootstrap versions
>> * add 'form-label' to labels
>> * use containers with 'mb-3' for form + buttons
>> * use 'd-grid' container for button instead of 'btn-block'
>> * add 'breadcrumb-item' where necessary
>>
>> Since bootstrap 5 does not depend on jQuery anymore, use that chance to
>> remove it here as dependency too. For that remove the 'button'
>> and 'add_js' subs that were never actually used.
>>
>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>> ---
>> debian/control | 3 +-
>> src/PVE/APIServer/AnyEvent.pm | 3 +
>> src/PVE/APIServer/Formatter/Bootstrap.pm | 37 +------
>> src/PVE/APIServer/Formatter/HTML.pm | 132 +++++++++++++----------
>> 4 files changed, 84 insertions(+), 91 deletions(-)
>>
>> diff --git a/debian/control b/debian/control
>> index 0d0161e..4ce0368 100644
>> --- a/debian/control
>> +++ b/debian/control
>> @@ -15,8 +15,7 @@ Depends: libanyevent-http-perl,
>> libhttp-date-perl,
>> libhttp-message-perl,
>> libio-socket-ssl-perl,
>> - libjs-bootstrap,
>> - libjs-jquery,
>> + libjs-bootstrap5,
>> libjson-perl,
>> libnet-ip-perl,
>> libpve-common-perl (>= 8.0.2),
>> diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
>> index b71a9a5..9aeae2f 100644
>> --- a/src/PVE/APIServer/AnyEvent.pm
>> +++ b/src/PVE/APIServer/AnyEvent.pm
>> @@ -2032,6 +2032,9 @@ sub new {
>
> expanding the context a bit here:
>
> # add default dirs which includes jquery and bootstrap
> my $jsbase = '/usr/share/javascript';
> add_dirs($self->{dirs}, '/js/' => "$jsbase/");
>
> The jquery part would be wrong, and with the new location of the bootstrap file
> we could evaluate if it's really required to expose all of /usr/share/javascript.
> I mean, it does not really hurt, we disallow symlinks anyway and there is nothing
> secretive in there nor do we interpret any files directly as code on the server,
> so there is probably no big reason, but if we touch this it might be still worth
> a quick evaluation.
>
>> my $glyphicons = '/usr/share/fonts/truetype/glyphicons/';
>> add_dirs($self->{dirs}, '/js/bootstrap/fonts/' => "$glyphicons");
>
> but that font file and directory is provided by the fonts-glyphicons-halflings package,
> the old libjs-bootstrap depends on that, the newer does not and thus quite likely
> doesn't use it anymore. Can we drop it here? As on a fresh installation with this
> patch applied it won't be reachable anyway.
>
>
> besides that it look OK, albeit I only skimmed the remaining changes.
yes you're right, we probably can drop more folders here that I missed.
I'll check which ones we can drop and update the comments if necessary in the v2
>
>>
>> + # libjs-bootstrap5 uses a different dir with symlinks
>> + add_dirs($self->{dirs}, '/js/bootstrap5/' => "/usr/share/bootstrap-html");
>> +
>> # init inotify
>> PVE::INotify::inotify_init();
>>
More information about the pve-devel
mailing list