30
frontend/src/views/HomeView.vue
Normal file
30
frontend/src/views/HomeView.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<script setup>
|
||||
import PlayerComponent from '@/components/PlayerComponent.vue';
|
||||
import { Space, Button } from 'vant';
|
||||
import { ref } from 'vue';
|
||||
import { postRequest } from '@/utils';
|
||||
|
||||
const can_watch = ref(false);
|
||||
|
||||
fetch("/api/can-start-watching").then((response) => {
|
||||
can_watch.value = response.ok
|
||||
})
|
||||
|
||||
async function kill(...names) {
|
||||
postRequest("/api/kill", { names })
|
||||
}
|
||||
|
||||
async function startWatching() {
|
||||
await postRequest("/api/start-watching")
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Space fill direction="vertical" :size="20">
|
||||
<Button type="warning" round size="large" @click="kill('mpv')">Убить MPV</Button>
|
||||
<Button type="danger" round size="large" @click="kill('awatch', 'mpv')">Убить awatch</Button>
|
||||
<Button type="primary" round size="large" :disabled="!can_watch">Начать потребление анимы</Button>
|
||||
</Space>
|
||||
<PlayerComponent />
|
||||
</template>
|
Reference in New Issue
Block a user