openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
214 stars 235 forks source link

OH 3.2 - 404 error for fonts and icon/number #1273

Closed Daniel-at-git closed 1 year ago

Daniel-at-git commented 2 years ago

The problem

I get some 404 errors in Chrome Console in basicUI image

(basicUI load fine I just saw this errors in console)

Expected behavior

No 404 errors in console ;-)

Steps to reproduce

Start Developer Tool (F12) and reload your basicUI

Your environment

root@openhab:~# openhab-cli info

Version:     3.2.0 (Build)

User:        openhab (Active Process 5900)
User Groups: openhab tty dialout audio

Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab          | openhab:openhab
             OPENHAB_RUNTIME  | /usr/share/openhab/runtime  | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab            | openhab:openhab
             OPENHAB_CONF     | /etc/openhab                | openhab:openhab
             OPENHAB_LOGDIR   | /var/log/openhab            | openhab:openhab

I'm not an expert but is this the data for webui?

jar tf /var/lib/openhab/tmp/kar/openhab-addons-3.2.0/org/openhab/ui/bundles/org.openhab.ui.habpanel/3.2.0/org.openhab.ui.habpanel-3.2.0.jar |grep Roboto
web/fonts/roboto/Roboto-Regular.woff2
web/fonts/roboto/Roboto-Regular.eot
web/fonts/roboto/Roboto-Regular.ttf
web/fonts/roboto/Roboto-Regular.svg
web/fonts/roboto/Roboto-Regular.woff

Then we have to add "/roboto" to roboto.css. But I don't have an idea for 404 on numbers.

Daniel-at-git commented 2 years ago

@maggu2810 Is it broken by https://github.com/openhab/openhab-webui/commit/1a36cd49150eb262c2d05f1b41b94f13af34e161

Should we modify in bundles/org.openhab.ui.basic/src/main/resources/web/roboto.css all "fonts/" to "/habpanel/fonts/roboto/" or should Robot-Regular be bundled in basicui?

maggu2810 commented 2 years ago

Hi @Daniel-at-git, sorry I am not part of the "game" anymore. You need to discuss with active members.

Daniel-at-git commented 2 years ago

Can someone else tell me if there is an architecture rule to bundle font with basic-ui or should I modify it to get it from habpanel?

lolodomo commented 2 years ago

Should we modify in bundles/org.openhab.ui.basic/src/main/resources/web/roboto.css all "fonts/" to "/habpanel/fonts/roboto/" or should Robot-Regular be bundled in basicui?

Basic UI cannot "reference" habpanel, they are 2 different and independent UIs.

Daniel-at-git commented 2 years ago

Basic UI cannot "reference" habpanel, they are 2 different and independent UIs.

Technical we can reference it... So we have to add roboto font from habpanel https://github.com/openhab/openhab-webui/tree/main/bundles/org.openhab.ui.habpanel/web/fonts/roboto to basicui? This should be easy ;-)

lolodomo commented 2 years ago

Can you propose the change after testing it?

lolodomo commented 2 years ago

Can you propose the change after testing it?

Daniel-at-git commented 2 years ago

Can you propose the change after testing it?

Which one? Referencing Roboto Font from habpanel?

lolodomo commented 2 years ago

Of course not. More the option to copy the fonts in Basic UI.

Daniel-at-git commented 2 years ago

Sorry, I give up... I don't understand the build system and directories.

In https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui.basic/gulpfile.js#L19 you try to source some Roboto-Medium Fonts. But I didn't found the node_modules directory :-( Or is it fetched online via https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui.basic/package-lock.json#L3403

I'm not a Java/Web developer....

silviuchingaru commented 1 year ago

The bug still exists in OpenHab 3.3.

lolodomo commented 1 year ago

This will be solved by the proposed fix removing the Roboto font (as unused). Regarding the number icon, that is true that an icon is missing in the classic iconset. One should be added.

Daniel-at-git commented 1 year ago

that is true that an icon is missing in the classic iconset. One should be added.

@lolodomo Should I open a new issue for icon? This issue has been closed....

lolodomo commented 1 year ago

@lolodomo Should I open a new issue for icon? This issue has been closed....

Rather propose an icon (we need one version in PNG format and one in SVG format).