refactor(frontend): extract shared modules, thin views, delete dead code
Shared utilities: - Add src/utils/formatters.js — formatDate, formatSize, providerColor, providerBg, providerLabel; all components import from here, no inline duplicates - Add src/components/ui/TreeItem.vue — generic expand/collapse tree node; FolderTreeItem, CloudFolderTreeItem, CloudProviderTreeItem now wrap it - Add src/components/storage/StorageBrowser.vue — unified file browser grid used by both FileManagerView and CloudFolderView View refactor (thin data-providers): - FileManagerView.vue: stripped to props + event wiring; all layout moved to StorageBrowser - CloudFolderView.vue: same treatment — feeds props into StorageBrowser - All tree sidebar components delegate expand/collapse to TreeItem.vue Dead code removed: - Delete HomeView.vue — no active route, replaced by FileManagerView - Delete FolderView.vue — no active route, logic merged into FileManagerView Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a548266461
commit
cce70b2ef6
@@ -62,6 +62,7 @@
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useCloudConnectionsStore } from '../stores/cloudConnections.js'
|
||||
import { providerColor, providerBg } from '../utils/formatters.js'
|
||||
|
||||
const router = useRouter()
|
||||
const cloudStore = useCloudConnectionsStore()
|
||||
@@ -73,21 +74,4 @@ function openProvider(conn) {
|
||||
router.push(`/cloud/${conn.provider}/root`)
|
||||
}
|
||||
|
||||
function providerColor(provider) {
|
||||
return {
|
||||
google_drive: 'text-blue-500',
|
||||
onedrive: 'text-sky-500',
|
||||
nextcloud: 'text-orange-500',
|
||||
webdav: 'text-gray-500',
|
||||
}[provider] ?? 'text-gray-400'
|
||||
}
|
||||
|
||||
function providerBg(provider) {
|
||||
return {
|
||||
google_drive: 'bg-blue-50',
|
||||
onedrive: 'bg-sky-50',
|
||||
nextcloud: 'bg-orange-50',
|
||||
webdav: 'bg-gray-100',
|
||||
}[provider] ?? 'bg-gray-50'
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user