Skip to content

Commit

Permalink
fix: 优化右侧抽屉内容过多导致显示不完整的问题 (1Panel-dev#3547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu authored Jan 9, 2024
1 parent c23c3db commit 3dca8e3
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 6 deletions.
5 changes: 4 additions & 1 deletion frontend/src/components/drawer-header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<span>{{ header }}</span>
<span v-if="resource && !hideResource">
-
<el-tag effect="dark" type="success">{{ resource }}</el-tag>
<el-tooltip v-if="resource.length > 25" :content="resource" placement="bottom">
<el-tag effect="dark" type="success">{{ resource.substring(0, 23) + '...' }}</el-tag>
</el-tooltip>
<el-tag v-else effect="dark" type="success">{{ resource }}</el-tag>
</span>
<el-divider v-if="slots.buttons" direction="vertical" />
<slot v-if="slots.buttons" name="buttons"></slot>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/global/form-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const checkContainerName = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback();
} else {
const reg = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{1,127}$/;
const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9_.-]{1,127}$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.containerName')));
} else {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const message = {
paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)',
nginxDoc: 'Only supports English case, numbers, and .',
appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_',
containerName: 'Supports letters, numbers, -, _ and .; cannot start with - _ or .; length: 2-127',
containerName: 'Supports letters, numbers, -, _ and .; cannot start with - _ or .; length: 2-128',
mirror: 'Support image accelerator addresses that start with http(s)://, English uppercase and lowercase letters, numbers, periods, and hyphens, and there should be no empty lines.',
disableFunction: 'Only support letters ,underscores,and,',
leechExts: 'Only support letters, numbers and,',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const message = {
paramUrlAndPort: '格式為 http(s)://(域名/ip):(端口)',
nginxDoc: '僅支持英文大小寫數字,和.',
appName: '支持英文數字-和_,長度2-30,並且不能以-_開頭和結尾',
containerName: '支持字母數字、_-.,不能以-_或.開頭,長度2-127',
containerName: '支持字母數字、_-.,不能以-_或.開頭,長度2-128',
mirror: '支持以 http(s):// 開頭,英文大小寫,數字,. 和 - 的鏡像加速地址,且不能有空行',
disableFunction: '僅支持字母下劃線和,',
leechExts: '僅支持字母數字和,',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const message = {
paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)',
nginxDoc: '仅支持英文大小写数字,和.',
appName: '支持英文数字-和_,长度2-30,并且不能以-_开头和结尾',
containerName: '支持字母数字、_-.,不能以-_或.开头,长度2-127',
containerName: '支持字母数字、_-.,不能以-_或.开头,长度2-128',
mirror: '支持以 http(s):// 开头,英文大小写,数字,. 和 - 的镜像加速地址,且不能有空行',
disableFunction: '仅支持字母下划线和,',
leechExts: '仅支持字母数字和,',
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/views/container/container/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@
{{ $t('container.limitHelper', [limits.cpu]) }}{{ $t('commons.units.core') }}
</span>
</el-form-item>
<el-form-item :label="$t('container.memoryLimit')" prop="memory">
<el-form-item
:label="$t('container.memoryLimit')"
prop="memory"
:rules="checkFloatNumberRange(0, Number(limits.memory))"
>
<el-input class="mini-form-item" v-model="dialogData.rowData!.memory">
<template #append><div style="width: 35px">MB</div></template>
</el-input>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/container/container/terminal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const initTerm = (formEl: FormInstance | undefined) => {
endpoint: '/api/v1/containers/exec',
args: `containerid=${form.containerID}&user=${form.user}&command=${form.command}`,
error: '',
initCmd: '',
});
});
};
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/database/mysql/bind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ interface DialogProps {
const acceptParams = (params: DialogProps): void => {
form.database = params.database;
form.mysqlName = params.mysqlName;
form.username = '';
form.password = '';
form.permission = '%';
form.from = params.from;
bindVisible.value = true;
};
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/database/postgresql/bind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ interface DialogProps {
const acceptParams = (params: DialogProps): void => {
form.database = params.database;
form.name = params.name;
form.username = '';
form.password = '';
form.superUser = true;
bindVisible.value = true;
};
const emit = defineEmits<{ (e: 'search'): void }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ interface DialogProps {
const emit = defineEmits<{ (e: 'search'): void }>();
const acceptParams = async (prop: DialogProps) => {
deleteInfo.value = '';
deleteReq.value = {
id: prop.id,
database: prop.database,
Expand Down

0 comments on commit 3dca8e3

Please sign in to comment.