From 52f7df0350f4106d102cb355fb0668924c2e2c9e Mon Sep 17 00:00:00 2001
From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com>
Date: Mon, 25 Nov 2024 12:05:42 +0800
Subject: [PATCH] feat(runtime): correct typo in variable name (#7172)
---
backend/app/service/runtime.go | 12 ++++++------
backend/app/service/runtime_utils.go | 6 +++---
backend/app/service/website.go | 2 +-
backend/app/service/website_utils.go | 2 +-
backend/constant/common.go | 3 +--
backend/constant/runtime.go | 2 +-
frontend/src/lang/modules/en.ts | 2 +-
frontend/src/lang/modules/tw.ts | 2 +-
frontend/src/lang/modules/zh.ts | 2 +-
frontend/src/routers/modules/website.ts | 6 +++---
frontend/src/views/app-store/apps/index.vue | 2 +-
frontend/src/views/app-store/detail/index.vue | 2 +-
frontend/src/views/home/app/index.vue | 2 +-
.../website/runtime/{donet => dotnet}/index.vue | 8 ++++----
.../runtime/{donet => dotnet}/operate/index.vue | 6 +++---
frontend/src/views/website/runtime/index.vue | 2 +-
16 files changed, 30 insertions(+), 31 deletions(-)
rename frontend/src/views/website/runtime/{donet => dotnet}/index.vue (97%)
rename frontend/src/views/website/runtime/{donet => dotnet}/operate/index.vue (98%)
diff --git a/backend/app/service/runtime.go b/backend/app/service/runtime.go
index 638c87875..34659c9bb 100644
--- a/backend/app/service/runtime.go
+++ b/backend/app/service/runtime.go
@@ -83,7 +83,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
if exist != nil {
return nil, buserr.New(constant.ErrImageExist)
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
if !fileOp.Stat(create.CodeDir) {
return nil, buserr.New(constant.ErrPathNotFound)
}
@@ -133,7 +133,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
if err = handlePHP(create, runtime, fileOp, appVersionDir); err != nil {
return nil, err
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
runtime.Port = create.Port
if err = handleNodeAndJava(create, runtime, fileOp, appVersionDir); err != nil {
return nil, err
@@ -217,7 +217,7 @@ func (r *RuntimeService) Delete(runtimeDelete request.RuntimeDelete) error {
global.LOG.Errorf("delete image id [%s] error %v", imageID, err)
}
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
if out, err := compose.Down(runtime.GetComposePath()); err != nil && !runtimeDelete.ForceDelete {
if out != "" {
return errors.New(out)
@@ -300,7 +300,7 @@ func (r *RuntimeService) Get(id uint) (*response.RuntimeDTO, error) {
}
}
res.AppParams = appParams
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
res.Params = make(map[string]interface{})
envs, err := gotenv.Unmarshal(runtime.Env)
if err != nil {
@@ -361,7 +361,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
if exist != nil {
return buserr.New(constant.ErrImageExist)
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
if runtime.Port != req.Port {
if err = checkPortExist(req.Port); err != nil {
return err
@@ -441,7 +441,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
return err
}
go buildRuntime(runtime, imageID, req.Rebuild)
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
runtime.Version = req.Version
runtime.CodeDir = req.CodeDir
runtime.Port = req.Port
diff --git a/backend/app/service/runtime_utils.go b/backend/app/service/runtime_utils.go
index d1bbf6633..72640f5ea 100644
--- a/backend/app/service/runtime_utils.go
+++ b/backend/app/service/runtime_utils.go
@@ -354,9 +354,9 @@ func handleParams(create request.RuntimeCreate, projectDir string) (composeConte
if err != nil {
return
}
- case constant.RuntimeDoNet:
+ case constant.RuntimeDotNet:
create.Params["CODE_DIR"] = create.CodeDir
- create.Params["DONET_VERSION"] = create.Version
+ create.Params["DOTNET_VERSION"] = create.Version
create.Params["PANEL_APP_PORT_HTTP"] = create.Port
composeContent, err = handleCompose(env, composeContent, create, projectDir)
if err != nil {
@@ -408,7 +408,7 @@ func handleCompose(env gotenv.Env, composeContent []byte, create request.Runtime
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${JAVA_APP_PORT}")
case constant.RuntimeGo:
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${GO_APP_PORT}")
- case constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimePython, constant.RuntimeDotNet:
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${APP_PORT}")
}
diff --git a/backend/app/service/website.go b/backend/app/service/website.go
index 4bf21ccb0..6f7a0bb57 100644
--- a/backend/app/service/website.go
+++ b/backend/app/service/website.go
@@ -352,7 +352,7 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error)
}
website.Proxy = proxy
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
website.Proxy = fmt.Sprintf("127.0.0.1:%d", runtime.Port)
}
}
diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go
index 14e2125a2..7906a6062 100644
--- a/backend/app/service/website_utils.go
+++ b/backend/app/service/website_utils.go
@@ -277,7 +277,7 @@ func configDefaultNginx(website *model.Website, domains []model.WebsiteDomain, a
server.UpdateRoot(rootIndex)
server.UpdatePHPProxy([]string{website.Proxy}, "")
}
- case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDoNet:
+ case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
proxy := fmt.Sprintf("http://127.0.0.1:%d", runtime.Port)
server.UpdateRootProxy([]string{proxy})
}
diff --git a/backend/constant/common.go b/backend/constant/common.go
index 8707b6389..7be163104 100644
--- a/backend/constant/common.go
+++ b/backend/constant/common.go
@@ -96,10 +96,9 @@ var WebUrlMap = map[string]struct{}{
"/websites/runtimes/php": {},
"/websites/runtimes/node": {},
"/websites/runtimes/java": {},
- "/websites/runtimes/net": {},
"/websites/runtimes/go": {},
"/websites/runtimes/python": {},
- "/websites/runtimes/donet": {},
+ "/websites/runtimes/dotnet": {},
"/login": {},
diff --git a/backend/constant/runtime.go b/backend/constant/runtime.go
index cc4e89881..97dffda64 100644
--- a/backend/constant/runtime.go
+++ b/backend/constant/runtime.go
@@ -19,7 +19,7 @@ const (
RuntimeJava = "java"
RuntimeGo = "go"
RuntimePython = "python"
- RuntimeDoNet = "donet"
+ RuntimeDotNet = "dotnet"
RuntimeProxyUnix = "unix"
RuntimeProxyTcp = "tcp"
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 85cc15381..c5e700393 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -2428,7 +2428,7 @@ const message = {
goDirHelper: 'The directory must contain go files or binary files, subdirectories are also acceptable',
pythonHelper:
'Please fill in the complete startup command, for example: pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
- donetHelper: 'Please fill in the complete startup comman, for example: dotnet MyWebApp.dll',
+ dotnetHelper: 'Please fill in the complete startup comman, for example: dotnet MyWebApp.dll',
},
process: {
pid: 'Process ID',
diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts
index c2dda6f19..c8078e346 100644
--- a/frontend/src/lang/modules/tw.ts
+++ b/frontend/src/lang/modules/tw.ts
@@ -2247,7 +2247,7 @@ const message = {
goDirHelper: '目錄中要包含 go 文件或者二進制文件,子目錄中包含也可',
pythonHelper:
'請填入完整啟動指令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
- donetHelper: '請填入完整啟動指令,例如 dotnet MyWebApp.dll',
+ dotnetHelper: '請填入完整啟動指令,例如 dotnet MyWebApp.dll',
},
process: {
pid: '進程ID',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 1285a2317..8778ebedd 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -2249,7 +2249,7 @@ const message = {
goDirHelper: '目录中要包含 go 文件或者二进制文件,子目录中包含也可',
pythonHelper:
'请填写完整启动命令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
- donetHelper: '请填写完整启动命令,例如 dotnet MyWebApp.dll',
+ dotnetHelper: '请填写完整启动命令,例如 dotnet MyWebApp.dll',
},
process: {
pid: '进程ID',
diff --git a/frontend/src/routers/modules/website.ts b/frontend/src/routers/modules/website.ts
index 945990dbf..b2352485c 100644
--- a/frontend/src/routers/modules/website.ts
+++ b/frontend/src/routers/modules/website.ts
@@ -89,10 +89,10 @@ const webSiteRouter = {
},
},
{
- path: '/websites/runtimes/donet',
- name: 'doNet',
+ path: '/websites/runtimes/dotnet',
+ name: 'dotNet',
hidden: true,
- component: () => import('@/views/website/runtime/donet/index.vue'),
+ component: () => import('@/views/website/runtime/dotnet/index.vue'),
meta: {
activeMenu: '/websites/runtimes/php',
requiresAuth: false,
diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue
index b397c618d..caefb7c37 100644
--- a/frontend/src/views/app-store/apps/index.vue
+++ b/frontend/src/views/app-store/apps/index.vue
@@ -237,7 +237,7 @@ const openInstall = (app: App.App) => {
case 'java':
case 'go':
case 'python':
- case 'donet':
+ case 'dotnet':
router.push({ path: '/websites/runtimes/' + app.type });
break;
default:
diff --git a/frontend/src/views/app-store/detail/index.vue b/frontend/src/views/app-store/detail/index.vue
index 0498116d0..8c8d665ab 100644
--- a/frontend/src/views/app-store/detail/index.vue
+++ b/frontend/src/views/app-store/detail/index.vue
@@ -146,7 +146,7 @@ const openInstall = () => {
case 'java':
case 'go':
case 'python':
- case 'donet':
+ case 'dotnet':
router.push({ path: '/websites/runtimes/' + app.value.type });
break;
default:
diff --git a/frontend/src/views/home/app/index.vue b/frontend/src/views/home/app/index.vue
index e5f4c7417..f1e880b47 100644
--- a/frontend/src/views/home/app/index.vue
+++ b/frontend/src/views/home/app/index.vue
@@ -71,7 +71,7 @@ const goInstall = (key: string, type: string) => {
case 'java':
case 'go':
case 'python':
- case 'donet':
+ case 'dotnet':
router.push({ path: '/websites/runtimes/' + type });
break;
default:
diff --git a/frontend/src/views/website/runtime/donet/index.vue b/frontend/src/views/website/runtime/dotnet/index.vue
similarity index 97%
rename from frontend/src/views/website/runtime/donet/index.vue
rename to frontend/src/views/website/runtime/dotnet/index.vue
index a376dfab3..53dcb26ca 100644
--- a/frontend/src/views/website/runtime/donet/index.vue
+++ b/frontend/src/views/website/runtime/dotnet/index.vue
@@ -95,7 +95,7 @@
-
+
@@ -108,7 +108,7 @@ import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
-import OperateDonet from '@/views/website/runtime/donet/operate/index.vue';
+import OperateDotnet from '@/views/website/runtime/dotnet/operate/index.vue';
import Status from '@/components/status/index.vue';
import Delete from '@/views/website/runtime/delete/index.vue';
import i18n from '@/lang';
@@ -147,7 +147,7 @@ const req = reactive({
name: '',
page: 1,
pageSize: 40,
- type: 'donet',
+ type: 'dotnet',
});
const buttons = [
{
@@ -213,7 +213,7 @@ const sync = () => {
};
const openCreate = () => {
- operateRef.value.acceptParams({ type: 'donet', mode: 'create' });
+ operateRef.value.acceptParams({ type: 'dotnet', mode: 'create' });
};
const openDetail = (row: Runtime.Runtime) => {
diff --git a/frontend/src/views/website/runtime/donet/operate/index.vue b/frontend/src/views/website/runtime/dotnet/operate/index.vue
similarity index 98%
rename from frontend/src/views/website/runtime/donet/operate/index.vue
rename to frontend/src/views/website/runtime/dotnet/operate/index.vue
index 1a6755a44..3674680a1 100644
--- a/frontend/src/views/website/runtime/donet/operate/index.vue
+++ b/frontend/src/views/website/runtime/dotnet/operate/index.vue
@@ -76,7 +76,7 @@
- {{ $t('runtime.donetHelper') }}
+ {{ $t('runtime.dotnetHelper') }}
@@ -174,7 +174,7 @@ const mode = ref('create');
const editParams = ref();
const appVersions = ref([]);
const appReq = reactive({
- type: 'donet',
+ type: 'dotnet',
page: 1,
pageSize: 20,
resource: 'remote',
@@ -193,7 +193,7 @@ const initData = (type: string) => ({
port: 8080,
exposedPorts: [],
});
-let runtime = reactive(initData('donet'));
+let runtime = reactive(initData('dotnet'));
const rules = ref({
name: [Rules.requiredInput, Rules.appName],
appID: [Rules.requiredSelect],
diff --git a/frontend/src/views/website/runtime/index.vue b/frontend/src/views/website/runtime/index.vue
index f44c36598..7561114a1 100644
--- a/frontend/src/views/website/runtime/index.vue
+++ b/frontend/src/views/website/runtime/index.vue
@@ -31,7 +31,7 @@ const buttons = [
},
{
label: '.NET',
- path: '/websites/runtimes/donet',
+ path: '/websites/runtimes/dotnet',
},
];