Allow Fingerprint to be defined in SSH Preset. Once defined, Sshwifty will use the fingerprint value to verify the public key fingerprint of the connecting SSH host
This commit is contained in:
@@ -25,7 +25,7 @@ const presetItem = {
|
||||
title: "",
|
||||
type: "",
|
||||
host: "",
|
||||
meta: {}
|
||||
meta: {},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -153,6 +153,25 @@ export class Preset {
|
||||
return this.preset.meta[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the given meta of current preset, and if failed, return the given
|
||||
* default value
|
||||
*
|
||||
* @param {string} name name of the meta data
|
||||
* @param {string} defaultValue default value to be returned when the meta was
|
||||
* not found
|
||||
*
|
||||
* @returns {string}
|
||||
*
|
||||
*/
|
||||
metaDefault(name, defaultValue) {
|
||||
try {
|
||||
return this.meta(name);
|
||||
} catch (e) {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert new meta item
|
||||
*
|
||||
@@ -182,7 +201,7 @@ export function emptyPreset() {
|
||||
title: "Default",
|
||||
type: "Default",
|
||||
host: "",
|
||||
meta: {}
|
||||
meta: {},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user