update fallback

pull/1768/head
gabrielburnworth 2020-04-23 15:58:33 -07:00
parent 4375a935f0
commit b3f93dd678
2 changed files with 10 additions and 2 deletions

View File

@ -263,7 +263,7 @@ export function FbosDetails(props: FbosDetailsProps) {
soc_temp, wifi_level, uptime, memory_usage, disk_usage, throttled,
wifi_level_percent, cpu_usage, private_ip,
} = props.botInfoSettings;
const { last_ota, last_ota_checkup } = props.deviceAccount.body;
const { last_ota, last_ota_checkup, fbos_version } = props.deviceAccount.body;
const infoFwCommit = firmware_version?.includes(".") ? firmware_commit : "---";
const firmwareCommit = firmware_version?.split("-")[1] || infoFwCommit;
@ -273,6 +273,7 @@ export function FbosDetails(props: FbosDetailsProps) {
botToMqttLastSeen={props.botToMqttLastSeen}
timeSettings={props.timeSettings}
device={props.deviceAccount} />
<p><b>{t("Version last seen")}: </b>{fbos_version}</p>
<p><b>{t("Environment")}: </b>{env}</p>
<CommitDisplay title={t("Commit")}
repo={FarmBotRepo.FarmBotOS} commit={commit} />

View File

@ -120,7 +120,7 @@ export function createShouldDisplayFn(
const fallback = globalConfig.FBOS_END_OF_LIFE_VERSION ||
FbosVersionFallback.NULL;
const target = override || current || fallback;
const table = lookupData || {};
const table = lookupData || fallbackData;
const min = table[feature] || MinVersionOverride.NEVER;
switch (semverCompare(target, min)) {
case SemverResult.LEFT_IS_GREATER:
@ -132,6 +132,13 @@ export function createShouldDisplayFn(
};
}
// Temporary hotfix fallback data. Please remove.
const fallbackData: MinOsFeatureLookup = {};
Object.values(Feature).map(feature =>
fallbackData[feature] = globalConfig.FBOS_END_OF_LIFE_VERSION);
fallbackData.criteria_groups = "9.2.2";
fallbackData.boot_sequence = MinVersionOverride.NEVER;
/**
* Compare the current FBOS version in the bot's
* state with the API's fbos_version string and return the greatest version. */