Browse Source

fix: avoid 'checking for updates...' always present in offline-mode

guenhter 3 months ago
parent
commit
661ea773f4

+ 3 - 4
src/app.html

@@ -33,7 +33,6 @@
 		</script>
 
 		<script>
-
 			// On page load or when changing themes, best to add inline in `head` to avoid FOUC
 			(() => {
 				const metaThemeColorTag = document.querySelector('meta[name="theme-color"]');
@@ -82,10 +81,11 @@
 
 				const logo = document.createElement('img');
 				logo.id = 'logo';
-				logo.style = "position: absolute; width: auto; height: 6rem; top: 44%; left: 50%; transform: translateX(-50%); display:block;";
+				logo.style =
+					'position: absolute; width: auto; height: 6rem; top: 44%; left: 50%; transform: translateX(-50%); display:block;';
 				logo.src = isDarkMode ? '/static/splash-dark.png' : '/static/splash.png';
 
-				document.addEventListener('DOMContentLoaded', function() {
+				document.addEventListener('DOMContentLoaded', function () {
 					const splash = document.getElementById('splash-screen');
 					if (splash) splash.prepend(logo);
 				});
@@ -110,7 +110,6 @@
 				}
 			</style>
 
-
 			<div
 				style="
 					position: absolute;

+ 12 - 10
src/lib/components/admin/Settings/General.svelte

@@ -139,16 +139,18 @@
 										v{WEBUI_VERSION}
 									</Tooltip>
 
-									<a
-										href="https://github.com/open-webui/open-webui/releases/tag/v{version.latest}"
-										target="_blank"
-									>
-										{updateAvailable === null
-											? $i18n.t('Checking for updates...')
-											: updateAvailable
-												? `(v${version.latest} ${$i18n.t('available!')})`
-												: $i18n.t('(latest)')}
-									</a>
+									{#if $config?.features?.enable_version_update_check}
+										<a
+											href="https://github.com/open-webui/open-webui/releases/tag/v{version.latest}"
+											target="_blank"
+										>
+											{updateAvailable === null
+												? $i18n.t('Checking for updates...')
+												: updateAvailable
+													? `(v${version.latest} ${$i18n.t('available!')})`
+													: $i18n.t('(latest)')}
+										</a>
+									{/if}
 								</div>
 
 								<button

+ 3 - 1
src/lib/components/chat/Placeholder.svelte

@@ -119,7 +119,9 @@
 							>
 								<button
 									aria-hidden={models.length <= 1}
-									aria-label={$i18n.t('Get information on {{name}} in the UI', { name: models[modelIdx]?.name})}
+									aria-label={$i18n.t('Get information on {{name}} in the UI', {
+										name: models[modelIdx]?.name
+									})}
 									on:click={() => {
 										selectedModelIdx = modelIdx;
 									}}

+ 12 - 10
src/lib/components/chat/Settings/About.svelte

@@ -60,16 +60,18 @@
 							v{WEBUI_VERSION}
 						</Tooltip>
 
-						<a
-							href="https://github.com/open-webui/open-webui/releases/tag/v{version.latest}"
-							target="_blank"
-						>
-							{updateAvailable === null
-								? $i18n.t('Checking for updates...')
-								: updateAvailable
-									? `(v${version.latest} ${$i18n.t('available!')})`
-									: $i18n.t('(latest)')}
-						</a>
+						{#if $config?.features?.enable_version_update_check}
+							<a
+								href="https://github.com/open-webui/open-webui/releases/tag/v{version.latest}"
+								target="_blank"
+							>
+								{updateAvailable === null
+									? $i18n.t('Checking for updates...')
+									: updateAvailable
+										? `(v${version.latest} ${$i18n.t('available!')})`
+										: $i18n.t('(latest)')}
+							</a>
+						{/if}
 					</div>
 
 					<button