mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
style: 文件页面 样式修改
This commit is contained in:
parent
bcff85a348
commit
4b06621274
@ -3,18 +3,19 @@ package viper
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/cmd"
|
||||
"strings"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/configs"
|
||||
"github.com/1Panel-dev/1Panel/backend/global"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/cmd"
|
||||
"github.com/1Panel-dev/1Panel/cmd/server/conf"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
stdout, err := cmd.Exec("grep '^BASE_DIR=' /usr/bin/1pctl | cut -d'=' -f2")
|
||||
//stdout, err := cmd.Exec("grep '^BASE_DIR=' /usr/bin/1pctl | cut -d'=' -f2")
|
||||
stdout, err := cmd.Exec("grep '^BASE_DIR=' /Users/wangzhengkun/Downloads/1pctl | cut -d'=' -f2")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="open"
|
||||
:title="title"
|
||||
:destroy-on-close="true"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
size="50%"
|
||||
>
|
||||
<template #header>
|
||||
<DrawerHeader :header="title" :back="handleClose" />
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form
|
||||
@ -56,6 +58,7 @@ import { Rules } from '@/global/form-rules';
|
||||
import { CompressExtention, CompressType } from '@/enums/files';
|
||||
import { CompressFile } from '@/api/modules/files';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface CompressProps {
|
||||
files: Array<any>;
|
||||
|
@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="open"
|
||||
:title="$t('file.deCompress')"
|
||||
:destroy-on-close="true"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
size="30%"
|
||||
>
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.deCompress')" :back="handleClose" />
|
||||
</template>
|
||||
<el-form
|
||||
ref="fileForm"
|
||||
label-position="left"
|
||||
@ -42,6 +44,7 @@ import { Rules } from '@/global/form-rules';
|
||||
import { DeCompressFile } from '@/api/modules/files';
|
||||
import { Mimetypes } from '@/global/mimetype';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface CompressProps {
|
||||
files: Array<any>;
|
||||
|
@ -1,12 +1,17 @@
|
||||
<template>
|
||||
<el-drawer v-model="open" :title="$t('file.info')" :column="1" width="30%">
|
||||
<el-drawer v-model="open" width="30%">
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.info')" :back="handleClose" />
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item :label="$t('file.fileName')">{{ data.name }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item :label="$t('file.type')">{{ data.type }}</el-descriptions-item> -->
|
||||
<el-descriptions-item :label="$t('file.path')">{{ data.path }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('file.size')">{{ computeSize(data.size) }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('file.size')">
|
||||
{{ computeSize(data.size) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('file.role')">{{ data.mode }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('file.user')">{{ data.user }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('file.group')">{{ data.group }}</el-descriptions-item>
|
||||
@ -24,6 +29,7 @@ import { GetFileContent } from '@/api/modules/files';
|
||||
import { computeSize } from '@/utils/util';
|
||||
import { ref } from 'vue';
|
||||
import { dateFormatSimple } from '@/utils/util';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface InfoProps {
|
||||
path: string;
|
||||
@ -35,6 +41,10 @@ const props = ref<InfoProps>({
|
||||
let open = ref(false);
|
||||
let data = ref();
|
||||
|
||||
const handleClose = () => {
|
||||
open.value = false;
|
||||
};
|
||||
|
||||
const acceptParams = async (params: InfoProps): Promise<void> => {
|
||||
props.value = params;
|
||||
GetFileContent({ path: params.path, expand: false, page: 1, pageSize: 1 }).then((res) => {
|
||||
|
@ -7,6 +7,9 @@
|
||||
:before-close="handleClose"
|
||||
size="30%"
|
||||
>
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.download')" :back="handleClose" />
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-form
|
||||
@ -46,6 +49,7 @@ import { computed, reactive, ref } from 'vue';
|
||||
import { DownloadFile } from '@/api/modules/files';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface DownloadProps {
|
||||
paths: Array<string>;
|
||||
|
@ -375,7 +375,7 @@ const openWget = () => {
|
||||
wgetRef.value.acceptParams(fileWget);
|
||||
};
|
||||
|
||||
const closeWget = (submit: any) => {
|
||||
const closeWget = (submit: Boolean) => {
|
||||
search();
|
||||
if (submit) {
|
||||
openProcess();
|
||||
|
@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="open"
|
||||
:title="title"
|
||||
:destroy-on-close="true"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
size="30%"
|
||||
>
|
||||
<template #header>
|
||||
<DrawerHeader :header="title" :back="handleClose" />
|
||||
</template>
|
||||
<el-form
|
||||
ref="fileForm"
|
||||
label-position="left"
|
||||
@ -39,6 +41,7 @@ import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface MoveProps {
|
||||
oldPaths: Array<string>;
|
||||
|
@ -1,11 +1,8 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
width="30%"
|
||||
:title="$t('file.downloadProcess')"
|
||||
v-model="open"
|
||||
@open="onOpen"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-dialog width="30%" v-model="open" @open="onOpen" :before-close="handleClose">
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.downloadProcess')" :back="handleClose" />
|
||||
</template>
|
||||
<div v-for="(value, index) in res" :key="index">
|
||||
<span>{{ $t('file.downloading') }} {{ value['name'] }}</span>
|
||||
<el-progress :text-inside="true" :stroke-width="15" :percentage="value['percent']"></el-progress>
|
||||
@ -18,6 +15,7 @@
|
||||
import { FileKeys } from '@/api/modules/files';
|
||||
import { computeSize } from '@/utils/util';
|
||||
import { onBeforeUnmount, ref, toRefs } from 'vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
const props = defineProps({
|
||||
open: {
|
||||
|
@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<el-drawer v-model="open" :title="$t('file.upload')" :before-close="handleClose" size="40%" :file-list="files">
|
||||
<el-drawer v-model="open" :before-close="handleClose" size="40%">
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.upload')" :back="handleClose" />
|
||||
</template>
|
||||
<el-upload
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
@ -29,13 +32,13 @@ import { ref } from 'vue';
|
||||
import { ElMessage, UploadFile, UploadFiles, UploadInstance } from 'element-plus';
|
||||
import { UploadFileData } from '@/api/modules/files';
|
||||
import i18n from '@/lang';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface UploadProps {
|
||||
path: string;
|
||||
}
|
||||
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
const files = ref();
|
||||
const loading = ref(false);
|
||||
let uploadPrecent = ref(0);
|
||||
let open = ref(false);
|
||||
|
@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<el-drawer v-model="open" :before-close="handleClose" :title="$t('file.download')" size="50%">
|
||||
<el-drawer v-model="open" :before-close="handleClose" size="50%">
|
||||
<template #header>
|
||||
<DrawerHeader :header="$t('file.download')" :back="handleClose" />
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-form
|
||||
@ -42,6 +45,7 @@ import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
|
||||
interface WgetProps {
|
||||
path: string;
|
||||
@ -71,7 +75,7 @@ const handleClose = () => {
|
||||
fileForm.value.resetFields();
|
||||
}
|
||||
open.value = false;
|
||||
em('close', submitData);
|
||||
em('close', submitData.value);
|
||||
};
|
||||
|
||||
const getPath = (path: string) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user