Flask-AppBuilder icon indicating copy to clipboard operation
Flask-AppBuilder copied to clipboard

App Icon Url Broken

Open cavemancoder999 opened this issue 6 years ago • 7 comments

Environment: Windows 10 (Non-English)

If I set an app icon in config.py, it only displays correctly on the index page. If I go to another page, like: Security --> List Users, the icon is broken.

Also, the output in the command prompt shows the url is incorrect: INFO:werkzeug:127.0.0.1 - - "GET /users/list/static/img/my_custom_icon.png HTTP/1.1" 404 - The url should be : "/static/img/my_custom_icon.png" It seems like it is joining the path of the view to the path for the app icon.

Please let me know if there is a way to fix this.

cavemancoder999 avatar Feb 08 '18 06:02 cavemancoder999

I'm having the same issue... Going to try to take a look and see if I can fix it.

Edit: It looks like it may have something to do with: appbuilder.get_url_for_index in the template baselib.html...... Going to adjust some things and test locally.

cjbirk avatar Mar 26 '18 01:03 cjbirk

Any progress on this ? I was checking out Apache Superset, which also uses Flask-Appbuilder, and the icon seems fine. Maybe it is a template coding issue ?

cavemancoder999 avatar May 24 '18 01:05 cavemancoder999

I'm having the same issue... Going to try to take a look and see if I can fix it.

Edit: It looks like it may have something to do with: appbuilder.get_url_for_index in the template baselib.html...... Going to adjust some things and test locally.

thank your suggest , it can work after change ''flask_appbuilder/templates/appbuilder/navbar.html'' {% if appbuilder.app_icon %} <a class="navbar-brand" href="{{appbuilder.get_url_for_index}}"> <img src="{{appbuilder.get_url_for_index}}{{appbuilder.app_icon}}" height="100%" width="auto"> <!--change this line--> </a>

redalert253225 avatar Oct 16 '18 01:10 redalert253225

Adding a forwardslash to the logo path in config.[y resolved the issue for me:

In config.py:

APP_ICON = "static/img/logo.jpg" --> issue as described above. Only works on the index.html

APP_ICON = "/static/img/logo.jpg" --> issue resolved. Logo appears on all pages.

tomanizer avatar Nov 19 '18 13:11 tomanizer

this is still a question isn't it any solution ?

bawantha avatar Sep 12 '19 06:09 bawantha

I'm having the same problem. Regarding Superset, they have APP_ICON = "/static/assets/images/superset-logo-horiz.png" but the icon is in the folder superset-frontend/images. I'm new to FAB, is this s a bug or can someone explain what's going on here. Thx!

ghost avatar Jul 23 '20 08:07 ghost

I saw the log message on my command line console.
127.0.0.1 - - [24/Nov/2022 22:00:19] "GET /app/static/img/app_icon.ico HTTP/1.1" 404 -
So, I think need to settings a route path for APP, after that I change settings to APP_ICON = "/static/img/app_icon.ico"
127.0.0.1 - - [24/Nov/2022 22:00:44] "GET /static/img/app_icon.ico HTTP/1.1" 200 -
It is works! so the base path is behind the "/app" path.

mayenpotsu avatar Nov 24 '22 14:11 mayenpotsu