feat: 修改终端配置.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.orion.ops.module.infra.handler.preference.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -24,9 +25,50 @@ public class TerminalPreferenceModel implements PreferenceModel {
|
||||
private String darkTheme;
|
||||
|
||||
@Schema(description = "终端主题")
|
||||
private JSONObject terminalTheme;
|
||||
private JSONObject themeSchema;
|
||||
|
||||
@Schema(description = "显示设置")
|
||||
private JSONObject viewSetting;
|
||||
private JSONObject displaySetting;
|
||||
|
||||
@Schema(description = "背景设置")
|
||||
private JSONObject backgroundSetting;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DisplaySettingModel {
|
||||
|
||||
@Schema(description = "字体样式")
|
||||
private String fontFamily;
|
||||
|
||||
@Schema(description = "字体大小")
|
||||
private Integer fontSize;
|
||||
|
||||
@Schema(description = "行高")
|
||||
private Double lineHeight;
|
||||
|
||||
@Schema(description = "文本字重")
|
||||
private String fontWeight;
|
||||
|
||||
@Schema(description = "加粗字重")
|
||||
private String fontWeightBold;
|
||||
|
||||
@Schema(description = "光标样式")
|
||||
private String cursorStyle;
|
||||
|
||||
@Schema(description = "光标闪烁")
|
||||
private Boolean cursorBlink;
|
||||
|
||||
/**
|
||||
* 转为 json
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public JSONObject toJson() {
|
||||
return JSON.parseObject(JSON.toJSONString(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,19 @@ public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalP
|
||||
public TerminalPreferenceModel getDefault() {
|
||||
return TerminalPreferenceModel.builder()
|
||||
.darkTheme("dark")
|
||||
.terminalTheme(new JSONObject())
|
||||
.viewSetting(new JSONObject())
|
||||
.themeSchema(new JSONObject())
|
||||
.displaySetting(TerminalPreferenceModel.DisplaySettingModel.builder()
|
||||
.fontFamily("_")
|
||||
.fontSize(15)
|
||||
.lineHeight(1.00)
|
||||
.fontWeight("normal")
|
||||
.fontWeightBold("bold")
|
||||
.cursorStyle("bar")
|
||||
.cursorBlink(true)
|
||||
.build()
|
||||
.toJson()
|
||||
)
|
||||
.backgroundSetting(new JSONObject())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user