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.

feat(ui): add GitHub star prompt for returning users

rcourtman4d692a327715
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index 43e8047589..fead1557b8 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -34,6 +34,7 @@ import { eventBus } from './stores/events';
import { updateStore } from './stores/updates';
import { UpdateBanner } from './components/UpdateBanner';
import { DemoBanner } from './components/DemoBanner';
+import { GitHubStarBanner } from './components/GitHubStarBanner';
import { createTooltipSystem } from './components/shared/Tooltip';
import type { State, Alert } from '@/types/api';
import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';
@@ -897,6 +898,7 @@ function App() {
<SecurityWarning />
<DemoBanner />
<UpdateBanner />
+ <GitHubStarBanner />
<GlobalUpdateProgressWatcher />
</Show>
{/* Main layout container - flexbox to allow AI panel to push content */}
diff --git a/frontend-modern/src/components/GitHubStarBanner.tsx b/frontend-modern/src/components/GitHubStarBanner.tsx
new file mode 100644
index 0000000000..f994bff7fa
--- /dev/null
+++ b/frontend-modern/src/components/GitHubStarBanner.tsx
@@ -0,0 +1,147 @@
+import { createSignal, createEffect, Show } from 'solid-js';
+import { createLocalStorageBooleanSignal, createLocalStorageStringSignal, STORAGE_KEYS } from '@/utils/localStorage';
+import { useWebSocket } from '@/App';
+import GithubIcon from 'lucide-solid/icons/github';
+import StarIcon from 'lucide-solid/icons/star';
+import XIcon from 'lucide-solid/icons/x';
+
+const GITHUB_REPO_URL = 'https://github.com/rcourtman/Pulse';
+
+function getTodayDateString(): string {
+ return new Date().toISOString().split('T')[0]; // YYYY-MM-DD
+}
+
+export function GitHubStarBanner() {
+ const wsContext = useWebSocket();
+
+ // Track if user has dismissed the modal (permanent)
+ const [dismissed, setDismissed] = createLocalStorageBooleanSignal(
+ STORAGE_KEYS.GITHUB_STAR_DISMISSED,
+ false
+ );
+
+ // Track the first date user had infrastructure connected
+ const [firstSeenDate, setFirstSeenDate] = createLocalStorageStringSignal(
+ STORAGE_KEYS.GITHUB_STAR_FIRST_SEEN,
+ ''
+ );
+
+ const [showModal, setShowModal] = createSignal(false);
+
+ // Check if user qualifies to see the modal
+ createEffect(() => {
+ // Already dismissed? Don't show
+ if (dismissed()) {
+ setShowModal(false);
+ return;
+ }
+
+ const state = wsContext?.state;
+ if (!state) return;
+
+ // Check if user has connected infrastructure
+ const hasInfrastructure =
+ (state.nodes?.length ?? 0) > 0 ||
+ (state.dockerHosts?.length ?? 0) > 0 ||
+ (state.kubernetesClusters?.length ?? 0) > 0 ||
+ (state.hosts?.length ?? 0) > 0;
+
+ if (!hasInfrastructure) {
+ setShowModal(false);
+ return;
+ }
+
+ const today = getTodayDateString();
+ const firstSeen = firstSeenDate();
+
+ // First time seeing infrastructure? Record the date, don't show yet
+ if (!firstSeen) {
+ setFirstSeenDate(today);
+ setShowModal(false);
+ return;
+ }
+
+ // Returning user (different day than first seen)? Show the modal
+ if (firstSeen !== today) {
+ setShowModal(true);
+ }
+ });
+
+ const handleDismiss = () => {
+ setDismissed(true);
+ setShowModal(false);
+ };
+
+ const handleStarClick = () => {
+ window.open(GITHUB_REPO_URL, '_blank', 'noopener,noreferrer');
+ // Auto-dismiss - trust that they starred
+ setDismissed(true);
+ setShowModal(false);
+ };
+
+ const handleMaybeLater = () => {
+ // Just close for this session, but don't permanently dismiss
+ // They'll see it again next time they return
+ setShowModal(false);
+ };
+
+ return (
+ <Show when={showModal()}>
+ <div class="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4">
+ <div class="bg-white dark:bg-gray-800 rounded-xl shadow-2xl max-w-md w-full overflow-hidden">
+ {/* Header with close button */}
+ <div class="flex justify-end p-3 pb-0">
+ <button
+ onClick={handleDismiss}
+ class="p-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
+ title="Don't show again"
+ aria-label="Close and don't show again"
+ >
+ <XIcon class="w-5 h-5" />
+ </button>
+ </div>
+
+ {/* Content */}
+ <div class="px-6 pb-6 text-center">
+ {/* Icon */}
+ <div class="flex justify-center mb-4">
+ <div class="relative">
+ <div class="w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center">
+ <GithubIcon class="w-8 h-8 text-gray-700 dark:text-gray-300" />
+ </div>
+ <div class="absolute -top-1 -right-1 w-7 h-7 bg-yellow-400 rounded-full flex items-center justify-center shadow-md">
+ <StarIcon class="w-4 h-4 text-yellow-800" />
+ </div>
+ </div>
+ </div>
+
+ {/* Text */}
+ <h2 class="text-xl font-semibold text-gray-900 dark:text-gray-100 mb-2">
+ Enjoying Pulse?
+ </h2>
+ <p class="text-gray-600 dark:text-gray-400 mb-6 leading-relaxed">
+ Pulse is built and maintained by an independent developer. If it's been useful for monitoring your infrastructure, a GitHub star helps more than you'd think.
+ </p>
+
+ {/* Buttons */}
+ <div class="flex flex-col gap-3">
+ <button
+ onClick={handleStarClick}
+ class="w-full inline-flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-white rounded-lg transition-colors"
+ >
+ <StarIcon class="w-4 h-4" />
+ Star on GitHub
+ </button>
+ <button
+ onClick={handleMaybeLater}
+ class="w-full px-4 py-2 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 transition-colors"
+ >
+ Maybe later
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </Show>
+ );
+}
diff --git a/frontend-modern/src/utils/localStorage.ts b/frontend-modern/src/utils/localStorage.ts
index 2257015c1f..fd5b37c752 100644
--- a/frontend-modern/src/utils/localStorage.ts
+++ b/frontend-modern/src/utils/localStorage.ts
@@ -165,6 +165,10 @@ export const STORAGE_KEYS = {
// Feature discovery
DISMISSED_FEATURE_TIPS: 'pulse-dismissed-feature-tips',
+ // GitHub star prompt
+ GITHUB_STAR_DISMISSED: 'pulse-github-star-dismissed',
+ GITHUB_STAR_FIRST_SEEN: 'pulse-github-star-first-seen',
+
// Audit log
AUDIT_AUTO_VERIFY: 'pulse-audit-auto-verify',
AUDIT_AUTO_VERIFY_LIMIT: 'pulse-audit-auto-verify-limit',