mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
commit
ecbe25b235
@ -15,7 +15,7 @@
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.flex-warp {
|
||||
.flex-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@ -120,6 +120,10 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.items-flex-start {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.m-auto {
|
||||
margin: auto;
|
||||
}
|
||||
|
@ -461,6 +461,7 @@ export const useFileManager = (instanceId?: string, daemonId?: string) => {
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const changePermission = async (name: string, mode: number) => {
|
||||
permission.loading = true;
|
||||
permission.data = number2permission(mode);
|
||||
@ -493,6 +494,20 @@ export const useFileManager = (instanceId?: string, daemonId?: string) => {
|
||||
permission.deep = false;
|
||||
};
|
||||
|
||||
const currentDisk = ref(t("程序根目录"));
|
||||
|
||||
const toDisk = async (disk: string) => {
|
||||
breadcrumbs.splice(0, breadcrumbs.length);
|
||||
breadcrumbs.push({
|
||||
path: disk + ":\\",
|
||||
name: "/",
|
||||
disabled: false
|
||||
});
|
||||
spinning.value = true;
|
||||
await getFileList();
|
||||
spinning.value = false;
|
||||
};
|
||||
|
||||
return {
|
||||
fileStatus,
|
||||
dialog,
|
||||
@ -504,6 +519,7 @@ export const useFileManager = (instanceId?: string, daemonId?: string) => {
|
||||
permission,
|
||||
clipboard,
|
||||
selectedRowKeys,
|
||||
currentDisk,
|
||||
selectChanged,
|
||||
openDialog,
|
||||
getFileList,
|
||||
@ -522,6 +538,7 @@ export const useFileManager = (instanceId?: string, daemonId?: string) => {
|
||||
handleChangeDir,
|
||||
handleTableChange,
|
||||
getFileStatus,
|
||||
changePermission
|
||||
changePermission,
|
||||
toDisk
|
||||
};
|
||||
};
|
||||
|
@ -43,7 +43,7 @@ export const getFileStatus = useDefineApi<
|
||||
globalFileTask: number;
|
||||
platform: string;
|
||||
isGlobalInstance: boolean;
|
||||
dist: string[];
|
||||
disks: string[];
|
||||
}
|
||||
>({
|
||||
url: "/api/files/status",
|
||||
|
@ -24,7 +24,7 @@ export interface FileStatus {
|
||||
globalFileTask: number;
|
||||
platform: string;
|
||||
isGlobalInstance: boolean;
|
||||
dist: string[];
|
||||
disks: string[];
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
|
@ -284,6 +284,7 @@ onMounted(async () => {
|
||||
<a-menu-item
|
||||
v-for="item in nodes"
|
||||
:key="item.uuid"
|
||||
:disabled="!item.available"
|
||||
@click="handleChangeNode(item)"
|
||||
>
|
||||
<DatabaseOutlined v-if="item.available" />
|
||||
|
@ -24,7 +24,7 @@ const { getMetaOrRouteValue } = useLayoutCardTools(props.card);
|
||||
const instanceId = getMetaOrRouteValue("instanceId");
|
||||
const daemonId = getMetaOrRouteValue("daemonId");
|
||||
|
||||
const screen = useScreen();
|
||||
const { isPhone } = useScreen();
|
||||
|
||||
const {
|
||||
dialog,
|
||||
@ -37,6 +37,7 @@ const {
|
||||
dataSource,
|
||||
breadcrumbs,
|
||||
clipboard,
|
||||
currentDisk,
|
||||
selectChanged,
|
||||
getFileList,
|
||||
touchFile,
|
||||
@ -53,7 +54,8 @@ const {
|
||||
rowClickTable,
|
||||
handleTableChange,
|
||||
getFileStatus,
|
||||
changePermission
|
||||
changePermission,
|
||||
toDisk
|
||||
} = useFileManager(instanceId, daemonId);
|
||||
|
||||
const columns = computed(() => {
|
||||
@ -83,7 +85,7 @@ const columns = computed(() => {
|
||||
customRender: (e: { text: number }) =>
|
||||
e.text == 0 ? "--" : convertFileSize(e.text.toString()),
|
||||
minWidth: "200px",
|
||||
condition: () => !screen.isPhone.value
|
||||
condition: () => !isPhone.value
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
@ -94,7 +96,7 @@ const columns = computed(() => {
|
||||
return dayjs(e.text).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
minWidth: "200px",
|
||||
condition: () => !screen.isPhone.value
|
||||
condition: () => !isPhone.value
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
@ -102,7 +104,7 @@ const columns = computed(() => {
|
||||
dataIndex: "mode",
|
||||
key: "mode",
|
||||
minWidth: "200px",
|
||||
condition: () => !screen.isPhone.value && fileStatus.value?.platform !== "win32"
|
||||
condition: () => !isPhone.value && fileStatus.value?.platform !== "win32"
|
||||
},
|
||||
{
|
||||
align: "center",
|
||||
@ -153,7 +155,7 @@ onMounted(() => {
|
||||
</template>
|
||||
<template #right>
|
||||
<a-upload
|
||||
v-if="!screen.isPhone.value"
|
||||
v-if="!isPhone"
|
||||
:before-upload="beforeUpload"
|
||||
:max-count="1"
|
||||
:disabled="percentComplete > 0"
|
||||
@ -185,7 +187,7 @@ onMounted(() => {
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-upload
|
||||
v-if="screen.isPhone.value"
|
||||
v-if="isPhone"
|
||||
:before-upload="beforeUpload"
|
||||
:max-count="1"
|
||||
:disabled="percentComplete > 0"
|
||||
@ -245,15 +247,33 @@ onMounted(() => {
|
||||
:percent="percentComplete"
|
||||
class="mb-20"
|
||||
/>
|
||||
<div class="file-breadcrumbs mb-20">
|
||||
<a-breadcrumb separator=">">
|
||||
<a-breadcrumb-item v-for="item in breadcrumbs" :key="item.path">
|
||||
<div class="file-breadcrumbs-item" @click="handleChangeDir(item.path)">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
<div class="flex-wrap items-flex-start">
|
||||
<a-select
|
||||
v-if="fileStatus?.disks.length"
|
||||
v-model:value="currentDisk"
|
||||
:class="isPhone ? 'w-100 mb-10' : 'mr-10'"
|
||||
style="width: 125px"
|
||||
@change="toDisk(currentDisk)"
|
||||
>
|
||||
<a-select-option value="/">{{ t("程序根目录") }}</a-select-option>
|
||||
<a-select-option v-for="disk in fileStatus?.disks" :key="disk" :value="disk">
|
||||
{{ disk }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<div
|
||||
class="file-breadcrumbs mb-20"
|
||||
:style="{ width: isPhone ? '100%' : 'calc(100% - 135px)' }"
|
||||
>
|
||||
<a-breadcrumb separator=">">
|
||||
<a-breadcrumb-item v-for="item in breadcrumbs" :key="item.path">
|
||||
<div class="file-breadcrumbs-item" @click="handleChangeDir(item.path)">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p
|
||||
v-if="fileStatus?.instanceFileTask && fileStatus.instanceFileTask > 0"
|
||||
style="color: #1677ff"
|
||||
@ -481,7 +501,7 @@ onMounted(() => {
|
||||
border-radius: 6px;
|
||||
|
||||
.file-breadcrumbs-item {
|
||||
padding: 6px;
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
transition: all 0.4s;
|
||||
|
Loading…
Reference in New Issue
Block a user