diff options
author | patrick <patrick@westberliner.net> | 2021-02-28 14:20:54 +0300 |
---|---|---|
committer | patrick <patrick@westberliner.net> | 2021-02-28 14:20:54 +0300 |
commit | 6abb3b5741e540e45929b77fe7adeccb9d89db05 (patch) | |
tree | 347881d96483e344de05db1dc68f7de863d1d109 | |
parent | 0322cca43be3474894e1a15c7438d790719618e7 (diff) |
Working solution on Nextcloud 20 to allow checksum only on files.
-rw-r--r-- | src/views/ChecksumTab.vue | 19 | ||||
-rw-r--r-- | translationfiles/templates/checksum.pot | 10 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/views/ChecksumTab.vue b/src/views/ChecksumTab.vue index f450bfb..d174d29 100644 --- a/src/views/ChecksumTab.vue +++ b/src/views/ChecksumTab.vue @@ -76,9 +76,10 @@ export default { data() { return { - icon: 'icon-category-auth', - loading: false, + // Enabled won't work as intended. This is a workaround for now. + icon: (this.fileInfo.type === 'file') ? 'icon-category-auth' : '', name: t('checksum', 'Checksum'), + loading: false, algorithm: algorithms[0], algorithms, hash: '', @@ -87,8 +88,8 @@ export default { computed: { /** - * Needed to differenciate the tabs. - * Pulled from the AppSidebarTab component. + * Needed to differenciate the tabs + * pulled from the AppSidebarTab component. * * @returns {string} */ @@ -97,6 +98,15 @@ export default { }, /** + * Allow checksum only on files. + * + * @returns {boolean} + */ + enabled() { + return (this.fileInfo.type === 'file') + }, + + /** * Returns the current active tab. * Needed because AppSidebarTab also uses $parent.activeTab. * @@ -105,6 +115,7 @@ export default { activeTab() { return this.$parent.activeTab }, + }, methods: { diff --git a/translationfiles/templates/checksum.pot b/translationfiles/templates/checksum.pot index 6a57dc1..6146a18 100644 --- a/translationfiles/templates/checksum.pot +++ b/translationfiles/templates/checksum.pot @@ -32,15 +32,7 @@ msgstr "" msgid "Creating a hash checksum of a file." msgstr "" -msgid "" -"Allows users to create a hash checksum of a file.\n" -" Possible algorithms are md5, sha1, sha256, sha384, sha512 and " -"crc32.\n" -"\n" -" Just open the details view of the file (Sidebar). There should be a " -"new tab called \"Checksum\".\n" -" Select a algorithm and it will try to generate a hash.\n" -" If you want an other algorithm, just click on the reload button." +msgid "Allows users to create a hash checksum of a file. Possible algorithms are md5, sha1, sha256, sha384, sha512 and crc32. Just open the details view of the file (Sidebar). There should be a new tab called \"Checksum\". Select a algorithm and it will try to generate a hash. If you want an other algorithm, just click on the reload button." msgstr "" msgid "Choose Algorithm" |