mirror of
https://github.com/zhaojh329/rttys.git
synced 2026-02-27 09:53:21 +08:00
ui: Limit the number of window splits to 6
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
@@ -96,5 +96,6 @@
|
||||
"Match Case": "Match Case",
|
||||
"Whole Word": "Whole Word",
|
||||
"Regular": "Regular",
|
||||
"Clear Highlighting": "Clear Highlighting"
|
||||
}
|
||||
"Clear Highlighting": "Clear Highlighting",
|
||||
"windows-limit": "Maximum number of windows ({n}) reached"
|
||||
}
|
||||
@@ -96,5 +96,6 @@
|
||||
"Match Case": "匹配大小写",
|
||||
"Whole Word": "匹配整个单词",
|
||||
"Regular": "正则匹配",
|
||||
"Clear Highlighting": "清除高亮"
|
||||
}
|
||||
"Clear Highlighting": "清除高亮",
|
||||
"windows-limit": "已达到最大窗口数量({n}个)"
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
import RttySplitter from '../components/RttySplitter.vue'
|
||||
import RttyTerm from '../components/RttyTerm.vue'
|
||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineProps({
|
||||
devid: {
|
||||
@@ -17,6 +19,8 @@ defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const paneRootID = 'rtty-panel-root'
|
||||
|
||||
const rootConfig = ref({
|
||||
@@ -87,6 +91,11 @@ const deletePanel = (config, panelId, index, parent) => {
|
||||
}
|
||||
|
||||
const handleSplitPanel = (panelId, direction) => {
|
||||
if (terms.value.length > 5) {
|
||||
ElMessage.warning(t('windows-limit', { n: 6 }))
|
||||
return
|
||||
}
|
||||
|
||||
moveTerminalsToPool()
|
||||
splitPanel(rootConfig.value, panelId, 0, direction)
|
||||
moveTerminalsToPlaceholders()
|
||||
|
||||
Reference in New Issue
Block a user