174 lines
4.3 KiB
HTML
174 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<title>首页</title>
|
|
{% include 'layout/head.html' %}
|
|
<style>
|
|
table {
|
|
border: 1px solid black;
|
|
}
|
|
|
|
table tr > td {
|
|
padding: 0;
|
|
margin: 0;
|
|
border: 1px solid black;
|
|
}
|
|
|
|
td.success {
|
|
background: green;
|
|
color: white;
|
|
}
|
|
|
|
td.warning {
|
|
background: orangered;
|
|
color: white;
|
|
}
|
|
|
|
#app[v-cloak] {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
{% raw %}
|
|
<div id="app" v-cloak>
|
|
<h1>TEST</h1>
|
|
<hr>
|
|
<h2>当前状态</h2>
|
|
<table class="current-status-table">
|
|
<tbody>
|
|
<tr>
|
|
<td>系统</td>
|
|
<td>{{ collector.basic.system.os }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>FFMPEG状态</td>
|
|
<td :class="collector.basic.exec.ffmpeg ? 'success' : 'warning'"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>弹幕工具状态</td>
|
|
<td :class="collector.basic.exec.danmaku ? 'success' : 'warning'"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h2>配置状态</h2>
|
|
<table class="current-config">
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2">FFMPEG</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>命令</td>
|
|
<td>{{ config.ffmpeg.exec }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>嘤伟达GPU</td>
|
|
<td :class="{warning: !config.ffmpeg.nvidia_gpu, success: config.ffmpeg.nvidia_gpu}"></td>
|
|
</tr>
|
|
<tr v-if="config.ffmpeg.gpu">
|
|
<td>嘤特尔GPU</td>
|
|
<td :class="{warning: !config.ffmpeg.intel_gpu, success: config.ffmpeg.intel_gpu}"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>视频比特率</td>
|
|
<td>{{ config.ffmpeg.bitrate }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="current-config">
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2">弹幕</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>命令</td>
|
|
<td>{{ config.danmaku.exec }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>滚动速度</td>
|
|
<td>{{ config.danmaku.speed }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>视频分辨率</td>
|
|
<td>{{ config.danmaku.resolution }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="current-config">
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2">片段</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>片段时长</td>
|
|
<td>{{ config.clip.each_sec }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>超出时长</td>
|
|
<td>{{ config.clip.overflow_sec }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endraw %}
|
|
</body>
|
|
<script>
|
|
Vue.devtools = true
|
|
Vue.createApp({
|
|
data() {
|
|
return {
|
|
collector: {
|
|
basic: {
|
|
exec: {
|
|
ffmpeg: false,
|
|
danmaku: false,
|
|
},
|
|
system: {
|
|
os: "",
|
|
}
|
|
}
|
|
},
|
|
config: {
|
|
danmaku: {
|
|
exec: "",
|
|
speed: 0,
|
|
font: "",
|
|
resolution: "",
|
|
},
|
|
video: {
|
|
title: "",
|
|
},
|
|
clip: {
|
|
each_sec: 0,
|
|
overflow_sec: 0,
|
|
},
|
|
ffmpeg: {
|
|
exec: "",
|
|
nvidia_gpu: false,
|
|
intel_gpu: false,
|
|
bitrate: "",
|
|
}
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
axios({
|
|
url: "/api/collector/"
|
|
}).then((response) => {
|
|
this.collector.basic = response.data;
|
|
})
|
|
axios({
|
|
url: "/api/config/"
|
|
}).then((response) => {
|
|
this.config = response.data;
|
|
})
|
|
},
|
|
}).mount("#app")
|
|
</script>
|
|
</html> |