mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-23 16:00:52 +00:00
feat: Add parent website display in website list (#11695)
This commit is contained in:
@@ -40,6 +40,7 @@ type WebsiteRes struct {
|
||||
SSLStatus string `json:"sslStatus"`
|
||||
AppInstallID uint `json:"appInstallId"`
|
||||
ChildSites []string `json:"childSites"`
|
||||
ParentSite string `json:"parentSite"`
|
||||
RuntimeType string `json:"runtimeType"`
|
||||
Favorite bool `json:"favorite"`
|
||||
IPV6 bool `json:"IPV6"`
|
||||
|
||||
@@ -208,6 +208,13 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
|
||||
IPV6: web.IPV6,
|
||||
}
|
||||
|
||||
if siteDTO.Type == constant.Subsite {
|
||||
parentWeb, _ := websiteRepo.GetFirst(repo.WithByID(web.ParentWebsiteID))
|
||||
if parentWeb.ID != 0 {
|
||||
siteDTO.ParentSite = parentWeb.PrimaryDomain
|
||||
}
|
||||
}
|
||||
|
||||
sites, _ := websiteRepo.List(websiteRepo.WithParentID(web.ID))
|
||||
if len(sites) > 0 {
|
||||
for _, site := range sites {
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
{{ $t('website.' + row.type) }}
|
||||
<span v-if="row.type === 'deployment'">[{{ row.appName }}]</span>
|
||||
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
|
||||
<span v-if="row.type === 'subsite'">[{{ row.parentSite }}]</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user