Skip to content

Commit

Permalink
v1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Apr 8, 2023
1 parent 694e1ee commit e9f7419
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 66 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## 更新日志

- v1.2.4(2023-04-07)
- 新增:分组批量域名
- 新增:分组批量关联域名
- 优化:域名导出新增分组字段
- 优化:域名编辑分组的时候,看不到第10个以后的分组名字。
- 优化:域名导入支持txt(仅域名字段)、csv(域名、备注)
- 修复:域名编辑分组的时候,看不到第10个以后的分组名字。
- 优化:域名分组列表ID改为序号

- v1.2.3(2023-04-05)
- 优化:支持docker多平台

Expand Down
47 changes: 21 additions & 26 deletions domain_admin/api/domain_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def add_domain():

domain = request.json.get('domain')
alias = request.json.get('alias', '')
group_id = request.json.get('group_id', 0)
group_id = request.json.get('group_id') or 0

if not domain:
raise AppException('参数缺失:domain')
Expand Down Expand Up @@ -54,6 +54,7 @@ def update_domain_by_id():
domain_service.check_permission_and_get_row(domain_id, current_user_id)

data['update_time'] = datetime_util.get_datetime()
data['group_id'] = data.get('group_id') or 0

DomainModel.update(data).where(
DomainModel.id == domain_id
Expand Down Expand Up @@ -264,27 +265,6 @@ def check_domain_cert():
async_task_service.submit_task(fn=domain_service.update_and_check_domain_cert, user_id=current_user_id)


def import_domain_from_file():
"""
从文件导入域名
:return:
"""
current_user_id = g.user_id

update_file = request.files.get('file')

filename = file_service.save_temp_file(update_file)

# 异步导入
async_task_service.submit_task(fn=domain_service.add_domain_from_file, filename=filename, user_id=current_user_id)

# count = domain_service.add_domain_from_file(filename, current_user_id)

# return {
# 'count': count
# }


def get_all_domain_list_of_user():
"""
获取用户的所有域名数据
Expand All @@ -306,19 +286,34 @@ def get_all_domain_list_of_user():
}


def import_domain_from_file():
"""
从文件导入域名
支持 txt 和 csv格式
:return:
"""
current_user_id = g.user_id

update_file = request.files.get('file')

filename = file_service.save_temp_file(update_file)

# 异步导入
async_task_service.submit_task(fn=domain_service.add_domain_from_file, filename=filename, user_id=current_user_id)


def export_domain_file():
"""
导出域名文件
csv格式
:return:
"""
current_user_id = g.user_id
# temp_filename = domain_service.export_domain_to_file(current_user_id)

ret = domain_service.export_domain_to_file(current_user_id)
filename = domain_service.export_domain_to_file(current_user_id)

return {
'ret': ret,
'url': file_service.resolve_temp_url(ret)
'url': file_service.resolve_temp_url(filename)
}


Expand Down
2 changes: 1 addition & 1 deletion domain_admin/model/domain_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DomainModel(BaseModel):
ip = CharField(default="")

# 分组
group_id = IntegerField(default=0)
group_id = IntegerField(default=0, null=False)

# 域名注册时间 @since 1.1.0
domain_start_time = DateTimeField(default=None, null=True)
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions domain_admin/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
content="no-referrer"
/>
<title>Domain Admin-域名证书SSL监测系统</title>
<script type="module" crossorigin src="/js/index.c9528988.js"></script>
<script type="module" crossorigin src="/js/index.b7697840.js"></script>
<link rel="modulepreload" crossorigin href="/js/vendor-vue.e07d7f7e.js">
<link rel="modulepreload" crossorigin href="/js/element-icon.bb5f2c38.js">
<link rel="modulepreload" crossorigin href="/js/element-plus.0d508af4.js">
<link rel="modulepreload" crossorigin href="/js/vendor-lib.f93a8f58.js">
<link rel="stylesheet" href="/css/index.1def0e09.css">
<link rel="stylesheet" href="/css/index.8b1a49a5.css">
</head>
<body>
<div id="app"></div>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions domain_admin/public/js/SelectGroup.4a24a2f4.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion domain_admin/public/js/group-store.43a1d7ec.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions domain_admin/public/js/index.9dd5ab40.js

This file was deleted.

Loading

0 comments on commit e9f7419

Please sign in to comment.