Spaces:
Build error
Build error
assistants settings buttons (#738)
Browse files
src/routes/settings/assistants/[assistantId]/+page.svelte
CHANGED
@@ -43,13 +43,13 @@
|
|
43 |
</div>
|
44 |
{/if}
|
45 |
|
46 |
-
<div>
|
47 |
<h1 class="text-xl font-semibold">
|
48 |
{assistant?.name}
|
49 |
</h1>
|
50 |
|
51 |
{#if assistant?.description}
|
52 |
-
<p class="
|
53 |
{assistant.description}
|
54 |
</p>
|
55 |
{/if}
|
@@ -57,18 +57,54 @@
|
|
57 |
<p class="text-sm text-gray-500">
|
58 |
Model: <span class="font-semibold"> {assistant?.modelId} </span>
|
59 |
</p>
|
60 |
-
<
|
61 |
-
class="
|
62 |
-
? 'bg-gray-100'
|
63 |
-
: 'bg-black text-white'} my-2 flex w-fit items-center rounded-full px-3 py-1"
|
64 |
-
disabled={isActive}
|
65 |
-
name="Activate model"
|
66 |
-
on:click|stopPropagation={() => {
|
67 |
-
$settings.activeModel = $page.params.assistantId;
|
68 |
-
}}
|
69 |
>
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
</div>
|
73 |
</div>
|
74 |
|
@@ -117,42 +153,7 @@
|
|
117 |
|
118 |
<textarea
|
119 |
disabled
|
120 |
-
class="min-h-[8lh] w-full rounded-lg border-2 border-gray-200 bg-gray-100 p-2 2xl:min-h-[12lh]"
|
121 |
>{assistant?.preprompt}</textarea
|
122 |
>
|
123 |
-
|
124 |
-
<div class="mt-5 flex gap-4">
|
125 |
-
{#if assistant?.createdByMe}
|
126 |
-
<a href="{base}/settings/assistants/{assistant?._id}/edit" class="underline"
|
127 |
-
><CarbonPen class="mr-1.5 inline" />Edit assistant</a
|
128 |
-
>
|
129 |
-
<form method="POST" action="?/delete" use:enhance>
|
130 |
-
<button type="submit" class="flex items-center underline">
|
131 |
-
<CarbonTrash class="mr-1.5 inline" />Delete assistant</button
|
132 |
-
>
|
133 |
-
</form>
|
134 |
-
{:else}
|
135 |
-
<form method="POST" action="?/unsubscribe" use:enhance>
|
136 |
-
<button type="submit" class="underline">
|
137 |
-
<CarbonTrash class="mr-1.5 inline" />Remove assistant</button
|
138 |
-
>
|
139 |
-
</form>
|
140 |
-
<form method="POST" action="?/edit" use:enhance class="hidden">
|
141 |
-
<button type="submit" class="underline">
|
142 |
-
<CarbonCopy class="mr-1.5 inline" />Duplicate assistant</button
|
143 |
-
>
|
144 |
-
</form>
|
145 |
-
{#if !assistant?.reported}
|
146 |
-
<form method="POST" action="?/report" use:enhance>
|
147 |
-
<button type="submit" class="underline">
|
148 |
-
<CarbonFlag class="mr-1.5 inline" />Report assistant</button
|
149 |
-
>
|
150 |
-
</form>
|
151 |
-
{:else}
|
152 |
-
<button type="button" disabled class="text-gray-700">
|
153 |
-
<CarbonFlag class="mr-1.5 inline" />Reported</button
|
154 |
-
>
|
155 |
-
{/if}
|
156 |
-
{/if}
|
157 |
-
</div>
|
158 |
</div>
|
|
|
43 |
</div>
|
44 |
{/if}
|
45 |
|
46 |
+
<div class="flex-1">
|
47 |
<h1 class="text-xl font-semibold">
|
48 |
{assistant?.name}
|
49 |
</h1>
|
50 |
|
51 |
{#if assistant?.description}
|
52 |
+
<p class="mb-1 text-sm text-gray-500">
|
53 |
{assistant.description}
|
54 |
</p>
|
55 |
{/if}
|
|
|
57 |
<p class="text-sm text-gray-500">
|
58 |
Model: <span class="font-semibold"> {assistant?.modelId} </span>
|
59 |
</p>
|
60 |
+
<div
|
61 |
+
class="flex items-center gap-4 whitespace-nowrap text-sm text-gray-500 hover:*:text-gray-800"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
>
|
63 |
+
<button
|
64 |
+
class="{isActive
|
65 |
+
? 'bg-gray-100 text-gray-800'
|
66 |
+
: 'bg-black !text-white'} my-2 flex w-fit items-center rounded-full px-3 py-1 text-base"
|
67 |
+
disabled={isActive}
|
68 |
+
name="Activate model"
|
69 |
+
on:click|stopPropagation={() => {
|
70 |
+
$settings.activeModel = $page.params.assistantId;
|
71 |
+
}}
|
72 |
+
>
|
73 |
+
{isActive ? "Active" : "Activate"}
|
74 |
+
</button>
|
75 |
+
{#if assistant?.createdByMe}
|
76 |
+
<a href="{base}/settings/assistants/{assistant?._id}/edit" class="underline"
|
77 |
+
><CarbonPen class="mr-1.5 inline text-xs" />Edit
|
78 |
+
</a>
|
79 |
+
<form method="POST" action="?/delete" use:enhance>
|
80 |
+
<button type="submit" class="flex items-center underline">
|
81 |
+
<CarbonTrash class="mr-1.5 inline text-xs" />Delete</button
|
82 |
+
>
|
83 |
+
</form>
|
84 |
+
{:else}
|
85 |
+
<form method="POST" action="?/unsubscribe" use:enhance>
|
86 |
+
<button type="submit" class="underline">
|
87 |
+
<CarbonTrash class="mr-1.5 inline text-xs" />Remove</button
|
88 |
+
>
|
89 |
+
</form>
|
90 |
+
<form method="POST" action="?/edit" use:enhance class="hidden">
|
91 |
+
<button type="submit" class="underline">
|
92 |
+
<CarbonCopy class="mr-1.5 inline text-xs" />Duplicate</button
|
93 |
+
>
|
94 |
+
</form>
|
95 |
+
{#if !assistant?.reported}
|
96 |
+
<form method="POST" action="?/report" use:enhance>
|
97 |
+
<button type="submit" class="underline">
|
98 |
+
<CarbonFlag class="mr-1.5 inline text-xs" />Report</button
|
99 |
+
>
|
100 |
+
</form>
|
101 |
+
{:else}
|
102 |
+
<button type="button" disabled class="text-gray-700">
|
103 |
+
<CarbonFlag class="mr-1.5 inline text-xs" />Reported</button
|
104 |
+
>
|
105 |
+
{/if}
|
106 |
+
{/if}
|
107 |
+
</div>
|
108 |
</div>
|
109 |
</div>
|
110 |
|
|
|
153 |
|
154 |
<textarea
|
155 |
disabled
|
156 |
+
class="min-h-[8lh] w-full flex-1 rounded-lg border-2 border-gray-200 bg-gray-100 p-2 text-gray-600 disabled:cursor-not-allowed 2xl:min-h-[12lh]"
|
157 |
>{assistant?.preprompt}</textarea
|
158 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
</div>
|