mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
feat(runtime): correct typo in variable name (#7172)
This commit is contained in:
parent
38d1cac5d9
commit
52f7df0350
@ -83,7 +83,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
|
|||||||
if exist != nil {
|
if exist != nil {
|
||||||
return nil, buserr.New(constant.ErrImageExist)
|
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) {
|
if !fileOp.Stat(create.CodeDir) {
|
||||||
return nil, buserr.New(constant.ErrPathNotFound)
|
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 {
|
if err = handlePHP(create, runtime, fileOp, appVersionDir); err != nil {
|
||||||
return nil, err
|
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
|
runtime.Port = create.Port
|
||||||
if err = handleNodeAndJava(create, runtime, fileOp, appVersionDir); err != nil {
|
if err = handleNodeAndJava(create, runtime, fileOp, appVersionDir); err != nil {
|
||||||
return nil, err
|
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)
|
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, err := compose.Down(runtime.GetComposePath()); err != nil && !runtimeDelete.ForceDelete {
|
||||||
if out != "" {
|
if out != "" {
|
||||||
return errors.New(out)
|
return errors.New(out)
|
||||||
@ -300,7 +300,7 @@ func (r *RuntimeService) Get(id uint) (*response.RuntimeDTO, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
res.AppParams = appParams
|
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{})
|
res.Params = make(map[string]interface{})
|
||||||
envs, err := gotenv.Unmarshal(runtime.Env)
|
envs, err := gotenv.Unmarshal(runtime.Env)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -361,7 +361,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
|
|||||||
if exist != nil {
|
if exist != nil {
|
||||||
return buserr.New(constant.ErrImageExist)
|
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 runtime.Port != req.Port {
|
||||||
if err = checkPortExist(req.Port); err != nil {
|
if err = checkPortExist(req.Port); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -441,7 +441,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
go buildRuntime(runtime, imageID, req.Rebuild)
|
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.Version = req.Version
|
||||||
runtime.CodeDir = req.CodeDir
|
runtime.CodeDir = req.CodeDir
|
||||||
runtime.Port = req.Port
|
runtime.Port = req.Port
|
||||||
|
@ -354,9 +354,9 @@ func handleParams(create request.RuntimeCreate, projectDir string) (composeConte
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case constant.RuntimeDoNet:
|
case constant.RuntimeDotNet:
|
||||||
create.Params["CODE_DIR"] = create.CodeDir
|
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
|
create.Params["PANEL_APP_PORT_HTTP"] = create.Port
|
||||||
composeContent, err = handleCompose(env, composeContent, create, projectDir)
|
composeContent, err = handleCompose(env, composeContent, create, projectDir)
|
||||||
if err != nil {
|
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}")
|
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${JAVA_APP_PORT}")
|
||||||
case constant.RuntimeGo:
|
case constant.RuntimeGo:
|
||||||
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${GO_APP_PORT}")
|
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}")
|
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${APP_PORT}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error)
|
|||||||
}
|
}
|
||||||
website.Proxy = proxy
|
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)
|
website.Proxy = fmt.Sprintf("127.0.0.1:%d", runtime.Port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ func configDefaultNginx(website *model.Website, domains []model.WebsiteDomain, a
|
|||||||
server.UpdateRoot(rootIndex)
|
server.UpdateRoot(rootIndex)
|
||||||
server.UpdatePHPProxy([]string{website.Proxy}, "")
|
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)
|
proxy := fmt.Sprintf("http://127.0.0.1:%d", runtime.Port)
|
||||||
server.UpdateRootProxy([]string{proxy})
|
server.UpdateRootProxy([]string{proxy})
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,9 @@ var WebUrlMap = map[string]struct{}{
|
|||||||
"/websites/runtimes/php": {},
|
"/websites/runtimes/php": {},
|
||||||
"/websites/runtimes/node": {},
|
"/websites/runtimes/node": {},
|
||||||
"/websites/runtimes/java": {},
|
"/websites/runtimes/java": {},
|
||||||
"/websites/runtimes/net": {},
|
|
||||||
"/websites/runtimes/go": {},
|
"/websites/runtimes/go": {},
|
||||||
"/websites/runtimes/python": {},
|
"/websites/runtimes/python": {},
|
||||||
"/websites/runtimes/donet": {},
|
"/websites/runtimes/dotnet": {},
|
||||||
|
|
||||||
"/login": {},
|
"/login": {},
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ const (
|
|||||||
RuntimeJava = "java"
|
RuntimeJava = "java"
|
||||||
RuntimeGo = "go"
|
RuntimeGo = "go"
|
||||||
RuntimePython = "python"
|
RuntimePython = "python"
|
||||||
RuntimeDoNet = "donet"
|
RuntimeDotNet = "dotnet"
|
||||||
|
|
||||||
RuntimeProxyUnix = "unix"
|
RuntimeProxyUnix = "unix"
|
||||||
RuntimeProxyTcp = "tcp"
|
RuntimeProxyTcp = "tcp"
|
||||||
|
@ -2428,7 +2428,7 @@ const message = {
|
|||||||
goDirHelper: 'The directory must contain go files or binary files, subdirectories are also acceptable',
|
goDirHelper: 'The directory must contain go files or binary files, subdirectories are also acceptable',
|
||||||
pythonHelper:
|
pythonHelper:
|
||||||
'Please fill in the complete startup command, for example: pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
|
'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: {
|
process: {
|
||||||
pid: 'Process ID',
|
pid: 'Process ID',
|
||||||
|
@ -2247,7 +2247,7 @@ const message = {
|
|||||||
goDirHelper: '目錄中要包含 go 文件或者二進制文件,子目錄中包含也可',
|
goDirHelper: '目錄中要包含 go 文件或者二進制文件,子目錄中包含也可',
|
||||||
pythonHelper:
|
pythonHelper:
|
||||||
'請填入完整啟動指令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
|
'請填入完整啟動指令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
|
||||||
donetHelper: '請填入完整啟動指令,例如 dotnet MyWebApp.dll',
|
dotnetHelper: '請填入完整啟動指令,例如 dotnet MyWebApp.dll',
|
||||||
},
|
},
|
||||||
process: {
|
process: {
|
||||||
pid: '進程ID',
|
pid: '進程ID',
|
||||||
|
@ -2249,7 +2249,7 @@ const message = {
|
|||||||
goDirHelper: '目录中要包含 go 文件或者二进制文件,子目录中包含也可',
|
goDirHelper: '目录中要包含 go 文件或者二进制文件,子目录中包含也可',
|
||||||
pythonHelper:
|
pythonHelper:
|
||||||
'请填写完整启动命令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
|
'请填写完整启动命令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000',
|
||||||
donetHelper: '请填写完整启动命令,例如 dotnet MyWebApp.dll',
|
dotnetHelper: '请填写完整启动命令,例如 dotnet MyWebApp.dll',
|
||||||
},
|
},
|
||||||
process: {
|
process: {
|
||||||
pid: '进程ID',
|
pid: '进程ID',
|
||||||
|
@ -89,10 +89,10 @@ const webSiteRouter = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/websites/runtimes/donet',
|
path: '/websites/runtimes/dotnet',
|
||||||
name: 'doNet',
|
name: 'dotNet',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/website/runtime/donet/index.vue'),
|
component: () => import('@/views/website/runtime/dotnet/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
activeMenu: '/websites/runtimes/php',
|
activeMenu: '/websites/runtimes/php',
|
||||||
requiresAuth: false,
|
requiresAuth: false,
|
||||||
|
@ -237,7 +237,7 @@ const openInstall = (app: App.App) => {
|
|||||||
case 'java':
|
case 'java':
|
||||||
case 'go':
|
case 'go':
|
||||||
case 'python':
|
case 'python':
|
||||||
case 'donet':
|
case 'dotnet':
|
||||||
router.push({ path: '/websites/runtimes/' + app.type });
|
router.push({ path: '/websites/runtimes/' + app.type });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -146,7 +146,7 @@ const openInstall = () => {
|
|||||||
case 'java':
|
case 'java':
|
||||||
case 'go':
|
case 'go':
|
||||||
case 'python':
|
case 'python':
|
||||||
case 'donet':
|
case 'dotnet':
|
||||||
router.push({ path: '/websites/runtimes/' + app.value.type });
|
router.push({ path: '/websites/runtimes/' + app.value.type });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -71,7 +71,7 @@ const goInstall = (key: string, type: string) => {
|
|||||||
case 'java':
|
case 'java':
|
||||||
case 'go':
|
case 'go':
|
||||||
case 'python':
|
case 'python':
|
||||||
case 'donet':
|
case 'dotnet':
|
||||||
router.push({ path: '/websites/runtimes/' + type });
|
router.push({ path: '/websites/runtimes/' + type });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
</template>
|
</template>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
<OperateDonet ref="operateRef" @close="search" />
|
<OperateDotnet ref="operateRef" @close="search" />
|
||||||
<Delete ref="deleteRef" @close="search" />
|
<Delete ref="deleteRef" @close="search" />
|
||||||
<ComposeLogs ref="composeLogRef" />
|
<ComposeLogs ref="composeLogRef" />
|
||||||
<PortJumpDialog ref="dialogPortJumpRef" />
|
<PortJumpDialog ref="dialogPortJumpRef" />
|
||||||
@ -108,7 +108,7 @@ import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
|
|||||||
import { Runtime } from '@/api/interface/runtime';
|
import { Runtime } from '@/api/interface/runtime';
|
||||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||||
import { dateFormat } from '@/utils/util';
|
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 Status from '@/components/status/index.vue';
|
||||||
import Delete from '@/views/website/runtime/delete/index.vue';
|
import Delete from '@/views/website/runtime/delete/index.vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
@ -147,7 +147,7 @@ const req = reactive<Runtime.RuntimeReq>({
|
|||||||
name: '',
|
name: '',
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 40,
|
pageSize: 40,
|
||||||
type: 'donet',
|
type: 'dotnet',
|
||||||
});
|
});
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -213,7 +213,7 @@ const sync = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openCreate = () => {
|
const openCreate = () => {
|
||||||
operateRef.value.acceptParams({ type: 'donet', mode: 'create' });
|
operateRef.value.acceptParams({ type: 'dotnet', mode: 'create' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const openDetail = (row: Runtime.Runtime) => {
|
const openDetail = (row: Runtime.Runtime) => {
|
@ -76,7 +76,7 @@
|
|||||||
<el-form-item :label="$t('runtime.runScript')" prop="params.EXEC_SCRIPT">
|
<el-form-item :label="$t('runtime.runScript')" prop="params.EXEC_SCRIPT">
|
||||||
<el-input v-model="runtime.params['EXEC_SCRIPT']"></el-input>
|
<el-input v-model="runtime.params['EXEC_SCRIPT']"></el-input>
|
||||||
<span class="input-help">
|
<span class="input-help">
|
||||||
{{ $t('runtime.donetHelper') }}
|
{{ $t('runtime.dotnetHelper') }}
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
@ -174,7 +174,7 @@ const mode = ref('create');
|
|||||||
const editParams = ref<App.InstallParams[]>();
|
const editParams = ref<App.InstallParams[]>();
|
||||||
const appVersions = ref<string[]>([]);
|
const appVersions = ref<string[]>([]);
|
||||||
const appReq = reactive({
|
const appReq = reactive({
|
||||||
type: 'donet',
|
type: 'dotnet',
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
resource: 'remote',
|
resource: 'remote',
|
||||||
@ -193,7 +193,7 @@ const initData = (type: string) => ({
|
|||||||
port: 8080,
|
port: 8080,
|
||||||
exposedPorts: [],
|
exposedPorts: [],
|
||||||
});
|
});
|
||||||
let runtime = reactive<Runtime.RuntimeCreate>(initData('donet'));
|
let runtime = reactive<Runtime.RuntimeCreate>(initData('dotnet'));
|
||||||
const rules = ref<any>({
|
const rules = ref<any>({
|
||||||
name: [Rules.requiredInput, Rules.appName],
|
name: [Rules.requiredInput, Rules.appName],
|
||||||
appID: [Rules.requiredSelect],
|
appID: [Rules.requiredSelect],
|
@ -31,7 +31,7 @@ const buttons = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '.NET',
|
label: '.NET',
|
||||||
path: '/websites/runtimes/donet',
|
path: '/websites/runtimes/dotnet',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user