diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index cbfed93..364a4ce 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -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" +} \ No newline at end of file diff --git a/ui/src/i18n/zh-CN.json b/ui/src/i18n/zh-CN.json index 2c4263e..c69212a 100644 --- a/ui/src/i18n/zh-CN.json +++ b/ui/src/i18n/zh-CN.json @@ -96,5 +96,6 @@ "Match Case": "匹配大小写", "Whole Word": "匹配整个单词", "Regular": "正则匹配", - "Clear Highlighting": "清除高亮" -} + "Clear Highlighting": "清除高亮", + "windows-limit": "已达到最大窗口数量({n}个)" +} \ No newline at end of file diff --git a/ui/src/views/Rtty.vue b/ui/src/views/Rtty.vue index ec3e504..2525b8d 100644 --- a/ui/src/views/Rtty.vue +++ b/ui/src/views/Rtty.vue @@ -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()