You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
953 B
Django/Jinja
34 lines
953 B
Django/Jinja
from iti.modules import ModuleMenuSeed, ModulePermission
|
|
|
|
from .routes import router
|
|
|
|
|
|
class ExampleModule:
|
|
name = "example"
|
|
|
|
def register_routes(self, app):
|
|
app.include_router(router)
|
|
|
|
def register_permissions(self, app):
|
|
app.state.iti_modules.register_permission(
|
|
ModulePermission(
|
|
code="example:item:list",
|
|
name="示例列表",
|
|
description="查看示例模块数据",
|
|
)
|
|
)
|
|
|
|
def register_menu_seed(self, app):
|
|
app.state.iti_modules.register_menu_seed(
|
|
ModuleMenuSeed(
|
|
id="example-menu-root",
|
|
name="Example",
|
|
type="menu",
|
|
path="/example",
|
|
component="/example/list",
|
|
auth_code="example:item:list",
|
|
meta={"title": "示例模块", "icon": "carbon:application"},
|
|
sort=100,
|
|
)
|
|
)
|