feat: 实现Redis集成协议并重构项目控制台
refactor(backend): 重构后端服务以支持Redis协议 feat(backend): 添加Redis客户端和服务模块 feat(backend): 实现命令和日志路由处理Redis交互 refactor(frontend): 重构前端状态管理和组件结构 feat(frontend): 实现基于Redis的日志和命令功能 docs: 添加Redis集成协议文档 chore: 更新ESLint配置和依赖
This commit is contained in:
@@ -1,25 +1,45 @@
|
||||
<template>
|
||||
<div class="command-view">
|
||||
<h2>发送指令</h2>
|
||||
<form @submit.prevent="sendCommand" class="command-form">
|
||||
<form
|
||||
class="command-form"
|
||||
@submit.prevent="sendCommand"
|
||||
>
|
||||
<div class="form-group">
|
||||
<label for="command">指令内容</label>
|
||||
<textarea
|
||||
id="command"
|
||||
v-model="command"
|
||||
rows="5"
|
||||
<textarea
|
||||
id="command"
|
||||
v-model="command"
|
||||
rows="5"
|
||||
placeholder="请输入要发送的指令..."
|
||||
required
|
||||
></textarea>
|
||||
/>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">发送指令</button>
|
||||
<button type="button" class="btn btn-secondary" @click="clearCommand">清空</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
发送指令
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
@click="clearCommand"
|
||||
>
|
||||
清空
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div v-if="response" class="response-section">
|
||||
<div
|
||||
v-if="response"
|
||||
class="response-section"
|
||||
>
|
||||
<h3>发送结果</h3>
|
||||
<div class="response-content" :class="{ 'success': response.success, 'error': !response.success }">
|
||||
<div
|
||||
class="response-content"
|
||||
:class="{ 'success': response.success, 'error': !response.success }"
|
||||
>
|
||||
{{ response.message }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,24 +47,24 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref } from 'vue';
|
||||
|
||||
const command = ref('')
|
||||
const response = ref(null)
|
||||
const command = ref('');
|
||||
const response = ref(null);
|
||||
|
||||
const sendCommand = () => {
|
||||
// 这里将实现发送指令的逻辑
|
||||
response.value = {
|
||||
success: true,
|
||||
message: `指令已发送: ${command.value}`
|
||||
}
|
||||
command.value = ''
|
||||
}
|
||||
message: `指令已发送: ${command.value}`,
|
||||
};
|
||||
command.value = '';
|
||||
};
|
||||
|
||||
const clearCommand = () => {
|
||||
command.value = ''
|
||||
response.value = null
|
||||
}
|
||||
command.value = '';
|
||||
response.value = null;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user