About.svelte 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <script lang="ts">
  2. import { getVersionUpdates } from '$lib/apis';
  3. import { getOllamaVersion } from '$lib/apis/ollama';
  4. import { WEBUI_BUILD_HASH, WEBUI_VERSION } from '$lib/constants';
  5. import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
  6. import { compareVersion } from '$lib/utils';
  7. import { onMount, getContext } from 'svelte';
  8. import Tooltip from '$lib/components/common/Tooltip.svelte';
  9. const i18n = getContext('i18n');
  10. let ollamaVersion = '';
  11. let updateAvailable = null;
  12. let version = {
  13. current: '',
  14. latest: ''
  15. };
  16. const checkForVersionUpdates = async () => {
  17. updateAvailable = null;
  18. version = await getVersionUpdates(localStorage.token).catch((error) => {
  19. return {
  20. current: WEBUI_VERSION,
  21. latest: WEBUI_VERSION
  22. };
  23. });
  24. console.log(version);
  25. updateAvailable = compareVersion(version.latest, version.current);
  26. console.log(updateAvailable);
  27. };
  28. onMount(async () => {
  29. ollamaVersion = await getOllamaVersion(localStorage.token).catch((error) => {
  30. return '';
  31. });
  32. checkForVersionUpdates();
  33. });
  34. </script>
  35. <div class="flex flex-col h-full justify-between space-y-3 text-sm mb-6">
  36. <div class=" space-y-3 overflow-y-scroll max-h-[28rem] lg:max-h-full">
  37. <div>
  38. <div class=" mb-2.5 text-sm font-medium flex space-x-2 items-center">
  39. <div>
  40. {$WEBUI_NAME}
  41. {$i18n.t('Version')}
  42. </div>
  43. </div>
  44. <div class="flex w-full justify-between items-center">
  45. <div class="flex flex-col text-xs text-gray-700 dark:text-gray-200">
  46. <div class="flex gap-1">
  47. <Tooltip content={WEBUI_BUILD_HASH}>
  48. v{WEBUI_VERSION}
  49. </Tooltip>
  50. <a
  51. href="https://github.com/open-webui/open-webui/releases/tag/v{version.latest}"
  52. target="_blank"
  53. >
  54. {updateAvailable === null
  55. ? $i18n.t('Checking for updates...')
  56. : updateAvailable
  57. ? `(v${version.latest} ${$i18n.t('available!')})`
  58. : $i18n.t('(latest)')}
  59. </a>
  60. </div>
  61. <button
  62. class=" underline flex items-center space-x-1 text-xs text-gray-500 dark:text-gray-500"
  63. on:click={() => {
  64. showChangelog.set(true);
  65. }}
  66. >
  67. <div>{$i18n.t("See what's new")}</div>
  68. </button>
  69. </div>
  70. <button
  71. class=" text-xs px-3 py-1.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-lg font-medium"
  72. on:click={() => {
  73. checkForVersionUpdates();
  74. }}
  75. >
  76. {$i18n.t('Check for updates')}
  77. </button>
  78. </div>
  79. </div>
  80. {#if ollamaVersion}
  81. <hr class=" border-gray-100 dark:border-gray-850" />
  82. <div>
  83. <div class=" mb-2.5 text-sm font-medium">{$i18n.t('Ollama Version')}</div>
  84. <div class="flex w-full">
  85. <div class="flex-1 text-xs text-gray-700 dark:text-gray-200">
  86. {ollamaVersion ?? 'N/A'}
  87. </div>
  88. </div>
  89. </div>
  90. {/if}
  91. <hr class=" border-gray-100 dark:border-gray-850" />
  92. {#if $config?.license_metadata}
  93. <div class="mb-2 text-xs">
  94. {#if !$WEBUI_NAME.includes('Open WebUI')}
  95. <span class=" text-gray-500 dark:text-gray-300 font-medium">{$WEBUI_NAME}</span> -
  96. {/if}
  97. <span class=" capitalize">{$config?.license_metadata?.type}</span> license purchased by
  98. <span class=" capitalize">{$config?.license_metadata?.organization_name}</span>
  99. </div>
  100. {:else}
  101. <div class="flex space-x-1">
  102. <a href="https://discord.gg/5rJgQTnV4s" target="_blank">
  103. <img
  104. alt="Discord"
  105. src="https://img.shields.io/badge/Discord-Open_WebUI-blue?logo=discord&logoColor=white"
  106. />
  107. </a>
  108. <a href="https://twitter.com/OpenWebUI" target="_blank">
  109. <img
  110. alt="X (formerly Twitter) Follow"
  111. src="https://img.shields.io/twitter/follow/OpenWebUI"
  112. />
  113. </a>
  114. <a href="https://github.com/open-webui/open-webui" target="_blank">
  115. <img
  116. alt="Github Repo"
  117. src="https://img.shields.io/github/stars/open-webui/open-webui?style=social&label=Star us on Github"
  118. />
  119. </a>
  120. </div>
  121. {/if}
  122. <div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
  123. Emoji graphics provided by
  124. <a href="https://github.com/jdecked/twemoji" target="_blank">Twemoji</a>, licensed under
  125. <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">CC-BY 4.0</a>.
  126. </div>
  127. <div>
  128. <pre
  129. class="text-xs text-gray-400 dark:text-gray-500">Copyright (c) {new Date().getFullYear()} <a
  130. href="https://openwebui.com"
  131. target="_blank"
  132. class="underline">Open WebUI (Timothy Jaeryang Baek)</a
  133. >
  134. All rights reserved.
  135. Redistribution and use in source and binary forms, with or without
  136. modification, are permitted provided that the following conditions are met:
  137. 1. Redistributions of source code must retain the above copyright notice, this
  138. list of conditions and the following disclaimer.
  139. 2. Redistributions in binary form must reproduce the above copyright notice,
  140. this list of conditions and the following disclaimer in the documentation
  141. and/or other materials provided with the distribution.
  142. 3. Neither the name of the copyright holder nor the names of its
  143. contributors may be used to endorse or promote products derived from
  144. this software without specific prior written permission.
  145. 4. Notwithstanding any other provision of this License, and as a material condition of the rights granted herein, licensees are strictly prohibited from altering, removing, obscuring, or replacing any "Open WebUI" branding, including but not limited to the name, logo, or any visual, textual, or symbolic identifiers that distinguish the software and its interfaces, in any deployment or distribution, regardless of the number of users, except as explicitly set forth in Clauses 5 and 6 below.
  146. 5. The branding restriction enumerated in Clause 4 shall not apply in the following limited circumstances: (i) deployments or distributions where the total number of end users (defined as individual natural persons with direct access to the application) does not exceed fifty (50) within any rolling thirty (30) day period; (ii) cases in which the licensee is an official contributor to the codebase—with a substantive code change successfully merged into the main branch of the official codebase maintained by the copyright holder—who has obtained specific prior written permission for branding adjustment from the copyright holder; or (iii) where the licensee has obtained a duly executed enterprise license expressly permitting such modification. For all other cases, any removal or alteration of the "Open WebUI" branding shall constitute a material breach of license.
  147. 6. All code, modifications, or derivative works incorporated into this project prior to the incorporation of this branding clause remain licensed under the BSD 3-Clause License, and prior contributors retain all BSD-3 rights therein; if any such contributor requests the removal of their BSD-3-licensed code, the copyright holder will do so, and any replacement code will be licensed under the project's primary license then in effect. By contributing after this clause's adoption, you agree to the project's Contributor License Agreement (CLA) and to these updated terms for all new contributions.
  148. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  149. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  150. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  151. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  152. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  153. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  154. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  155. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  156. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  157. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  158. </pre>
  159. </div>
  160. <div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
  161. {$i18n.t('Created by')}
  162. <a
  163. class=" text-gray-500 dark:text-gray-300 font-medium"
  164. href="https://github.com/tjbck"
  165. target="_blank">Timothy J. Baek</a
  166. >
  167. </div>
  168. </div>
  169. </div>