1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-12 19:40:06 +08:00

feat: 容器名称修改增加来源判断 (#3390)

This commit is contained in:
ssongliu 2023-12-19 22:02:07 +08:00 committed by GitHub
parent d50fa7d928
commit f50972a0e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 3 deletions

View File

@ -577,6 +577,8 @@ const message = {
containerFromAppHelper: containerFromAppHelper:
'Detected that this container originates from the app store. App operations may cause current edits to be invalidated.', 'Detected that this container originates from the app store. App operations may cause current edits to be invalidated.',
containerFromAppHelper1:
'Click the `Settings` button in the installed applications list to enter the editing page and modify the container name.',
command: 'Command', command: 'Command',
console: 'Console Interaction', console: 'Console Interaction',
tty: 'TTY (-t)', tty: 'TTY (-t)',

View File

@ -561,6 +561,7 @@ const message = {
cpuShareHelper: '容器默認份額為 1024 CPU增大可使當前容器獲得更多的 CPU 時間', cpuShareHelper: '容器默認份額為 1024 CPU增大可使當前容器獲得更多的 CPU 時間',
containerFromAppHelper: '檢測到該容器來源於應用商店應用操作可能會導致當前編輯失效', containerFromAppHelper: '檢測到該容器來源於應用商店應用操作可能會導致當前編輯失效',
containerFromAppHelper1: '在已安裝應用程式列表點擊 `參數` 按鈕進入編輯頁面即可修改容器名稱',
command: '命令', command: '命令',
console: '控製臺交互', console: '控製臺交互',
tty: '偽終端 ( -t )', tty: '偽終端 ( -t )',

View File

@ -562,6 +562,7 @@ const message = {
cpuShareHelper: '容器默认份额为 1024 CPU增大可使当前容器获得更多的 CPU 时间', cpuShareHelper: '容器默认份额为 1024 CPU增大可使当前容器获得更多的 CPU 时间',
containerFromAppHelper: '检测到该容器来源于应用商店应用操作可能会导致当前编辑失效', containerFromAppHelper: '检测到该容器来源于应用商店应用操作可能会导致当前编辑失效',
containerFromAppHelper1: '在已安装应用列表点击 `参数` 按钮进入编辑页面即可修改容器名称',
command: '命令', command: '命令',
console: '控制台交互', console: '控制台交互',
tty: '伪终端 ( -t )', tty: '伪终端 ( -t )',

View File

@ -27,12 +27,30 @@
<el-alert <el-alert
v-if="dialogData.title === 'edit' && isFromApp(dialogData.rowData!)" v-if="dialogData.title === 'edit' && isFromApp(dialogData.rowData!)"
:title="$t('container.containerFromAppHelper')" :title="$t('container.containerFromAppHelper')"
class="common-prompt"
:closable="false" :closable="false"
type="error" type="error"
/> />
<el-form-item :label="$t('commons.table.name')" prop="name"> <el-form-item class="mt-5" :label="$t('commons.table.name')" prop="name">
<el-input clearable v-model.trim="dialogData.rowData!.name" /> <el-input
:disabled="isFromApp(dialogData.rowData!)"
clearable
v-model.trim="dialogData.rowData!.name"
/>
<div v-if="dialogData.title === 'edit' && isFromApp(dialogData.rowData!)">
<span class="input-help">
{{ $t('container.containerFromAppHelper1') }}
<el-button
style="margin-left: -5px"
size="small"
text
type="primary"
@click="goRouter()"
>
<el-icon><Position /></el-icon>
{{ $t('firewall.quickJump') }}
</el-button>
</span>
</div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('container.image')" prop="image"> <el-form-item :label="$t('container.image')" prop="image">
<el-checkbox v-model="dialogData.rowData!.imageInput" :label="$t('container.input')" /> <el-checkbox v-model="dialogData.rowData!.imageInput" :label="$t('container.input')" />
@ -278,6 +296,7 @@ import {
import { Container } from '@/api/interface/container'; import { Container } from '@/api/interface/container';
import { MsgError, MsgSuccess } from '@/utils/message'; import { MsgError, MsgSuccess } from '@/utils/message';
import { checkIpV4V6, checkPort } from '@/utils/util'; import { checkIpV4V6, checkPort } from '@/utils/util';
import router from '@/routers';
const loading = ref(false); const loading = ref(false);
interface DialogProps { interface DialogProps {
@ -374,6 +393,10 @@ const handlePortsDelete = (index: number) => {
dialogData.value.rowData!.exposedPorts.splice(index, 1); dialogData.value.rowData!.exposedPorts.splice(index, 1);
}; };
const goRouter = async () => {
router.push({ name: 'AppInstalled' });
};
const handleVolumesAdd = () => { const handleVolumesAdd = () => {
let item = { let item = {
sourceDir: '', sourceDir: '',