Merge branch 'master' into develop

This commit is contained in:
Jan Prochazka
2021-09-30 08:28:25 +02:00
56 changed files with 752 additions and 225 deletions

View File

@@ -14,6 +14,7 @@ let analysedStructure = null;
let lastPing = null;
let lastStatus = null;
let analysedTime = 0;
let serverVersion;
async function checkedAsyncCall(promise) {
try {
@@ -36,7 +37,7 @@ async function handleFullRefresh() {
loadingModel = true;
const driver = requireEngineDriver(storedConnection);
setStatusName('loadStructure');
analysedStructure = await checkedAsyncCall(driver.analyseFull(systemConnection));
analysedStructure = await checkedAsyncCall(driver.analyseFull(systemConnection, serverVersion));
analysedTime = new Date().getTime();
process.send({ msgtype: 'structure', structure: analysedStructure });
process.send({ msgtype: 'structureTime', analysedTime });
@@ -48,7 +49,7 @@ async function handleIncrementalRefresh(forceSend) {
loadingModel = true;
const driver = requireEngineDriver(storedConnection);
setStatusName('checkStructure');
const newStructure = await checkedAsyncCall(driver.analyseIncremental(systemConnection, analysedStructure));
const newStructure = await checkedAsyncCall(driver.analyseIncremental(systemConnection, analysedStructure, serverVersion));
analysedTime = new Date().getTime();
if (newStructure != null) {
analysedStructure = newStructure;
@@ -84,6 +85,7 @@ async function readVersion() {
const driver = requireEngineDriver(storedConnection);
const version = await driver.getVersion(systemConnection);
process.send({ msgtype: 'version', version });
serverVersion = version;
}
async function handleConnect({ connection, structure, globalSettings }) {
@@ -93,7 +95,7 @@ async function handleConnect({ connection, structure, globalSettings }) {
if (!structure) setStatusName('pending');
const driver = requireEngineDriver(storedConnection);
systemConnection = await checkedAsyncCall(connectUtility(driver, storedConnection));
readVersion();
await checkedAsyncCall(readVersion());
if (structure) {
analysedStructure = structure;
handleIncrementalRefresh(true);

View File

@@ -70,14 +70,14 @@ function decryptPasswordField(connection, field) {
function encryptConnection(connection) {
connection = encryptPasswordField(connection, 'password');
connection = encryptPasswordField(connection, 'sshPassword');
connection = encryptPasswordField(connection, 'sshKeyFilePassword');
connection = encryptPasswordField(connection, 'sshKeyfilePassword');
return connection;
}
function decryptConnection(connection) {
connection = decryptPasswordField(connection, 'password');
connection = decryptPasswordField(connection, 'sshPassword');
connection = decryptPasswordField(connection, 'sshKeyFilePassword');
connection = decryptPasswordField(connection, 'sshKeyfilePassword');
return connection;
}

View File

@@ -37,7 +37,7 @@ const platformInfo = {
environment: process.env.NODE_ENV,
platform,
runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL,
defaultKeyFile: path.join(os.homedir(), '.ssh/id_rsa'),
defaultKeyfile: path.join(os.homedir(), '.ssh/id_rsa'),
};
module.exports = platformInfo;

View File

@@ -16,9 +16,9 @@ const CONNECTION_FIELDS = [
'sshLogin',
'sshPassword',
'sshMode',
'sshKeyFile',
'sshKeyfile',
'sshBastionHost',
'sshKeyFilePassword',
'sshKeyfilePassword',
];
const TUNNEL_FIELDS = [...CONNECTION_FIELDS, 'server', 'port'];
@@ -31,7 +31,7 @@ async function getSshConnection(connection) {
endPort: connection.sshPort || 22,
bastionHost: connection.sshBastionHost || '',
agentForward: connection.sshMode == 'agent',
passphrase: connection.sshMode == 'keyFile' ? connection.sshKeyFilePassword : undefined,
passphrase: connection.sshMode == 'keyFile' ? connection.sshKeyfilePassword : undefined,
username: connection.sshLogin,
password: connection.sshMode == 'userPassword' ? connection.sshPassword : undefined,
agentSocket: connection.sshMode == 'agent' ? platformInfo.sshAuthSock : undefined,