@hostlink/nuxt-light 1.27.7 → 1.28.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/dist/module.d.mts +2 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +40 -42
- package/dist/runtime/components/L/CustomField/Add.vue +41 -52
- package/dist/runtime/components/L/CustomField/Add.vue.d.ts +2 -0
- package/dist/runtime/components/L/CustomField/List.vue +26 -30
- package/dist/runtime/components/L/CustomField/List.vue.d.ts +2 -0
- package/dist/runtime/components/L/Database/create-table-dialog.vue +22 -38
- package/dist/runtime/components/L/Database/create-table-dialog.vue.d.ts +2 -0
- package/dist/runtime/components/L/Fieldset.vue +19 -23
- package/dist/runtime/components/L/Fieldset.vue.d.ts +2 -0
- package/dist/runtime/components/L/ForgetPasswordDialog.vue +39 -41
- package/dist/runtime/components/L/ForgetPasswordDialog.vue.d.ts +2 -0
- package/dist/runtime/components/L/Revision.vue +101 -137
- package/dist/runtime/components/L/Revision.vue.d.ts +2 -0
- package/dist/runtime/components/L/Storage.vue +26 -30
- package/dist/runtime/components/L/Storage.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/authentication.vue +22 -44
- package/dist/runtime/components/L/System/Setting/authentication.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/developer.vue +43 -59
- package/dist/runtime/components/L/System/Setting/developer.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/forget-password.vue +42 -58
- package/dist/runtime/components/L/System/Setting/forget-password.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/general.vue +29 -41
- package/dist/runtime/components/L/System/Setting/general.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/mail.vue +39 -42
- package/dist/runtime/components/L/System/Setting/mail.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/modules.vue +9 -9
- package/dist/runtime/components/L/System/Setting/modules.vue.d.ts +2 -0
- package/dist/runtime/components/L/System/Setting/security.vue +20 -39
- package/dist/runtime/components/L/System/Setting/security.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/eventlog.vue +26 -26
- package/dist/runtime/components/L/User/eventlog.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/overview.vue +25 -27
- package/dist/runtime/components/L/User/overview.vue.d.ts +2 -0
- package/dist/runtime/components/L/User/userlog.vue +22 -28
- package/dist/runtime/components/L/User/userlog.vue.d.ts +2 -0
- package/dist/runtime/components/L/ValidationInput.vue +68 -91
- package/dist/runtime/components/L/ValidationInput.vue.d.ts +2 -0
- package/dist/runtime/components/MyTest.vue +8 -7
- package/dist/runtime/components/MyTest.vue.d.ts +2 -0
- package/dist/runtime/components/l-add-btn.vue +13 -12
- package/dist/runtime/components/l-add-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-alert.vue +25 -29
- package/dist/runtime/components/l-alert.vue.d.ts +2 -0
- package/dist/runtime/components/l-app-main.vue +226 -294
- package/dist/runtime/components/l-app-main.vue.d.ts +2 -0
- package/dist/runtime/components/l-app.vue +76 -89
- package/dist/runtime/components/l-app.vue.d.ts +2 -0
- package/dist/runtime/components/l-audit-card.vue +8 -14
- package/dist/runtime/components/l-audit-card.vue.d.ts +2 -0
- package/dist/runtime/components/l-back-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-banner.vue +28 -34
- package/dist/runtime/components/l-banner.vue.d.ts +2 -0
- package/dist/runtime/components/l-bar.vue +21 -25
- package/dist/runtime/components/l-bar.vue.d.ts +2 -0
- package/dist/runtime/components/l-btn.vue +62 -39
- package/dist/runtime/components/l-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-card.vue +90 -141
- package/dist/runtime/components/l-card.vue.d.ts +2 -0
- package/dist/runtime/components/l-checkbox.vue +30 -7
- package/dist/runtime/components/l-checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/l-col.vue +21 -29
- package/dist/runtime/components/l-col.vue.d.ts +2 -0
- package/dist/runtime/components/l-customizer.vue +84 -100
- package/dist/runtime/components/l-customizer.vue.d.ts +2 -0
- package/dist/runtime/components/l-date-picker.vue +101 -147
- package/dist/runtime/components/l-date-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-delete-btn.vue +22 -27
- package/dist/runtime/components/l-delete-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-dialog-database-field-add.vue +19 -36
- package/dist/runtime/components/l-dialog-database-field-add.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop-container.vue +44 -62
- package/dist/runtime/components/l-drag-drop-container.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop-group.vue +49 -70
- package/dist/runtime/components/l-drag-drop-group.vue.d.ts +2 -0
- package/dist/runtime/components/l-drag-drop.vue +33 -44
- package/dist/runtime/components/l-drag-drop.vue.d.ts +2 -0
- package/dist/runtime/components/l-edit-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-editor.vue +185 -172
- package/dist/runtime/components/l-editor.vue.d.ts +2 -0
- package/dist/runtime/components/l-facebook-button.vue +18 -26
- package/dist/runtime/components/l-facebook-button.vue.d.ts +2 -0
- package/dist/runtime/components/l-fav-menu.vue +19 -24
- package/dist/runtime/components/l-fav-menu.vue.d.ts +2 -0
- package/dist/runtime/components/l-field.vue +49 -18
- package/dist/runtime/components/l-field.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-labels.vue +46 -48
- package/dist/runtime/components/l-file-manager-labels.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-move.vue +53 -68
- package/dist/runtime/components/l-file-manager-move.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager-preview.vue +46 -81
- package/dist/runtime/components/l-file-manager-preview.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-manager.vue +498 -640
- package/dist/runtime/components/l-file-manager.vue.d.ts +2 -0
- package/dist/runtime/components/l-file-upload.vue +80 -109
- package/dist/runtime/components/l-file-upload.vue.d.ts +2 -0
- package/dist/runtime/components/l-file.vue +37 -61
- package/dist/runtime/components/l-file.vue.d.ts +2 -0
- package/dist/runtime/components/l-form-dialog.vue +71 -83
- package/dist/runtime/components/l-form-dialog.vue.d.ts +2 -0
- package/dist/runtime/components/l-form.vue +82 -96
- package/dist/runtime/components/l-form.vue.d.ts +2 -0
- package/dist/runtime/components/l-group-select.vue +59 -94
- package/dist/runtime/components/l-group-select.vue.d.ts +2 -0
- package/dist/runtime/components/l-icon-picker.vue +3265 -3274
- package/dist/runtime/components/l-icon-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-input-xlsx.vue +30 -38
- package/dist/runtime/components/l-input-xlsx.vue.d.ts +2 -0
- package/dist/runtime/components/l-input.vue +142 -126
- package/dist/runtime/components/l-input.vue.d.ts +2 -0
- package/dist/runtime/components/l-item.vue +30 -21
- package/dist/runtime/components/l-item.vue.d.ts +2 -0
- package/dist/runtime/components/l-link.vue +16 -15
- package/dist/runtime/components/l-link.vue.d.ts +2 -0
- package/dist/runtime/components/l-list.vue +27 -35
- package/dist/runtime/components/l-list.vue.d.ts +2 -0
- package/dist/runtime/components/l-login.vue +246 -287
- package/dist/runtime/components/l-login.vue.d.ts +2 -0
- package/dist/runtime/components/l-menu.vue +45 -54
- package/dist/runtime/components/l-menu.vue.d.ts +2 -0
- package/dist/runtime/components/l-microsoft-button.vue +42 -52
- package/dist/runtime/components/l-microsoft-button.vue.d.ts +2 -0
- package/dist/runtime/components/l-page.vue +48 -67
- package/dist/runtime/components/l-page.vue.d.ts +2 -0
- package/dist/runtime/components/l-row.vue +8 -13
- package/dist/runtime/components/l-row.vue.d.ts +2 -0
- package/dist/runtime/components/l-save-btn.vue.d.ts +2 -0
- package/dist/runtime/components/l-select.vue +150 -76
- package/dist/runtime/components/l-select.vue.d.ts +2 -0
- package/dist/runtime/components/l-small-box.vue +18 -31
- package/dist/runtime/components/l-small-box.vue.d.ts +2 -0
- package/dist/runtime/components/l-statistic.vue +17 -23
- package/dist/runtime/components/l-statistic.vue.d.ts +2 -0
- package/dist/runtime/components/l-tab.vue +20 -15
- package/dist/runtime/components/l-tab.vue.d.ts +2 -0
- package/dist/runtime/components/l-table.vue +444 -560
- package/dist/runtime/components/l-table.vue.d.ts +2 -0
- package/dist/runtime/components/l-tabs.vue +34 -16
- package/dist/runtime/components/l-tabs.vue.d.ts +2 -0
- package/dist/runtime/components/l-test2.vue +10 -9
- package/dist/runtime/components/l-test2.vue.d.ts +2 -0
- package/dist/runtime/components/l-time-picker.vue +53 -68
- package/dist/runtime/components/l-time-picker.vue.d.ts +2 -0
- package/dist/runtime/components/l-view-btn.vue.d.ts +2 -0
- package/dist/runtime/composables/mytest.d.ts +2 -0
- package/dist/runtime/composables/mytest.js +3 -0
- package/dist/runtime/formkit/Checkbox.vue +15 -18
- package/dist/runtime/formkit/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/formkit/DatePicker.vue +15 -18
- package/dist/runtime/formkit/DatePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/Editor.vue +15 -18
- package/dist/runtime/formkit/Editor.vue.d.ts +2 -0
- package/dist/runtime/formkit/File.vue +30 -37
- package/dist/runtime/formkit/File.vue.d.ts +2 -0
- package/dist/runtime/formkit/FilePicker.vue +22 -25
- package/dist/runtime/formkit/FilePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/FileUpload.vue +22 -25
- package/dist/runtime/formkit/FileUpload.vue.d.ts +2 -0
- package/dist/runtime/formkit/Form.vue +79 -100
- package/dist/runtime/formkit/Form.vue.d.ts +2 -0
- package/dist/runtime/formkit/GroupSelect.vue +21 -27
- package/dist/runtime/formkit/GroupSelect.vue.d.ts +2 -0
- package/dist/runtime/formkit/Input.vue +53 -61
- package/dist/runtime/formkit/Input.vue.d.ts +2 -0
- package/dist/runtime/formkit/InputXlsx.vue +15 -18
- package/dist/runtime/formkit/InputXlsx.vue.d.ts +2 -0
- package/dist/runtime/formkit/OptionGroup.vue +20 -26
- package/dist/runtime/formkit/OptionGroup.vue.d.ts +2 -0
- package/dist/runtime/formkit/Radio.vue +15 -18
- package/dist/runtime/formkit/Radio.vue.d.ts +2 -0
- package/dist/runtime/formkit/Repeater.vue +62 -76
- package/dist/runtime/formkit/Repeater.vue.d.ts +2 -0
- package/dist/runtime/formkit/Select.vue +21 -29
- package/dist/runtime/formkit/Select.vue.d.ts +2 -0
- package/dist/runtime/formkit/TimePicker.vue +15 -19
- package/dist/runtime/formkit/TimePicker.vue.d.ts +2 -0
- package/dist/runtime/formkit/Toggle.vue +13 -16
- package/dist/runtime/formkit/Toggle.vue.d.ts +2 -0
- package/dist/runtime/light.d.ts +1129 -6
- package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue +24 -26
- package/dist/runtime/pages/CustomField/[custom_field_id]/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/CustomField/index.vue +22 -29
- package/dist/runtime/pages/CustomField/index.vue.d.ts +2 -0
- package/dist/runtime/pages/EventLog/_eventlog_id/view.vue +8 -8
- package/dist/runtime/pages/EventLog/_eventlog_id/view.vue.d.ts +2 -0
- package/dist/runtime/pages/EventLog/index.vue +7 -6
- package/dist/runtime/pages/EventLog/index.vue.d.ts +2 -0
- package/dist/runtime/pages/FileManager/index.vue.d.ts +2 -0
- package/dist/runtime/pages/MailLog/index.vue +7 -6
- package/dist/runtime/pages/MailLog/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/add.vue +26 -29
- package/dist/runtime/pages/Permission/add.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/all.vue +57 -73
- package/dist/runtime/pages/Permission/all.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/export.vue +49 -62
- package/dist/runtime/pages/Permission/export.vue.d.ts +2 -0
- package/dist/runtime/pages/Permission/index.vue +19 -20
- package/dist/runtime/pages/Permission/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/_name/update-child.vue +12 -14
- package/dist/runtime/pages/Role/_name/update-child.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/add.vue +13 -15
- package/dist/runtime/pages/Role/add.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/add2.vue +27 -38
- package/dist/runtime/pages/Role/add2.vue.d.ts +2 -0
- package/dist/runtime/pages/Role/index.vue +100 -127
- package/dist/runtime/pages/Role/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/backup.vue +28 -36
- package/dist/runtime/pages/System/database/backup.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/process.vue +33 -43
- package/dist/runtime/pages/System/database/process.vue.d.ts +2 -0
- package/dist/runtime/pages/System/database/table.vue +168 -205
- package/dist/runtime/pages/System/database/table.vue.d.ts +2 -0
- package/dist/runtime/pages/System/fs.vue +95 -107
- package/dist/runtime/pages/System/fs.vue.d.ts +2 -0
- package/dist/runtime/pages/System/index.vue +30 -31
- package/dist/runtime/pages/System/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/mailtest.vue +29 -35
- package/dist/runtime/pages/System/mailtest.vue.d.ts +2 -0
- package/dist/runtime/pages/System/menu/index.vue +175 -223
- package/dist/runtime/pages/System/menu/index.vue.d.ts +2 -0
- package/dist/runtime/pages/System/package.vue +21 -21
- package/dist/runtime/pages/System/package.vue.d.ts +2 -0
- package/dist/runtime/pages/System/phpinfo.vue +11 -10
- package/dist/runtime/pages/System/phpinfo.vue.d.ts +2 -0
- package/dist/runtime/pages/System/setting.vue +42 -59
- package/dist/runtime/pages/System/setting.vue.d.ts +2 -0
- package/dist/runtime/pages/System/test.vue.d.ts +2 -0
- package/dist/runtime/pages/System/view_as.vue +65 -68
- package/dist/runtime/pages/System/view_as.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue +7 -7
- package/dist/runtime/pages/SystemValue/_systemvalue_id/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/add.vue.d.ts +2 -0
- package/dist/runtime/pages/SystemValue/index.vue +7 -6
- package/dist/runtime/pages/SystemValue/index.vue.d.ts +2 -0
- package/dist/runtime/pages/Translate/index.vue +81 -100
- package/dist/runtime/pages/Translate/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/change-password.vue +38 -45
- package/dist/runtime/pages/User/_user_id/change-password.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/edit.vue +35 -26
- package/dist/runtime/pages/User/_user_id/edit.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/update-role.vue +33 -43
- package/dist/runtime/pages/User/_user_id/update-role.vue.d.ts +2 -0
- package/dist/runtime/pages/User/_user_id/view.vue +35 -37
- package/dist/runtime/pages/User/_user_id/view.vue.d.ts +2 -0
- package/dist/runtime/pages/User/add.vue +52 -60
- package/dist/runtime/pages/User/add.vue.d.ts +2 -0
- package/dist/runtime/pages/User/index.vue +23 -32
- package/dist/runtime/pages/User/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/profile.vue +52 -58
- package/dist/runtime/pages/User/profile.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/bio-auth.vue +85 -95
- package/dist/runtime/pages/User/setting/bio-auth.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/index.vue +27 -28
- package/dist/runtime/pages/User/setting/index.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/information.vue +28 -27
- package/dist/runtime/pages/User/setting/information.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/my_favorite.vue +29 -35
- package/dist/runtime/pages/User/setting/my_favorite.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/open_id.vue +140 -165
- package/dist/runtime/pages/User/setting/open_id.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/password.vue +37 -44
- package/dist/runtime/pages/User/setting/password.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/style.vue +84 -102
- package/dist/runtime/pages/User/setting/style.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting/two-factor-auth.vue +51 -61
- package/dist/runtime/pages/User/setting/two-factor-auth.vue.d.ts +2 -0
- package/dist/runtime/pages/User/setting.vue +9 -9
- package/dist/runtime/pages/User/setting.vue.d.ts +2 -0
- package/dist/runtime/pages/UserLog/index.vue +7 -6
- package/dist/runtime/pages/UserLog/index.vue.d.ts +2 -0
- package/dist/types.d.mts +3 -1
- package/package.json +9 -11
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -7
- package/dist/types.d.ts +0 -1
|
@@ -1,642 +1,500 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useI18n } from "vue-i18n";
|
|
3
|
-
import { ref, watch, computed, onMounted } from
|
|
4
|
-
import { useQuasar, format } from
|
|
5
|
-
import { q, m, useLight, api } from
|
|
6
|
-
const { humanStorageSize } = format
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const $
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
type: String
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
await drive.value.files.
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
})
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
await loadItems();
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
const permission = await api.auth.granted([
|
|
503
|
-
'fs.folder.create', 'fs.folder.delete', 'fs.folder.rename',
|
|
504
|
-
'fs.file.delete', 'fs.file.rename', 'fs.file.upload'
|
|
505
|
-
]);
|
|
506
|
-
|
|
507
|
-
const canDeleteRow = (row) => {
|
|
508
|
-
if (row.type == "folder" && permission.includes("fs.folder.delete")) {
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
if (row.type == "file" && permission.includes("fs.file.delete")) {
|
|
513
|
-
return true;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
const canRenameRow = (row) => {
|
|
520
|
-
if (row.type == "folder" && permission.includes("fs.folder.rename")) {
|
|
521
|
-
return true;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
if (row.type == "file" && permission.includes("fs.file.rename")) {
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/* const perm = await q("granted", {
|
|
532
|
-
rights: ["fs.folder.create"]
|
|
533
|
-
}) */
|
|
534
|
-
|
|
535
|
-
const showPreviewImgDialog = ref(false);
|
|
536
|
-
const previewImg = ref(null);
|
|
537
|
-
const isDark = computed(() => light.isDarkMode());
|
|
538
|
-
|
|
539
|
-
const onPreview = (row) => {
|
|
540
|
-
showPreviewImgDialog.value = true;
|
|
541
|
-
previewImg.value = row.url;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
const onPreviewPDF = async (row) => {
|
|
545
|
-
const height = window.innerHeight - 200;
|
|
546
|
-
$q.dialog({
|
|
547
|
-
autoClose: true,
|
|
548
|
-
fullWidth: true,
|
|
549
|
-
fullHeight: true,
|
|
550
|
-
title: "Preview PDF",
|
|
551
|
-
message: "<iframe src='" + row.url + "' width='100%' height='" + height + "px'></iframe>",
|
|
552
|
-
html: true,
|
|
553
|
-
|
|
554
|
-
})
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
const onClickInfo = async (row) => {
|
|
558
|
-
rightDrawerOpen.value = true;
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
const items = computed(() => {
|
|
563
|
-
return [...folders.value, ...files.value];
|
|
564
|
-
})
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
const selectedNodePath = ref(null)
|
|
570
|
-
const selectedDrive = computed(() => {
|
|
571
|
-
if (selectedNodePath.value) {
|
|
572
|
-
//split the path into drive index and folder path
|
|
573
|
-
//examle 0/folder1/folder2
|
|
574
|
-
const [driveIndex, ...path] = selectedNodePath.value.split("/");
|
|
575
|
-
return parseInt(driveIndex);
|
|
576
|
-
}
|
|
577
|
-
return null;
|
|
578
|
-
})
|
|
579
|
-
|
|
580
|
-
const selectedPath = computed(() => {
|
|
581
|
-
if (selectedNodePath.value) {
|
|
582
|
-
//split the path into drive index and folder path
|
|
583
|
-
//examle 0/folder1/folder2
|
|
584
|
-
const [driveIndex, ...path] = selectedNodePath.value.split("/");
|
|
585
|
-
return "/" + path.join("/");
|
|
586
|
-
}
|
|
587
|
-
return "";
|
|
588
|
-
})
|
|
589
|
-
|
|
590
|
-
watch(selectedNodePath, async () => {
|
|
591
|
-
selected.value = [];
|
|
592
|
-
await loadItems()
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
const canPreview = (file) => {
|
|
596
|
-
//check file mime type
|
|
597
|
-
const mime = ['image/jpeg', 'image/png', 'image/gif'];
|
|
598
|
-
return mime.includes(file.mime);
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
const onCheckTotalSize = async (folder) => {
|
|
603
|
-
|
|
604
|
-
const d = $q.dialog({
|
|
605
|
-
title: "Total Size",
|
|
606
|
-
progress: true,
|
|
607
|
-
|
|
608
|
-
});
|
|
609
|
-
|
|
610
|
-
const resp = await q({
|
|
611
|
-
app: {
|
|
612
|
-
drive: {
|
|
613
|
-
__args: {
|
|
614
|
-
index: folder.driveIndex,
|
|
615
|
-
},
|
|
616
|
-
folder: {
|
|
617
|
-
__args: {
|
|
618
|
-
path: folder.path,
|
|
619
|
-
},
|
|
620
|
-
totalSize: true,
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
}
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
d.update({
|
|
628
|
-
message: humanStorageSize(resp.app.drive.folder.totalSize),
|
|
629
|
-
progress: false,
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
selectedNodePath.value = drives[0].index.toString();
|
|
637
|
-
</script>
|
|
638
|
-
<template>
|
|
639
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useI18n } from "vue-i18n";
|
|
3
|
+
import { ref, watch, computed, onMounted } from "vue";
|
|
4
|
+
import { useQuasar, format } from "quasar";
|
|
5
|
+
import { q, m, useLight, api } from "#imports";
|
|
6
|
+
const { humanStorageSize } = format;
|
|
7
|
+
const light = useLight();
|
|
8
|
+
const i18n = useI18n();
|
|
9
|
+
const $q = useQuasar();
|
|
10
|
+
const $light = useLight();
|
|
11
|
+
const emit = defineEmits(["input", "close"]);
|
|
12
|
+
const { app: { drives } } = await q({
|
|
13
|
+
app: {
|
|
14
|
+
drives: {
|
|
15
|
+
index: true,
|
|
16
|
+
name: true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const folders = ref([]);
|
|
21
|
+
const files = ref([]);
|
|
22
|
+
const nodes = drives.map((drive2) => {
|
|
23
|
+
return {
|
|
24
|
+
icon: "sym_o_storage",
|
|
25
|
+
name: drive2.name,
|
|
26
|
+
id: drive2.index.toString(),
|
|
27
|
+
path: "/",
|
|
28
|
+
lazy: true,
|
|
29
|
+
driveIndex: drive2.index,
|
|
30
|
+
type: "drive"
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
const onLazyLoad = async ({ node, key, done, fail }) => {
|
|
34
|
+
const folders2 = await api.drive(node.driveIndex).folders.list(node.path, {
|
|
35
|
+
name: true,
|
|
36
|
+
path: true
|
|
37
|
+
});
|
|
38
|
+
const data = folders2.map((item) => {
|
|
39
|
+
item.driveIndex = node.driveIndex;
|
|
40
|
+
item.id = node.driveIndex + "/" + item.path;
|
|
41
|
+
item.lazy = true;
|
|
42
|
+
item.type = "folder";
|
|
43
|
+
return item;
|
|
44
|
+
});
|
|
45
|
+
done(data);
|
|
46
|
+
};
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
closeable: Boolean,
|
|
49
|
+
height: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "700px"
|
|
52
|
+
},
|
|
53
|
+
defaultAction: {
|
|
54
|
+
default: "preview",
|
|
55
|
+
type: String
|
|
56
|
+
},
|
|
57
|
+
multiple: {
|
|
58
|
+
default: false,
|
|
59
|
+
type: Boolean
|
|
60
|
+
},
|
|
61
|
+
base: {
|
|
62
|
+
default: "/",
|
|
63
|
+
type: String
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const loading = ref(false);
|
|
67
|
+
const folderTree = ref(null);
|
|
68
|
+
const pagination = {
|
|
69
|
+
rowsPerPage: 0,
|
|
70
|
+
"rows-per-page-options": [0]
|
|
71
|
+
};
|
|
72
|
+
const columns = ref([
|
|
73
|
+
{
|
|
74
|
+
name: "icon",
|
|
75
|
+
label: "",
|
|
76
|
+
field: "type"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "name",
|
|
80
|
+
label: i18n.t("Name"),
|
|
81
|
+
field: "name",
|
|
82
|
+
sortable: true,
|
|
83
|
+
align: "left"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "last_modified",
|
|
87
|
+
label: i18n.t("Last Modified"),
|
|
88
|
+
field: "lastModifiedHuman",
|
|
89
|
+
align: "left"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "size_display",
|
|
93
|
+
label: i18n.t("Size"),
|
|
94
|
+
field: "size",
|
|
95
|
+
align: "right",
|
|
96
|
+
format: (val) => {
|
|
97
|
+
if (val == null) {
|
|
98
|
+
return "";
|
|
99
|
+
}
|
|
100
|
+
return humanStorageSize(val);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{ name: "action" }
|
|
104
|
+
]);
|
|
105
|
+
const localSearch = ref(null);
|
|
106
|
+
const rightDrawerOpen = ref(false);
|
|
107
|
+
const leftDrawerOpen = ref(false);
|
|
108
|
+
const showDateOptions = ref(false);
|
|
109
|
+
const exactPhrase = ref("");
|
|
110
|
+
const hasWords = ref("");
|
|
111
|
+
const excludeWords = ref("");
|
|
112
|
+
const byWebsite = ref("");
|
|
113
|
+
const byDate = ref("Any time");
|
|
114
|
+
function onClear() {
|
|
115
|
+
exactPhrase.value = "";
|
|
116
|
+
hasWords.value = "";
|
|
117
|
+
excludeWords.value = "";
|
|
118
|
+
byWebsite.value = "";
|
|
119
|
+
byDate.value = "Any time";
|
|
120
|
+
}
|
|
121
|
+
function changeDate(option) {
|
|
122
|
+
byDate.value = option;
|
|
123
|
+
showDateOptions.value = false;
|
|
124
|
+
}
|
|
125
|
+
function toggleLeftDrawer() {
|
|
126
|
+
leftDrawerOpen.value = !leftDrawerOpen.value;
|
|
127
|
+
}
|
|
128
|
+
const loadItems = async () => {
|
|
129
|
+
let path2 = selectedPath.value;
|
|
130
|
+
files.value = [];
|
|
131
|
+
folders.value = [];
|
|
132
|
+
loading.value = true;
|
|
133
|
+
let filesParams = { path: path2 };
|
|
134
|
+
if (label.value) {
|
|
135
|
+
filesParams.type = label.value;
|
|
136
|
+
}
|
|
137
|
+
if (localSearch.value) {
|
|
138
|
+
filesParams.search = localSearch.value;
|
|
139
|
+
}
|
|
140
|
+
const resp = await q({
|
|
141
|
+
app: {
|
|
142
|
+
drive: {
|
|
143
|
+
__args: {
|
|
144
|
+
index: selectedDrive.value
|
|
145
|
+
},
|
|
146
|
+
files: {
|
|
147
|
+
__args: filesParams,
|
|
148
|
+
name: true,
|
|
149
|
+
path: true,
|
|
150
|
+
size: true,
|
|
151
|
+
mime: true,
|
|
152
|
+
url: true,
|
|
153
|
+
lastModified: true,
|
|
154
|
+
lastModifiedHuman: true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
files.value = resp.app.drive.files.map((item) => {
|
|
160
|
+
item.driveIndex = selectedDrive.value;
|
|
161
|
+
item.type = "file";
|
|
162
|
+
return item;
|
|
163
|
+
});
|
|
164
|
+
if (!label.value && !localSearch.value) {
|
|
165
|
+
folders.value = (await drive.value.folders.list(path2)).map((item) => {
|
|
166
|
+
item.driveIndex = selectedDrive.value;
|
|
167
|
+
item.type = "folder";
|
|
168
|
+
item.lazy = true;
|
|
169
|
+
item.id = selectedDrive.value + "/" + item.path;
|
|
170
|
+
return item;
|
|
171
|
+
});
|
|
172
|
+
reloadTreeFolder(selectedNodePath.value, folders.value);
|
|
173
|
+
}
|
|
174
|
+
loading.value = false;
|
|
175
|
+
};
|
|
176
|
+
const label = ref(null);
|
|
177
|
+
watch(label, () => {
|
|
178
|
+
loadItems();
|
|
179
|
+
});
|
|
180
|
+
const selected = ref([]);
|
|
181
|
+
const breadcrumbs = computed(() => {
|
|
182
|
+
if (selectedPath.value.toString() == "") {
|
|
183
|
+
return [];
|
|
184
|
+
}
|
|
185
|
+
let paths = selectedNodePath.value.split("/");
|
|
186
|
+
let driveIndex = paths.shift();
|
|
187
|
+
let driveName = drives.find((d) => d.index == driveIndex).name;
|
|
188
|
+
let breadcrumbs2 = [{
|
|
189
|
+
label: driveName,
|
|
190
|
+
path: driveIndex
|
|
191
|
+
}];
|
|
192
|
+
let ps = [];
|
|
193
|
+
for (let p of paths) {
|
|
194
|
+
if (p) {
|
|
195
|
+
ps.push(p);
|
|
196
|
+
breadcrumbs2.push({
|
|
197
|
+
label: p,
|
|
198
|
+
path: driveIndex + "/" + ps.join("/")
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return breadcrumbs2;
|
|
203
|
+
});
|
|
204
|
+
const onClickRow = (evt, row, index) => {
|
|
205
|
+
if (row.type == "folder") {
|
|
206
|
+
preview.value = null;
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
preview.value = row;
|
|
210
|
+
};
|
|
211
|
+
const grid = ref(false);
|
|
212
|
+
const onDblclickRow = (evt, row, index) => {
|
|
213
|
+
if (row.type == "folder") {
|
|
214
|
+
selectedNodePath.value = row.driveIndex + "/" + row.path;
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (row.type == "file") {
|
|
218
|
+
emit("input", row.path);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const findFolder = (path2, folders2) => {
|
|
222
|
+
folders2.value.forEach((item) => {
|
|
223
|
+
if (item.path == path2) {
|
|
224
|
+
return item;
|
|
225
|
+
}
|
|
226
|
+
let found = findFolder(path2, item.children);
|
|
227
|
+
if (found) {
|
|
228
|
+
return found;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
const reloadTreeFolder = (path2, newFolders) => {
|
|
233
|
+
let node = folderTree.value.getNodeByKey(path2);
|
|
234
|
+
if (node) {
|
|
235
|
+
node.lazy = false;
|
|
236
|
+
node.children = newFolders;
|
|
237
|
+
folderTree.value.setExpanded(path2, true);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const onDeleteSelected = () => {
|
|
241
|
+
$q.dialog({
|
|
242
|
+
title: "Delete",
|
|
243
|
+
message: "Are you sure you want to delete this files or folders?",
|
|
244
|
+
cancel: true
|
|
245
|
+
}).onOk(async () => {
|
|
246
|
+
for (let row of selected.value) {
|
|
247
|
+
if (row.type == "folder") {
|
|
248
|
+
await drive.value.folders.delete(row.path);
|
|
249
|
+
} else {
|
|
250
|
+
await drive.value.files.delete(row.path);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
selected.value = [];
|
|
254
|
+
await loadItems();
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
const onNewFolder = () => {
|
|
258
|
+
$q.dialog({
|
|
259
|
+
color: $light.color,
|
|
260
|
+
title: "New Folder",
|
|
261
|
+
prompt: {
|
|
262
|
+
model: "",
|
|
263
|
+
label: "Name",
|
|
264
|
+
isValid: (val) => {
|
|
265
|
+
return val.length > 0;
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
cancel: true
|
|
269
|
+
}).onOk(async (name) => {
|
|
270
|
+
await drive.value.folders.create(selectedPath.value + "/" + name);
|
|
271
|
+
await loadItems();
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
const onDeleteRow = (row) => {
|
|
275
|
+
if (row.type == "file") {
|
|
276
|
+
$q.dialog({
|
|
277
|
+
title: "Delete",
|
|
278
|
+
message: "Are you sure you want to delete this file?",
|
|
279
|
+
cancel: true
|
|
280
|
+
}).onOk(async () => {
|
|
281
|
+
await drive.value.files.delete(row.path);
|
|
282
|
+
await loadItems();
|
|
283
|
+
});
|
|
284
|
+
} else if (row.type == "folder") {
|
|
285
|
+
$q.dialog({
|
|
286
|
+
title: "Delete",
|
|
287
|
+
message: "Are you sure you want to delete this folder?",
|
|
288
|
+
cancel: true
|
|
289
|
+
}).onOk(async () => {
|
|
290
|
+
await drive.value.folders.delete(row.path);
|
|
291
|
+
await loadItems();
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const onRenameRow = (row) => {
|
|
296
|
+
$q.dialog({
|
|
297
|
+
title: "Rename " + row.type,
|
|
298
|
+
prompt: {
|
|
299
|
+
label: "Name",
|
|
300
|
+
model: row.name
|
|
301
|
+
},
|
|
302
|
+
cancel: true
|
|
303
|
+
}).onOk(async (name) => {
|
|
304
|
+
try {
|
|
305
|
+
if (row.type == "file") {
|
|
306
|
+
await drive.value.files.rename(row.path, name);
|
|
307
|
+
} else {
|
|
308
|
+
await drive.value.folders.rename(row.path, name);
|
|
309
|
+
}
|
|
310
|
+
} catch (e) {
|
|
311
|
+
$q.dialog({
|
|
312
|
+
title: "Error",
|
|
313
|
+
message: e.message
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
await loadItems();
|
|
318
|
+
});
|
|
319
|
+
};
|
|
320
|
+
const uploadFiles = ref([]);
|
|
321
|
+
const showUploadFiles = ref(false);
|
|
322
|
+
const onUploadFiles = async () => {
|
|
323
|
+
$q.loading.show({
|
|
324
|
+
message: "Uploading files..."
|
|
325
|
+
});
|
|
326
|
+
try {
|
|
327
|
+
for (let file of uploadFiles.value) {
|
|
328
|
+
await m("lightDriveUploadFile", {
|
|
329
|
+
index: selectedDrive.value,
|
|
330
|
+
path: selectedPath.value,
|
|
331
|
+
file
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
} catch (e) {
|
|
335
|
+
$q.dialog({
|
|
336
|
+
title: "Error",
|
|
337
|
+
message: e.message
|
|
338
|
+
});
|
|
339
|
+
$q.loading.hide();
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
uploadFiles.value = [];
|
|
343
|
+
$q.loading.hide();
|
|
344
|
+
showUploadFiles.value = false;
|
|
345
|
+
await loadItems();
|
|
346
|
+
};
|
|
347
|
+
const preview = ref(null);
|
|
348
|
+
const drive = computed(() => {
|
|
349
|
+
return api.drive(selectedDrive.value);
|
|
350
|
+
});
|
|
351
|
+
const moveToFolder = async (folder) => {
|
|
352
|
+
for (let row of selected.value) {
|
|
353
|
+
if (row.type == "folder") {
|
|
354
|
+
await drive.value.folders.move(row.path, folder);
|
|
355
|
+
} else {
|
|
356
|
+
await drive.value.files.move(row.path, folder);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
await loadItems();
|
|
360
|
+
};
|
|
361
|
+
const submitSearch = (e) => {
|
|
362
|
+
localSearch.value = search.value;
|
|
363
|
+
loadItems();
|
|
364
|
+
};
|
|
365
|
+
const onDownloadRow = async (row) => {
|
|
366
|
+
const app = await q({
|
|
367
|
+
app: {
|
|
368
|
+
drive: {
|
|
369
|
+
__args: {
|
|
370
|
+
index: row.driveIndex
|
|
371
|
+
},
|
|
372
|
+
file: {
|
|
373
|
+
__args: {
|
|
374
|
+
path: row.path
|
|
375
|
+
},
|
|
376
|
+
base64Content: true
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
console.log(app);
|
|
382
|
+
const base64Content = app.app.drive.file.base64Content;
|
|
383
|
+
const downloadLink = document.createElement("a");
|
|
384
|
+
downloadLink.href = `data:application/octet-stream;base64,${base64Content}`;
|
|
385
|
+
downloadLink.download = row.name;
|
|
386
|
+
downloadLink.click();
|
|
387
|
+
};
|
|
388
|
+
const search = ref(null);
|
|
389
|
+
const reloadStorage = async () => {
|
|
390
|
+
path.value = props.base;
|
|
391
|
+
search.value = "";
|
|
392
|
+
localSearch.value = "";
|
|
393
|
+
label.value = null;
|
|
394
|
+
await loadItems();
|
|
395
|
+
};
|
|
396
|
+
const permission = await api.auth.granted([
|
|
397
|
+
"fs.folder.create",
|
|
398
|
+
"fs.folder.delete",
|
|
399
|
+
"fs.folder.rename",
|
|
400
|
+
"fs.file.delete",
|
|
401
|
+
"fs.file.rename",
|
|
402
|
+
"fs.file.upload"
|
|
403
|
+
]);
|
|
404
|
+
const canDeleteRow = (row) => {
|
|
405
|
+
if (row.type == "folder" && permission.includes("fs.folder.delete")) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
if (row.type == "file" && permission.includes("fs.file.delete")) {
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
return false;
|
|
412
|
+
};
|
|
413
|
+
const canRenameRow = (row) => {
|
|
414
|
+
if (row.type == "folder" && permission.includes("fs.folder.rename")) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
if (row.type == "file" && permission.includes("fs.file.rename")) {
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
return false;
|
|
421
|
+
};
|
|
422
|
+
const showPreviewImgDialog = ref(false);
|
|
423
|
+
const previewImg = ref(null);
|
|
424
|
+
const isDark = computed(() => light.isDarkMode());
|
|
425
|
+
const onPreview = (row) => {
|
|
426
|
+
showPreviewImgDialog.value = true;
|
|
427
|
+
previewImg.value = row.url;
|
|
428
|
+
};
|
|
429
|
+
const onPreviewPDF = async (row) => {
|
|
430
|
+
const height = window.innerHeight - 200;
|
|
431
|
+
$q.dialog({
|
|
432
|
+
autoClose: true,
|
|
433
|
+
fullWidth: true,
|
|
434
|
+
fullHeight: true,
|
|
435
|
+
title: "Preview PDF",
|
|
436
|
+
message: "<iframe src='" + row.url + "' width='100%' height='" + height + "px'></iframe>",
|
|
437
|
+
html: true
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
const onClickInfo = async (row) => {
|
|
441
|
+
rightDrawerOpen.value = true;
|
|
442
|
+
};
|
|
443
|
+
const items = computed(() => {
|
|
444
|
+
return [...folders.value, ...files.value];
|
|
445
|
+
});
|
|
446
|
+
const selectedNodePath = ref(null);
|
|
447
|
+
const selectedDrive = computed(() => {
|
|
448
|
+
if (selectedNodePath.value) {
|
|
449
|
+
const [driveIndex, ...path2] = selectedNodePath.value.split("/");
|
|
450
|
+
return parseInt(driveIndex);
|
|
451
|
+
}
|
|
452
|
+
return null;
|
|
453
|
+
});
|
|
454
|
+
const selectedPath = computed(() => {
|
|
455
|
+
if (selectedNodePath.value) {
|
|
456
|
+
const [driveIndex, ...path2] = selectedNodePath.value.split("/");
|
|
457
|
+
return "/" + path2.join("/");
|
|
458
|
+
}
|
|
459
|
+
return "";
|
|
460
|
+
});
|
|
461
|
+
watch(selectedNodePath, async () => {
|
|
462
|
+
selected.value = [];
|
|
463
|
+
await loadItems();
|
|
464
|
+
});
|
|
465
|
+
const canPreview = (file) => {
|
|
466
|
+
const mime = ["image/jpeg", "image/png", "image/gif"];
|
|
467
|
+
return mime.includes(file.mime);
|
|
468
|
+
};
|
|
469
|
+
const onCheckTotalSize = async (folder) => {
|
|
470
|
+
const d = $q.dialog({
|
|
471
|
+
title: "Total Size",
|
|
472
|
+
progress: true
|
|
473
|
+
});
|
|
474
|
+
const resp = await q({
|
|
475
|
+
app: {
|
|
476
|
+
drive: {
|
|
477
|
+
__args: {
|
|
478
|
+
index: folder.driveIndex
|
|
479
|
+
},
|
|
480
|
+
folder: {
|
|
481
|
+
__args: {
|
|
482
|
+
path: folder.path
|
|
483
|
+
},
|
|
484
|
+
totalSize: true
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
d.update({
|
|
490
|
+
message: humanStorageSize(resp.app.drive.folder.totalSize),
|
|
491
|
+
progress: false
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
selectedNodePath.value = drives[0].index.toString();
|
|
495
|
+
</script>
|
|
496
|
+
|
|
497
|
+
<template>
|
|
640
498
|
<q-layout view="hHh lpR fFf" :class="isDark ? '' : 'bg-white'" container :style="{ 'min-height': height }">
|
|
641
499
|
<q-header bordered :class="isDark ? '' : 'bg-white text-grey-8'" height-hint="64">
|
|
642
500
|
<q-toolbar>
|
|
@@ -884,4 +742,4 @@ selectedNodePath.value = drives[0].index.toString();
|
|
|
884
742
|
</template>
|
|
885
743
|
</q-page-container>
|
|
886
744
|
</q-layout>
|
|
887
|
-
</template>
|
|
745
|
+
</template>
|