Before Vuex
This commit is contained in:
parent
42926cdbfc
commit
e46925718d
25
src/components/AddRss.vue
Normal file
25
src/components/AddRss.vue
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<ul>
|
||||||
|
<NcAppNavigationNewItem :title="t('', 'Add a RSS link')">
|
||||||
|
<template #icon>
|
||||||
|
<Plus size="20" />
|
||||||
|
</template>
|
||||||
|
</NcAppNavigationNewItem>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { NcAppNavigationNewItem } from '@nextcloud/vue'
|
||||||
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddRss',
|
||||||
|
components: {
|
||||||
|
NcAppNavigationNewItem,
|
||||||
|
Plus,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
@ -37,8 +37,6 @@ export default {
|
|||||||
showMore: true,
|
showMore: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
},
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.fetch(10)
|
await this.fetch(10)
|
||||||
},
|
},
|
||||||
|
@ -6,29 +6,22 @@
|
|||||||
</NcTextField>
|
</NcTextField>
|
||||||
</p>
|
</p>
|
||||||
<Top v-if="!search" />
|
<Top v-if="!search" />
|
||||||
<ul v-if="!search">
|
<AddRss v-if="!search" />
|
||||||
<NcAppNavigationNewItem :title="t('', 'Add a RSS link')">
|
|
||||||
<template #icon>
|
|
||||||
<Plus size="20" />
|
|
||||||
</template>
|
|
||||||
</NcAppNavigationNewItem>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcAppNavigationNewItem, NcTextField } from '@nextcloud/vue'
|
import AddRss from '../components/AddRss.vue'
|
||||||
import Magnify from 'vue-material-design-icons/Magnify.vue'
|
import Magnify from 'vue-material-design-icons/Magnify.vue'
|
||||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
import { NcTextField } from '@nextcloud/vue'
|
||||||
import Top from '../components/Top.vue'
|
import Top from '../components/Top.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Discover',
|
name: 'Discover',
|
||||||
components: {
|
components: {
|
||||||
|
AddRss,
|
||||||
Magnify,
|
Magnify,
|
||||||
NcAppNavigationNewItem,
|
|
||||||
NcTextField,
|
NcTextField,
|
||||||
Plus,
|
|
||||||
Top,
|
Top,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
<NcLoadingIcon v-if="loading" />
|
<NcLoadingIcon v-if="loading" />
|
||||||
<ul v-if="!loading">
|
<ul v-if="!loading">
|
||||||
<NcAppNavigationItem v-for="subscription in subscriptions"
|
<NcAppNavigationItem v-for="subscription in sortedSubscriptions"
|
||||||
:key="subscription.id"
|
:key="subscription.id"
|
||||||
:loading="subscription.loading"
|
:loading="subscription.loading"
|
||||||
:title="subscription.title ?? subscription.url">
|
:title="subscription.title ?? subscription.url">
|
||||||
@ -59,6 +59,14 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
sortedSubscriptions() {
|
||||||
|
return this.subscriptions.concat().sort((a, b) => {
|
||||||
|
if (a.title && b.title) return a.title.localeCompare(b.title)
|
||||||
|
return a.id - b.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
try {
|
try {
|
||||||
const metrics = await axios.get(generateUrl('/apps/gpoddersync/personal_settings/metrics'))
|
const metrics = await axios.get(generateUrl('/apps/gpoddersync/personal_settings/metrics'))
|
||||||
@ -87,11 +95,6 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.subscriptions[subscriptionId] = subscription
|
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) {
|
async updateSubscriptionMeta(subscription) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user