mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
refac
This commit is contained in:
@@ -335,6 +335,7 @@
|
||||
<!-- Delete -->
|
||||
<div class="pt-1.5">
|
||||
<button
|
||||
aria-label={$i18n.t('Delete')}
|
||||
class="invisible group-hover:visible p-1 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition rounded-lg"
|
||||
on:click={() => deleteIndices(di.indices)}
|
||||
>
|
||||
|
||||
@@ -218,6 +218,7 @@
|
||||
</div>
|
||||
<div class=" absolute -top-1 -right-1">
|
||||
<button
|
||||
aria-label={$i18n.t('Remove file')}
|
||||
class=" bg-white text-black border border-white rounded-full {($settings?.highContrastMode ??
|
||||
false)
|
||||
? ''
|
||||
@@ -432,6 +433,7 @@
|
||||
{#if siblings.length > 1}
|
||||
<div class="flex self-center" dir="ltr">
|
||||
<button
|
||||
aria-label={$i18n.t('Previous message')}
|
||||
class="self-center p-1 hover:bg-black/5 dark:hover:bg-white/5 dark:hover:text-white hover:text-black rounded-md transition"
|
||||
on:click={() => {
|
||||
showPreviousMessage(message);
|
||||
@@ -499,6 +501,7 @@
|
||||
{/if}
|
||||
|
||||
<button
|
||||
aria-label={$i18n.t('Next message')}
|
||||
class="self-center p-1 hover:bg-black/5 dark:hover:bg-white/5 dark:hover:text-white hover:text-black rounded-md transition"
|
||||
on:click={() => {
|
||||
showNextMessage(message);
|
||||
@@ -528,6 +531,7 @@
|
||||
class="{($settings?.highContrastMode ?? false)
|
||||
? ''
|
||||
: 'invisible group-hover:visible'} p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg dark:hover:text-white hover:text-black transition edit-user-message-button"
|
||||
aria-label={$i18n.t('Edit')}
|
||||
on:click={() => {
|
||||
editMessageHandler();
|
||||
}}
|
||||
@@ -556,6 +560,7 @@
|
||||
class="{($settings?.highContrastMode ?? false)
|
||||
? ''
|
||||
: 'invisible group-hover:visible'} p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg dark:hover:text-white hover:text-black transition"
|
||||
aria-label={$i18n.t('Copy')}
|
||||
on:click={() => {
|
||||
copyToClipboard(message.content);
|
||||
}}
|
||||
@@ -582,6 +587,7 @@
|
||||
{#if !compactPreview && !readOnly && allowDelete && (!isFirstMessage || siblings.length > 1)}
|
||||
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
||||
<button
|
||||
aria-label={$i18n.t('Delete')}
|
||||
class="{($settings?.highContrastMode ?? false)
|
||||
? ''
|
||||
: 'invisible group-hover:visible'} p-1 rounded-sm dark:hover:text-white hover:text-black transition"
|
||||
@@ -616,6 +622,7 @@
|
||||
{#if siblings.length > 1}
|
||||
<div class="flex self-center" dir="ltr">
|
||||
<button
|
||||
aria-label={$i18n.t('Previous message')}
|
||||
class="self-center p-1 hover:bg-black/5 dark:hover:bg-white/5 dark:hover:text-white hover:text-black rounded-md transition"
|
||||
on:click={() => {
|
||||
showPreviousMessage(message);
|
||||
@@ -683,6 +690,7 @@
|
||||
{/if}
|
||||
|
||||
<button
|
||||
aria-label={$i18n.t('Next message')}
|
||||
class="self-center p-1 hover:bg-black/5 dark:hover:bg-white/5 dark:hover:text-white hover:text-black rounded-md transition"
|
||||
on:click={() => {
|
||||
showNextMessage(message);
|
||||
|
||||
@@ -595,6 +595,7 @@
|
||||
{#if pptxSlides.length > 1}
|
||||
<div class="flex items-center justify-center gap-3 pb-3 text-sm text-gray-500">
|
||||
<button
|
||||
aria-label={$i18n.t('Previous slide')}
|
||||
class="p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-30"
|
||||
disabled={pptxCurrentSlide === 0}
|
||||
on:click={() => (pptxCurrentSlide = Math.max(0, pptxCurrentSlide - 1))}
|
||||
@@ -614,6 +615,7 @@
|
||||
</button>
|
||||
<span>{pptxCurrentSlide + 1} / {pptxSlides.length}</span>
|
||||
<button
|
||||
aria-label={$i18n.t('Next slide')}
|
||||
class="p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-30"
|
||||
disabled={pptxCurrentSlide === pptxSlides.length - 1}
|
||||
on:click={() =>
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
|
||||
<div>
|
||||
<button
|
||||
aria-label={$i18n.t('Download')}
|
||||
class=" p-5 z-999"
|
||||
on:click={() => {
|
||||
if (src.startsWith('data:image/')) {
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<button
|
||||
aria-label={$i18n.t('Close')}
|
||||
class="self-center rounded-lg p-1 text-gray-500 transition hover:bg-gray-50 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
@@ -312,6 +313,7 @@
|
||||
{#if unarchiveHandler}
|
||||
<Tooltip content={$i18n.t('Unarchive Chat')}>
|
||||
<button
|
||||
aria-label={$i18n.t('Unarchive Chat')}
|
||||
class="self-center w-fit px-1 text-sm rounded-xl"
|
||||
on:click={async (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<button
|
||||
aria-label={$i18n.t('Close')}
|
||||
class="self-center rounded-lg p-1 text-gray-500 transition hover:bg-gray-50 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
|
||||
@@ -730,6 +730,7 @@
|
||||
<!-- Shortcut support using "delete-chat-button" id -->
|
||||
<button
|
||||
id="delete-chat-button"
|
||||
aria-label={$i18n.t('Delete')}
|
||||
class="hidden"
|
||||
on:click={() => {
|
||||
showDeleteConfirm = true;
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
<div class=" pt-1">
|
||||
<button
|
||||
class=" group-hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-300 transition"
|
||||
aria-label={$i18n.t('Delete')}
|
||||
on:click={() => {
|
||||
onDelete();
|
||||
}}
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
<button
|
||||
class=" bg-white text-black border border-white rounded-full group-hover:visible invisible transition"
|
||||
type="button"
|
||||
aria-label={$i18n.t('Remove image')}
|
||||
on:click={() => removeImage(index)}
|
||||
>
|
||||
<svg
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<Tooltip content={$i18n.t('Add Content')}>
|
||||
<button
|
||||
class="p-1.5 rounded-xl bg-transparent transition text-xs flex items-center space-x-1 hover:text-gray-900 dark:hover:text-gray-100"
|
||||
aria-label={$i18n.t('Add Content')}
|
||||
on:click={(e) => {
|
||||
e.stopPropagation();
|
||||
show = true;
|
||||
|
||||
Reference in New Issue
Block a user