feat: refine web workspace UI
This commit is contained in:
@@ -29,6 +29,8 @@ createApp({
|
||||
isLogin: true,
|
||||
fileViewMode: 'grid', // 文件显示模式: grid 大图标, list 列表
|
||||
shareViewMode: 'list', // 分享显示模式: grid 大图标, list 列表
|
||||
shareResourceTab: 'shares', // 分享中心资源标签: shares / directLinks
|
||||
settingsTab: 'storage', // 设置中心标签: storage / appearance / security
|
||||
debugMode: false, // 调试模式(管理员可切换)
|
||||
adminTab: initialAdminTab, // 管理员页面当前标签:overview, settings, monitor, users
|
||||
|
||||
@@ -565,6 +567,24 @@ createApp({
|
||||
return [...rows].reverse();
|
||||
},
|
||||
|
||||
downloadTrafficChartRows() {
|
||||
const rows = Array.isArray(this.downloadTrafficReport?.daily)
|
||||
? this.downloadTrafficReport.daily
|
||||
: [];
|
||||
return rows.slice(-7);
|
||||
},
|
||||
|
||||
downloadTrafficChartMax() {
|
||||
return Math.max(
|
||||
1,
|
||||
...this.downloadTrafficChartRows.map(row => Number(row?.bytes_used || 0))
|
||||
);
|
||||
},
|
||||
|
||||
shareTotalViews() {
|
||||
return this.shares.reduce((total, share) => total + Number(share?.view_count || 0), 0);
|
||||
},
|
||||
|
||||
// 存储类型显示文本
|
||||
storageTypeText() {
|
||||
return this.storageType === 'local' ? '本地存储' : 'OSS存储';
|
||||
@@ -4209,6 +4229,9 @@ handleDragLeave(e) {
|
||||
}
|
||||
break;
|
||||
case 'settings':
|
||||
if (this.user?.is_admin && this.settingsTab === 'storage') {
|
||||
this.settingsTab = 'appearance';
|
||||
}
|
||||
this.loadOnlineDevices();
|
||||
if (this.user && !this.user.is_admin) {
|
||||
this.loadOssConfig();
|
||||
|
||||
Reference in New Issue
Block a user