feat: 优化应用启动 (#6193)

This commit is contained in:
zhengkunwang 2024-08-21 11:46:49 +08:00 committed by GitHub
parent 37df602ae8
commit 6dec845848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 2 deletions

View File

@ -33,6 +33,7 @@ type WebsiteRes struct {
SSLStatus string `json:"sslStatus"`
AppInstallID uint `json:"appInstallId"`
ChildSites []string `json:"childSites"`
RuntimeType string `json:"runtimeType"`
}
type WebsiteOption struct {

View File

@ -255,7 +255,7 @@ func (a *AppInstallService) Operate(req request.AppInstalledOperate) error {
case constant.Rebuild:
return rebuildApp(install)
case constant.Start:
out, err := compose.Start(dockerComposePath)
out, err := compose.Up(dockerComposePath)
if err != nil {
return handleErr(install, err, out)
}

View File

@ -159,6 +159,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
var (
appName string
runtimeName string
runtimeType string
appInstallID uint
)
switch web.Type {
@ -175,6 +176,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
return 0, nil, err
}
runtimeName = runtime.Name
runtimeType = runtime.Type
appInstallID = runtime.ID
}
sitePath := path.Join(constant.AppInstallDir, constant.AppOpenresty, nginxInstall.Name, "www", "sites", web.Alias)
@ -195,6 +197,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
RuntimeName: runtimeName,
SitePath: sitePath,
AppInstallID: appInstallID,
RuntimeType: runtimeType,
}
sites, _ := websiteRepo.List(websiteRepo.WithParentID(web.ID))

View File

@ -32,6 +32,7 @@ export namespace Website {
sitePath: string;
appName: string;
runtimeName: string;
runtimeType: string;
}
export interface WebsiteRes extends CommonModel {
protocol: string;

View File

@ -87,7 +87,7 @@ const handleClose = () => {
em('close', false);
};
const acceptParams = async (website: Website.Website) => {
const acceptParams = async (website: Website.WebsiteDTO) => {
deleteReq.value = {
id: 0,
deleteApp: false,

View File

@ -188,6 +188,7 @@
<el-tag v-if="row.protocol == 'HTTPS'" :type="row.sslStatus">
{{ dateFormatSimple(row.sslExpireDate) }}
</el-tag>
<span v-else></span>
</template>
</el-table-column>
<fu-table-operations