Skip to content

Commit

Permalink
优化:主机列表/DNS列表接口密码返回为空 fix:#149
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Nov 17, 2024
1 parent edd8fe9 commit dc7626f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- v1.6.59(2024-11-05)
- fix
- doc: dingtalk webhook (#146)
- 修复普通用户网站监测日志查看权限

Expand Down
10 changes: 9 additions & 1 deletion domain_admin/api/dns_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@Date : 2023-07-29
"""
from flask import request, g
from playhouse.shortcuts import model_to_dict

from domain_admin.enums.dns_type_enum import DnsTypeEnum
from domain_admin.enums.role_enum import RoleEnum
Expand Down Expand Up @@ -86,6 +87,8 @@ def get_dns_by_id():
if not dns_row:
raise DataNotFoundAppException()

dns_row.secret_key = ''

return dns_row


Expand Down Expand Up @@ -139,7 +142,12 @@ def get_dns_list():
DnsModel.id.desc()
)

lst = list(map(lambda m: model_to_dict(model=m), rows))

for row in lst:
row['secret_key'] = ''

return {
'list': rows,
'list': lst,
'total': total,
}
12 changes: 11 additions & 1 deletion domain_admin/api/host_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@Date : 2023-07-29
"""
from flask import request, g
from playhouse.shortcuts import model_to_dict

from domain_admin.config import DEFAULT_SSH_PORT
from domain_admin.enums.role_enum import RoleEnum
Expand Down Expand Up @@ -97,6 +98,9 @@ def get_host_by_id():
if not host_row:
raise DataNotFoundAppException()

host_row.password = ''
host_row.private_key = ''

return host_row


Expand Down Expand Up @@ -153,7 +157,13 @@ def get_host_list():
HostModel.id.desc()
).paginate(page, size)

lst = list(map(lambda m: model_to_dict(model=m), rows))

for row in lst:
row['password'] = ''
row['private_key'] = ''

return {
'list': rows,
'list': lst,
'total': total,
}

0 comments on commit dc7626f

Please sign in to comment.