1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00
Setup vue with gulp and initial components:

* Status Bar
* Logo
* Battery Legend
This commit is contained in:
Tomas Chmelevskij 2020-10-10 13:31:07 +02:00
parent 14d98c4dea
commit d6cee386e8
27 changed files with 1511 additions and 283 deletions

View file

@ -188,9 +188,9 @@ function startProcess() {
}
$('.connect_b a.connect').removeClass('disabled');
$('#logo .version, #tab_logoversion .version').text(CONFIGURATOR.version);
updateStatusBarVersion();
updateTopBarVersion();
// with Vue reactive system we don't need to call these,
// our view is reactive to model changes
// updateTopBarVersion();
if (!GUI.isOther() && GUI.operating_system !== 'ChromeOS') {
checkForConfiguratorUpdates();
@ -580,10 +580,6 @@ function notifyOutdatedVersion(releaseData) {
});
}
function update_packet_error(caller) {
$('span.packet-error').html(caller.packet_error);
}
function microtime() {
return new Date().getTime() / 1000;
}
@ -704,62 +700,6 @@ function generateFilename(prefix, suffix) {
return `${filename}.${suffix}`;
}
function getTargetVersion(hardwareId) {
let versionText = '';
if (hardwareId) {
versionText = `${i18n.getMessage('versionLabelTarget')}: ${hardwareId}`;
}
return versionText;
}
function getFirmwareVersion(firmwareVersion, firmwareId) {
let versionText = '';
if (firmwareVersion) {
versionText = `${i18n.getMessage('versionLabelFirmware')}: ${firmwareId} ${firmwareVersion}`;
}
return versionText;
}
function getConfiguratorVersion() {
return `${i18n.getMessage('versionLabelConfigurator')}: ${CONFIGURATOR.version}`;
}
function updateTopBarVersion(firmwareVersion, firmwareId, hardwareId) {
const configuratorVersion = getConfiguratorVersion();
const firmwareVersionAndId = getFirmwareVersion(firmwareVersion, firmwareId);
const targetVersion = getTargetVersion(hardwareId);
const versionText = `${configuratorVersion}<br />${firmwareVersionAndId}<br />${targetVersion}`;
$('#logo .logo_text, #tab_logoversion .version').html(versionText);
}
function updateStatusBarVersion(firmwareVersion, firmwareId, hardwareId) {
let versionText = '';
versionText = versionText + getFirmwareVersion(firmwareVersion, firmwareId);
if (versionText !== '') {
versionText = `${versionText}, `;
}
const targetVersion = getTargetVersion(hardwareId);
versionText = versionText + targetVersion;
if (targetVersion !== '') {
versionText = `${versionText}, `;
}
versionText = `${versionText}${getConfiguratorVersion()} (${CONFIGURATOR.gitChangesetId})`;
$('#status-bar .version').text(versionText);
}
function showErrorDialog(message) {
const dialog = $('.dialogError')[0];