Working POC
This commit is contained in:
parent
04350b4512
commit
8360e9c74e
@ -1,4 +1,4 @@
|
|||||||
FROM nextcloud:25
|
FROM nextcloud
|
||||||
|
|
||||||
ENV NEXTCLOUD_UPDATE 1
|
ENV NEXTCLOUD_UPDATE 1
|
||||||
ENV NEXTCLOUD_ADMIN_USER repod
|
ENV NEXTCLOUD_ADMIN_USER repod
|
||||||
|
71
package-lock.json
generated
71
package-lock.json
generated
@ -10,9 +10,11 @@
|
|||||||
"license": "agpl",
|
"license": "agpl",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nextcloud/axios": "2.3.0",
|
"@nextcloud/axios": "2.3.0",
|
||||||
|
"@nextcloud/dialogs": "4.0.1",
|
||||||
"@nextcloud/router": "2.1.2",
|
"@nextcloud/router": "2.1.2",
|
||||||
"@nextcloud/vue": "7.0.1",
|
"@nextcloud/vue": "7.0.1",
|
||||||
"vue": "2.7.14"
|
"vue": "2.7.14",
|
||||||
|
"vue-material-design-icons": "^5.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nextcloud/babel-config": "^1.0.0",
|
"@nextcloud/babel-config": "^1.0.0",
|
||||||
@ -2212,12 +2214,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nextcloud/dialogs": {
|
"node_modules/@nextcloud/dialogs": {
|
||||||
"version": "3.2.0",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.0.1.tgz",
|
||||||
"integrity": "sha512-notaHF8LXPJINBbILCbRe+dgXnJPe7NQTIrN1vwfaGUSG9GUfEf+v367yyg2brCgV6ulE/HmNhYjTQwW5AqSJA==",
|
"integrity": "sha512-jgIJdxTpc3suHkuZBRge6/dU6krG7x9emMGTxKY5qRQqFwn9r4rCqjV7Cys7VMn1QLlHmEDdqHcYZFRtN/XVNA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nextcloud/l10n": "^1.3.0",
|
"@nextcloud/l10n": "^1.3.0",
|
||||||
"@nextcloud/typings": "^1.0.0",
|
"@nextcloud/typings": "^1.4.3",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"toastify-js": "^1.12.0"
|
"toastify-js": "^1.12.0"
|
||||||
},
|
},
|
||||||
@ -2432,6 +2434,21 @@
|
|||||||
"npm": "^7.0.0 || ^8.0.0"
|
"npm": "^7.0.0 || ^8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@nextcloud/vue/node_modules/@nextcloud/dialogs": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-notaHF8LXPJINBbILCbRe+dgXnJPe7NQTIrN1vwfaGUSG9GUfEf+v367yyg2brCgV6ulE/HmNhYjTQwW5AqSJA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@nextcloud/l10n": "^1.3.0",
|
||||||
|
"@nextcloud/typings": "^1.0.0",
|
||||||
|
"core-js": "^3.6.4",
|
||||||
|
"toastify-js": "^1.12.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^16.0.0",
|
||||||
|
"npm": "^7.0.0 || ^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nextcloud/webpack-vue-config": {
|
"node_modules/@nextcloud/webpack-vue-config": {
|
||||||
"version": "5.5.1",
|
"version": "5.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nextcloud/webpack-vue-config/-/webpack-vue-config-5.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nextcloud/webpack-vue-config/-/webpack-vue-config-5.5.1.tgz",
|
||||||
@ -6652,21 +6669,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/fsevents": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
|
||||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
|
||||||
"dev": true,
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
|
||||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
@ -14102,12 +14104,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nextcloud/dialogs": {
|
"@nextcloud/dialogs": {
|
||||||
"version": "3.2.0",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-4.0.1.tgz",
|
||||||
"integrity": "sha512-notaHF8LXPJINBbILCbRe+dgXnJPe7NQTIrN1vwfaGUSG9GUfEf+v367yyg2brCgV6ulE/HmNhYjTQwW5AqSJA==",
|
"integrity": "sha512-jgIJdxTpc3suHkuZBRge6/dU6krG7x9emMGTxKY5qRQqFwn9r4rCqjV7Cys7VMn1QLlHmEDdqHcYZFRtN/XVNA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nextcloud/l10n": "^1.3.0",
|
"@nextcloud/l10n": "^1.3.0",
|
||||||
"@nextcloud/typings": "^1.0.0",
|
"@nextcloud/typings": "^1.4.3",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"toastify-js": "^1.12.0"
|
"toastify-js": "^1.12.0"
|
||||||
}
|
}
|
||||||
@ -14251,6 +14253,19 @@
|
|||||||
"vue-material-design-icons": "^5.1.2",
|
"vue-material-design-icons": "^5.1.2",
|
||||||
"vue-multiselect": "^2.1.6",
|
"vue-multiselect": "^2.1.6",
|
||||||
"vue2-datepicker": "^3.11.0"
|
"vue2-datepicker": "^3.11.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@nextcloud/dialogs": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-notaHF8LXPJINBbILCbRe+dgXnJPe7NQTIrN1vwfaGUSG9GUfEf+v367yyg2brCgV6ulE/HmNhYjTQwW5AqSJA==",
|
||||||
|
"requires": {
|
||||||
|
"@nextcloud/l10n": "^1.3.0",
|
||||||
|
"@nextcloud/typings": "^1.0.0",
|
||||||
|
"core-js": "^3.6.4",
|
||||||
|
"toastify-js": "^1.12.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nextcloud/webpack-vue-config": {
|
"@nextcloud/webpack-vue-config": {
|
||||||
@ -17582,14 +17597,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
"fsevents": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
|
||||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"peer": true
|
|
||||||
},
|
|
||||||
"function-bind": {
|
"function-bind": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
|
@ -19,9 +19,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nextcloud/axios": "2.3.0",
|
"@nextcloud/axios": "2.3.0",
|
||||||
|
"@nextcloud/dialogs": "4.0.1",
|
||||||
"@nextcloud/router": "2.1.2",
|
"@nextcloud/router": "2.1.2",
|
||||||
"@nextcloud/vue": "7.0.1",
|
"@nextcloud/vue": "7.0.1",
|
||||||
"vue": "2.7.14"
|
"vue": "2.7.14",
|
||||||
|
"vue-material-design-icons": "^5.2.0"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"extends @nextcloud/browserslist-config"
|
"extends @nextcloud/browserslist-config"
|
||||||
|
79
src/App.vue
79
src/App.vue
@ -1,44 +1,97 @@
|
|||||||
<template>
|
<template>
|
||||||
<NcContent app-name="repod">
|
<NcContent app-name="repod">
|
||||||
<NcAppNavigation>
|
<NcAppNavigation>
|
||||||
<NcAppNavigationNew :text="t('repod', 'Add a podcast')"
|
<NcAppContentList>
|
||||||
@click="discover" />
|
<NcAppNavigationNew :text="t('repod', 'Add a podcast')">
|
||||||
|
<template #icon>
|
||||||
|
<Plus :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcAppNavigationNew>
|
||||||
<ul>
|
<ul>
|
||||||
<NcAppNavigationItem v-for="podcast in podcasts"
|
<NcAppNavigationItem v-for="subscription in subscriptions"
|
||||||
:key="podcast.id"
|
:key="subscription.id"
|
||||||
:name="podcast.id"
|
:loading="subscription.loading"
|
||||||
:title="note.title ? note.title : t('repod', 'New note')"
|
:title="subscription.title ?? subscription.url">
|
||||||
:class="{active: currentNoteId === note.id}"
|
<template #icon>
|
||||||
@click="openNote(note)" />
|
<img :src="subscription.imageUrl" alt="">
|
||||||
|
</template>
|
||||||
|
</NcAppNavigationItem>
|
||||||
</ul>
|
</ul>
|
||||||
|
</NcAppContentList>
|
||||||
</NcAppNavigation>
|
</NcAppNavigation>
|
||||||
<NcAppContent>
|
<NcAppContent />
|
||||||
</NcAppContent>
|
|
||||||
</NcContent>
|
</NcContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcAppContent, NcContent, NcAppNavigation, NcAppNavigationItem, NcAppNavigationNew } from '@nextcloud/vue'
|
import { NcAppContent, NcContent, NcAppContentList, NcAppNavigation, NcAppNavigationItem, NcAppNavigationNew } from '@nextcloud/vue'
|
||||||
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||||
|
import axios from '@nextcloud/axios'
|
||||||
|
import { showError } from '@nextcloud/dialogs'
|
||||||
|
import { generateUrl } from '@nextcloud/router'
|
||||||
|
import '@nextcloud/dialogs/dist/index.css'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
NcAppContent,
|
NcAppContent,
|
||||||
|
NcAppContentList,
|
||||||
NcAppNavigation,
|
NcAppNavigation,
|
||||||
NcAppNavigationItem,
|
NcAppNavigationItem,
|
||||||
NcAppNavigationNew,
|
NcAppNavigationNew,
|
||||||
NcContent
|
NcContent,
|
||||||
|
Plus,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
podcasts: [],
|
subscriptions: [],
|
||||||
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
try {
|
||||||
|
const metrics = await axios.get(generateUrl('/apps/gpoddersync/personal_settings/metrics'))
|
||||||
|
for (const subscriptionId in metrics.data.subscriptions) {
|
||||||
|
this.addSubscription({
|
||||||
|
id: subscriptionId,
|
||||||
|
url: metrics.data.subscriptions[subscriptionId].url,
|
||||||
|
loading: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
for (const subscription of this.subscriptions) {
|
||||||
|
this.updateSubscriptionMeta(subscription)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
showError(t('repod', 'Could not fetch subscriptions'))
|
||||||
|
}
|
||||||
|
this.loading = false
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
addSubscription(subscription) {
|
||||||
|
const subscriptionId = this.subscriptions.findIndex(sub => sub.url === subscription.url)
|
||||||
|
|
||||||
|
if (subscriptionId === -1) {
|
||||||
|
this.subscriptions.push(subscription)
|
||||||
|
} else {
|
||||||
|
this.subscriptions[subscriptionId] = subscription
|
||||||
|
}
|
||||||
|
|
||||||
|
this.subscriptions.sort((a, b) => {
|
||||||
|
if (a.title && b.title) return a.title.localeCompare(b.title)
|
||||||
|
return a.id - b.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async updateSubscriptionMeta(subscription) {
|
||||||
|
try {
|
||||||
|
const podcasts = await axios.get(generateUrl('/apps/gpoddersync/personal_settings/podcast_data?url={url}', { url: subscription.url }))
|
||||||
|
this.addSubscription({ ...podcasts.data.data, ...subscription, ...{ loading: false } })
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user