1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-03-14 01:34:47 +08:00

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"` SSLStatus string `json:"sslStatus"`
AppInstallID uint `json:"appInstallId"` AppInstallID uint `json:"appInstallId"`
ChildSites []string `json:"childSites"` ChildSites []string `json:"childSites"`
RuntimeType string `json:"runtimeType"`
} }
type WebsiteOption struct { type WebsiteOption struct {

View File

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

View File

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

View File

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

View File

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

View File

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