mbkbucket 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +14 -14
- package/.mbkbucket.config.example.json +14 -14
- package/LICENSE +20 -20
- package/README.md +377 -350
- package/index.js +30 -30
- package/lib/cli.js +649 -649
- package/lib/public/bucketadmin.css +1420 -1420
- package/lib/public/bucketadmin.js +1229 -1229
- package/lib/public/mbkbucket-helper-demo.html +1184 -1184
- package/lib/public/mbkbucket-helper.css +1235 -1235
- package/lib/public/mbkbucket-helper.js +1557 -1557
- package/lib/src/app.js +109 -109
- package/lib/src/cli/auth-helper.js +150 -150
- package/lib/src/config/index.js +112 -112
- package/lib/src/config/validation.js +73 -73
- package/lib/src/controllers/api.controller.js +410 -410
- package/lib/src/controllers/dashboard.controller.js +48 -48
- package/lib/src/controllers/info.controller.js +34 -34
- package/lib/src/controllers/view.controller.js +233 -233
- package/lib/src/middleware/async-handler.js +23 -23
- package/lib/src/middleware/bucket-resolver.js +37 -37
- package/lib/src/middleware/error-handler.js +54 -54
- package/lib/src/middleware/rate-limiter.js +22 -22
- package/lib/src/middleware/security.js +27 -27
- package/lib/src/routes/api.routes.js +54 -40
- package/lib/src/routes/index.js +40 -21
- package/lib/src/routes/info.routes.js +9 -9
- package/lib/src/routes/view.routes.js +25 -20
- package/lib/src/services/s3.service.js +603 -603
- package/lib/src/utils/errors.js +54 -54
- package/lib/src/utils/helpers.js +251 -251
- package/lib/src/utils/logger.js +17 -17
- package/package.json +83 -83
- package/views/bucket.handlebars +196 -196
- package/views/bucketadmin_alerts.handlebars +15 -15
- package/views/bucketadmin_delete_modal.handlebars +36 -36
- package/views/bucketadmin_filelist_skeleton.handlebars +32 -32
- package/views/bucketadmin_newfolder_modal.handlebars +29 -29
- package/views/bucketadmin_preview_modal.handlebars +40 -40
- package/views/bucketadmin_upload_modal.handlebars +54 -54
- package/views/bucketadmincontent.handlebars +141 -141
- package/views/mbkbucket_info.handlebars +232 -232
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
{{!-- Gentelella v4 File Management System - Bucket Dashboard --}}
|
|
2
|
-
<link rel="stylesheet" href="/mbkbucket/bucketadmin.css{{mbkbucket_cachebuster}}">
|
|
3
|
-
<div id="bucketAppData" data-app-name="{{APP_NAME}}" hidden></div>
|
|
4
|
-
|
|
5
|
-
<div class="page-wrapper">
|
|
6
|
-
<!-- Page Header -->
|
|
7
|
-
<div class="page-header">
|
|
8
|
-
<div class="page-header-row">
|
|
9
|
-
<div>
|
|
10
|
-
<div class="page-pretitle">Storage & Buckets</div>
|
|
11
|
-
<h1 class="page-title">Files</h1>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="page-actions">
|
|
14
|
-
<button type="button" class="btn btn-outline" id="new-folder-btn" data-action="create-folder">
|
|
15
|
-
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4a1 1 0 011-1h3l2 2h5a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"/><path d="M8 7v4M6 9h4"/></svg>
|
|
16
|
-
New folder
|
|
17
|
-
</button>
|
|
18
|
-
<button type="button" class="btn btn-primary" id="upload-btn" data-action="upload-files">
|
|
19
|
-
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 11v3H2v-3"/><path d="M11 6L8 3 5 6"/><line x1="8" y1="3" x2="8" y2="11"/></svg>
|
|
20
|
-
Upload
|
|
21
|
-
</button>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
{{> bucketadmin_alerts }}
|
|
27
|
-
|
|
28
|
-
<!-- Main File Manager Card -->
|
|
29
|
-
<div class="card file-manager">
|
|
30
|
-
<div class="fm-layout">
|
|
31
|
-
<!-- Tree sidebar -->
|
|
32
|
-
<aside class="fm-tree-wrap">
|
|
33
|
-
<div class="fm-tree-header">
|
|
34
|
-
<span class="fm-tree-title">Explorer</span>
|
|
35
|
-
</div>
|
|
36
|
-
<div id="fm-tree" class="fm-tree"></div>
|
|
37
|
-
|
|
38
|
-
<div class="fm-storage">
|
|
39
|
-
<div class="fm-storage-label">Connected Bucket</div>
|
|
40
|
-
<div class="bucket-switcher-wrap mb-2">
|
|
41
|
-
<div class="bucket-switcher-control">
|
|
42
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" class="bucket-switcher-icon"><path d="M2 4.5C2 3.12 5.13 2 9 2s7 1.12 7 2.5v7c0 1.38-3.13 2.5-7 2.5s-7-1.12-7-2.5v-7z"/><path d="M2 8c0 1.38 3.13 2.5 7 2.5s7-1.12 7-2.5"/></svg>
|
|
43
|
-
<select id="bucketSelector" class="bucket-switcher-select" aria-label="Select connected bucket">
|
|
44
|
-
{{#if bucketOptions.length}}
|
|
45
|
-
{{#each bucketOptions}}
|
|
46
|
-
<option value="{{name}}" {{#if isSelected}}selected{{/if}}>{{name}}{{#if isDefault}} (default){{/if}}</option>
|
|
47
|
-
{{/each}}
|
|
48
|
-
{{else}}
|
|
49
|
-
<option value="">No buckets configured</option>
|
|
50
|
-
{{/if}}
|
|
51
|
-
</select>
|
|
52
|
-
</div>
|
|
53
|
-
<small id="bucketSwitchStatus" class="bucket-switcher-status is-hidden">Switching bucket...</small>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="storage-bar"><div id="storageUsageBar" style="width: 100%; background: var(--primary);"></div></div>
|
|
56
|
-
<div class="fm-storage-meta d-flex justify-content-between align-items-center">
|
|
57
|
-
<span id="totalFilesCount">Loading...</span>
|
|
58
|
-
</div>
|
|
59
|
-
<div id="filterInfo" class="fm-storage-subinfo"></div>
|
|
60
|
-
</div>
|
|
61
|
-
</aside>
|
|
62
|
-
|
|
63
|
-
<!-- Main area -->
|
|
64
|
-
<section class="fm-main">
|
|
65
|
-
<div class="fm-toolbar">
|
|
66
|
-
<nav class="fm-breadcrumb breadcrumb" id="fm-breadcrumb" aria-label="Path"></nav>
|
|
67
|
-
|
|
68
|
-
<div class="fm-toolbar-actions">
|
|
69
|
-
<!-- Quick filters -->
|
|
70
|
-
<div class="quick-filter-group" role="group" aria-label="Quick filters">
|
|
71
|
-
<button type="button" class="quick-filter-btn active" data-filter="all">All</button>
|
|
72
|
-
<button type="button" class="quick-filter-btn" data-filter="media">Media</button>
|
|
73
|
-
<button type="button" class="quick-filter-btn" data-filter="docs">Docs</button>
|
|
74
|
-
<button type="button" class="quick-filter-btn" data-filter="code">Code</button>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- Search -->
|
|
78
|
-
<div class="search-box">
|
|
79
|
-
<svg class="s-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="7" cy="7" r="5"/><path d="M11 11l3.5 3.5"/></svg>
|
|
80
|
-
<input type="text" id="searchInput" placeholder="Search files…" aria-label="Search files">
|
|
81
|
-
<button type="button" class="search-clear-btn" id="searchClearBtn" style="display: none;" aria-label="Clear search">×</button>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<!-- View toggle -->
|
|
85
|
-
<div class="fm-view-toggle">
|
|
86
|
-
<button type="button" class="view-btn active" id="view-grid" aria-label="Grid view" title="Grid view">
|
|
87
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="5" height="5" rx="1"/><rect x="9" y="2" width="5" height="5" rx="1"/><rect x="2" y="9" width="5" height="5" rx="1"/><rect x="9" y="9" width="5" height="5" rx="1"/></svg>
|
|
88
|
-
</button>
|
|
89
|
-
<button type="button" class="view-btn" id="view-list" aria-label="List view" title="List view">
|
|
90
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/></svg>
|
|
91
|
-
</button>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<!-- File Grid / List Container -->
|
|
97
|
-
<div id="fileListContainer" class="fm-grid-wrap">
|
|
98
|
-
<div id="fm-grid" class="fm-grid view-grid">
|
|
99
|
-
{{> bucketadmin_filelist_skeleton }}
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<!-- Empty state -->
|
|
103
|
-
<div id="fm-empty" class="fm-empty" style="display: none;" hidden>
|
|
104
|
-
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 7a2 2 0 012-2h4l2 2h7a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"/></svg>
|
|
105
|
-
<div class="empty-title">This folder is empty</div>
|
|
106
|
-
<div class="empty-desc">Drag files into the browser or use the Upload button to add files.</div>
|
|
107
|
-
<div class="empty-actions mt-3">
|
|
108
|
-
<button type="button" class="btn btn-outline btn-sm me-2" data-action="create-folder">
|
|
109
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4a1 1 0 011-1h3l2 2h5a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"/><path d="M8 7v4M6 9h4"/></svg>
|
|
110
|
-
New Folder
|
|
111
|
-
</button>
|
|
112
|
-
<button type="button" class="btn btn-primary btn-sm" data-action="upload-files">
|
|
113
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 11v3H2v-3"/><path d="M11 6L8 3 5 6"/><line x1="8" y1="3" x2="8" y2="11"/></svg>
|
|
114
|
-
Upload Files
|
|
115
|
-
</button>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<!-- Pagination -->
|
|
121
|
-
<div id="paginationContainer" class="pagination-container" style="display: none;">
|
|
122
|
-
<nav aria-label="File pagination">
|
|
123
|
-
<ul class="pagination" id="paginationList"></ul>
|
|
124
|
-
</nav>
|
|
125
|
-
</div>
|
|
126
|
-
</section>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
{{> bucketadmin_upload_modal }}
|
|
132
|
-
{{> bucketadmin_newfolder_modal }}
|
|
133
|
-
{{> bucketadmin_delete_modal }}
|
|
134
|
-
{{> bucketadmin_preview_modal }}
|
|
135
|
-
|
|
136
|
-
<!-- Toast Container -->
|
|
137
|
-
<div id="toast-container" class="toast-container"></div>
|
|
138
|
-
|
|
139
|
-
<!-- Context Menu Element -->
|
|
140
|
-
<div id="fm-context-menu" class="fm-context-menu" style="display: none;"></div>
|
|
141
|
-
|
|
1
|
+
{{!-- Gentelella v4 File Management System - Bucket Dashboard --}}
|
|
2
|
+
<link rel="stylesheet" href="/mbkbucket/bucketadmin.css{{mbkbucket_cachebuster}}">
|
|
3
|
+
<div id="bucketAppData" data-app-name="{{APP_NAME}}" hidden></div>
|
|
4
|
+
|
|
5
|
+
<div class="page-wrapper">
|
|
6
|
+
<!-- Page Header -->
|
|
7
|
+
<div class="page-header">
|
|
8
|
+
<div class="page-header-row">
|
|
9
|
+
<div>
|
|
10
|
+
<div class="page-pretitle">Storage & Buckets</div>
|
|
11
|
+
<h1 class="page-title">Files</h1>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="page-actions">
|
|
14
|
+
<button type="button" class="btn btn-outline" id="new-folder-btn" data-action="create-folder">
|
|
15
|
+
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4a1 1 0 011-1h3l2 2h5a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"/><path d="M8 7v4M6 9h4"/></svg>
|
|
16
|
+
New folder
|
|
17
|
+
</button>
|
|
18
|
+
<button type="button" class="btn btn-primary" id="upload-btn" data-action="upload-files">
|
|
19
|
+
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 11v3H2v-3"/><path d="M11 6L8 3 5 6"/><line x1="8" y1="3" x2="8" y2="11"/></svg>
|
|
20
|
+
Upload
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
{{> bucketadmin_alerts }}
|
|
27
|
+
|
|
28
|
+
<!-- Main File Manager Card -->
|
|
29
|
+
<div class="card file-manager">
|
|
30
|
+
<div class="fm-layout">
|
|
31
|
+
<!-- Tree sidebar -->
|
|
32
|
+
<aside class="fm-tree-wrap">
|
|
33
|
+
<div class="fm-tree-header">
|
|
34
|
+
<span class="fm-tree-title">Explorer</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div id="fm-tree" class="fm-tree"></div>
|
|
37
|
+
|
|
38
|
+
<div class="fm-storage">
|
|
39
|
+
<div class="fm-storage-label">Connected Bucket</div>
|
|
40
|
+
<div class="bucket-switcher-wrap mb-2">
|
|
41
|
+
<div class="bucket-switcher-control">
|
|
42
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" class="bucket-switcher-icon"><path d="M2 4.5C2 3.12 5.13 2 9 2s7 1.12 7 2.5v7c0 1.38-3.13 2.5-7 2.5s-7-1.12-7-2.5v-7z"/><path d="M2 8c0 1.38 3.13 2.5 7 2.5s7-1.12 7-2.5"/></svg>
|
|
43
|
+
<select id="bucketSelector" class="bucket-switcher-select" aria-label="Select connected bucket">
|
|
44
|
+
{{#if bucketOptions.length}}
|
|
45
|
+
{{#each bucketOptions}}
|
|
46
|
+
<option value="{{name}}" {{#if isSelected}}selected{{/if}}>{{name}}{{#if isDefault}} (default){{/if}}</option>
|
|
47
|
+
{{/each}}
|
|
48
|
+
{{else}}
|
|
49
|
+
<option value="">No buckets configured</option>
|
|
50
|
+
{{/if}}
|
|
51
|
+
</select>
|
|
52
|
+
</div>
|
|
53
|
+
<small id="bucketSwitchStatus" class="bucket-switcher-status is-hidden">Switching bucket...</small>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="storage-bar"><div id="storageUsageBar" style="width: 100%; background: var(--primary);"></div></div>
|
|
56
|
+
<div class="fm-storage-meta d-flex justify-content-between align-items-center">
|
|
57
|
+
<span id="totalFilesCount">Loading...</span>
|
|
58
|
+
</div>
|
|
59
|
+
<div id="filterInfo" class="fm-storage-subinfo"></div>
|
|
60
|
+
</div>
|
|
61
|
+
</aside>
|
|
62
|
+
|
|
63
|
+
<!-- Main area -->
|
|
64
|
+
<section class="fm-main">
|
|
65
|
+
<div class="fm-toolbar">
|
|
66
|
+
<nav class="fm-breadcrumb breadcrumb" id="fm-breadcrumb" aria-label="Path"></nav>
|
|
67
|
+
|
|
68
|
+
<div class="fm-toolbar-actions">
|
|
69
|
+
<!-- Quick filters -->
|
|
70
|
+
<div class="quick-filter-group" role="group" aria-label="Quick filters">
|
|
71
|
+
<button type="button" class="quick-filter-btn active" data-filter="all">All</button>
|
|
72
|
+
<button type="button" class="quick-filter-btn" data-filter="media">Media</button>
|
|
73
|
+
<button type="button" class="quick-filter-btn" data-filter="docs">Docs</button>
|
|
74
|
+
<button type="button" class="quick-filter-btn" data-filter="code">Code</button>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<!-- Search -->
|
|
78
|
+
<div class="search-box">
|
|
79
|
+
<svg class="s-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="7" cy="7" r="5"/><path d="M11 11l3.5 3.5"/></svg>
|
|
80
|
+
<input type="text" id="searchInput" placeholder="Search files…" aria-label="Search files">
|
|
81
|
+
<button type="button" class="search-clear-btn" id="searchClearBtn" style="display: none;" aria-label="Clear search">×</button>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<!-- View toggle -->
|
|
85
|
+
<div class="fm-view-toggle">
|
|
86
|
+
<button type="button" class="view-btn active" id="view-grid" aria-label="Grid view" title="Grid view">
|
|
87
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="5" height="5" rx="1"/><rect x="9" y="2" width="5" height="5" rx="1"/><rect x="2" y="9" width="5" height="5" rx="1"/><rect x="9" y="9" width="5" height="5" rx="1"/></svg>
|
|
88
|
+
</button>
|
|
89
|
+
<button type="button" class="view-btn" id="view-list" aria-label="List view" title="List view">
|
|
90
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/></svg>
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<!-- File Grid / List Container -->
|
|
97
|
+
<div id="fileListContainer" class="fm-grid-wrap">
|
|
98
|
+
<div id="fm-grid" class="fm-grid view-grid">
|
|
99
|
+
{{> bucketadmin_filelist_skeleton }}
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<!-- Empty state -->
|
|
103
|
+
<div id="fm-empty" class="fm-empty" style="display: none;" hidden>
|
|
104
|
+
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 7a2 2 0 012-2h4l2 2h7a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"/></svg>
|
|
105
|
+
<div class="empty-title">This folder is empty</div>
|
|
106
|
+
<div class="empty-desc">Drag files into the browser or use the Upload button to add files.</div>
|
|
107
|
+
<div class="empty-actions mt-3">
|
|
108
|
+
<button type="button" class="btn btn-outline btn-sm me-2" data-action="create-folder">
|
|
109
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4a1 1 0 011-1h3l2 2h5a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"/><path d="M8 7v4M6 9h4"/></svg>
|
|
110
|
+
New Folder
|
|
111
|
+
</button>
|
|
112
|
+
<button type="button" class="btn btn-primary btn-sm" data-action="upload-files">
|
|
113
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 11v3H2v-3"/><path d="M11 6L8 3 5 6"/><line x1="8" y1="3" x2="8" y2="11"/></svg>
|
|
114
|
+
Upload Files
|
|
115
|
+
</button>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<!-- Pagination -->
|
|
121
|
+
<div id="paginationContainer" class="pagination-container" style="display: none;">
|
|
122
|
+
<nav aria-label="File pagination">
|
|
123
|
+
<ul class="pagination" id="paginationList"></ul>
|
|
124
|
+
</nav>
|
|
125
|
+
</div>
|
|
126
|
+
</section>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
{{> bucketadmin_upload_modal }}
|
|
132
|
+
{{> bucketadmin_newfolder_modal }}
|
|
133
|
+
{{> bucketadmin_delete_modal }}
|
|
134
|
+
{{> bucketadmin_preview_modal }}
|
|
135
|
+
|
|
136
|
+
<!-- Toast Container -->
|
|
137
|
+
<div id="toast-container" class="toast-container"></div>
|
|
138
|
+
|
|
139
|
+
<!-- Context Menu Element -->
|
|
140
|
+
<div id="fm-context-menu" class="fm-context-menu" style="display: none;"></div>
|
|
141
|
+
|
|
142
142
|
<script src="/mbkbucket/bucketadmin.js{{mbkbucket_cachebuster}}"></script>
|