mirror of https://github.com/1Panel-dev/1Panel
chore:新建文件夹支持添加空格,登录页鼠标悬浮样式 (#6058)
parent
d639e46bc7
commit
3d0018c0bd
|
@ -23,7 +23,7 @@
|
||||||
@submit.enter.prevent
|
@submit.enter.prevent
|
||||||
>
|
>
|
||||||
<el-form-item :label="$t('commons.table.name')" prop="name">
|
<el-form-item :label="$t('commons.table.name')" prop="name">
|
||||||
<el-input v-model.trim="addForm.name" />
|
<el-input v-model="addForm.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="!addForm.isDir">
|
<el-form-item v-if="!addForm.isDir">
|
||||||
<el-checkbox v-model="addForm.isLink" :label="$t('file.link')"></el-checkbox>
|
<el-checkbox v-model="addForm.isLink" :label="$t('file.link')"></el-checkbox>
|
||||||
|
@ -105,9 +105,9 @@ const getMode = (val: number) => {
|
||||||
|
|
||||||
let getPath = computed(() => {
|
let getPath = computed(() => {
|
||||||
if (addForm.path.endsWith('/')) {
|
if (addForm.path.endsWith('/')) {
|
||||||
return addForm.path + addForm.name;
|
return addForm.path + addForm.name.trim();
|
||||||
} else {
|
} else {
|
||||||
return addForm.path + '/' + addForm.name;
|
return addForm.path + '/' + addForm.name.trim();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
||||||
if (!setRole.value) {
|
if (!setRole.value) {
|
||||||
addItem['mode'] = undefined;
|
addItem['mode'] = undefined;
|
||||||
}
|
}
|
||||||
|
addItem['name'] = addForm.name.trim();
|
||||||
CreateFile(addItem as File.FileCreate)
|
CreateFile(addItem as File.FileCreate)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||||
|
|
|
@ -146,7 +146,6 @@ const handleDrop = async (event: DragEvent) => {
|
||||||
initTempFiles();
|
initTempFiles();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const items = event.dataTransfer?.items;
|
const items = event.dataTransfer?.items;
|
||||||
|
|
||||||
if (items) {
|
if (items) {
|
||||||
const entries = Array.from(items).map((item) => item.webkitGetAsEntry());
|
const entries = Array.from(items).map((item) => item.webkitGetAsEntry());
|
||||||
await Promise.all(entries.map((entry) => traverseFileTree(entry)));
|
await Promise.all(entries.map((entry) => traverseFileTree(entry)));
|
||||||
|
@ -183,7 +182,9 @@ const convertFileToUploadFile = (file: File, path: string): UploadFile => {
|
||||||
|
|
||||||
const traverseFileTree = async (item: any, path = '') => {
|
const traverseFileTree = async (item: any, path = '') => {
|
||||||
path = path || '';
|
path = path || '';
|
||||||
|
if (!item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (item.isFile) {
|
if (item.isFile) {
|
||||||
if (tmpFiles.value.length > 1000) {
|
if (tmpFiles.value.length > 1000) {
|
||||||
breakFlag.value = true;
|
breakFlag.value = true;
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<el-form ref="loginFormRef" :model="loginForm" size="default" :rules="loginRules">
|
<el-form ref="loginFormRef" :model="loginForm" size="default" :rules="loginRules">
|
||||||
<div class="login-form-header">
|
<div class="login-form-header">
|
||||||
<div class="title">{{ $t('commons.button.login') }}</div>
|
<div class="title cursor-pointer">{{ $t('commons.button.login') }}</div>
|
||||||
<div>
|
<div class="cursor-pointer">
|
||||||
<el-dropdown @command="handleCommand">
|
<el-dropdown @command="handleCommand">
|
||||||
<span>
|
<span>
|
||||||
{{ dropdownText }}
|
{{ dropdownText }}
|
||||||
|
|
Loading…
Reference in New Issue