mirror of
https://github.com/acepanel/panel.git
synced 2026-02-07 16:47:14 +08:00
feat: 大部分视图支持消息总线
This commit is contained in:
@@ -22,6 +22,7 @@ const handleSubmit = async () => {
|
||||
.create(model.value)
|
||||
.then(() => {
|
||||
window.$message.success('创建成功')
|
||||
window.$bus.emit('ssh:refresh')
|
||||
loading.value = false
|
||||
show.value = false
|
||||
model.value = {
|
||||
|
||||
@@ -208,26 +208,17 @@ const onTermWheel = (event: WheelEvent) => {
|
||||
}
|
||||
}
|
||||
|
||||
watch(create, () => {
|
||||
if (!create.value) fetchData()
|
||||
})
|
||||
|
||||
watch(update, () => {
|
||||
if (!update.value) {
|
||||
fetchData()
|
||||
updateId.value = 0
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// https://github.com/xtermjs/xterm.js/pull/5178
|
||||
document.fonts.ready.then((fontFaceSet: any) =>
|
||||
Promise.all(Array.from(fontFaceSet).map((el: any) => el.load())).then(fetchData)
|
||||
)
|
||||
window.$bus.on('ssh:refresh', fetchData)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
closeSession()
|
||||
window.$bus.off('ssh:refresh')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@ const handleSubmit = async () => {
|
||||
.update(id.value, model.value)
|
||||
.then(() => {
|
||||
window.$message.success('更新成功')
|
||||
id.value = 0
|
||||
loading.value = false
|
||||
show.value = false
|
||||
window.$bus.emit('ssh:refresh')
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
|
||||
Reference in New Issue
Block a user