Spaces:
Sleeping
Sleeping
update
Browse files- src/lib/components/ConfirmModal.svelte +28 -0
- src/lib/components/chat/ChatIntroduction.svelte +12 -0
- src/lib/components/icons/Logo.svelte +5 -12
- src/routes/+layout.svelte +8 -6
- src/routes/conversation/[id]/+page.svelte +3 -4
- static/chatui/chat.png +0 -0
- static/chatui/chat.svg +7 -0
- static/chatui/favicon.png +0 -0
- static/chatui/thumbnail.jpg +0 -0
- static/chatui/touch-icon-ipad-retina.png +0 -0
- static/chatui/touch-icon-ipad.png +0 -0
- static/chatui/touch-icon-iphone-retina.png +0 -0
src/lib/components/ConfirmModal.svelte
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import Modal from "$lib/components/Modal.svelte";
|
| 3 |
+
import { createEventDispatcher } from "svelte";
|
| 4 |
+
import CarbonClose from "~icons/carbon/close";
|
| 5 |
+
|
| 6 |
+
const dispatch = createEventDispatcher<{ close: void }>();
|
| 7 |
+
</script>
|
| 8 |
+
|
| 9 |
+
<Modal>
|
| 10 |
+
<div class="flex w-full flex-col gap-0 p-2">
|
| 11 |
+
<div class="flex items-start text-xl font-bold text-gray-800 m-2">
|
| 12 |
+
<h1>You are about to download an AI model on your device</h1>
|
| 13 |
+
<br />
|
| 14 |
+
<button type="button" class="group" on:click={() => dispatch("close")}>
|
| 15 |
+
<CarbonClose class="text-gray-900 group-hover:text-gray-500" />
|
| 16 |
+
</button>
|
| 17 |
+
</div>
|
| 18 |
+
<div class="flex items-start text-m text-gray-800 m-2">
|
| 19 |
+
<br>To ensure your conversations with our AI remain private, our web application sends a model to your device to perform inference locally. No data leaves your device.<br />
|
| 20 |
+
<br>This might be demanding in terms of bandwidth, storage and computing power on your side.<br />
|
| 21 |
+
<br />
|
| 22 |
+
</div>
|
| 23 |
+
<div class="flex items-start text-m text-gray-800 m-2">
|
| 24 |
+
<br><b>Mobile usage is not advised.</b><br />
|
| 25 |
+
</div>
|
| 26 |
+
<br />
|
| 27 |
+
</div>
|
| 28 |
+
</Modal>
|
src/lib/components/chat/ChatIntroduction.svelte
CHANGED
|
@@ -27,6 +27,8 @@
|
|
| 27 |
|
| 28 |
const dispatch = createEventDispatcher<{ message: string }>();
|
| 29 |
|
|
|
|
|
|
|
| 30 |
$: title = env.PUBLIC_APP_NAME
|
| 31 |
</script>
|
| 32 |
|
|
@@ -48,6 +50,16 @@
|
|
| 48 |
</div>
|
| 49 |
</div>
|
| 50 |
<div class="lg:col-span-2 lg:pl-24">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
{#if isModelsModalOpen}
|
| 52 |
<ModelsModal {settings} {models} on:close={() => (isModelsModalOpen = false)} />
|
| 53 |
{/if}
|
|
|
|
| 27 |
|
| 28 |
const dispatch = createEventDispatcher<{ message: string }>();
|
| 29 |
|
| 30 |
+
console.log(PUBLIC_ANNOUNCEMENT_BANNERS)
|
| 31 |
+
|
| 32 |
$: title = env.PUBLIC_APP_NAME
|
| 33 |
</script>
|
| 34 |
|
|
|
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
<div class="lg:col-span-2 lg:pl-24">
|
| 53 |
+
{#each announcementBanners as banner}
|
| 54 |
+
<AnnouncementBanner classNames="mb-4" title={banner.title}>
|
| 55 |
+
<a
|
| 56 |
+
target="_blank"
|
| 57 |
+
href={banner.linkHref}
|
| 58 |
+
class="mr-2 flex items-center underline hover:no-underline"
|
| 59 |
+
><CarbonArrowUpRight class="mr-1.5 text-xs" /> {banner.linkTitle}</a
|
| 60 |
+
>
|
| 61 |
+
</AnnouncementBanner>
|
| 62 |
+
{/each}
|
| 63 |
{#if isModelsModalOpen}
|
| 64 |
<ModelsModal {settings} {models} on:close={() => (isModelsModalOpen = false)} />
|
| 65 |
{/if}
|
src/lib/components/icons/Logo.svelte
CHANGED
|
@@ -7,22 +7,15 @@
|
|
| 7 |
</script>
|
| 8 |
|
| 9 |
{#if PUBLIC_APP_ASSETS === "chatui"}
|
| 10 |
-
<
|
| 11 |
-
height="30"
|
| 12 |
-
width="30"
|
| 13 |
-
viewBox="0 0 30 30"
|
| 14 |
-
xmlns="http://www.w3.org/2000/svg"
|
| 15 |
class={classNames}
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
class="fill-primary-500"
|
| 20 |
-
/>
|
| 21 |
-
</svg>
|
| 22 |
{:else}
|
| 23 |
<object
|
| 24 |
class={classNames}
|
| 25 |
-
data="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/favicon.
|
| 26 |
title="{PUBLIC_APP_NAME} logo"
|
| 27 |
/>
|
| 28 |
{/if}
|
|
|
|
| 7 |
</script>
|
| 8 |
|
| 9 |
{#if PUBLIC_APP_ASSETS === "chatui"}
|
| 10 |
+
<object
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
class={classNames}
|
| 12 |
+
data="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/chat.png"
|
| 13 |
+
title="{PUBLIC_APP_NAME} logo"
|
| 14 |
+
/>
|
|
|
|
|
|
|
|
|
|
| 15 |
{:else}
|
| 16 |
<object
|
| 17 |
class={classNames}
|
| 18 |
+
data="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/favicon.png"
|
| 19 |
title="{PUBLIC_APP_NAME} logo"
|
| 20 |
/>
|
| 21 |
{/if}
|
src/routes/+layout.svelte
CHANGED
|
@@ -14,6 +14,7 @@
|
|
| 14 |
import MobileNav from "$lib/components/MobileNav.svelte";
|
| 15 |
import NavMenu from "$lib/components/NavMenu.svelte";
|
| 16 |
import Toast from "$lib/components/Toast.svelte";
|
|
|
|
| 17 |
import SettingsModal from "$lib/components/SettingsModal.svelte";
|
| 18 |
import LoadingModal from "$lib/components/LoadingModal.svelte";
|
| 19 |
import LoginModal from "$lib/components/LoginModal.svelte";
|
|
@@ -24,6 +25,7 @@
|
|
| 24 |
|
| 25 |
export let data;
|
| 26 |
let isloading = false;
|
|
|
|
| 27 |
|
| 28 |
let go_to_main = false;
|
| 29 |
|
|
@@ -128,12 +130,7 @@
|
|
| 128 |
<meta property="og:url" content="{PUBLIC_ORIGIN || $page.url.origin}{base}" />
|
| 129 |
<meta
|
| 130 |
property="og:image"
|
| 131 |
-
content="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/thumbnail.
|
| 132 |
-
/>
|
| 133 |
-
<link
|
| 134 |
-
rel="icon"
|
| 135 |
-
href="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/favicon.svg"
|
| 136 |
-
type="image/svg+xml"
|
| 137 |
/>
|
| 138 |
<link
|
| 139 |
rel="icon"
|
|
@@ -196,6 +193,11 @@
|
|
| 196 |
{#if currentError}
|
| 197 |
<Toast message={currentError} />
|
| 198 |
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
{#if isloading}
|
| 200 |
<LoadingModal />
|
| 201 |
{/if}
|
|
|
|
| 14 |
import MobileNav from "$lib/components/MobileNav.svelte";
|
| 15 |
import NavMenu from "$lib/components/NavMenu.svelte";
|
| 16 |
import Toast from "$lib/components/Toast.svelte";
|
| 17 |
+
import ConfirmModal from "$lib/components/ConfirmModal.svelte";
|
| 18 |
import SettingsModal from "$lib/components/SettingsModal.svelte";
|
| 19 |
import LoadingModal from "$lib/components/LoadingModal.svelte";
|
| 20 |
import LoginModal from "$lib/components/LoginModal.svelte";
|
|
|
|
| 25 |
|
| 26 |
export let data;
|
| 27 |
let isloading = false;
|
| 28 |
+
let showWarning = true;
|
| 29 |
|
| 30 |
let go_to_main = false;
|
| 31 |
|
|
|
|
| 130 |
<meta property="og:url" content="{PUBLIC_ORIGIN || $page.url.origin}{base}" />
|
| 131 |
<meta
|
| 132 |
property="og:image"
|
| 133 |
+
content="{PUBLIC_ORIGIN || $page.url.origin}{base}/{PUBLIC_APP_ASSETS}/thumbnail.jpg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
/>
|
| 135 |
<link
|
| 136 |
rel="icon"
|
|
|
|
| 193 |
{#if currentError}
|
| 194 |
<Toast message={currentError} />
|
| 195 |
{/if}
|
| 196 |
+
{#if showWarning}
|
| 197 |
+
<ConfirmModal
|
| 198 |
+
on:close={() => (showWarning = false)}
|
| 199 |
+
/>
|
| 200 |
+
{/if}
|
| 201 |
{#if isloading}
|
| 202 |
<LoadingModal />
|
| 203 |
{/if}
|
src/routes/conversation/[id]/+page.svelte
CHANGED
|
@@ -29,7 +29,7 @@
|
|
| 29 |
|
| 30 |
let id = ""
|
| 31 |
|
| 32 |
-
let title_ret =
|
| 33 |
|
| 34 |
let messages = [];
|
| 35 |
let lastLoadedMessages = [];
|
|
@@ -212,7 +212,6 @@
|
|
| 212 |
}
|
| 213 |
|
| 214 |
await getTextGenerationStream(message, messageId, isRetry, searchResponseId ?? undefined);
|
| 215 |
-
title_ret = await getTitle($page.params.id)
|
| 216 |
} catch (err) {
|
| 217 |
if (err instanceof Error && err.message.includes("overloaded")) {
|
| 218 |
$error = "Too much traffic, please try again.";
|
|
@@ -259,7 +258,7 @@
|
|
| 259 |
params_writable.subscribe(async (value) => {
|
| 260 |
if (value != id) {
|
| 261 |
id = value
|
| 262 |
-
title_ret = await getTitle(value)
|
| 263 |
let res = await getMessages(value)
|
| 264 |
|
| 265 |
if (res != undefined) {
|
|
@@ -273,7 +272,7 @@
|
|
| 273 |
const Worker = await import("./worker.js?worker");
|
| 274 |
pipelineWorker = new Worker.default();
|
| 275 |
|
| 276 |
-
title_ret = await getTitle($page.params.id)
|
| 277 |
let res = await getMessages($page.params.id)
|
| 278 |
|
| 279 |
id = $page.params.id
|
|
|
|
| 29 |
|
| 30 |
let id = ""
|
| 31 |
|
| 32 |
+
let title_ret = "BlindChat"
|
| 33 |
|
| 34 |
let messages = [];
|
| 35 |
let lastLoadedMessages = [];
|
|
|
|
| 212 |
}
|
| 213 |
|
| 214 |
await getTextGenerationStream(message, messageId, isRetry, searchResponseId ?? undefined);
|
|
|
|
| 215 |
} catch (err) {
|
| 216 |
if (err instanceof Error && err.message.includes("overloaded")) {
|
| 217 |
$error = "Too much traffic, please try again.";
|
|
|
|
| 258 |
params_writable.subscribe(async (value) => {
|
| 259 |
if (value != id) {
|
| 260 |
id = value
|
| 261 |
+
//title_ret = await getTitle(value)
|
| 262 |
let res = await getMessages(value)
|
| 263 |
|
| 264 |
if (res != undefined) {
|
|
|
|
| 272 |
const Worker = await import("./worker.js?worker");
|
| 273 |
pipelineWorker = new Worker.default();
|
| 274 |
|
| 275 |
+
//title_ret = await getTitle($page.params.id)
|
| 276 |
let res = await getMessages($page.params.id)
|
| 277 |
|
| 278 |
id = $page.params.id
|
static/chatui/chat.png
ADDED
|
static/chatui/chat.svg
ADDED
|
|
static/chatui/favicon.png
CHANGED
|
|
|
|
static/chatui/thumbnail.jpg
ADDED
|
|
static/chatui/touch-icon-ipad-retina.png
CHANGED
|
|
|
|
static/chatui/touch-icon-ipad.png
CHANGED
|
|
|
|
static/chatui/touch-icon-iphone-retina.png
CHANGED
|
|
|
|