调整插件流程,server共享 robot项目的对象。

This commit is contained in:
liuwei
2025-04-11 16:06:31 +08:00
parent e5f9a09728
commit b092fe2215

View File

@@ -55,29 +55,33 @@
</el-row>
<!-- 插件详情对话框 -->
<el-dialog title="插件详情" {% raw %}:visible.sync="pluginInfoVisible"{% endraw %} width="50%">
<div v-if="selectedPlugin">
<el-descriptions border direction="vertical" :column="1">
<el-descriptions-item label="插件名称">{% raw %}{{ selectedPlugin.name }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="模块名称">{% raw %}{{ selectedPlugin.module_name }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="版本">{% raw %}{{ selectedPlugin.version }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="作者">{% raw %}{{ selectedPlugin.author }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="描述">{% raw %}{{ selectedPlugin.description }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag {% raw %}:type="selectedPlugin.status === 'RUNNING' ? 'success' : 'danger'"{% endraw %}>
<el-dialog title="插件详情" {% raw %}:visible.sync="pluginInfoVisible"{% endraw %} width="60%" top="5vh">
<div v-if="selectedPlugin" class="plugin-detail-container">
<el-descriptions border direction="vertical" :column="2" size="small" class="plugin-descriptions">
<el-descriptions-item label="插件名称" :span="1">{% raw %}{{ selectedPlugin.name }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="模块名称" :span="1">{% raw %}{{ selectedPlugin.module_name }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="版本" :span="1">{% raw %}{{ selectedPlugin.version }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="作者" :span="1">{% raw %}{{ selectedPlugin.author }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="状态" :span="1">
<el-tag {% raw %}:type="selectedPlugin.status === 'RUNNING' ? 'success' : 'danger'"{% endraw %} size="small">
{% raw %}{{ selectedPlugin.status === 'RUNNING' ? '已启用' : '已禁用' }}{% endraw %}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="命令前缀" v-if="selectedPlugin.command_prefix !== undefined">
<el-descriptions-item label="命令前缀" :span="1" v-if="selectedPlugin.command_prefix !== undefined">
{% raw %}{{ selectedPlugin.command_prefix || '无' }}{% endraw %}
</el-descriptions-item>
<el-descriptions-item label="命令列表" v-if="selectedPlugin.commands && selectedPlugin.commands.length > 0">
<el-tag v-for="cmd in selectedPlugin.commands" :key="cmd" style="margin-right: 5px; margin-bottom: 5px;">
{% raw %}{{ cmd }}{% endraw %}
</el-tag>
<el-descriptions-item label="描述" :span="2">{% raw %}{{ selectedPlugin.description }}{% endraw %}</el-descriptions-item>
<el-descriptions-item label="命令列表" :span="2" v-if="selectedPlugin.commands && selectedPlugin.commands.length > 0">
<div class="command-tags">
<el-tag v-for="cmd in selectedPlugin.commands" :key="cmd" size="mini" style="margin-right: 5px; margin-bottom: 5px;">
{% raw %}{{ cmd }}{% endraw %}
</el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item label="配置信息" v-if="selectedPlugin.config">
<pre style="max-height: 300px; overflow-y: auto;">{% raw %}{{ JSON.stringify(selectedPlugin.config, null, 2) }}{% endraw %}</pre>
<el-descriptions-item label="配置信息" :span="2" v-if="selectedPlugin.config">
<div class="config-container">
<pre>{% raw %}{{ JSON.stringify(selectedPlugin.config, null, 2) }}{% endraw %}</pre>
</div>
</el-descriptions-item>
</el-descriptions>
</div>
@@ -197,4 +201,52 @@
}
});
</script>
<style>
.plugin-detail-container {
max-height: 70vh;
overflow-y: auto;
}
.plugin-descriptions {
width: 100%;
}
.config-container {
max-height: 200px;
overflow-y: auto;
background-color: #f5f7fa;
border-radius: 4px;
padding: 8px;
font-size: 12px;
}
.config-container pre {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
}
.command-tags {
display: flex;
flex-wrap: wrap;
}
/* 自定义滚动条样式 */
.plugin-detail-container::-webkit-scrollbar,
.config-container::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.plugin-detail-container::-webkit-scrollbar-thumb,
.config-container::-webkit-scrollbar-thumb {
background: #c0c4cc;
border-radius: 3px;
}
.plugin-detail-container::-webkit-scrollbar-track,
.config-container::-webkit-scrollbar-track {
background: #f5f7fa;
}
</style>
{% endblock %}