feat: 添加文件夹大小重新计算功能,并带有进度指示
This commit is contained in:
parent
26aafce0a3
commit
9c0f4a80e3
@ -84,6 +84,13 @@ export default {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
recalculateFolderSize(params) {
|
||||||
|
return request({
|
||||||
|
url: '/cloud/setting/recalculateFolderSize',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
},
|
||||||
isSync(params) {
|
isSync(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/user/setting/isSync',
|
url: '/user/setting/isSync',
|
||||||
|
|||||||
@ -62,6 +62,9 @@ export default {
|
|||||||
rebuildIndexDesc: 'Rebuilding the index is divided into two steps: 1. Synchronize basic file information, 2. Create an index for the file content',
|
rebuildIndexDesc: 'Rebuilding the index is divided into two steps: 1. Synchronize basic file information, 2. Create an index for the file content',
|
||||||
rebuildIndexStep1: 'Synchronizing basic file information',
|
rebuildIndexStep1: 'Synchronizing basic file information',
|
||||||
rebuildIndexStep2: 'Creating an index for the file content',
|
rebuildIndexStep2: 'Creating an index for the file content',
|
||||||
|
confirmRecalculateFolderSize: 'Confirm to recalculate folder size?',
|
||||||
|
recalculateFolderSize: 'Recalculate folder size',
|
||||||
|
recalculateFolderSizeDesc: 'This operation only needs to be performed once, and then it will be automatically updated in real time.',
|
||||||
resetMenuAndRole: 'Reset Menu and Role',
|
resetMenuAndRole: 'Reset Menu and Role',
|
||||||
resetMenuAndRoleDesc: 'Generally used to initialize role and menu data',
|
resetMenuAndRoleDesc: 'Generally used to initialize role and menu data',
|
||||||
currentVersion: 'Current Version',
|
currentVersion: 'Current Version',
|
||||||
|
|||||||
@ -62,6 +62,9 @@ export default {
|
|||||||
rebuildIndexDesc: '重建索引分为两步: 1.同步文件基本信息, 2.为文件内容创建索引',
|
rebuildIndexDesc: '重建索引分为两步: 1.同步文件基本信息, 2.为文件内容创建索引',
|
||||||
rebuildIndexStep1: '正在同步文件基本信息',
|
rebuildIndexStep1: '正在同步文件基本信息',
|
||||||
rebuildIndexStep2: '正在为文件内容创建索引',
|
rebuildIndexStep2: '正在为文件内容创建索引',
|
||||||
|
confirmRecalculateFolderSize: '确认重新计算文件夹大小?',
|
||||||
|
recalculateFolderSize: '重新计算文件夹大小',
|
||||||
|
recalculateFolderSizeDesc: '该操作只需要执行一次, 之后会自动实时更新',
|
||||||
resetMenuAndRole: '重置角色、菜单',
|
resetMenuAndRole: '重置角色、菜单',
|
||||||
resetMenuAndRoleDesc: '一般用于初始化角色、菜单数据',
|
resetMenuAndRoleDesc: '一般用于初始化角色、菜单数据',
|
||||||
currentVersion: '当前版本',
|
currentVersion: '当前版本',
|
||||||
|
|||||||
@ -139,6 +139,7 @@ function onMessage(msg) {
|
|||||||
const { url, body } = msg;
|
const { url, body } = msg;
|
||||||
const eventMapping = {
|
const eventMapping = {
|
||||||
synced: 'msg/synced',
|
synced: 'msg/synced',
|
||||||
|
calculateFolderSizeProcessed: 'msg/calculateFolderSizeProcessed',
|
||||||
taskProgress: 'msg/taskProgress',
|
taskProgress: 'msg/taskProgress',
|
||||||
transcodeStatus: 'msg/transcodeStatus',
|
transcodeStatus: 'msg/transcodeStatus',
|
||||||
uploaderChunkSize: 'uploaderChunkSize',
|
uploaderChunkSize: 'uploaderChunkSize',
|
||||||
|
|||||||
@ -48,6 +48,13 @@
|
|||||||
<span v-show="indexingPercent > 0 && indexingPercent < 100">{{ $t('app.rebuildIndexStep2') }}: </span><span v-show="indexingPercent > 0 && indexingPercent < 100">{{ indexingPercent }}%</span>
|
<span v-show="indexingPercent > 0 && indexingPercent < 100">{{ $t('app.rebuildIndexStep2') }}: </span><span v-show="indexingPercent > 0 && indexingPercent < 100">{{ indexingPercent }}%</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="instruction">{{ $t('app.rebuildIndexDesc') }}</span>
|
<span class="instruction">{{ $t('app.rebuildIndexDesc') }}</span>
|
||||||
|
|
||||||
|
<div class="config-itme-label">{{ $t('app.recalculateFolderSize') }}:
|
||||||
|
<el-button round class="sync-button" size="mini" type="primary" :loading="calculateFolderSizeLoading" @click="recalculateFolderSize()"><i class="el-icon-refresh"></i></el-button>
|
||||||
|
<span v-show="calculateFolderSizeProcessedPercent > 0 && calculateFolderSizeProcessedPercent < 100">{{ calculateFolderSizeProcessedPercent }}%</span>
|
||||||
|
</div>
|
||||||
|
<span class="instruction">{{ $t('app.recalculateFolderSizeDesc') }}</span>
|
||||||
|
|
||||||
<div class="config-itme-label">{{ $t('app.resetMenuAndRole') }}:
|
<div class="config-itme-label">{{ $t('app.resetMenuAndRole') }}:
|
||||||
<el-button round class="sync-button" size="mini" :loading="resetLoading" type="danger"
|
<el-button round class="sync-button" size="mini" :loading="resetLoading" type="danger"
|
||||||
@click="resetMenuAndRole()">
|
@click="resetMenuAndRole()">
|
||||||
@ -134,6 +141,8 @@ export default {
|
|||||||
clickSync: false,
|
clickSync: false,
|
||||||
indexingPercent: 100,
|
indexingPercent: 100,
|
||||||
syncPercent: 100,
|
syncPercent: 100,
|
||||||
|
calculateFolderSizeProcessedPercent: 100,
|
||||||
|
calculateFolderSizeLoading: false,
|
||||||
resetLoading: false,
|
resetLoading: false,
|
||||||
webpEnabled: false,
|
webpEnabled: false,
|
||||||
logoFileName: this.$store.state.user.netdiskLogo || '',
|
logoFileName: this.$store.state.user.netdiskLogo || '',
|
||||||
@ -163,6 +172,9 @@ export default {
|
|||||||
if (msg.event === 'msg/synced') {
|
if (msg.event === 'msg/synced') {
|
||||||
this.updateSyncStatus(msg.data.body)
|
this.updateSyncStatus(msg.data.body)
|
||||||
}
|
}
|
||||||
|
if (msg.event === 'msg/calculateFolderSizeProcessed') {
|
||||||
|
this.calculateFolderSizeProcessedStatus(msg.data.body)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -267,6 +279,11 @@ export default {
|
|||||||
}
|
}
|
||||||
this.syncLoading = !((this.syncPercent === 100 && this.indexingPercent === 100) || (this.syncPercent === 0 && this.indexingPercent === 0));
|
this.syncLoading = !((this.syncPercent === 100 && this.indexingPercent === 100) || (this.syncPercent === 0 && this.indexingPercent === 0));
|
||||||
},
|
},
|
||||||
|
calculateFolderSizeProcessedStatus(calculateFolderSizeProcessedPercent) {
|
||||||
|
console.log('calculateFolderSizeProcessedPercent', calculateFolderSizeProcessedPercent)
|
||||||
|
this.calculateFolderSizeProcessedPercent = calculateFolderSizeProcessedPercent
|
||||||
|
this.calculateFolderSizeLoading = !(this.calculateFolderSizeProcessedPercent === 100 || this.calculateFolderSizeProcessedPercent === 0);
|
||||||
|
},
|
||||||
sync() {
|
sync() {
|
||||||
this.$confirm(`${this.$t('app.startSync')}`, `${this.$t('common.tips')}`, {
|
this.$confirm(`${this.$t('app.startSync')}`, `${this.$t('common.tips')}`, {
|
||||||
confirmButtonText: `${this.$t('common.confirm')}`,
|
confirmButtonText: `${this.$t('common.confirm')}`,
|
||||||
@ -283,6 +300,16 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
recalculateFolderSize() {
|
||||||
|
this.$confirm(`${this.$t('app.confirmRecalculateFolderSize')}`, `${this.$t('common.tips')}`, {
|
||||||
|
confirmButtonText: `${this.$t('common.confirm')}`,
|
||||||
|
cancelButtonText: `${this.$t('common.cancel')}`,
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
settingApi.recalculateFolderSize();
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
// 重置角色菜单
|
// 重置角色菜单
|
||||||
resetMenuAndRole() {
|
resetMenuAndRole() {
|
||||||
this.$confirm(`${this.$t('app.confirmDeleteMenuAndRole')}`, `${this.$t('common.tips')}`, {
|
this.$confirm(`${this.$t('app.confirmDeleteMenuAndRole')}`, `${this.$t('common.tips')}`, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user