cube-studio/myapp/views/view_link.py

24 lines
447 B
Python
Raw Normal View History

2021-08-17 17:00:34 +08:00
from flask_babel import gettext as __
from flask_babel import lazy_gettext as _
2022-08-11 10:47:08 +08:00
2021-08-17 17:00:34 +08:00
from myapp import app, appbuilder,db,event_logger
conf = app.config
all_links = conf.get('ALL_LINKS',{})
for link in all_links:
appbuilder.add_link(
link['label'],
label=_(link['label']),
href=link['url'],
category_icon="fa-link",
icon="fa-link",
category="link",
category_label=__("链接"),
)