🔨 重构终端前端逻辑

This commit is contained in:
lijiahangmax
2024-02-02 01:29:21 +08:00
parent ae52a556d9
commit 9bf4a8e291
6 changed files with 85 additions and 9 deletions

View File

@@ -162,6 +162,62 @@ public class TerminalPreferenceModel implements PreferenceModel {
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class ActionBarSettingModel implements IJsonObject {
@Schema(description = "命令输入框")
private Boolean commandInput;
@Schema(description = "连接状态")
private Boolean connectStatus;
@Schema(description = "去顶部")
private Boolean toTop;
@Schema(description = "去底部")
private Boolean toBottom;
@Schema(description = "全选")
private Boolean selectAll;
@Schema(description = "搜索")
private Boolean search;
@Schema(description = "复制")
private Boolean copy;
@Schema(description = "粘贴")
private Boolean paste;
@Schema(description = "中断")
private Boolean interrupt;
@Schema(description = "回车")
private Boolean enter;
@Schema(description = "增大字号")
private Boolean fontSizePlus;
@Schema(description = "减小字号")
private Boolean fontSizeSubtract;
@Schema(description = "命令编辑器")
private Boolean commandEditor;
@Schema(description = "清空")
private Boolean clear;
@Schema(description = "断开连接")
private Boolean disconnect;
@Schema(description = "关闭终端")
private Boolean closeTab;
}
@Data
@Builder
@NoArgsConstructor

View File

@@ -76,7 +76,27 @@ public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalP
new TerminalPreferenceModel.ShortcutKeysModel("changeToNextTab", true, false, true, "ArrowRight", true),
new TerminalPreferenceModel.ShortcutKeysModel("openCopyTerminalTab", true, false, true, "KeyO", true),
new TerminalPreferenceModel.ShortcutKeysModel("openNewConnectTab", true, false, true, "KeyN", true)
))
))
.build()
.toJsonString();
// 操作栏设置
String actionBarSetting = TerminalPreferenceModel.ActionBarSettingModel.builder()
.commandInput(false)
.connectStatus(true)
.toTop(true)
.toBottom(true)
.selectAll(false)
.search(true)
.copy(true)
.paste(true)
.interrupt(false)
.enter(false)
.fontSizePlus(false)
.fontSizeSubtract(false)
.commandEditor(true)
.clear(true)
.disconnect(false)
.closeTab(true)
.build()
.toJsonString();
// 默认配置
@@ -84,7 +104,7 @@ public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalP
.newConnectionType("group")
.theme(new JSONObject())
.displaySetting(JSONObject.parseObject(defaultDisplaySetting))
.actionBarSetting(new JSONObject())
.actionBarSetting(JSONObject.parseObject(actionBarSetting))
.rightMenuSetting(Lists.of("copy", "paste", "checkAll", "search", "clear"))
.interactSetting(JSONObject.parseObject(defaultInteractSetting))
.pluginsSetting(JSONObject.parseObject(defaultPluginsSetting))