1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-28 19:14:13 +08:00

fix: Fix the monitoring data exception (#8028)

This commit is contained in:
ssongliu 2025-02-27 17:51:09 +08:00 committed by GitHub
parent 3de37a7cba
commit 36c5e648e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 131 additions and 27 deletions

View File

@ -1,7 +1,6 @@
package dto package dto
type SettingInfo struct { type SettingInfo struct {
SystemIP string `json:"systemIP"`
DockerSockPath string `json:"dockerSockPath"` DockerSockPath string `json:"dockerSockPath"`
SystemVersion string `json:"systemVersion"` SystemVersion string `json:"systemVersion"`

View File

@ -28,7 +28,7 @@ func NewIMonitorRepo() IMonitorRepo {
func (u *MonitorRepo) GetBase(opts ...DBOption) ([]model.MonitorBase, error) { func (u *MonitorRepo) GetBase(opts ...DBOption) ([]model.MonitorBase, error) {
var data []model.MonitorBase var data []model.MonitorBase
db := global.DB db := global.MonitorDB
for _, opt := range opts { for _, opt := range opts {
db = opt(db) db = opt(db)
} }
@ -37,7 +37,7 @@ func (u *MonitorRepo) GetBase(opts ...DBOption) ([]model.MonitorBase, error) {
} }
func (u *MonitorRepo) GetIO(opts ...DBOption) ([]model.MonitorIO, error) { func (u *MonitorRepo) GetIO(opts ...DBOption) ([]model.MonitorIO, error) {
var data []model.MonitorIO var data []model.MonitorIO
db := global.DB db := global.MonitorDB
for _, opt := range opts { for _, opt := range opts {
db = opt(db) db = opt(db)
} }
@ -46,7 +46,7 @@ func (u *MonitorRepo) GetIO(opts ...DBOption) ([]model.MonitorIO, error) {
} }
func (u *MonitorRepo) GetNetwork(opts ...DBOption) ([]model.MonitorNetwork, error) { func (u *MonitorRepo) GetNetwork(opts ...DBOption) ([]model.MonitorNetwork, error) {
var data []model.MonitorNetwork var data []model.MonitorNetwork
db := global.DB db := global.MonitorDB
for _, opt := range opts { for _, opt := range opts {
db = opt(db) db = opt(db)
} }

View File

@ -9,6 +9,7 @@ import (
"github.com/1Panel-dev/1Panel/agent/app/repo" "github.com/1Panel-dev/1Panel/agent/app/repo"
"github.com/1Panel-dev/1Panel/agent/buserr" "github.com/1Panel-dev/1Panel/agent/buserr"
"github.com/1Panel-dev/1Panel/agent/constant"
"github.com/1Panel-dev/1Panel/agent/app/dto" "github.com/1Panel-dev/1Panel/agent/app/dto"
"github.com/1Panel-dev/1Panel/agent/app/model" "github.com/1Panel-dev/1Panel/agent/app/model"
@ -82,7 +83,7 @@ func (m *MonitorService) LoadMonitorData(req dto.MonitorSearch) ([]dto.MonitorDa
data = append(data, itemData) data = append(data, itemData)
} }
if req.Param == "all" || req.Param == "network" { if req.Param == "all" || req.Param == "network" {
bases, err := monitorRepo.GetIO(repo.WithByName(req.Info), repo.WithByCreatedAt(req.StartTime, req.EndTime)) bases, err := monitorRepo.GetNetwork(repo.WithByName(req.Info), repo.WithByCreatedAt(req.StartTime, req.EndTime))
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -119,6 +120,33 @@ func (m *MonitorService) LoadSetting() (*dto.MonitorSetting, error) {
} }
func (m *MonitorService) UpdateSetting(key, value string) error { func (m *MonitorService) UpdateSetting(key, value string) error {
switch key {
case "MonitorStatus":
if value == constant.StatusEnable && global.MonitorCronID == 0 {
interval, err := settingRepo.Get(settingRepo.WithByKey("MonitorInterval"))
if err != nil {
return err
}
if err := StartMonitor(false, interval.Value); err != nil {
return err
}
}
if value == constant.StatusDisable && global.MonitorCronID != 0 {
monitorCancel()
global.Cron.Remove(cron.EntryID(global.MonitorCronID))
global.MonitorCronID = 0
}
case "MonitorInterval":
status, err := settingRepo.Get(settingRepo.WithByKey("MonitorStatus"))
if err != nil {
return err
}
if status.Value == constant.StatusEnable && global.MonitorCronID != 0 {
if err := StartMonitor(true, value); err != nil {
return err
}
}
}
return settingRepo.Update(key, value) return settingRepo.Update(key, value)
} }

View File

@ -247,7 +247,6 @@ func loadDbConn(snap *snapHelper, targetDir string, req dto.SnapshotCreate) erro
} }
} }
_ = snap.snapAgentDB.Model(&model.Setting{}).Where("key = ?", "SystemIP").Updates(map[string]interface{}{"value": ""}).Error
_ = snap.snapAgentDB.Where("id = ?", snap.SnapID).Delete(&model.Snapshot{}).Error _ = snap.snapAgentDB.Where("id = ?", snap.SnapID).Delete(&model.Snapshot{}).Error
return nil return nil

View File

@ -28,7 +28,7 @@ func Run() {
if err := global.DB.Where("key = ?", "MonitorStatus").Find(&status).Error; err != nil { if err := global.DB.Where("key = ?", "MonitorStatus").Find(&status).Error; err != nil {
global.LOG.Errorf("load monitor status from db failed, err: %v", err) global.LOG.Errorf("load monitor status from db failed, err: %v", err)
} }
if status.Value == "enable" { if status.Value == "Enable" {
if err := global.DB.Where("key = ?", "MonitorInterval").Find(&interval).Error; err != nil { if err := global.DB.Where("key = ?", "MonitorInterval").Find(&interval).Error; err != nil {
global.LOG.Errorf("load monitor interval from db failed, err: %v", err) global.LOG.Errorf("load monitor interval from db failed, err: %v", err)
} }

View File

@ -25,6 +25,7 @@ func InitAgentDB() {
migrations.UpdateAppTag, migrations.UpdateAppTag,
migrations.UpdateApp, migrations.UpdateApp,
migrations.AddOllamaModel, migrations.AddOllamaModel,
migrations.UpdateSettingStatus,
}) })
if err := m.Migrate(); err != nil { if err := m.Migrate(); err != nil {
global.LOG.Error(err) global.LOG.Error(err)

View File

@ -104,9 +104,6 @@ var InitSetting = &gormigrate.Migration{
if err := tx.Create(&model.Setting{Key: "EncryptKey", Value: global.CONF.Base.EncryptKey}).Error; err != nil { if err := tx.Create(&model.Setting{Key: "EncryptKey", Value: global.CONF.Base.EncryptKey}).Error; err != nil {
return err return err
} }
if err := tx.Create(&model.Setting{Key: "SystemIP", Value: ""}).Error; err != nil {
return err
}
if err := tx.Create(&model.Setting{Key: "DockerSockPath", Value: "unix:///var/run/docker.sock"}).Error; err != nil { if err := tx.Create(&model.Setting{Key: "DockerSockPath", Value: "unix:///var/run/docker.sock"}).Error; err != nil {
return err return err
} }
@ -275,3 +272,16 @@ var AddOllamaModel = &gormigrate.Migration{
return nil return nil
}, },
} }
var UpdateSettingStatus = &gormigrate.Migration{
ID: "20250227-update-setting-status",
Migrate: func(tx *gorm.DB) error {
if err := tx.Model(model.Setting{}).Where("value = ?", "enable").Update("value", constant.StatusEnable).Error; err != nil {
return err
}
if err := tx.Model(model.Setting{}).Where("value = ?", "disable").Update("value", constant.StatusDisable).Error; err != nil {
return err
}
return nil
},
}

View File

@ -15,6 +15,7 @@ type SettingInfo struct {
Theme string `json:"theme"` Theme string `json:"theme"`
MenuTabs string `json:"menuTabs"` MenuTabs string `json:"menuTabs"`
Language string `json:"language"` Language string `json:"language"`
SystemIP string `json:"systemIP"`
ServerPort string `json:"serverPort"` ServerPort string `json:"serverPort"`
SSL string `json:"ssl"` SSL string `json:"ssl"`

View File

@ -22,6 +22,7 @@ func Init() {
migrations.RemoveLocalBackup, migrations.RemoveLocalBackup,
migrations.AddMFAInterval, migrations.AddMFAInterval,
migrations.UpdateXpackHideMemu, migrations.UpdateXpackHideMemu,
migrations.AddSystemIP,
}) })
if err := m.Migrate(); err != nil { if err := m.Migrate(); err != nil {
global.LOG.Error(err) global.LOG.Error(err)

View File

@ -318,3 +318,13 @@ var UpdateXpackHideMemu = &gormigrate.Migration{
return nil return nil
}, },
} }
var AddSystemIP = &gormigrate.Migration{
ID: "20250227-add-system-ip",
Migrate: func(tx *gorm.DB) error {
if err := tx.Create(&model.Setting{Key: "SystemIP", Value: ""}).Error; err != nil {
return err
}
return nil
},
}

View File

@ -70,6 +70,8 @@ import i18n from '@/lang';
import { ElForm } from 'element-plus'; import { ElForm } from 'element-plus';
import { getSettingInfo } from '@/api/modules/setting'; import { getSettingInfo } from '@/api/modules/setting';
import { getBindDomain } from '@/api/modules/ai'; import { getBindDomain } from '@/api/modules/ai';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const loading = ref(false); const loading = ref(false);
@ -104,6 +106,10 @@ const handleClose = () => {
}; };
const loadSystemIP = async () => { const loadSystemIP = async () => {
if (globalStore.currentNode !== 'local') {
form.systemIP = globalStore.currentNode || i18n.global.t('database.localIP');
return;
}
const res = await getSettingInfo(); const res = await getSettingInfo();
form.systemIP = res.data.systemIP || i18n.global.t('database.localIP'); form.systemIP = res.data.systemIP || i18n.global.t('database.localIP');
}; };

View File

@ -113,6 +113,8 @@ import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util'; import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting'; import { getSettingInfo } from '@/api/modules/setting';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const loading = ref(false); const loading = ref(false);
@ -179,6 +181,10 @@ const loadAccess = async () => {
}; };
const loadSystemIP = async () => { const loadSystemIP = async () => {
if (globalStore.currentNode !== 'local') {
form.systemIP = globalStore.currentNode || i18n.global.t('database.localIP');
return;
}
const res = await getSettingInfo(); const res = await getSettingInfo();
form.systemIP = res.data.systemIP || i18n.global.t('database.localIP'); form.systemIP = res.data.systemIP || i18n.global.t('database.localIP');
}; };

View File

@ -115,6 +115,8 @@ import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util'; import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting'; import { getSettingInfo } from '@/api/modules/setting';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const loading = ref(false); const loading = ref(false);
@ -179,6 +181,10 @@ const loadAccess = async () => {
}; };
const loadSystemIP = async () => { const loadSystemIP = async () => {
if (globalStore.currentNode !== 'local') {
form.systemIP = globalStore.currentNode || i18n.global.t('database.localIP');
return;
}
const res = await getSettingInfo(); const res = await getSettingInfo();
form.systemIP = res.data.systemIP || i18n.global.t('database.localIP'); form.systemIP = res.data.systemIP || i18n.global.t('database.localIP');
}; };

View File

@ -104,6 +104,8 @@ import { getAppConnInfo } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { getRandomStr } from '@/utils/util'; import { getRandomStr } from '@/utils/util';
import { getSettingInfo } from '@/api/modules/setting'; import { getSettingInfo } from '@/api/modules/setting';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const loading = ref(false); const loading = ref(false);
@ -181,6 +183,10 @@ const loadPassword = async () => {
}; };
const loadSystemIP = async () => { const loadSystemIP = async () => {
if (globalStore.currentNode !== 'local') {
form.systemIP = globalStore.currentNode || i18n.global.t('database.localIP');
return;
}
const res = await getSettingInfo(); const res = await getSettingInfo();
form.systemIP = res.data.systemIP || i18n.global.t('database.localIP'); form.systemIP = res.data.systemIP || i18n.global.t('database.localIP');
}; };

View File

@ -4,7 +4,7 @@
<template #header-r> <template #header-r>
<el-popover placement="left" :width="226" trigger="click"> <el-popover placement="left" :width="226" trigger="click">
<el-input size="small" v-model="filter" clearable @input="loadOption()" /> <el-input size="small" v-model="filter" clearable @input="loadOption()" />
<el-table :show-header="false" :data="options" max-height="500px"> <el-table :show-header="false" :data="options" max-height="150px">
<el-table-column prop="key" width="120" show-overflow-tooltip /> <el-table-column prop="key" width="120" show-overflow-tooltip />
<el-table-column prop="name"> <el-table-column prop="name">
<template #default="{ row }"> <template #default="{ row }">

View File

@ -12,7 +12,7 @@
{{ $t('file.reduce') }} {{ $t('file.reduce') }}
</el-button> </el-button>
<el-form-item :label="$t('file.fileRecycleBin')"> <el-form-item :label="$t('file.fileRecycleBin')">
<el-switch v-model="status" active-value="enable" inactive-value="disable" @change="changeStatus" /> <el-switch v-model="status" active-value="Enable" inactive-value="Disable" @change="changeStatus" />
</el-form-item> </el-form-item>
</div> </div>
<ComplexTable <ComplexTable
@ -78,7 +78,7 @@ const em = defineEmits(['close']);
const selects = ref([]); const selects = ref([]);
const loading = ref(false); const loading = ref(false);
const files = ref([]); const files = ref([]);
const status = ref('enable'); const status = ref('Enable');
const paginationConfig = reactive({ const paginationConfig = reactive({
cacheSizeKey: 'recycle-page-size', cacheSizeKey: 'recycle-page-size',

View File

@ -26,7 +26,7 @@
size="small" size="small"
class="ml-2" class="ml-2"
inactive-value="Disable" inactive-value="Disable"
active-value="enable" active-value="Enable"
@change="onPingOperate" @change="onPingOperate"
v-model="onPing" v-model="onPing"
/> />

View File

@ -12,8 +12,8 @@
<el-switch <el-switch
@change="onSaveStatus" @change="onSaveStatus"
v-model="form.monitorStatus" v-model="form.monitorStatus"
active-value="enable" active-value="Enable"
inactive-value="disable" inactive-value="Disable"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('monitor.storeDays')" prop="monitorStoreDays"> <el-form-item :label="$t('monitor.storeDays')" prop="monitorStoreDays">
@ -72,7 +72,7 @@ import { MsgSuccess } from '@/utils/message';
const loading = ref(); const loading = ref();
const form = reactive({ const form = reactive({
monitorStatus: 'disable', monitorStatus: 'Disable',
monitorStoreDays: 30, monitorStoreDays: 30,
monitorInterval: 1, monitorInterval: 1,
defaultNetwork: '', defaultNetwork: '',
@ -88,7 +88,8 @@ const search = async () => {
form.monitorStatus = res.data.monitorStatus; form.monitorStatus = res.data.monitorStatus;
form.monitorInterval = Number(res.data.monitorInterval); form.monitorInterval = Number(res.data.monitorInterval);
form.monitorStoreDays = Number(res.data.monitorStoreDays); form.monitorStoreDays = Number(res.data.monitorStoreDays);
form.defaultNetwork = res.data.defaultNetwork; form.defaultNetwork =
res.data.defaultNetwork === 'all' ? i18n.global.t('commons.table.all') : res.data.defaultNetwork;
}; };
const onSaveStatus = async () => { const onSaveStatus = async () => {

View File

@ -81,6 +81,7 @@
<el-form-item prop="password" class="w-full"> <el-form-item prop="password" class="w-full">
<el-input <el-input
type="password" type="password"
show-password
v-model.trim="loginForm.password" v-model.trim="loginForm.password"
class="w-full" class="w-full"
size="large" size="large"

View File

@ -118,6 +118,27 @@
</span> </span>
</el-form-item> </el-form-item>
<el-form-item
v-if="globalStore.currentNode === 'local'"
:label="$t('setting.systemIP')"
prop="systemIP"
>
<el-input disabled v-if="form.systemIP" v-model="form.systemIP">
<template #append>
<el-button @click="onChangeSystemIP" icon="Setting">
{{ $t('commons.button.set') }}
</el-button>
</template>
</el-input>
<el-input disabled v-if="!form.systemIP" v-model="unset">
<template #append>
<el-button @click="onChangeSystemIP" icon="Setting">
{{ $t('commons.button.set') }}
</el-button>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('setting.proxy')" prop="proxyShow"> <el-form-item :label="$t('setting.proxy')" prop="proxyShow">
<el-input disabled v-model="form.proxyShow"> <el-input disabled v-model="form.proxyShow">
<template #append> <template #append>
@ -174,6 +195,7 @@
<Password ref="passwordRef" /> <Password ref="passwordRef" />
<UserName ref="userNameRef" /> <UserName ref="userNameRef" />
<PanelName ref="panelNameRef" @search="search()" /> <PanelName ref="panelNameRef" @search="search()" />
<SystemIP ref="systemIPRef" @search="search()" />
<Proxy ref="proxyRef" @search="search()" /> <Proxy ref="proxyRef" @search="search()" />
<ApiInterface ref="apiInterfaceRef" @search="search()" /> <ApiInterface ref="apiInterfaceRef" @search="search()" />
<Timeout ref="timeoutRef" @search="search()" /> <Timeout ref="timeoutRef" @search="search()" />
@ -196,6 +218,7 @@ import Password from '@/views/setting/panel/password/index.vue';
import UserName from '@/views/setting/panel/username/index.vue'; import UserName from '@/views/setting/panel/username/index.vue';
import Timeout from '@/views/setting/panel/timeout/index.vue'; import Timeout from '@/views/setting/panel/timeout/index.vue';
import PanelName from '@/views/setting/panel/name/index.vue'; import PanelName from '@/views/setting/panel/name/index.vue';
import SystemIP from '@/views/setting/panel/systemip/index.vue';
import Proxy from '@/views/setting/panel/proxy/index.vue'; import Proxy from '@/views/setting/panel/proxy/index.vue';
import HideMenu from '@/views/setting/panel/hidemenu/index.vue'; import HideMenu from '@/views/setting/panel/hidemenu/index.vue';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
@ -233,6 +256,7 @@ const form = reactive({
language: '', language: '',
complexityVerification: '', complexityVerification: '',
developerMode: '', developerMode: '',
systemIP: '',
proxyShow: '', proxyShow: '',
proxyUrl: '', proxyUrl: '',
@ -256,6 +280,7 @@ const show = ref();
const userNameRef = ref(); const userNameRef = ref();
const passwordRef = ref(); const passwordRef = ref();
const panelNameRef = ref(); const panelNameRef = ref();
const systemIPRef = ref();
const proxyRef = ref(); const proxyRef = ref();
const timeoutRef = ref(); const timeoutRef = ref();
const hideMenuRef = ref(); const hideMenuRef = ref();
@ -299,6 +324,7 @@ const search = async () => {
form.ipWhiteList = res.data.ipWhiteList; form.ipWhiteList = res.data.ipWhiteList;
form.apiKeyValidityTime = res.data.apiKeyValidityTime; form.apiKeyValidityTime = res.data.apiKeyValidityTime;
form.hideMenu = res.data.hideMenu; form.hideMenu = res.data.hideMenu;
form.systemIP = res.data.systemIP;
if (isMasterProductPro.value) { if (isMasterProductPro.value) {
const xpackRes = await getXpackSetting(); const xpackRes = await getXpackSetting();
@ -328,6 +354,9 @@ const onChangeTitle = () => {
const onChangeTimeout = () => { const onChangeTimeout = () => {
timeoutRef.value.acceptParams({ sessionTimeout: form.sessionTimeout }); timeoutRef.value.acceptParams({ sessionTimeout: form.sessionTimeout });
}; };
const onChangeSystemIP = () => {
systemIPRef.value.acceptParams({ systemIP: form.systemIP });
};
const onChangeProxy = () => { const onChangeProxy = () => {
proxyRef.value.acceptParams({ proxyRef.value.acceptParams({
url: form.proxyUrl, url: form.proxyUrl,

View File

@ -3,12 +3,12 @@
<el-form ref="formRef" label-position="top" :model="form" @submit.prevent v-loading="loading"> <el-form ref="formRef" label-position="top" :model="form" @submit.prevent v-loading="loading">
<el-form-item :label="$t('setting.ipv6')" prop="ipv6" :rules="Rules.requiredSelect"> <el-form-item :label="$t('setting.ipv6')" prop="ipv6" :rules="Rules.requiredSelect">
<el-radio-group style="width: 100%" v-model="form.ipv6" @change="onChangeMode()"> <el-radio-group style="width: 100%" v-model="form.ipv6" @change="onChangeMode()">
<el-radio value="enable">{{ $t('commons.button.enable') }}</el-radio> <el-radio value="Enable">{{ $t('commons.button.enable') }}</el-radio>
<el-radio value="disable">{{ $t('commons.button.disable') }}</el-radio> <el-radio value="Disable">{{ $t('commons.button.disable') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="form.ipv6 === 'disable'" v-if="form.ipv6 === 'Disable'"
:label="$t('setting.bindAddress')" :label="$t('setting.bindAddress')"
prop="bindAddress" prop="bindAddress"
:rules="Rules.ip" :rules="Rules.ip"
@ -82,7 +82,7 @@ const loadInterface = async () => {
}; };
const onChangeMode = () => { const onChangeMode = () => {
form.bindAddress = form.ipv6 === 'enable' ? '::' : '0.0.0.0'; form.bindAddress = form.ipv6 === 'Enable' ? '::' : '0.0.0.0';
}; };
const onSavePort = async (formEl: FormInstance | undefined) => { const onSavePort = async (formEl: FormInstance | undefined) => {

View File

@ -46,8 +46,8 @@
<el-form-item :label="$t('terminal.cursorBlink')"> <el-form-item :label="$t('terminal.cursorBlink')">
<el-switch <el-switch
v-model="form.cursorBlink" v-model="form.cursorBlink"
active-value="enable" active-value="Enable"
inactive-value="disable" inactive-value="Disable"
@change="changeItem()" @change="changeItem()"
/> />
</el-form-item> </el-form-item>
@ -115,7 +115,7 @@ const form = reactive({
lineHeight: 1.2, lineHeight: 1.2,
letterSpacing: 1.2, letterSpacing: 1.2,
fontSize: 12, fontSize: 12,
cursorBlink: 'enable', cursorBlink: 'Enable',
cursorStyle: 'underline', cursorStyle: 'underline',
scrollback: 1000, scrollback: 1000,
scrollSensitivity: 10, scrollSensitivity: 10,
@ -171,7 +171,7 @@ const changeItem = () => {
term.value.options.lineHeight = form.lineHeight; term.value.options.lineHeight = form.lineHeight;
term.value.options.letterSpacing = form.letterSpacing; term.value.options.letterSpacing = form.letterSpacing;
term.value.options.fontSize = form.fontSize; term.value.options.fontSize = form.fontSize;
term.value.options.cursorBlink = form.cursorBlink === 'enable'; term.value.options.cursorBlink = form.cursorBlink === 'Enable';
term.value.options.cursorStyle = form.cursorStyle; term.value.options.cursorStyle = form.cursorStyle;
term.value.options.scrollback = form.scrollback; term.value.options.scrollback = form.scrollback;
term.value.options.scrollSensitivity = form.scrollSensitivity; term.value.options.scrollSensitivity = form.scrollSensitivity;
@ -183,7 +183,7 @@ const onSetDefault = () => {
form.lineHeight = 1.2; form.lineHeight = 1.2;
form.letterSpacing = 0; form.letterSpacing = 0;
form.fontSize = 12; form.fontSize = 12;
form.cursorBlink = 'enable'; form.cursorBlink = 'Enable';
form.cursorStyle = 'block'; form.cursorStyle = 'block';
form.scrollback = 1000; form.scrollback = 1000;
form.scrollSensitivity = 6; form.scrollSensitivity = 6;