Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep enlarged token reveal headings clear of Close

pulse-triage[bot]862390a0d2b8
diff --git a/frontend-modern/src/components/TokenRevealDialog.tsx b/frontend-modern/src/components/TokenRevealDialog.tsx
index 3bd11ba263..ad74958dc9 100644
--- a/frontend-modern/src/components/TokenRevealDialog.tsx
+++ b/frontend-modern/src/components/TokenRevealDialog.tsx
@@ -97,7 +97,7 @@ export const TokenRevealDialog: Component = () => {
<div class="w-full min-h-0 overflow-y-auto overscroll-contain">
<Card padding="lg" class="shadow-xs relative">
<div class="flex items-start gap-3">
- <div class="shrink-0 rounded-full bg-green-100 text-green-700 dark:bg-green-900/25 dark:text-green-300 p-2">
+ <div class="hidden sm:block shrink-0 rounded-full bg-green-100 text-green-700 dark:bg-green-900/25 dark:text-green-300 p-2">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path
stroke-linecap="round"
@@ -109,11 +109,16 @@ export const TokenRevealDialog: Component = () => {
</div>
<div class="min-w-0 space-y-2 flex-1">
<div class="flex flex-wrap items-center gap-2">
- <h2 class="text-lg font-semibold text-base-content">API token ready</h2>
+ <h2 class="text-lg font-semibold text-base-content [overflow-wrap:anywhere]">
+ API token ready
+ </h2>
<Show when={sourceLabel}>
<span
class={`max-w-full [overflow-wrap:anywhere] ${
- sourceBadge?.classes ||
+ sourceBadge?.classes.replace(
+ 'whitespace-nowrap',
+ 'whitespace-normal',
+ ) ||
'inline-flex items-center rounded-sm px-2 py-0.5 text-[10px] font-medium bg-surface-alt text-base-content'
}`}
>
diff --git a/frontend-modern/src/components/__tests__/TokenRevealDialog.test.tsx b/frontend-modern/src/components/__tests__/TokenRevealDialog.test.tsx
index b16a085b38..8b613cf234 100644
--- a/frontend-modern/src/components/__tests__/TokenRevealDialog.test.tsx
+++ b/frontend-modern/src/components/__tests__/TokenRevealDialog.test.tsx
@@ -113,6 +113,25 @@ describe('TokenRevealDialog', () => {
);
});
+ it('keeps long source, record and guidance strings as wrapping literal text', async () => {
+ render(() => <TokenRevealDialog />);
+ showTokenReveal({
+ token: 'synthetic-<script>not-executable</script>',
+ record: { ...mockRecord, name: '<img src=x onerror=alert(1)>' + 'a'.repeat(160) },
+ source: 'unfamiliar-source-' + 'b'.repeat(120),
+ note: '<b>Literal operator guidance</b>',
+ });
+ expect(
+ await screen.findByText('synthetic-<script>not-executable</script>'),
+ ).toBeInTheDocument();
+ expect(screen.getByText('<b>Literal operator guidance</b>')).toBeInTheDocument();
+ expect(screen.getByText('<img src=x onerror=alert(1)>' + 'a'.repeat(160))).toBeInTheDocument();
+ const badge = screen.getByText(/Unfamiliar Source/);
+ expect(badge).not.toHaveClass('whitespace-nowrap');
+ expect(badge).toHaveClass('whitespace-normal');
+ expect(screen.getByRole('dialog').querySelector('script, img')).toBeNull();
+ });
+
it('copies the current value once and reports pending and settled outcomes', async () => {
const settle = deferredCopy();
render(() => <TokenRevealDialog />);