Initialize views
"""
from airflow_webserver import views
appbuilder.add_view_no_menu(views.Airflow())
appbuilder.add_view_no_menu(views.DagModelView())
appbuilder.add_view_no_menu(views.ConfigurationView())
appbuilder.add_view_no_menu(views.VersionView())

appbuilder.add_view(views.DagRunModelView, "DAG Runs", category="Browse", category_icon="fa-globe")
appbuilder.add_view(views.JobModelView, "Jobs", category="Browse")
appbuilder.add_view(views.LogModelView, "Logs", category="Browse")
appbuilder.add_view(views.SlaMissModelView, "SLA Misses", category="Browse")
appbuilder.add_view(views.TaskInstanceModelView, "Task Instances", category="Browse")


appbuilder.add_link("Configurations", href='/configuration', category="Admin", category_icon="fa-user")
appbuilder.add_view(views.ConnectionModelView, "Connections", category="Admin")
appbuilder.add_view(views.PoolModelView, "Pools", category="Admin")
appbuilder.add_view(views.VariableModelView, "Variables", category="Admin")
appbuilder.add_view(views.XComModelView, "XComs", category="Admin")

appbuilder.add_link("Documentation", href='http://pythonhosted.org/airflow/', category="Docs", category_icon="fa-cube")
appbuilder.add_link("Github", href='https://github.com/apache/incubator-airflow', category="Docs")

appbuilder.add_link('Version', href='/version', category='About', category_icon='fa-th')

"""
 Initialize Role-Based Access Control
"""
from airflow_webserver.security import init_roles
init_roles()
Esempio n. 2
0
    ##########          HISTORIQUE EXPEDITION        ############
    @expose('/histexped/<string:param1>')
    @has_access
    def histexped(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        self.update_redirect()
        return self.render_template('historique_exped.html', param1=param1)


########################          ESPACE ADMIN          ############################
#accueil admin tableau de bord
appbuilder.add_link("Première connection",
                    href='/myview/FirstConnAdmin/john',
                    category='Espace Admin')
appbuilder.add_view(MyView, "Tableau de bord", category='Espace Admin')
appbuilder.add_link("Utilisateurs",
                    href='/myview/utilisateurs/john',
                    category='Espace Admin')
appbuilder.add_link("Clients",
                    href='/myview/client/john',
                    category='Espace Admin')
appbuilder.add_link("Fournisseurs ",
                    href='/myview/listfournisseur/john',
                    category='Espace Admin')
appbuilder.add_link("Expédition client",
                    href='/myview/exped/john',
                    category='Espace Admin')
appbuilder.add_link("Commandes",