mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-29 23:55:23 +08:00
fix: bugs, add disable rss api.
This commit is contained in:
@@ -18,6 +18,11 @@ export const apiRSS = {
|
||||
return data!;
|
||||
},
|
||||
|
||||
async disable(rss_id: number) {
|
||||
const { data } = await axios.patch<ApiSuccess>(`api/v1/rss/disable/${rss_id}`);
|
||||
return data!;
|
||||
},
|
||||
|
||||
async update(rss_id: number, rss: RSS) {
|
||||
const { data } = await axios.patch<ApiSuccess>(`api/v1/rss/update/${rss_id}`, rss);
|
||||
return data!;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
name: string;
|
||||
|
||||
@@ -45,7 +45,7 @@ $notify-font: #A76E18;
|
||||
|
||||
.round-label {
|
||||
padding: 2px 12px;
|
||||
font-size: 8px;
|
||||
font-size: 10px;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -13,43 +13,46 @@ definePage({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ab-fold-panel :title="$t('rss.title')">
|
||||
<div flex justify-between>
|
||||
<div flex space-x-40px>
|
||||
<div text-h3>{{ $t('rss.selectbox') }}</div>
|
||||
<div class="spacer-1"></div>
|
||||
<div text-h3>{{ $t('rss.name') }}</div>
|
||||
<div class="spacer-2"></div>
|
||||
<div text-h3>{{ $t('rss.url') }}</div>
|
||||
<div overflow-auto mt-12px flex-grow>
|
||||
<ab-container :title="$t('rss.title')">
|
||||
<div flex justify-between>
|
||||
<div flex space-x-40px>
|
||||
<div text-h3>{{ $t('rss.selectbox') }}</div>
|
||||
<div class="spacer-1"></div>
|
||||
<div text-h3>{{ $t('rss.name') }}</div>
|
||||
<div class="spacer-2"></div>
|
||||
<div text-h3>{{ $t('rss.url') }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div text-h3>{{ $t('rss.status') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div line my-12px></div>
|
||||
<div>
|
||||
<div text-h3>{{ $t('rss.status') }}</div>
|
||||
<ab-rss-item
|
||||
v-for="i in rss"
|
||||
:key="i.id"
|
||||
:name="i.name"
|
||||
:url="i.url"
|
||||
:enable="i.enabled"
|
||||
:parser="i.parser"
|
||||
:aggregate="i.aggregate">
|
||||
</ab-rss-item>
|
||||
</div>
|
||||
</div>
|
||||
<div line my-12px></div>
|
||||
<div>
|
||||
<ab-rss-item
|
||||
v-for="i in rss"
|
||||
:key="i.id"
|
||||
:name="i.name"
|
||||
:url="i.url"
|
||||
:enable="i.enabled"
|
||||
:parser="i.parser"
|
||||
:aggregate="i.aggregate">
|
||||
</ab-rss-item>
|
||||
</div>
|
||||
<div line my-12px></div>
|
||||
<div flex="~ justify-end" space-x-10px>
|
||||
<ab-button icon="edit">{{ $t('rss.disable') }}</ab-button>
|
||||
<ab-button class="type-warn" text="delete">{{ $t('rss.delete') }}</ab-button>
|
||||
</div>
|
||||
</ab-fold-panel>
|
||||
<!-- <div line my-12px></div> -->
|
||||
<!-- <div flex="~ justify-end" space-x-10px> -->
|
||||
<!-- <ab-button @click="updateRSS">{{ $t('rss.disable') }}</ab-button> -->
|
||||
<!-- <ab-button class="type-warn" @click="deleteRSS">{{ $t('rss.delete') }}</ab-button> -->
|
||||
<!-- </div> -->
|
||||
</ab-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.spacer-1 {
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
.spacer-2 {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ export const useRSSStore = defineStore('rss', () => {
|
||||
const { execute: updateRSS, onResult: onUpdateRSSResult } = useApi(
|
||||
apiRSS.update
|
||||
);
|
||||
const { execute: disableRSS, onResult: onDisableRSSResult} = useApi(
|
||||
apiRSS.disable
|
||||
);
|
||||
const { execute: deleteRSS, onResult: onDeleteRSSResult } = useApi(
|
||||
apiRSS.delete
|
||||
);
|
||||
@@ -38,12 +41,14 @@ export const useRSSStore = defineStore('rss', () => {
|
||||
|
||||
onUpdateRSSResult(actionSuccess);
|
||||
onDeleteRSSResult(actionSuccess);
|
||||
onDisableRSSResult(actionSuccess)
|
||||
|
||||
return {
|
||||
rss,
|
||||
getAll,
|
||||
refresh,
|
||||
updateRSS,
|
||||
disableRSS,
|
||||
deleteRSS,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user