2022-09-26 16:32:40 +08:00
|
|
|
package model
|
|
|
|
|
2022-09-29 18:16:56 +08:00
|
|
|
import (
|
|
|
|
"github.com/1Panel-dev/1Panel/global"
|
|
|
|
"path"
|
|
|
|
)
|
|
|
|
|
2022-09-26 16:32:40 +08:00
|
|
|
type AppInstall struct {
|
|
|
|
BaseModel
|
2022-09-29 18:16:56 +08:00
|
|
|
Name string `json:"name" gorm:"type:varchar(64);not null"`
|
|
|
|
Version string `json:"version" gorm:"type:varchar(256);not null"`
|
|
|
|
AppId uint `json:"appId" gorm:"type:integer;not null"`
|
|
|
|
AppDetailId uint `json:"appDetailId" gorm:"type:integer;not null"`
|
2022-10-03 17:35:39 +08:00
|
|
|
Params string `json:"params" gorm:"type:longtext;"`
|
2022-09-29 18:16:56 +08:00
|
|
|
Status string `json:"status" gorm:"type:varchar(256);not null"`
|
2022-10-03 17:35:39 +08:00
|
|
|
Description string `json:"description" gorm:"type:varchar(256);"`
|
|
|
|
Message string `json:"message" gorm:"type:longtext;"`
|
|
|
|
CanUpdate bool `json:"canUpdate"`
|
2022-09-29 18:16:56 +08:00
|
|
|
App App `json:"-"`
|
|
|
|
Containers []AppContainer `json:"containers"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i AppInstall) GetPath() string {
|
|
|
|
return path.Join(global.CONF.System.AppDir, i.App.Key, i.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i AppInstall) GetComposePath() string {
|
|
|
|
return path.Join(global.CONF.System.AppDir, i.App.Key, i.Name, "docker-compose.yml")
|
2022-09-26 16:32:40 +08:00
|
|
|
}
|