mirror of
https://github.com/acepanel/panel.git
synced 2026-02-07 15:27:16 +08:00
fix: 网站列表优化
This commit is contained in:
@@ -1186,12 +1186,12 @@ func (r *websiteRepo) reloadWebServer() error {
|
||||
func (r *websiteRepo) readBasicAuthUsers(siteName string) map[string]string {
|
||||
htpasswdPath := filepath.Join(app.Root, "sites", siteName, "htpasswd")
|
||||
if !io.Exists(htpasswdPath) {
|
||||
return nil
|
||||
return make(map[string]string)
|
||||
}
|
||||
|
||||
file, err := os.Open(htpasswdPath)
|
||||
if err != nil {
|
||||
return nil
|
||||
return make(map[string]string)
|
||||
}
|
||||
defer func(file *os.File) { _ = file.Close() }(file)
|
||||
|
||||
@@ -1209,9 +1209,6 @@ func (r *websiteRepo) readBasicAuthUsers(siteName string) map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
if len(users) == 0 {
|
||||
return nil
|
||||
}
|
||||
return users
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,21 @@ const columns: any = [
|
||||
return h(NFlex, { align: 'center', wrap: false }, { default: () => elements })
|
||||
}
|
||||
},
|
||||
{
|
||||
title: $gettext('Website Type'),
|
||||
key: 'type',
|
||||
width: 150,
|
||||
resizable: true,
|
||||
render(row: any) {
|
||||
const typeMap: any = {
|
||||
proxy: { label: $gettext('Reverse Proxy'), type: 'warning' },
|
||||
php: { label: $gettext('PHP'), type: 'info' },
|
||||
static: { label: $gettext('Pure Static'), type: 'success' }
|
||||
}
|
||||
const config = typeMap[row.type] || { label: row.type, type: 'default' }
|
||||
return h(NTag, { type: config.type }, { default: () => config.label })
|
||||
}
|
||||
},
|
||||
{
|
||||
title: $gettext('Running'),
|
||||
key: 'status',
|
||||
@@ -362,7 +377,7 @@ onMounted(() => {
|
||||
striped
|
||||
remote
|
||||
:loading="loading"
|
||||
:scroll-x="1400"
|
||||
:scroll-x="1500"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
:row-key="(row: any) => row.id"
|
||||
|
||||
Reference in New Issue
Block a user