| | |
| | | <p class="text-muted">管çåçæ§ S7 PLC 模æå¨å®ä¾</p> |
| | | </div> |
| | | <div class="header-right"> |
| | | <el-button type="default" @click="handleRefresh"> |
| | | <el-icon><Refresh /></el-icon> |
| | | éæ°è·åå®ä¾ |
| | | </el-button> |
| | | <el-button type="primary" class="create-btn" @click="$router.push('/create')"> |
| | | <el-icon><Plus /></el-icon> |
| | | å建å®ä¾ |
| | |
| | | import { onMounted, onUnmounted, ref } from 'vue' |
| | | import { storeToRefs } from 'pinia' |
| | | import { useInstancesStore } from '../stores/instances' |
| | | import api from '../api' |
| | | import { syncInstances } from '../api' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { |
| | | Cpu, |
| | | Plus, |
| | | Loading, |
| | | Refresh, |
| | | User, |
| | | VideoPause, |
| | | VideoPlay, |
| | |
| | | store.stopAutoRefresh() |
| | | }) |
| | | |
| | | async function handleRefresh() { |
| | | try { |
| | | await syncInstances() |
| | | await store.loadInstances() |
| | | ElMessage.success('已鿰è·åå®ä¾å表') |
| | | } catch (err) { |
| | | console.error('åæ¥å¤±è´¥:', err) |
| | | ElMessage.error('åæ¥å¤±è´¥ï¼è¯·æ¥çæ§å¶å°') |
| | | } |
| | | } |
| | | |
| | | async function handleStart(id: string) { |
| | | try { |
| | | await ElMessageBox.confirm(`ç¡®å®è¦å¯å¨å®ä¾ "${id}" åï¼`, '确认', { |