@cloudron/pankow 4.1.2 → 4.1.4

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.
@@ -174,6 +174,22 @@ export default {
174
174
  type: Boolean,
175
175
  default: true
176
176
  },
177
+ showPaste: {
178
+ type: Boolean,
179
+ default: true
180
+ },
181
+ showRename: {
182
+ type: Boolean,
183
+ default: true
184
+ },
185
+ showSelectAll: {
186
+ type: Boolean,
187
+ default: true
188
+ },
189
+ showDownload: {
190
+ type: Boolean,
191
+ default: true
192
+ },
177
193
  showDelete: {
178
194
  type: Boolean,
179
195
  default: true
@@ -288,7 +304,7 @@ export default {
288
304
  },
289
305
  refreshHandler: {
290
306
  type: Function,
291
- default() { console.warn('Missing refreshHandler for DirectoryView'); }
307
+ default: null
292
308
  }
293
309
  },
294
310
  computed: {
@@ -362,13 +378,15 @@ export default {
362
378
  action: this.onSelectAll
363
379
  }, {
364
380
  separator:true,
365
- visible: () => { return this.showNewFile || this.showNewFolder; },
381
+ visible: () => { return typeof this.refreshHandler === 'function'; },
366
382
  }, {
367
383
  label: this.tr('filemanager.toolbar.refresh'),
368
384
  icon:'fa-solid fa-arrow-rotate-right',
385
+ visible: () => { return typeof this.refreshHandler === 'function'; },
369
386
  action: this.refreshHandler,
370
387
  }, {
371
388
  separator:true,
389
+ visible: () => { return this.showNewFile || this.showNewFolder; },
372
390
  }, {
373
391
  label: this.tr('filemanager.toolbar.newFile'),
374
392
  icon:'fa-solid fa-file-circle-plus',
@@ -399,11 +417,13 @@ export default {
399
417
  disabled: () => { return this.selectedCount > 1; },
400
418
  action: () => { this.onItemActivated(this.getSelected()[0]); }
401
419
  }, {
402
- separator:true
420
+ separator:true,
421
+ visible: () => { return this.showDownload || this.showShare || this.showCopy || this.showCut || this.showPaste || this.showSelectAll; },
403
422
  }, {
404
423
  label: this.tr('filemanager.list.menu.download'),
405
424
  icon:'fa-solid fa-download',
406
425
  action: this.onItemDownload,
426
+ visible: () => { return this.showDownload; },
407
427
  disabled: () => { return this.multiDownload ? this.selectedCount === 0 : this.selectedCount !== 1; }
408
428
  }, {
409
429
  label: this.tr('filemanager.list.menu.share'),
@@ -424,16 +444,19 @@ export default {
424
444
  }, {
425
445
  label: this.tr('filemanager.list.menu.paste'),
426
446
  icon:'fa-regular fa-paste',
447
+ visible: () => { return this.showPaste; },
427
448
  disabled: () => { return !(this.focusItem && this.focusItem.isDirectory) || this.selectedCount > 1 || !this.clipboard.files || !this.clipboard.files.length; },
428
449
  action: () => { this.pasteHandler(this.clipboard.action, this.clipboard.files, this.focusItem); }
429
450
  }, {
430
451
  label: this.tr('filemanager.list.menu.selectAll'),
431
452
  icon:'fa-solid fa-check-double',
453
+ visible: () => { return this.showSelectAll; },
432
454
  action: this.onSelectAll
433
455
  }, {
434
456
  label: this.tr('filemanager.list.menu.rename'),
435
457
  icon:'fa-regular fa-pen-to-square',
436
458
  action: this.onItemRenameBegin,
459
+ visible: () => { return this.showRename; },
437
460
  disabled: () => { return !this.editable || this.selectedCount > 1; }
438
461
  }, {
439
462
  label: this.tr('filemanager.list.menu.chown'),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudron/pankow",
3
3
  "private": false,
4
- "version": "4.1.2",
4
+ "version": "4.1.4",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "types": "types/index.d.ts",
package/utils.js CHANGED
@@ -357,6 +357,7 @@ const fallbackTranslations = {
357
357
  "uploadFolder": "Upload Folder",
358
358
  "uploadFile": "Upload File",
359
359
  "restartApp": "Restart App",
360
+ "refresh": "Refresh",
360
361
  "openTerminal": "Open Terminal",
361
362
  "openLogs": "Open Logs"
362
363
  },
@@ -11,7 +11,7 @@
11
11
  <div class="file-name">{{ entry ? entry.fileName : '' }}</div>
12
12
  </template>
13
13
  <template #right>
14
- <Button :icon="busySave ? null : 'fa-regular fa-floppy-disk'" success @click="onSave" :disabled="busySave || !isChanged" style="margin-right: 5px;"><Spinner v-show="busySave" style="stroke: white;"/> {{ tr('filemanager.textEditor.save') }}</Button>
14
+ <Button v-if="!readonly" :icon="busySave ? null : 'fa-regular fa-floppy-disk'" success @click="onSave" :disabled="busySave || !isChanged" style="margin-right: 5px;"><Spinner v-show="busySave" style="stroke: white;"/> {{ tr('filemanager.textEditor.save') }}</Button>
15
15
  <Button icon="fa-solid fa-xmark" @click="onClose">{{ tr('main.dialog.close') }}</Button>
16
16
  </template>
17
17
  </TopBar>
@@ -68,6 +68,10 @@ export default {
68
68
  tr: {
69
69
  type: Function,
70
70
  default(id) { console.warn('Missing tr for TextViewer'); return utils.translation(id); }
71
+ },
72
+ readonly: {
73
+ type: Boolean,
74
+ default: false
71
75
  }
72
76
  },
73
77
  components: {