Skip to content

Commit

Permalink
feat(icons): add some sidebar icon
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxin688 committed Jul 9, 2024
1 parent 04fd2c6 commit efd42cd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def add_views(admin: Admin) -> None:
from src.features.ipam.views import BlockView, PrefixView, VLANView
from src.features.org.views import LocationView, SiteGroupView, SiteView

admin.add_view(LocationView)
admin.add_view(DeviceTypeView)
admin.add_view(PlatformView)
admin.add_view(ManufacturerView)
Expand All @@ -99,6 +98,7 @@ def add_views(admin: Admin) -> None:
admin.add_view(DeviceRoleView)
admin.add_view(SiteGroupView)
admin.add_view(SiteView)
admin.add_view(LocationView)
admin.add_view(DeviceView)
admin.add_view(BlockView)
admin.add_view(PrefixView)
Expand Down
4 changes: 4 additions & 0 deletions backend/src/features/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class UserView(ModelView, model=models.User):

form_ajax_refs = {"group": {"fields": ("name",), "order_by": "id"}, "role": {"fields": ("name",), "order_by": "id"}}

icon = "fa-solid fa-user"


class GroupView(ModelView, model=models.Group):
name = models.Group.__visible_name__[locale_ctx.get()]
Expand All @@ -78,6 +80,7 @@ class GroupView(ModelView, model=models.Group):
page_size_options = [20, 50, 100, 200]

form_ajax_refs = {"role": {"fields": ("name",), "order_by": "id"}}
icon = "fa-solid fa-user-group"


class RoleView(ModelView, model=models.Role):
Expand All @@ -98,3 +101,4 @@ class RoleView(ModelView, model=models.Role):
page_size_options = [20, 50, 100, 200]

form_ajax_refs = {"group": {"fields": ("name",), "order_by": "id"}}
icon = "fa-sharp fa-solid fa-circle-user"
2 changes: 2 additions & 0 deletions backend/src/features/intend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class DeviceTypeView(ModelView, model=models.DeviceType):
name = "Device Type"
name_plural = "Device Types"

icon = "mdi:server"


class PlatformView(ModelView, model=models.Platform):
category = "Intend"
Expand Down
1 change: 1 addition & 0 deletions backend/src/features/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class BlockView(ModelView, model=models.Block):
models.Block.block,
models.Block.is_private,
]
icon = "codepen"


class PrefixView(ModelView, model=models.Prefix):
Expand Down
1 change: 1 addition & 0 deletions backend/src/features/org/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class SiteGroupView(ModelView, model=models.SiteGroup):
page_size = 20
page_size_options = [20, 50, 100, 200]
form_create_rules = ["name", "description"]
icon = "fa-solid fa-sitemap"


class SiteView(ModelView, model=models.Site):
Expand Down

0 comments on commit efd42cd

Please sign in to comment.