2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 22:07:16 +08:00

fix: 一些小问题

This commit is contained in:
耗子
2024-06-18 03:30:59 +08:00
parent 8a5b46ad7e
commit 46b431de30
6 changed files with 27 additions and 1 deletions

View File

@@ -200,6 +200,10 @@ func (r *PostgreSQLController) DatabaseList(ctx http.Context) http.Response {
}
pagedDatabases := databases[startIndex:endIndex]
if pagedDatabases == nil {
pagedDatabases = []database{}
}
return controllers.Success(ctx, http.Json{
"total": len(databases),
"items": pagedDatabases,
@@ -441,6 +445,10 @@ func (r *PostgreSQLController) RoleList(ctx http.Context) http.Response {
}
pagedRoles := roles[startIndex:endIndex]
if pagedRoles == nil {
pagedRoles = []role{}
}
return controllers.Success(ctx, http.Json{
"total": len(roles),
"items": pagedRoles,