|
@@ -33,13 +33,19 @@
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
|
+ <!-- TODO @haohao:如果是独立部署,也是通过上传插件包哇? -->
|
|
<ContentWrap class="mt-10px">
|
|
<ContentWrap class="mt-10px">
|
|
<el-button type="warning" plain @click="handleImport" v-hasPermi="['system:user:import']">
|
|
<el-button type="warning" plain @click="handleImport" v-hasPermi="['system:user:import']">
|
|
<Icon icon="ep:upload" /> 上传插件包
|
|
<Icon icon="ep:upload" /> 上传插件包
|
|
</el-button>
|
|
</el-button>
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- TODO @haohao:待完成:配置管理 -->
|
|
|
|
+ <!-- TODO @haohao:待完成:script 管理 -->
|
|
|
|
+ <!-- TODO @haohao:插件实例的前端展示:底部要不要加个分页,展示运行中的实力?默认勾选,只展示 state 为在线的 -->
|
|
|
|
+
|
|
<!-- 插件导入对话框 -->
|
|
<!-- 插件导入对话框 -->
|
|
|
|
+ <!-- TODO @haohao:Number 尽量不用。因为有用户会使用 snowflake、或者 string 的时候,会有问题 -->
|
|
<PluginImportForm
|
|
<PluginImportForm
|
|
ref="importFormRef"
|
|
ref="importFormRef"
|
|
:id="Number(pluginInfo.id)"
|
|
:id="Number(pluginInfo.id)"
|
|
@@ -50,7 +56,7 @@
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { PluginInfoApi, PluginInfoVO } from '@/api/iot/plugininfo'
|
|
import { PluginInfoApi, PluginInfoVO } from '@/api/iot/plugininfo'
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
-import { ref, onMounted } from 'vue'
|
|
|
|
|
|
+import { onMounted, ref } from 'vue'
|
|
import PluginImportForm from './PluginImportForm.vue'
|
|
import PluginImportForm from './PluginImportForm.vue'
|
|
|
|
|
|
const message = useMessage()
|
|
const message = useMessage()
|
|
@@ -70,6 +76,7 @@ const pluginInfo = ref<PluginInfoVO>({
|
|
config: '',
|
|
config: '',
|
|
script: ''
|
|
script: ''
|
|
})
|
|
})
|
|
|
|
+// TODO @haohao:这里可以改成 pluginInfo.id > 0 去判断,然后 handleStatusChange disable 按钮
|
|
const isInitialLoad = ref(true) // 初始化标志位
|
|
const isInitialLoad = ref(true) // 初始化标志位
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -81,9 +88,9 @@ onMounted(() => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+/** 获取插件详情 */
|
|
const getPluginInfo = async (id: number) => {
|
|
const getPluginInfo = async (id: number) => {
|
|
- const data = await PluginInfoApi.getPluginInfo(id)
|
|
|
|
- pluginInfo.value = data
|
|
|
|
|
|
+ pluginInfo.value = await PluginInfoApi.getPluginInfo(id)
|
|
}
|
|
}
|
|
|
|
|
|
/** 处理状态变更 */
|
|
/** 处理状态变更 */
|
|
@@ -100,7 +107,8 @@ const handleStatusChange = async (status: number) => {
|
|
status
|
|
status
|
|
})
|
|
})
|
|
message.success('更新状态成功')
|
|
message.success('更新状态成功')
|
|
- getPluginInfo(Number(pluginInfo.value.id))
|
|
|
|
|
|
+ // 获取详情
|
|
|
|
+ await getPluginInfo(pluginInfo.value.id)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
pluginInfo.value.status = status === 1 ? 0 : 1
|
|
pluginInfo.value.status = status === 1 ? 0 : 1
|
|
message.error('更新状态失败')
|
|
message.error('更新状态失败')
|