📡 Upgrade -> Show message
Some checks are pending
docker / docker_dev (push) Waiting to run

This commit is contained in:
jokob-sk
2024-09-02 15:53:15 +10:00
parent 9bd5ff10b4
commit 605a33330b
2 changed files with 8 additions and 5 deletions

View File

@@ -654,8 +654,8 @@
"UI_PRESENCE_name": "Show in presence chart",
"UI_REFRESH_description": "Enter number of seconds after which the UI reloads. Set to <code>0</code> to disable.",
"UI_REFRESH_name": "Auto-refresh UI",
"VERSION_description": "Version timestamp helper value to check if app was upgarded.",
"VERSION_name": "Version timestamp",
"VERSION_description": "Version or timestamp helper value to check if app was upgraded.",
"VERSION_name": "Version or timestamp",
"devices_old": "Refreshing...",
"general_event_description": "The event you have triggered might take a while until background processes finish. The execution ended once the below execution queue empties (Check the <a href='/maintenance.php#tab_Logging'>error log</a> if you encounter issues). <br/> <br/> Execution queue:",
"general_event_title": "Executing an ad-hoc event",

View File

@@ -298,14 +298,17 @@ def importConfigs (db, all_plugins):
# -----------------
# Plugins END
# manage upgrade
# Check if app was upgraded
with open(applicationPath + '/front/buildtimestamp.txt', 'r') as f:
buildTimestamp = int(f.read().strip())
if conf.VERSION != buildTimestamp:
if str(conf.VERSION) != str(buildTimestamp):
mylog('none', ['[Config] App upgraded 🎉'])
conf.VERSION = ccd('VERSION', buildTimestamp , c_d, 'Version', '{"dataType":"string", "elements": [{"elementType" : "input", "elementOptions" : [{ "readonly": "true" }] ,"transformers": []}]}', '', 'General')
write_notification(f'[Upgrade] : App upgarded, please clear cache.', 'interrupt', timeNowTZ())
write_notification(f'[Upgrade] : App upgraded 🎉. Please clear app cache with the 🔄 button in the header and clear the browser cache (shift + browser refresh button).', 'interrupt', timeNowTZ())
# Insert settings into the DB