Skip to content

Commit ffead78

Browse files
feat: Add parent website display in website list (#11695)
1 parent d742c7d commit ffead78

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

agent/app/dto/response/website.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type WebsiteRes struct {
4040
SSLStatus string `json:"sslStatus"`
4141
AppInstallID uint `json:"appInstallId"`
4242
ChildSites []string `json:"childSites"`
43+
ParentSite string `json:"parentSite"`
4344
RuntimeType string `json:"runtimeType"`
4445
Favorite bool `json:"favorite"`
4546
IPV6 bool `json:"IPV6"`

agent/app/service/website.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
208208
IPV6: web.IPV6,
209209
}
210210

211+
if siteDTO.Type == constant.Subsite {
212+
parentWeb, _ := websiteRepo.GetFirst(repo.WithByID(web.ParentWebsiteID))
213+
if parentWeb.ID != 0 {
214+
siteDTO.ParentSite = parentWeb.PrimaryDomain
215+
}
216+
}
217+
211218
sites, _ := websiteRepo.List(websiteRepo.WithParentID(web.ID))
212219
if len(sites) > 0 {
213220
for _, site := range sites {

frontend/src/views/website/website/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
{{ $t('website.' + row.type) }}
114114
<span v-if="row.type === 'deployment'">[{{ row.appName }}]</span>
115115
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
116+
<span v-if="row.type === 'subsite'">[{{ row.parentSite }}]</span>
116117
</div>
117118
</template>
118119
</el-table-column>

0 commit comments

Comments
 (0)