mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
feat: 文件列表样式修改
This commit is contained in:
parent
9dc8fb4976
commit
2e12b4ca51
3 changed files with 188 additions and 163 deletions
|
|
@ -1,20 +1,44 @@
|
||||||
<template>
|
<template>
|
||||||
<el-popover placement="right" :width="400" trigger="click" :title="$t('file.list')">
|
<el-popover placement="right" :width="400" trigger="click" :title="$t('file.list')" :visible="popoverVisible">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="Folder"></el-button>
|
<el-button :icon="Folder" @click="popoverVisible = true"></el-button>
|
||||||
</template>
|
</template>
|
||||||
<div>
|
<div>
|
||||||
<BreadCrumbs>
|
<BreadCrumbs>
|
||||||
<BreadCrumbItem @click="jump(-1)" :right="paths.length == 0">/</BreadCrumbItem>
|
<BreadCrumbItem @click="jump(-1)" :right="paths.length == 0">
|
||||||
<BreadCrumbItem
|
<el-icon><HomeFilled /></el-icon>
|
||||||
v-for="(item, key) in paths"
|
|
||||||
:key="key"
|
|
||||||
@click="jump(key)"
|
|
||||||
:right="key == paths.length - 1"
|
|
||||||
>
|
|
||||||
<!-- <span class="sle">{{ item }}</span> -->
|
|
||||||
{{ item }}
|
|
||||||
</BreadCrumbItem>
|
</BreadCrumbItem>
|
||||||
|
<template v-if="paths.length > 2">
|
||||||
|
<BreadCrumbItem>
|
||||||
|
<el-dropdown ref="dropdown1" trigger="click" @command="jump($event)">
|
||||||
|
<span class="el-dropdown-link">...</span>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="(item, key) in paths.slice(0, -1)"
|
||||||
|
:key="key"
|
||||||
|
:command="key"
|
||||||
|
>
|
||||||
|
{{ item }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</BreadCrumbItem>
|
||||||
|
<BreadCrumbItem @click="jump(paths.length - 1)" :right="true">
|
||||||
|
<span class="sle" style="max-width: 200px">{{ paths[paths.length - 1] }}</span>
|
||||||
|
</BreadCrumbItem>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<BreadCrumbItem
|
||||||
|
v-for="(item, key) in paths"
|
||||||
|
:key="key"
|
||||||
|
@click="jump(key)"
|
||||||
|
:right="key == paths.length - 1"
|
||||||
|
>
|
||||||
|
<span class="sle" style="max-width: 200px">{{ item }}</span>
|
||||||
|
</BreadCrumbItem>
|
||||||
|
</template>
|
||||||
</BreadCrumbs>
|
</BreadCrumbs>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -50,6 +74,8 @@ let loading = ref(false);
|
||||||
let paths = ref<string[]>([]);
|
let paths = ref<string[]>([]);
|
||||||
let req = reactive({ path: '/', expand: true, page: 1, pageSize: 300 });
|
let req = reactive({ path: '/', expand: true, page: 1, pageSize: 300 });
|
||||||
|
|
||||||
|
const popoverVisible = ref(false);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
path: {
|
path: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -66,6 +92,7 @@ const em = defineEmits(['choose']);
|
||||||
const checkFile = (row: any) => {
|
const checkFile = (row: any) => {
|
||||||
rowName.value = row.name;
|
rowName.value = row.name;
|
||||||
em('choose', row.path);
|
em('choose', row.path);
|
||||||
|
popoverVisible.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const open = async (row: File.File) => {
|
const open = async (row: File.File) => {
|
||||||
|
|
@ -91,6 +118,7 @@ const jump = async (index: number) => {
|
||||||
}
|
}
|
||||||
req.path = path;
|
req.path = path;
|
||||||
search(req);
|
search(req);
|
||||||
|
popoverVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const search = async (req: File.ReqFile) => {
|
const search = async (req: File.ReqFile) => {
|
||||||
|
|
|
||||||
|
|
@ -1,164 +1,160 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="isFirst">
|
<div v-if="isFirst">
|
||||||
<div class="login-container">
|
<div class="login-form">
|
||||||
<el-form ref="registerFormRef" :model="registerForm" size="default" :rules="registerRules">
|
<el-form ref="registerFormRef" :model="registerForm" size="default" :rules="registerRules">
|
||||||
<div class="login-title">{{ $t('commons.button.init') }}</div>
|
<div class="login-title">{{ $t('commons.button.init') }}</div>
|
||||||
<div class="login-form">
|
<input type="text" class="hide" id="name" />
|
||||||
<input type="text" class="hide" id="name" />
|
<input type="password" class="hide" id="password" />
|
||||||
<input type="password" class="hide" id="password" />
|
<el-form-item prop="name" class="no-border">
|
||||||
<el-form-item prop="name" class="no-border">
|
<el-input
|
||||||
<el-input
|
v-model="registerForm.name"
|
||||||
v-model="registerForm.name"
|
:placeholder="$t('commons.login.username')"
|
||||||
:placeholder="$t('commons.login.username')"
|
autocomplete="off"
|
||||||
autocomplete="off"
|
type="text"
|
||||||
type="text"
|
>
|
||||||
>
|
<template #prefix>
|
||||||
<template #prefix>
|
<el-icon class="el-input__icon">
|
||||||
<el-icon class="el-input__icon">
|
<user />
|
||||||
<user />
|
</el-icon>
|
||||||
</el-icon>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item prop="password" class="no-border">
|
||||||
<el-form-item prop="password" class="no-border">
|
<el-input
|
||||||
<el-input
|
type="password"
|
||||||
type="password"
|
clearable
|
||||||
clearable
|
v-model="registerForm.password"
|
||||||
v-model="registerForm.password"
|
show-password
|
||||||
show-password
|
:placeholder="$t('commons.login.password')"
|
||||||
:placeholder="$t('commons.login.password')"
|
name="passwod"
|
||||||
name="passwod"
|
autocomplete="new-password"
|
||||||
autocomplete="new-password"
|
>
|
||||||
>
|
<template #prefix>
|
||||||
<template #prefix>
|
<el-icon class="el-input__icon">
|
||||||
<el-icon class="el-input__icon">
|
<lock />
|
||||||
<lock />
|
</el-icon>
|
||||||
</el-icon>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item prop="rePassword" class="no-border">
|
||||||
<el-form-item prop="rePassword" class="no-border">
|
<el-input
|
||||||
<el-input
|
type="password"
|
||||||
type="password"
|
clearable
|
||||||
clearable
|
v-model="registerForm.rePassword"
|
||||||
v-model="registerForm.rePassword"
|
show-password
|
||||||
show-password
|
:placeholder="$t('commons.login.rePassword')"
|
||||||
:placeholder="$t('commons.login.rePassword')"
|
>
|
||||||
>
|
<template #prefix>
|
||||||
<template #prefix>
|
<el-icon class="el-input__icon">
|
||||||
<el-icon class="el-input__icon">
|
<lock />
|
||||||
<lock />
|
</el-icon>
|
||||||
</el-icon>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item>
|
||||||
<el-form-item>
|
<el-button
|
||||||
<el-button
|
@focus="registerButtonFocused = true"
|
||||||
@focus="registerButtonFocused = true"
|
@blur="registerButtonFocused = false"
|
||||||
@blur="registerButtonFocused = false"
|
@click="register(registerFormRef)"
|
||||||
@click="register(registerFormRef)"
|
class="login-button"
|
||||||
class="login-button"
|
type="primary"
|
||||||
type="primary"
|
size="default"
|
||||||
size="default"
|
round
|
||||||
round
|
>
|
||||||
>
|
{{ $t('commons.button.init') }}
|
||||||
{{ $t('commons.button.init') }}
|
</el-button>
|
||||||
</el-button>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="mfaShow">
|
||||||
|
<div class="login-form">
|
||||||
|
<el-form>
|
||||||
|
<div class="login-title">{{ $t('commons.login.mfaTitle') }}</div>
|
||||||
|
<el-form-item class="no-border">
|
||||||
|
<el-input
|
||||||
|
size="default"
|
||||||
|
:placeholder="$t('commons.login.captchaHelper')"
|
||||||
|
v-model="mfaLoginForm.code"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon class="el-input__icon">
|
||||||
|
<Finished />
|
||||||
|
</el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button class="login-button" type="primary" size="default" round @click="mfaLogin()">
|
||||||
|
{{ $t('commons.button.verify') }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="mfaShow">
|
<div class="login-form">
|
||||||
<div class="login-form">
|
<el-form ref="loginFormRef" :model="loginForm" size="default" :rules="loginRules">
|
||||||
<el-form>
|
<div class="login-title">{{ $t('commons.button.login') }}</div>
|
||||||
<div class="login-title">{{ $t('commons.login.mfaTitle') }}</div>
|
|
||||||
<el-form-item class="no-border">
|
|
||||||
<el-input
|
|
||||||
size="default"
|
|
||||||
:placeholder="$t('commons.login.captchaHelper')"
|
|
||||||
v-model="mfaLoginForm.code"
|
|
||||||
>
|
|
||||||
<template #prefix>
|
|
||||||
<el-icon class="el-input__icon">
|
|
||||||
<Finished />
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button class="login-button" type="primary" size="default" round @click="mfaLogin()">
|
|
||||||
{{ $t('commons.button.verify') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="!mfaShow">
|
|
||||||
<div class="login-form">
|
|
||||||
<el-form ref="loginFormRef" :model="loginForm" size="default" :rules="loginRules">
|
|
||||||
<div class="login-title">{{ $t('commons.button.login') }}</div>
|
|
||||||
|
|
||||||
<el-form-item prop="name" class="no-border">
|
<el-form-item prop="name" class="no-border">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginForm.name"
|
v-model="loginForm.name"
|
||||||
:placeholder="$t('commons.login.username')"
|
:placeholder="$t('commons.login.username')"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<el-icon class="el-input__icon">
|
<el-icon class="el-input__icon">
|
||||||
<user />
|
<user />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password" class="no-border">
|
<el-form-item prop="password" class="no-border">
|
||||||
<el-input
|
<el-input
|
||||||
type="password"
|
type="password"
|
||||||
clearable
|
clearable
|
||||||
v-model="loginForm.password"
|
v-model="loginForm.password"
|
||||||
show-password
|
show-password
|
||||||
:placeholder="$t('commons.login.password')"
|
:placeholder="$t('commons.login.password')"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<el-icon class="el-input__icon">
|
<el-icon class="el-input__icon">
|
||||||
<lock />
|
<lock />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<span v-if="errAuthInfo" class="input-error" style="line-height: 14px">
|
<span v-if="errAuthInfo" class="input-error" style="line-height: 14px">
|
||||||
{{ $t('commons.login.errorAuthInfo') }}
|
{{ $t('commons.login.errorAuthInfo') }}
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="captcha" class="login-captcha">
|
<el-form-item prop="captcha" class="login-captcha">
|
||||||
<el-input v-model="loginForm.captcha" :placeholder="$t('commons.login.captchaHelper')" />
|
<el-input v-model="loginForm.captcha" :placeholder="$t('commons.login.captchaHelper')" />
|
||||||
<img
|
<img
|
||||||
v-if="captcha.imagePath"
|
v-if="captcha.imagePath"
|
||||||
:src="captcha.imagePath"
|
:src="captcha.imagePath"
|
||||||
:alt="$t('commons.login.captchaHelper')"
|
:alt="$t('commons.login.captchaHelper')"
|
||||||
@click="loginVerify()"
|
@click="loginVerify()"
|
||||||
/>
|
/>
|
||||||
<span v-if="errCaptcha" class="input-error" style="line-height: 14px">
|
<span v-if="errCaptcha" class="input-error" style="line-height: 14px">
|
||||||
{{ $t('commons.login.errorCaptcha') }}
|
{{ $t('commons.login.errorCaptcha') }}
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
@click="login(loginFormRef)"
|
@click="login(loginFormRef)"
|
||||||
@focus="loginButtonFocused = true"
|
@focus="loginButtonFocused = true"
|
||||||
@blur="loginButtonFocused = false"
|
@blur="loginButtonFocused = false"
|
||||||
class="login-button"
|
class="login-button"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="default"
|
size="default"
|
||||||
round
|
round
|
||||||
>
|
>
|
||||||
{{ $t('commons.button.login') }}
|
{{ $t('commons.button.login') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -342,6 +338,7 @@ onMounted(() => {
|
||||||
width: 0;
|
width: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-title {
|
.login-title {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||||
open: viteEnv.VITE_OPEN,
|
open: viteEnv.VITE_OPEN,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api/v1': {
|
'/api/v1': {
|
||||||
target: 'http://127.0.0.1:9999/',
|
target: 'http://172.16.10.181:9999/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue