Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/westberliner/checksum.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/ChecksumTab.vue')
-rw-r--r--src/views/ChecksumTab.vue46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/views/ChecksumTab.vue b/src/views/ChecksumTab.vue
index d174d29..f08306e 100644
--- a/src/views/ChecksumTab.vue
+++ b/src/views/ChecksumTab.vue
@@ -21,9 +21,7 @@
-->
<template>
- <Tab :id="id"
- :icon="icon"
- :name="name">
+ <div>
<!-- checksum content -->
<Multiselect
v-model="algorithm"
@@ -36,14 +34,13 @@
<p :class="{ 'icon-loading': loading }" class="checksum-hash-result">
<span v-if="!loading && algorithm.id !== ''"><strong>{{ algorithm.label }}:</strong>{{ hash }}</span>
</p>
- </Tab>
+ </div>
</template>
<script>
import { generateUrl } from '@nextcloud/router'
import axios from '@nextcloud/axios'
import Multiselect from '@nextcloud/vue/dist/Components/Multiselect'
-import Tab from '@nextcloud/vue/dist/Components/AppSidebarTab'
const algorithms = [
{ id: '', label: t('checksum', 'Choose Algorithm') },
@@ -60,25 +57,13 @@ export default {
name: 'ChecksumTab',
components: {
- Tab,
Multiselect,
},
mixins: [],
- props: {
- fileInfo: {
- type: Object,
- default: () => {},
- required: true,
- },
- },
-
data() {
return {
- // 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,
@@ -88,25 +73,6 @@ export default {
computed: {
/**
- * Needed to differenciate the tabs
- * pulled from the AppSidebarTab component.
- *
- * @returns {string}
- */
- id() {
- return 'checksum'
- },
-
- /**
- * 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.
*
@@ -120,6 +86,14 @@ export default {
methods: {
/**
+ * Update current fileInfo and fetch new data.
+ * @param {Object} fileInfo the current file FileInfo.
+ */
+ update(fileInfo) {
+ this.fileInfo = fileInfo
+ },
+
+ /**
* Handles selection change event by triggering hash ajax call.
*
* @param {Object} algorithm - The selected algorithm object.