mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-01 09:40:59 +08:00
feat: 增加 resetRule 按钮
This commit is contained in:
@@ -62,7 +62,7 @@ defineEmits(['clickAdd']);
|
||||
hover:bg-primary
|
||||
class="group"
|
||||
:class="[active ? 'text-white bg-theme-row' : 'text-black']"
|
||||
@click="i.handle"
|
||||
@click="() => i.handle && i.handle()"
|
||||
>
|
||||
<div text-main>{{ i.label }}</div>
|
||||
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
import { Me, Pause, PlayOne, Power, Refresh } from '@icon-park/vue-next';
|
||||
import {
|
||||
Me,
|
||||
Pause,
|
||||
PlayOne,
|
||||
Power,
|
||||
Refresh,
|
||||
Format,
|
||||
} from '@icon-park/vue-next';
|
||||
|
||||
const search = ref('');
|
||||
const show = ref(false);
|
||||
const showAdd = ref(false);
|
||||
|
||||
const { onUpdate, offUpdate, start, pause, shutdown, restart } =
|
||||
const { onUpdate, offUpdate, start, pause, shutdown, restart, resetRule } =
|
||||
useProgramStore();
|
||||
const { running } = storeToRefs(useProgramStore());
|
||||
|
||||
@@ -36,6 +43,12 @@ const items = [
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
label: 'Reset Rule',
|
||||
icon: Format,
|
||||
handle: resetRule,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: 'Profile',
|
||||
icon: Me,
|
||||
handle: () => {
|
||||
|
||||
@@ -37,6 +37,10 @@ export const useProgramStore = defineStore('program', () => {
|
||||
const { execute: pause } = useApi(apiProgram.stop, opts('Pause'));
|
||||
const { execute: shutdown } = useApi(apiProgram.shutdown, opts('Shutdown'));
|
||||
const { execute: restart } = useApi(apiProgram.restart, opts('Restart'));
|
||||
const { execute: resetRule } = useApi(
|
||||
apiBangumi.resetAll,
|
||||
opts('Reset Rule')
|
||||
);
|
||||
|
||||
return {
|
||||
running,
|
||||
@@ -48,5 +52,6 @@ export const useProgramStore = defineStore('program', () => {
|
||||
pause,
|
||||
shutdown,
|
||||
restart,
|
||||
resetRule,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user