diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go
index 753437241..7d5ac1587 100644
--- a/backend/app/service/app_install.go
+++ b/backend/app/service/app_install.go
@@ -402,14 +402,12 @@ func (a *AppInstallService) DeleteCheck(installId uint) ([]dto.AppResource, erro
if err != nil {
return nil, err
}
- if app.Type == "website" {
- websites, _ := websiteRepo.GetBy(websiteRepo.WithAppInstallId(appInstall.ID))
- for _, website := range websites {
- res = append(res, dto.AppResource{
- Type: "website",
- Name: website.PrimaryDomain,
- })
- }
+ websites, _ := websiteRepo.GetBy(websiteRepo.WithAppInstallId(appInstall.ID))
+ for _, website := range websites {
+ res = append(res, dto.AppResource{
+ Type: "website",
+ Name: website.PrimaryDomain,
+ })
}
if app.Key == constant.AppOpenresty {
websites, _ := websiteRepo.GetBy()
diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go
index 076a70f1c..cdfa6927e 100644
--- a/backend/app/service/app_utils.go
+++ b/backend/app/service/app_utils.go
@@ -390,9 +390,13 @@ func upApp(ctx context.Context, composeFilePath string, appInstall model.AppInst
appInstall.Message = err.Error()
}
appInstall.Status = constant.Error
- _ = appInstallRepo.Save(ctx, &appInstall)
} else {
appInstall.Status = constant.Running
+ }
+ exist, _ := appInstallRepo.GetFirst(commonRepo.WithByID(appInstall.ID))
+ if exist.ID > 0 {
+ _ = appInstallRepo.Save(context.Background(), &appInstall)
+ } else {
_ = appInstallRepo.Save(ctx, &appInstall)
}
}
diff --git a/backend/app/service/website.go b/backend/app/service/website.go
index ddb997f13..cd0cd58d8 100644
--- a/backend/app/service/website.go
+++ b/backend/app/service/website.go
@@ -6,7 +6,6 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
- "github.com/1Panel-dev/1Panel/backend/utils/common"
"os"
"path"
"reflect"
@@ -184,9 +183,6 @@ func (w WebsiteService) CreateWebsite(ctx context.Context, create request.Websit
if err != nil {
return err
}
- if common.ScanPort(create.Port) {
- return buserr.WithDetail(constant.ErrPortInUsed, create.Port, nil)
- }
if runtime.Resource == constant.ResourceAppstore {
var req request.AppInstallCreate
reg, _ := regexp.Compile("[^a-z0-9_\\-]+")
diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go
index 539605357..e6ef8098e 100644
--- a/backend/init/migration/migrations/init.go
+++ b/backend/init/migration/migrations/init.go
@@ -249,7 +249,7 @@ var AddDefaultGroup = &gormigrate.Migration{
}
var AddTableRuntime = &gormigrate.Migration{
- ID: "20230330-add-table-runtime",
+ ID: "20230406-add-table-runtime",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(&model.Runtime{}, &model.Website{})
},
diff --git a/frontend/src/components/status/index.vue b/frontend/src/components/status/index.vue
index 6955d60c7..86801c253 100644
--- a/frontend/src/components/status/index.vue
+++ b/frontend/src/components/status/index.vue
@@ -1,7 +1,7 @@
{{ $t('commons.status.' + status) }}
-
+
@@ -31,6 +31,12 @@ const getType = (status: string) => {
}
};
+const loadingStatus = ['installing', 'building', 'restarting'];
+
+const loadingIcon = (status: string): boolean => {
+ return loadingStatus.indexOf(status) > -1;
+};
+
onMounted(() => {
status.value = props.status.toLocaleLowerCase();
});
diff --git a/frontend/src/views/app-store/detail/index.vue b/frontend/src/views/app-store/detail/index.vue
index 5e9ec2f66..31a0aa42b 100644
--- a/frontend/src/views/app-store/detail/index.vue
+++ b/frontend/src/views/app-store/detail/index.vue
@@ -97,6 +97,8 @@ import MdEditor from 'md-editor-v3';
import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import Install from './install/index.vue';
+import router from '@/routers';
+
const language = useI18n().locale.value;
interface OperateProps {
@@ -147,7 +149,12 @@ const openInstall = () => {
params: appDetail.value.params,
appDetailId: appDetail.value.id,
};
- installRef.value.acceptParams(params);
+ console.log(app.value);
+ if (app.value.type === 'php') {
+ router.push({ path: '/websites/runtime/php' });
+ } else {
+ installRef.value.acceptParams(params);
+ }
};
onMounted(() => {
diff --git a/frontend/src/views/website/runtime/create/index.vue b/frontend/src/views/website/runtime/create/index.vue
index e1efe113a..318e32a86 100644
--- a/frontend/src/views/website/runtime/create/index.vue
+++ b/frontend/src/views/website/runtime/create/index.vue
@@ -244,7 +244,11 @@ const getRuntime = async (id: number) => {
version: data.version,
};
editParams.value = data.appParams;
- searchApp(data.appId);
+ if (mode.value == 'create') {
+ searchApp(data.appId);
+ } else {
+ initParam.value = true;
+ }
} catch (error) {}
};
diff --git a/frontend/src/views/website/runtime/index.vue b/frontend/src/views/website/runtime/index.vue
index 5133af0ae..1c2349e40 100644
--- a/frontend/src/views/website/runtime/index.vue
+++ b/frontend/src/views/website/runtime/index.vue
@@ -68,7 +68,7 @@
diff --git a/frontend/src/views/website/ssl/index.vue b/frontend/src/views/website/ssl/index.vue
index e77ef65db..94a787b08 100644
--- a/frontend/src/views/website/ssl/index.vue
+++ b/frontend/src/views/website/ssl/index.vue
@@ -102,7 +102,7 @@ import { MsgSuccess } from '@/utils/message';
const paginationConfig = reactive({
currentPage: 1,
- pageSize: 20,
+ pageSize: 10,
total: 0,
});
const acmeAccountRef = ref();
diff --git a/frontend/src/views/website/website/create/index.vue b/frontend/src/views/website/website/create/index.vue
index bf2d0d1e3..e7a9c2dd3 100644
--- a/frontend/src/views/website/website/create/index.vue
+++ b/frontend/src/views/website/website/create/index.vue
@@ -393,6 +393,9 @@ const changeRuntime = (runID: number) => {
runtimes.value.forEach((item) => {
if (item.id === runID) {
runtimeResource.value = item.resource;
+ if (item.type === 'appstore') {
+ getAppDetailByID(item.appDetailId);
+ }
}
});
};
@@ -405,7 +408,7 @@ const getRuntimes = async () => {
const first = runtimes.value[0];
website.value.runtimeID = first.id;
runtimeResource.value = first.resource;
- if (first.type === 'appstore') {
+ if (first.resource === 'appstore') {
getAppDetailByID(first.appDetailId);
}
}
diff --git a/frontend/src/views/website/website/index.vue b/frontend/src/views/website/website/index.vue
index fdb0b1fcd..103f3edd4 100644
--- a/frontend/src/views/website/website/index.vue
+++ b/frontend/src/views/website/website/index.vue
@@ -217,13 +217,13 @@ let groups = ref([]);
const paginationConfig = reactive({
currentPage: 1,
- pageSize: 15,
+ pageSize: 10,
total: 0,
});
let req = reactive({
name: '',
page: 1,
- pageSize: 15,
+ pageSize: 10,
websiteGroupId: 0,
});