Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions components/UI/RemoveProviderConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
class="relative"
>
<!-- Trigger -->
<button
<UITooltip
v-if="asIcon"
type="button"
title="Remove provider"
class="inline-flex items-center justify-center rounded-md p-1.5 text-gray-500 transition hover:bg-gray-100 hover:text-red-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-600 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-red-400"
@click="open = !open"
text="Remove provider"
>
<TrashIcon class="h-4 w-4" />
</button>
<button
type="button"
aria-label="Remove provider"
class="inline-flex items-center justify-center rounded-md p-1.5 text-gray-500 transition hover:bg-gray-100 hover:text-red-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-600 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-red-400"
@click="open = !open"
>
<TrashIcon class="h-4 w-4" />
</button>
</UITooltip>
<button
v-else
type="button"
Expand Down
24 changes: 24 additions & 0 deletions components/UI/Tooltip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<UTooltip
v-bind="$attrs"
@focusin="onFocusin"
@focusout="onFocusout"
>
<slot />
<template
v-if="$slots.text"
#text
>
<slot name="text" />
</template>
</UTooltip>
</template>

<script setup lang="ts">
defineOptions({ name: "UITooltip", inheritAttrs: false });

const onFocusin = (e: FocusEvent) =>
(e.currentTarget as HTMLElement).dispatchEvent(new MouseEvent("mouseenter"));
const onFocusout = (e: FocusEvent) =>
(e.currentTarget as HTMLElement).dispatchEvent(new MouseEvent("mouseleave"));
</script>
54 changes: 34 additions & 20 deletions components/auth/OAuthProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,19 @@
type="text"
class="flex-1"
/>
<button
type="button"
class="shrink-0 rounded border border-gray-300 px-2 py-1 text-xs text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800"
title="Fill with this server's callback URL"
@click="provider.callback = callbackUrl()"
>
<UIcon
name="i-heroicons-arrow-path"
class="h-3 w-3"
/>
Fill
</button>
<UITooltip text="Fill with this server's callback URL">
<button
type="button"
class="shrink-0 rounded border border-gray-300 px-2 py-1 text-xs text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800"
@click="provider.callback = callbackUrl()"
>
<UIcon
name="i-heroicons-arrow-path"
class="h-3 w-3"
/>
Fill
</button>
</UITooltip>
</div>
<p class="text-xs text-gray-400">
The default value usually works as-is. Register this URL as an allowed callback/redirect URL with your
Expand Down Expand Up @@ -220,15 +221,28 @@
>
{{ connectionTest?.loading ? "Testing…" : "Test Connection" }}
</button>
<button
type="button"
:disabled="loginTest?.loading"
class="rounded border border-gray-300 px-3 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800"
title="Requires saved config — opens a popup to run the full OAuth login flow without affecting your current session"
@click="testLogin"
<UITooltip
:ui="{
width: 'max-w-none'
}"
>
{{ loginTest?.loading ? "Waiting…" : "Test Login" }}
</button>
<span class="inline-flex">
<button
type="button"
:disabled="loginTest?.loading"
class="rounded border border-gray-300 px-3 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800"
@click="testLogin"
>
{{ loginTest?.loading ? "Waiting…" : "Test Login" }}
</button>
</span>

<template #text>
<span class="whitespace-nowrap">
Requires saved config — opens a popup to run the full OAuth login flow without affecting your current session
</span>
</template>
</UITooltip>
</div>

<AuthConnectionTestResult :result="connectionTest" />
Expand Down
54 changes: 34 additions & 20 deletions components/auth/OIDCProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,19 @@
type="text"
class="flex-1"
/>
<button
type="button"
class="shrink-0 rounded border border-gray-300 px-2 py-1 text-xs text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800"
title="Fill with this server's callback URL"
@click="provider.callback = callbackUrl()"
>
<UIcon
name="i-heroicons-arrow-path"
class="h-3 w-3"
/>
Fill
</button>
<UITooltip text="Fill with this server's callback URL">
<button
type="button"
class="shrink-0 rounded border border-gray-300 px-2 py-1 text-xs text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800"
@click="provider.callback = callbackUrl()"
>
<UIcon
name="i-heroicons-arrow-path"
class="h-3 w-3"
/>
Fill
</button>
</UITooltip>
</div>
<p class="text-xs text-gray-400">
The default value usually works as-is. Register this URL as an allowed callback/redirect URL with your
Expand Down Expand Up @@ -203,15 +204,28 @@
>
{{ connectionTest?.loading ? "Testing…" : "Test Connection" }}
</button>
<button
type="button"
:disabled="loginTest?.loading"
class="rounded border border-gray-300 px-3 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800"
title="Requires saved config — opens a popup to run the full OIDC login flow without affecting your current session"
@click="testLogin"
<UITooltip
:ui="{
width: 'max-w-none',
}"
>
{{ loginTest?.loading ? "Waiting…" : "Test Login" }}
</button>
<span class="inline-flex">
<button
type="button"
:disabled="loginTest?.loading"
class="rounded border border-gray-300 px-3 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800"
@click="testLogin"
>
{{ loginTest?.loading ? "Waiting…" : "Test Login" }}
</button>
</span>

<template #text>
<span class="whitespace-nowrap">
Requires saved config — opens a popup to run the full OIDC login flow without affecting your current session
</span>
</template>
</UITooltip>
</div>

<AuthConnectionTestResult :result="connectionTest" />
Expand Down