remove autoinstall options from GUI, always set autoinstall flag, db migration to set autoinstall for all remotes (#48)

This commit is contained in:
sawka
2023-10-25 22:07:00 -07:00
committed by GitHub
parent 736fb7be6a
commit 267b035fc8
6 changed files with 8 additions and 66 deletions
+3 -8
View File
@@ -13,14 +13,14 @@ import (
"sync"
"time"
"github.com/google/uuid"
"github.com/jmoiron/sqlx"
"github.com/sawka/txwrap"
"github.com/wavetermdev/waveterm/waveshell/pkg/base"
"github.com/wavetermdev/waveterm/waveshell/pkg/packet"
"github.com/wavetermdev/waveterm/waveshell/pkg/shexec"
"github.com/wavetermdev/waveterm/wavesrv/pkg/dbutil"
"github.com/wavetermdev/waveterm/wavesrv/pkg/scbase"
"github.com/google/uuid"
"github.com/jmoiron/sqlx"
"github.com/sawka/txwrap"
)
const HistoryCols = "h.historyid, h.ts, h.userid, h.sessionid, h.screenid, h.lineid, h.haderror, h.cmdstr, h.remoteownerid, h.remoteid, h.remotename, h.ismetacmd, h.incognito, h.linenum"
@@ -1644,7 +1644,6 @@ func GetSessionStats(ctx context.Context, sessionId string) (*SessionStatsType,
const (
RemoteField_Alias = "alias" // string
RemoteField_ConnectMode = "connectmode" // string
RemoteField_AutoInstall = "autoinstall" // bool
RemoteField_SSHKey = "sshkey" // string
RemoteField_SSHPassword = "sshpassword" // string
RemoteField_Color = "color" // string
@@ -1670,10 +1669,6 @@ func UpdateRemote(ctx context.Context, remoteId string, editMap map[string]inter
query = `UPDATE remote SET connectmode = ? WHERE remoteid = ?`
tx.Exec(query, mode, remoteId)
}
if autoInstall, found := editMap[RemoteField_AutoInstall]; found {
query = `UPDATE remote SET autoinstall = ? WHERE remoteid = ?`
tx.Exec(query, autoInstall, remoteId)
}
if sshKey, found := editMap[RemoteField_SSHKey]; found {
query = `UPDATE remote SET sshopts = json_set(sshopts, '$.sshidentity', ?) WHERE remoteid = ?`
tx.Exec(query, sshKey, remoteId)
+2 -2
View File
@@ -11,16 +11,16 @@ import (
"strconv"
"time"
sh2db "github.com/wavetermdev/waveterm/wavesrv/db"
_ "github.com/golang-migrate/migrate/v4/database/sqlite3"
_ "github.com/golang-migrate/migrate/v4/source/file"
"github.com/golang-migrate/migrate/v4/source/iofs"
_ "github.com/mattn/go-sqlite3"
sh2db "github.com/wavetermdev/waveterm/wavesrv/db"
"github.com/golang-migrate/migrate/v4"
)
const MaxMigration = 22
const MaxMigration = 23
const MigratePrimaryScreenVersion = 9
const CmdScreenSpecialMigration = 13
const CmdLineSpecialMigration = 20