Skip to content

Commit

Permalink
1.0.1.1
Browse files Browse the repository at this point in the history
###
优化:
- 现在如果没有service,主页将不会出现service分类
  • Loading branch information
Xingsandesu committed Feb 20, 2024
1 parent 35d4d69 commit c29dfb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
"""

TAICHI_OS_WELCOME_MESSAGE = ("\n"
"版本 : 1.0.0.1\n"
"版本 : 1.0.1.1\n"
"交流群 : 909881726"
"GITHUB : https://github.com/Xingsandesu/TaiChi_OS\n")
16 changes: 11 additions & 5 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,20 @@ def update_docker():
items.add_item_to_category(DOCKER_CATEGORY, item)
items.remove_nonexistent_items(DOCKER_CATEGORY, docker_items)

if SERVICE_CATEGORY not in items.items_dict:
items.add_category(SERVICE_CATEGORY, service_items)
if service_items:
if SERVICE_CATEGORY not in items.items_dict:
items.add_category(SERVICE_CATEGORY, service_items)
else:
for item in service_items:
if not items.item_exists_in_category(SERVICE_CATEGORY, item):
items.add_item_to_category(SERVICE_CATEGORY, item)
else:
for item in service_items:
if not items.item_exists_in_category(SERVICE_CATEGORY, item):
items.add_item_to_category(SERVICE_CATEGORY, item)
items.remove_nonexistent_items(SERVICE_CATEGORY, service_items)

# 如果服务类别已经存在,但是服务项列表为空,那么就删除服务类别
if SERVICE_CATEGORY in items.items_dict and not items.items_dict[SERVICE_CATEGORY]:
items.delete_category(SERVICE_CATEGORY)


######################### 主页相关Class结束 #########################

Expand Down

0 comments on commit c29dfb0

Please sign in to comment.