mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 14:25:13 +03:00
Add version number to CLI save
This PR adds the version number to the CLI filename. It also adds a secondary way to get the data from the FC if it is out of range. If it fails, it appears as the previous save filename looked.
This commit is contained in:
parent
64ccd39264
commit
bd70d431c0
1 changed files with 17 additions and 2 deletions
|
@ -42,13 +42,28 @@ function generateFilename(prefix, suffix) {
|
|||
|
||||
if (CONFIG) {
|
||||
if (CONFIG.flightControllerIdentifier) {
|
||||
filename = CONFIG.flightControllerIdentifier + '_' + filename;
|
||||
}
|
||||
filename = CONFIG.flightControllerIdentifier + '_' + CONFIG.flightControllerVersion + "_" + filename;
|
||||
}
|
||||
if (CONFIG.name && CONFIG.name.trim() !== '') {
|
||||
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_');
|
||||
}
|
||||
} else {
|
||||
// Attempt to get the version number and
|
||||
MSPHelper.getSetting("version").then(function (data) {
|
||||
if (data.value) {
|
||||
let version = data.value.split('/')[0] + "_" + data.value.split(' ')[1];
|
||||
filename = "" + version + "_" + filename;
|
||||
}
|
||||
});
|
||||
|
||||
MSPHelper.getSetting("name").then(function (data) {
|
||||
if (data.value && data.value.trim() !== '') {
|
||||
filename += "_" + data.value.trim().replace(' ', '_');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
filename = filename + '_' + date.getFullYear()
|
||||
+ zeroPad(date.getMonth() + 1, 2)
|
||||
+ zeroPad(date.getDate(), 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue