Build frontend bundles with CSRF token support
This commit is contained in:
1 parent
883cce27df
commit
024be9c929
4 files changed
+2532
No files matched your search
Vendored
+218
@@ -0,0 +1,218 @@
|
||||
this.driver=this.driver||{},this.driver.js=(function(v){"use strict";let T={};function P(o={}){T={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...o}}function e(o){return o?T[o]:T}function t(o,r,n,s){return(o/=s/2)<1?n/2*o*o+r:-n/2*(--o*(o-2)-1)+r}function a(o){const r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return o.flatMap(n=>{const s=n.matches(r),i=Array.from(n.querySelectorAll(r));return[...s?[n]:[],...i]}).filter(n=>getComputedStyle(n).pointerEvents!=="none"&&A(n))}function p(o){if(!o||m(o))return;const r=e("smoothScroll");o.scrollIntoView({behavior:!r||y(o)?"auto":"smooth",inline:"center",block:"center"})}function y(o){if(!o||!o.parentElement)return;const r=o.parentElement;return r.scrollHeight>r.clientHeight}function m(o){const r=o.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function A(o){return!!(o.offsetWidth||o.offsetHeight||o.getClientRects().length)}let L={};function E(o,r){L[o]=r}function d(o){return o?L[o]:L}function K(){L={}}let F={};function R(o,r){F[o]=r}function O(o){var r;(r=F[o])==null||r.call(F)}function se(){F={}}function ae(o,r,n,s){let i=d("__activeStagePosition");const u=i||n.getBoundingClientRect(),b=s.getBoundingClientRect(),S=t(o,u.x,b.x-u.x,r),c=t(o,u.y,b.y-u.y,r),w=t(o,u.width,b.width-u.width,r),l=t(o,u.height,b.height-u.height,r);i={x:S,y:c,width:w,height:l},J(i),E("__activeStagePosition",i)}function Y(o){if(!o)return;const r=o.getBoundingClientRect(),n={x:r.x,y:r.y,width:r.width,height:r.height};E("__activeStagePosition",n),J(n)}function le(){const o=d("__activeStagePosition"),r=d("__overlaySvg");if(!o)return;if(!r){console.warn("No stage svg found.");return}const n=window.innerWidth,s=window.innerHeight;r.setAttribute("viewBox",`0 0 ${n} ${s}`)}function de(o){const r=ce(o);document.body.appendChild(r),ee(r,n=>{n.target.tagName==="path"&&O("overlayClick")}),E("__overlaySvg",r)}function J(o){const r=d("__overlaySvg");if(!r){de(o);return}const n=r.firstElementChild;if(n?.tagName!=="path")throw new Error("no path element found in stage svg");n.setAttribute("d",Q(o))}function ce(o){const r=window.innerWidth,n=window.innerHeight,s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.classList.add("driver-overlay","driver-overlay-animated"),s.setAttribute("viewBox",`0 0 ${r} ${n}`),s.setAttribute("xmlSpace","preserve"),s.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),s.setAttribute("version","1.1"),s.setAttribute("preserveAspectRatio","xMinYMin slice"),s.style.fillRule="evenodd",s.style.clipRule="evenodd",s.style.strokeLinejoin="round",s.style.strokeMiterlimit="2",s.style.zIndex="10000",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%";const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",Q(o)),i.style.fill=e("overlayColor")||"rgb(0,0,0)",i.style.opacity=`${e("overlayOpacity")}`,i.style.pointerEvents="auto",i.style.cursor="auto",s.appendChild(i),s}function Q(o){const r=window.innerWidth,n=window.innerHeight,s=e("stagePadding")||0,i=e("stageRadius")||0,u=o.width+s*2,b=o.height+s*2,S=Math.min(i,u/2,b/2),c=Math.floor(Math.max(S,0)),w=o.x-s+c,l=o.y-s,h=u-c*2,g=b-c*2;return`M${r},0L0,0L0,${n}L${r},${n}L${r},0Z
|
||||
M${w},${l} h${h} a${c},${c} 0 0 1 ${c},${c} v${g} a${c},${c} 0 0 1 -${c},${c} h-${h} a${c},${c} 0 0 1 -${c},-${c} v-${g} a${c},${c} 0 0 1 ${c},-${c} z`}function pe(){const o=d("__overlaySvg");o&&o.remove()}function ue(){const o=document.getElementById("driver-dummy-element");if(o)return o;let r=document.createElement("div");return r.id="driver-dummy-element",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.opacity="0",r.style.position="fixed",r.style.top="50%",r.style.left="50%",document.body.appendChild(r),r}function X(o){const{element:r}=o;let n=typeof r=="string"?document.querySelector(r):r;n||(n=ue()),he(n,o)}function me(){const o=d("__activeElement"),r=d("__activeStep");o&&(Y(o),le(),ne(o,r))}function he(o,r){const n=Date.now(),s=d("__activeStep"),i=d("__activeElement")||o,u=!i||i===o,b=o.id==="driver-dummy-element",S=i.id==="driver-dummy-element",c=e("animate"),w=r.onHighlightStarted||e("onHighlightStarted"),l=r?.onHighlighted||e("onHighlighted"),h=s?.onDeselected||e("onDeselected"),g=e(),C=d();!u&&h&&h(S?void 0:i,s,{config:g,state:C}),w&&w(b?void 0:o,r,{config:g,state:C});const k=!u&&c;let x=!1;we(),E("previousStep",s),E("previousElement",i),E("activeStep",r),E("activeElement",o);const f=()=>{if(d("__transitionCallback")!==f)return;const D=Date.now()-n,B=400-D<=400/2;r.popover&&B&&!x&&k&&(te(o,r),x=!0),e("animate")&&D<400?ae(D,400,i,o):(Y(o),l&&l(b?void 0:o,r,{config:e(),state:d()}),E("__transitionCallback",void 0),E("__previousStep",s),E("__previousElement",i),E("__activeStep",r),E("__activeElement",o)),window.requestAnimationFrame(f)};E("__transitionCallback",f),window.requestAnimationFrame(f),p(o),!k&&r.popover&&te(o,r),i.classList.remove("driver-active-element","driver-no-interaction"),i.removeAttribute("aria-haspopup"),i.removeAttribute("aria-expanded"),i.removeAttribute("aria-controls"),e("disableActiveInteraction")&&o.classList.add("driver-no-interaction"),o.classList.add("driver-active-element"),o.setAttribute("aria-haspopup","dialog"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-controls","driver-popover-content")}function ge(){var o;(o=document.getElementById("driver-dummy-element"))==null||o.remove(),document.querySelectorAll(".driver-active-element").forEach(r=>{r.classList.remove("driver-active-element","driver-no-interaction"),r.removeAttribute("aria-haspopup"),r.removeAttribute("aria-expanded"),r.removeAttribute("aria-controls")})}function z(){const o=d("__resizeTimeout");o&&window.cancelAnimationFrame(o),E("__resizeTimeout",window.requestAnimationFrame(me))}function ve(o){var r;if(!d("isInitialized")||!(o.key==="Tab"||o.keyCode===9))return;const n=d("__activeElement"),s=(r=d("popover"))==null?void 0:r.wrapper,i=a([...s?[s]:[],...n?[n]:[]]),u=i[0],b=i[i.length-1];if(o.preventDefault(),o.shiftKey){const S=i[i.indexOf(document.activeElement)-1]||b;S?.focus()}else{const S=i[i.indexOf(document.activeElement)+1]||u;S?.focus()}}function Z(o){var r;((r=e("allowKeyboardControl"))==null||r)&&(o.key==="Escape"?O("escapePress"):o.key==="ArrowRight"?O("arrowRightPress"):o.key==="ArrowLeft"&&O("arrowLeftPress"))}function ee(o,r,n){const s=(i,u)=>{const b=i.target;o.contains(b)&&((!n||n(b))&&(i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation()),u?.(i))};document.addEventListener("pointerdown",s,!0),document.addEventListener("mousedown",s,!0),document.addEventListener("pointerup",s,!0),document.addEventListener("mouseup",s,!0),document.addEventListener("click",i=>{s(i,r)},!0)}function fe(){window.addEventListener("keyup",Z,!1),window.addEventListener("keydown",ve,!1),window.addEventListener("resize",z),window.addEventListener("scroll",z)}function ye(){window.removeEventListener("keyup",Z),window.removeEventListener("resize",z),window.removeEventListener("scroll",z)}function we(){const o=d("popover");o&&(o.wrapper.style.display="none")}function te(o,r){var n,s;let i=d("popover");i&&document.body.removeChild(i.wrapper),i=Te(),document.body.appendChild(i.wrapper);const{title:u,description:b,showButtons:S,disableButtons:c,showProgress:w,nextBtnText:l=e("nextBtnText")||"Next →",prevBtnText:h=e("prevBtnText")||"← Previous",progressText:g=e("progressText")||"{current} of {total}"}=r.popover||{};i.nextButton.innerHTML=l,i.previousButton.innerHTML=h,i.progress.innerHTML=g,u?(i.title.innerHTML=u,i.title.style.display="block"):i.title.style.display="none",b?(i.description.innerHTML=b,i.description.style.display="block"):i.description.style.display="none";const C=S||e("showButtons"),k=w||e("showProgress")||!1,x=C?.includes("next")||C?.includes("previous")||k;i.closeButton.style.display=C.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=k?"block":"none",i.nextButton.style.display=C.includes("next")?"block":"none",i.previousButton.style.display=C.includes("previous")?"block":"none"):i.footer.style.display="none";const f=c||e("disableButtons")||[];f!=null&&f.includes("next")&&(i.nextButton.disabled=!0,i.
Line truncated
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background: var(--card-base, #2a2a2a);
|
||||
color: var(--fg, #ffffff);
|
||||
padding: 15px 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
font-size: 14px;
|
||||
`,e.innerHTML=`
|
||||
<strong>Welcome to DashCaddy!</strong><br>
|
||||
<p style="margin: 10px 0 0 0; font-size: 12px;">
|
||||
The interactive tour is unavailable, but you can explore the dashboard freely.
|
||||
Check the documentation for help getting started.
|
||||
</p>
|
||||
`,document.body.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},1e4),!0}handleStorageUnavailable(){this.logError("Storage Unavailable","Local storage is not available");const e={data:{},getItem(t){return this.data[t]||null},setItem(t,a){this.data[t]=a},removeItem(t){delete this.data[t]},clear(){this.data={}}};return console.warn("[ErrorHandler] Using in-memory storage - progress will not persist"),e}sendToErrorTracking(e){}}v.ErrorHandler=T,console.log("[ErrorHandler] Module loaded")})(window),(function(v){"use strict";class T{constructor(e="dashcaddy_onboarding"){this.storageKey=e,this.storageVersion="1.0",this.installOnboardingCompleted=typeof SITE<"u"&&SITE.onboardingCompleted===!0,this._initializeStorage(),this._updateLastVisit()}_initializeStorage(){const e=this._getStorage();if(!e||e.version!==this.storageVersion){const t={version:this.storageVersion,tourCompleted:!1,completedTooltips:[],currentStep:0,completionTimestamp:null,dnsSetupDeferred:!1,lastVisit:new Date().toISOString()};this._setStorage(t)}}_getStorage(){try{const e=localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}catch(e){return console.error("[ProgressTracker] Error reading from storage:",e),null}}_setStorage(e){try{localStorage.setItem(this.storageKey,JSON.stringify(e))}catch(t){console.error("[ProgressTracker] Error writing to storage:",t),this._handleStorageError(t)}}_handleStorageError(e){try{sessionStorage.setItem(this.storageKey,JSON.stringify(this._getStorage())),console.warn("[ProgressTracker] Falling back to session storage")}catch(t){console.error("[ProgressTracker] Session storage also unavailable:",t)}}_updateLastVisit(){const e=this._getStorage();e&&(e.lastVisit=new Date().toISOString(),this._setStorage(e))}isTooltipCompleted(e){const t=this._getStorage();return t?t.completedTooltips.includes(e):!1}markTooltipCompleted(e){const t=this._getStorage();t&&(t.completedTooltips.includes(e)||(t.completedTooltips.push(e),t.tooltipTimestamps||(t.tooltipTimestamps={}),t.tooltipTimestamps[e]=new Date().toISOString(),this._setStorage(t)))}isTourCompleted(){const e=this._getStorage();return e?e.tourCompleted===!0:!1}isInstallOnboardingCompleted(){return this.installOnboardingCompleted===!0}async markInstallOnboardingCompleted(){if(!this.installOnboardingCompleted){this.installOnboardingCompleted=!0,typeof SITE<"u"&&(SITE.onboardingCompleted=!0);try{await secureFetch("/api/v1/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({onboardingCompleted:!0})})}catch(e){console.error("[ProgressTracker] Failed to persist install onboarding state:",e)}}}markTourCompleted(){const e=this._getStorage();e&&(e.tourCompleted=!0,e.completionTimestamp=new Date().toISOString(),this._setStorage(e))}getCurrentStep(){const e=this._getStorage();return e&&e.currentStep||0}setCurrentStep(e){const t=this._getStorage();t&&(t.currentStep=e,this._setStorage(t))}resetProgress(){const e={version:this.storageVersion,tourCompleted:!1,completedTooltips:[],currentStep:0,completionTimestamp:null,dnsSetupDeferred:!1,lastVisit:new Date().toISOString()};this._setStorage(e)}getCompletionTimestamp(){const e=this._getStorage();return!e||!e.completionTimestamp?null:new Date(e.completionTimestamp)}isDnsSetupDeferred(){const e=this._getStorage();return e?e.dnsSetupDeferred===!0:!1}markDnsSetupDeferred(){const e=this._getStorage();e&&(e.dnsSetupDeferred=!0,this._setStorage(e))}getTooltipTimestamp(e){const t=this._getStorage();return!t||!t.tooltipTimestamps||!t.tooltipTimestamps[e]?null:new Date(t.tooltipTimestamps[e])}getCompletedTooltips(){const e=this._getStorage();return e?e.completedTooltips||[]:[]}getLastVisit(){const e=this._getStorage();return!e||!e.lastVisit?null:new Date(e.lastVisit)}}v.ProgressTracker=T,console.log("[ProgressTracker] Module loaded")})(window),(function(v){"use strict";const T={dark:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(0, 0, 0, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},light:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent-strong)",overlayColor:"rgba(0, 0, 0, 0.5)",borderColor:"var(--border)",highlightColor:"var(--accent-strong)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},blue:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(25, 8, 172, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},nord:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(46, 52, 64, 0.7)",borderColor:"var(--border)",highlightC
Line truncated
|
||||
.driver-popover {
|
||||
background: ${t.backgroundColor} !important;
|
||||
color: ${t.textColor} !important;
|
||||
border: 1px solid ${t.borderColor} !important;
|
||||
border-radius: 12px !important;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
|
||||
font-family: ${t.fontFamily} !important;
|
||||
}
|
||||
|
||||
.driver-popover-title {
|
||||
color: ${t.textColor} !important;
|
||||
font-weight: 600 !important;
|
||||
font-family: ${t.fontFamily} !important;
|
||||
}
|
||||
|
||||
.driver-popover-description {
|
||||
color: ${t.textColor} !important;
|
||||
font-family: ${t.fontFamily} !important;
|
||||
}
|
||||
|
||||
.driver-popover-footer button {
|
||||
background: ${t.primaryColor} !important;
|
||||
color: ${t.backgroundColor} !important;
|
||||
border: none !important;
|
||||
font-family: ${t.fontFamily} !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
|
||||
.driver-popover-footer button:hover {
|
||||
opacity: 0.9 !important;
|
||||
}
|
||||
|
||||
.driver-popover-close-btn {
|
||||
color: ${t.textColor} !important;
|
||||
}
|
||||
|
||||
.driver-overlay {
|
||||
background: ${t.overlayColor} !important;
|
||||
}
|
||||
|
||||
.driver-highlighted-element {
|
||||
outline: 2px solid ${t.highlightColor} !important;
|
||||
outline-offset: 4px !important;
|
||||
}
|
||||
|
||||
.driver-popover-progress-text {
|
||||
color: ${t.textColor} !important;
|
||||
opacity: 0.7 !important;
|
||||
font-family: ${t.fontFamily} !important;
|
||||
}
|
||||
`,document.head.appendChild(p)}getAvailableThemes(){return Object.keys(T)}isThemeAvailable(t){return T.hasOwnProperty(t)}}v.ThemeAdapter=P,console.log("[ThemeAdapter] Module loaded")})(window),(function(v){"use strict";function T(a){const p=[];if((!a.id||typeof a.id!="string")&&p.push("Tooltip must have a valid string id"),a.element||p.push("Tooltip must have an element selector or HTMLElement"),!a.popover||typeof a.popover!="object")p.push("Tooltip must have a popover object");else{if((!a.popover.title||typeof a.popover.title!="string")&&p.push("Tooltip popover must have a valid string title"),(!a.popover.description||typeof a.popover.description!="string")&&p.push("Tooltip popover must have a valid string description"),a.popover.position){const m=["top","bottom","left","right","center"];m.includes(a.popover.position)||p.push(`Invalid position: ${a.popover.position}. Must be one of: ${m.join(", ")}`)}if(a.popover.align){const m=["start","center","end"];m.includes(a.popover.align)||p.push(`Invalid align: ${a.popover.align}. Must be one of: ${m.join(", ")}`)}a.popover.showButtons&&!Array.isArray(a.popover.showButtons)&&p.push("showButtons must be an array"),["onNext","onPrevious","onClose","onSetupNow","onLater"].forEach(m=>{a.popover[m]&&typeof a.popover[m]!="function"&&p.push(`${m} must be a function`)})}return a.condition&&typeof a.condition!="function"&&p.push("condition must be a function"),a.priority!==void 0&&typeof a.priority!="number"&&p.push("priority must be a number"),{valid:p.length===0,errors:p}}function P(a){if(!Array.isArray(a))return{valid:!1,errors:[{tooltip:null,errors:["tooltips must be an array"]}]};const p=[],y=new Set;return a.forEach((m,A)=>{const L=T(m);L.valid||p.push({tooltip:m.id||`index ${A}`,errors:L.errors}),m.id&&(y.has(m.id)&&p.push({tooltip:m.id,errors:[`Duplicate tooltip ID: ${m.id}`]}),y.add(m.id))}),{valid:p.length===0,errors:p}}class e extends Error{constructor(p,y=null){super(p),this.name="TooltipError",this.tooltipId=y}}function t(a){if(!a.valid){const p=a.errors.map(y=>`${y.tooltip}: ${y.errors.join(", ")}`).join(`
|
||||
`);throw console.error("[TooltipDefinitions] Validation errors:",p),new e(`Tooltip validation failed:
|
||||
${p}`)}}v.TooltipValidation={validateTooltipDefinition:T,validateTooltipDefinitions:P,handleValidationErrors:t,TooltipError:e},console.log("[TooltipDefinitions] Validation module loaded")})(window);const TOOLTIP_DEFINITIONS=[{id:"welcome",element:"#brand",popover:{title:"Welcome to DashCaddy!",description:`
|
||||
<p>Your unified control panel for <strong>Docker</strong>, <strong>Caddy</strong>, and <strong>DNS</strong> — all in one place.</p>
|
||||
<p>This tour will walk you through every section so you know exactly where everything is.</p>
|
||||
<p style="margin-top: 8px; font-size: 0.85rem; opacity: 0.7;">You can click your logo anytime to customize it.</p>
|
||||
`,position:"bottom",align:"start",showButtons:["next"],showProgress:!0},priority:1},{id:"infrastructure",element:".top",popover:{title:"Infrastructure Overview",description:`
|
||||
<p>This top row shows the backbone of your setup:</p>
|
||||
<ul>
|
||||
<li><strong>DNS1 / DNS2 / DNS3</strong> — your Technitium DNS servers</li>
|
||||
<li><strong>Internet</strong> — live connectivity check with packet indicators</li>
|
||||
<li><strong>Auth</strong> — TOTP authentication status</li>
|
||||
<li><strong>DashCA</strong> — your certificate authority for your custom domain</li>
|
||||
</ul>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">These core services are always pinned here, separate from your app grid.</p>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:2},{id:"service-cards",element:"#cards",popover:{title:"Your App Grid",description:`
|
||||
<p>Every app you deploy appears here as a card. Each one shows:</p>
|
||||
<ul>
|
||||
<li><strong>Status dot</strong> — green = online, red = offline (pulses when down)</li>
|
||||
<li><strong>ON/OFF badge</strong> — current state at a glance</li>
|
||||
<li><strong>Response time</strong> — how fast the service responds (color-coded)</li>
|
||||
<li><strong>Uptime bar</strong> — historical uptime percentage</li>
|
||||
</ul>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">Hover over a card to see action buttons: Logs, Restart, Update, Settings, and Open.</p>
|
||||
`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:3},{id:"app-selector",element:"#add-service-btn",popover:{title:"App Selector — Deploy in One Click",description:`
|
||||
<p>Browse <strong>50+ self-hosted apps</strong> organized by category:</p>
|
||||
<ul>
|
||||
<li>Media (Plex, Jellyfin, Emby, Overseerr)</li>
|
||||
<li>Downloads (*arr stack, qBittorrent, Transmission)</li>
|
||||
<li>Productivity (Nextcloud, Vaultwarden, Gitea)</li>
|
||||
<li>Monitoring (Uptime Kuma, Grafana, Prometheus)</li>
|
||||
</ul>
|
||||
<p>Each app deploys with Docker, Caddy reverse proxy, and DNS — fully configured automatically.</p>
|
||||
<p style="margin-top: 6px; padding: 6px 10px; border-radius: 6px; background: rgba(241,196,15,0.12); border: 1px solid rgba(241,196,15,0.25); font-size: 0.85rem;">
|
||||
<strong style="color: #f1c40f;">★ Premium:</strong> <strong>Recipes</strong> let you deploy entire stacks (e.g., full media server) in one click with pre-wired configs.
|
||||
</p>
|
||||
`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:4,condition:()=>document.getElementById("add-service-btn")!==null},{id:"smart-arr",element:"#arr-setup-btn",popover:{title:"Smart Arr Connect",description:`
|
||||
<p>Automatically wire up your entire media stack:</p>
|
||||
<ul>
|
||||
<li>Detects running Arr services (Radarr, Sonarr, Prowlarr, etc.)</li>
|
||||
<li>Connects them together with the right API keys</li>
|
||||
<li>Links Plex/Jellyfin to Overseerr for request management</li>
|
||||
</ul>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">No manual API key copying — DashCaddy handles it all.</p>
|
||||
`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:5,condition:()=>document.getElementById("arr-setup-btn")!==null},{id:"add-manual",element:"#add-service",popover:{title:"Add App Manually",description:`
|
||||
<p>Already have a service running? Add it to your dashboard manually.</p>
|
||||
<p>You can add:</p>
|
||||
<ul>
|
||||
<li><strong>Docker containers</strong> — auto-detects running containers</li>
|
||||
<li><strong>External services</strong> — any URL you want to monitor</li>
|
||||
<li><strong>Test services</strong> — try the UI without deploying anything</li>
|
||||
</ul>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:6},{id:"theme-selector",element:"#theme",popover:{title:"Themes",description:`
|
||||
<p>Switch between <strong>7 built-in themes</strong>:</p>
|
||||
<p>Dark, Light, Blue, Nord, Dracula, Solarized Dark, and Solarized Light.</p>
|
||||
<p>Your preference is saved automatically. You can also build custom themes with the Theme Builder (in Admin → settings).</p>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:7},{id:"toolbar-status",element:'.tools-section[data-section="status"]',popover:{title:"Status Tools",description:`
|
||||
<p>Click <strong>Status</strong> to expand these tools:</p>
|
||||
<ul>
|
||||
<li><strong>Monitor</strong> — live CPU, memory, and disk usage for every container</li>
|
||||
<li><strong>Health</strong> — service health dashboard with uptime history and alerts</li>
|
||||
<li><strong>Updates</strong> — check for and apply Docker image updates</li>
|
||||
</ul>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">These sections remember whether you left them open or closed.</p>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:8},{id:"toolbar-tools",element:'.tools-section[data-section="tools"]',popover:{title:"Operational Tools",description:`
|
||||
<p>Click <strong>Tools</strong> for day-to-day operations:</p>
|
||||
<ul>
|
||||
<li><strong>Logs</strong> — view error logs from your API server and services</li>
|
||||
<li><strong>Alerts</strong> — configure notification rules (email, webhook, etc.)</li>
|
||||
<li><strong>Audit</strong> — full audit trail of every action taken in DashCaddy</li>
|
||||
</ul>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:9},{id:"toolbar-admin",element:'.tools-section[data-section="admin"]',popover:{title:"Admin & Configuration",description:`
|
||||
<p>Click <strong>Admin</strong> for setup and maintenance:</p>
|
||||
<ul>
|
||||
<li><strong>Tokens</strong> — manage API keys for DNS and other integrations</li>
|
||||
<li><strong>Export / Import</strong> — backup and restore your dashboard configuration</li>
|
||||
<li><strong>Backup</strong> — full system backup and restore</li>
|
||||
<li><strong>License</strong> — activate your license code to unlock premium features</li>
|
||||
<li><strong>API</strong> — interactive API documentation (125+ endpoints)</li>
|
||||
</ul>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:10},{id:"weather",element:"#weather-widget",popover:{title:"Weather Widget",description:`
|
||||
<p>Shows current conditions for your location. Click the <strong>gear icon</strong> to configure your city or switch temperature units.</p>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">Uses Open-Meteo — no API key required.</p>
|
||||
`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:11,condition:()=>document.getElementById("weather-widget")!==null},{id:"reload-caddy",element:"#reload-caddy-top",popover:{title:"Reload Caddy",description:`
|
||||
<p>After changing Caddy configuration (adding reverse proxy rules, SSL settings, etc.), click here to apply the changes live.</p>
|
||||
<p style="font-size: 0.85rem; opacity: 0.7;">This is a graceful reload — existing connections are not dropped.</p>
|
||||
`,position:"bottom",align:"end",showButtons:["previous","next"],showProgress:!0},priority:12,condition:()=>document.getElementById("reload-caddy-top")!==null},{id:"tour-complete",element:"#brand",popover:{title:"You're All Set!",description:`
|
||||
<p>That covers the essentials. A few tips to get the most out of DashCaddy:</p>
|
||||
<ul>
|
||||
<li><strong>Click any card</strong> to open that service directly</li>
|
||||
<li><strong>Keyboard shortcuts</strong> — press <code>?</code> anytime to see them all</li>
|
||||
<li><strong>DashCA</strong> — visit your CA page to install the root certificate on any device</li>
|
||||
</ul>
|
||||
<div style="margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: linear-gradient(135deg, rgba(241,196,15,0.1), rgba(243,156,18,0.08)); border: 1px solid rgba(241,196,15,0.25);">
|
||||
<p style="margin: 0 0 6px; font-weight: 600; color: #f1c40f;">★ Unlock Premium</p>
|
||||
<p style="margin: 0; font-size: 0.85rem;">Premium adds powerful features for serious homelabbers:</p>
|
||||
<ul style="margin: 6px 0 0; font-size: 0.85rem;">
|
||||
<li><strong>Auto-Login SSO</strong> — sign into every app automatically, no more password juggling</li>
|
||||
<li><strong>Recipes</strong> — deploy full stacks (media server, dev environment) in one click</li>
|
||||
<li><strong>Docker Swarm</strong> — orchestrate multi-node clusters from your dashboard</li>
|
||||
</ul>
|
||||
<p style="margin: 8px 0 0; font-size: 0.82rem; opacity: 0.8;">Activate in <strong>Admin → License</strong></p>
|
||||
</div>
|
||||
<p style="margin-top: 10px; font-size: 0.85rem; opacity: 0.7;">You can restart this tour anytime from <strong>Admin → Help Tour</strong>.</p>
|
||||
`,position:"bottom",align:"start",showButtons:["previous","close"],showProgress:!0},priority:13}];function getTooltipDefinitions(){return TOOLTIP_DEFINITIONS}function getTooltipById(v){return TOOLTIP_DEFINITIONS.find(T=>T.id===v)||null}function getActiveTooltips(){return TOOLTIP_DEFINITIONS.filter(v=>{if(v.condition&&typeof v.condition=="function")try{return v.condition()}catch(T){return console.error(`[TooltipDefinitions] Error evaluating condition for ${v.id}:`,T),!1}return!0})}function getSortedTooltips(){return getActiveTooltips().sort((T,P)=>{const e=T.priority||999,t=P.priority||999;return e-t})}function getNewFeatureTooltips(){return getActiveTooltips().filter(T=>T.isNewFeature===!0).sort((T,P)=>{const e=T.priority||999,t=P.priority||999;return e-t})}window.TooltipDefinitions={TOOLTIP_DEFINITIONS,getTooltipDefinitions,getTooltipById,getActiveTooltips,getSortedTooltips,getNewFeatureTooltips},console.log("[TooltipDefinitions] Definitions loaded:",TOOLTIP_DEFINITIONS.length,"tooltips"),(function(v){"use strict";class T{constructor(e){this.progressTracker=e,this.modal=null,this.onTemplateSelected=null,console.log("[DnsTemplateSelector] Module loaded")}getDnsTemplates(){return[{id:"technitium",name:"Technitium DNS Server",description:"Modern DNS server with web UI for managing private zones",icon:"\u{1F310}",difficulty:"Easy",features:["Web-based management interface","Private zone management for .sami domain","DHCP server integration","DNS-over-HTTPS and DNS-over-TLS support"],recommended:!0},{id:"bind9",name:"BIND9 DNS Server",description:"Industry-standard DNS server - powerful and flexible",icon:"\u{1F527}",difficulty:"Advanced",features:["Industry standard DNS server","Full RFC compliance","Advanced zone management","DNSSEC support"],recommended:!1},{id:"pihole",name:"Pi-hole",description:"Network-wide ad blocker with DNS capabilities",icon:"\u{1F6E1}\uFE0F",difficulty:"Intermediate",features:["Ad blocking at DNS level","Web interface for management","DHCP server included","Query logging and statistics"],recommended:!1},{id:"powerdns",name:"PowerDNS",description:"High-performance DNS server with SQL backend",icon:"\u26A1",difficulty:"Intermediate",features:["SQL database backend","RESTful API for automation","Geographic load balancing","DNSSEC support"],recommended:!1},{id:"coredns",name:"CoreDNS",description:"Cloud-native DNS server - lightweight and flexible",icon:"\u2601\uFE0F",difficulty:"Intermediate",features:["Plugin-based architecture","Kubernetes-native","Lightweight and fast","Prometheus metrics"],recommended:!1}]}showTemplateSelector(){this.modal||this.createModal(),this.populateTemplates(),this.modal.style.display="flex",document.body.style.overflow="hidden"}createModal(){const e=document.createElement("div");e.id="dns-template-modal",e.className="dns-template-modal",e.innerHTML=`
|
||||
<div class="dns-template-modal-content">
|
||||
<div class="dns-template-header">
|
||||
<h2>\u{1F310} Choose a DNS Server</h2>
|
||||
<p>Setting up a DNS server is essential for managing your private .sami domain</p>
|
||||
<button class="dns-template-close" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="dns-template-grid" id="dns-template-grid">
|
||||
<!-- Templates will be inserted here -->
|
||||
</div>
|
||||
<div class="dns-template-footer">
|
||||
<button class="dns-template-later-btn" id="dns-setup-later">Set up later</button>
|
||||
</div>
|
||||
</div>
|
||||
`,document.body.appendChild(e),this.modal=e,e.querySelector(".dns-template-close").addEventListener("click",()=>this.close()),e.querySelector("#dns-setup-later").addEventListener("click",()=>this.handleSetupLater()),e.addEventListener("click",t=>{t.target===e&&this.close()}),document.addEventListener("keydown",t=>{t.key==="Escape"&&e.style.display==="flex"&&this.close()})}populateTemplates(){const e=document.getElementById("dns-template-grid");if(!e)return;const t=this.getDnsTemplates();e.innerHTML="",t.forEach(a=>{const p=this.createTemplateCard(a);e.appendChild(p)})}createTemplateCard(e){const t=document.createElement("div");t.className="dns-template-card",e.recommended&&t.classList.add("recommended");const a=e.difficulty.toLowerCase();return t.innerHTML=`
|
||||
${e.recommended?'<div class="recommended-badge">Recommended</div>':""}
|
||||
<div class="dns-template-icon">${e.icon}</div>
|
||||
<h3>${e.name}</h3>
|
||||
<p class="dns-template-description">${e.description}</p>
|
||||
<div class="dns-template-difficulty difficulty-${a}">
|
||||
${e.difficulty}
|
||||
</div>
|
||||
<ul class="dns-template-features">
|
||||
${e.features.slice(0,3).map(y=>`<li>${y}</li>`).join("")}
|
||||
</ul>
|
||||
<button class="dns-template-select-btn" data-template-id="${e.id}">
|
||||
Select ${e.name}
|
||||
</button>
|
||||
`,t.querySelector(".dns-template-select-btn").addEventListener("click",()=>this.handleTemplateSelection(e)),t}handleTemplateSelection(e){console.log(`[DnsTemplateSelector] Template selected: ${e.id}`),this.close(),this.onTemplateSelected?this.onTemplateSelected(e):this.openAppSelector(e.id)}handleSetupLater(){console.log("[DnsTemplateSelector] DNS setup deferred"),this.progressTracker&&this.progressTracker.markDnsSetupDeferred(),this.close(),this.showNotification("DNS setup deferred. You can set it up later from the App Selector.")}openAppSelector(e){const t=document.querySelector('[onclick*="showAppSelector"]');t?(t.click(),setTimeout(()=>{const a=document.querySelector("#app-search");a&&(a.value=e,a.dispatchEvent(new Event("input",{bubbles:!0})))},300)):this.showNotification(`To deploy ${e}, use the App Selector and search for "${e}"`)}showNotification(e){const t=document.createElement("div");t.className="dns-template-notification",t.textContent=e,t.style.cssText=`
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background: var(--card-base);
|
||||
color: var(--fg);
|
||||
padding: 15px 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
|
||||
z-index: 10001;
|
||||
max-width: 300px;
|
||||
`,document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",t.style.transition="opacity 0.3s",setTimeout(()=>t.remove(),300)},3e3)}close(){this.modal&&(this.modal.style.display="none",document.body.style.overflow="")}}v.DnsTemplateSelector=T,console.log("[DnsTemplateSelector] Module loaded")})(window),(function(v){"use strict";class T{constructor(e,t,a){this.progressTracker=e,this.themeAdapter=t,this.dnsTemplateSelector=a,this.driver=null,this.currentStepIndex=0,this.isActive=!1,this.resizeHandler=null,this.layoutChangeHandler=null}async initializeDriver(){const e=v.driver?.js?.driver||v.driver?.driver||v.driver;if(typeof e!="function")return console.error("[TourManager] Driver.js not loaded or invalid. window.driver:",v.driver),!1;const t=this.themeAdapter.getDriverTheme();return this.driver=e({showProgress:!0,showButtons:["next","previous","close"],allowClose:!0,overlayClickNext:!1,overlayOpacity:.6,stagePadding:12,stageRadius:12,allowKeyboardControl:!0,popoverClass:"dashcaddy-popover",animate:!0,smoothScroll:!0,onDestroyed:()=>this.onTourComplete(),onDestroyStarted:()=>{this.progressTracker.isTourCompleted()||this.onTourSkip()}}),this.themeAdapter.applyTheme(this.driver),this.themeAdapter.onThemeChange(()=>{this.themeAdapter.applyTheme(this.driver)}),this.setupDynamicRepositioning(),!0}shouldAutoStart(){return!this.progressTracker.isInstallOnboardingCompleted()&&!this.progressTracker.isTourCompleted()&&this.progressTracker.getCurrentStep()===0}async startTour(){if(!this.driver&&!await this.initializeDriver())return;const e=v.TooltipDefinitions.getSortedTooltips(),t=this.progressTracker.getCompletedTooltips(),a=e.filter(y=>!t.includes(y.id));if(a.length===0){console.log("[TourManager] No tooltips to show"),this.progressTracker.markTourCompleted();return}const p=a.map((y,m)=>{const A=m===0,L=m===a.length-1,E={element:y.element,popover:{title:y.popover.title,description:y.popover.description,side:y.popover.position||"bottom",align:y.popover.align||"start",showButtons:this._getButtonsForStep(y,A,L),showProgress:y.popover.showProgress!==!1,onNextClick:()=>{this.progressTracker.markTooltipCompleted(y.id),this.progressTracker.setCurrentStep(m+1),this.currentStepIndex=m+1,this.driver.moveNext()},onPrevClick:()=>{this.progressTracker.setCurrentStep(Math.max(0,m-1)),this.currentStepIndex=Math.max(0,m-1),this.driver.movePrevious()},onCloseClick:()=>{this.skipTour()}}};return y.id==="dns-priority"&&this.dnsTemplateSelector&&(E.popover.onSetupNowClick=()=>{console.log("[TourManager] Opening DNS template selector"),this.dnsTemplateSelector.showTemplateSelector(),this.progressTracker.markTooltipCompleted(y.id),this.progressTracker.setCurrentStep(m+1),this.currentStepIndex=m+1,this.driver.moveNext()},E.popover.onLaterClick=()=>{console.log("[TourManager] DNS setup deferred"),this.progressTracker.markDnsSetupDeferred(),this.progressTracker.markTooltipCompleted(y.id),this.progressTracker.setCurrentStep(m+1),this.currentStepIndex=m+1,this.driver.moveNext()}),E});this.isActive=!0,this.driver.setSteps(p),this.driver.drive()}async resumeTour(){this.progressTracker.getCurrentStep()>0?await this.startTour():await this.startTour()}skipTour(){this.driver&&this.driver.destroy(),this.cleanupDynamicRepositioning(),this.isActive=!1}async restartTour(){this.progressTracker.resetProgress(),await this.startTour()}async showTooltip(e){const t=v.TooltipDefinitions.getTooltipById(e);if(!t){console.error(`[TourManager] Tooltip not found: ${e}`);return}this.driver||await this.initializeDriver();const a={element:t.element,popover:{title:t.popover.title,description:t.popover.description,side:t.popover.position||"bottom",align:t.popover.align||"start"}};this.driver.highlight(a)}async showWhatsNew(){if(!this.driver&&!await this.initializeDriver())return;const e=v.TooltipDefinitions.getNewFeatureTooltips();if(e.length===0){console.log("[TourManager] No new features to show");return}console.log(`[TourManager] Showing ${e.length} new features`);const t=e.map((a,p)=>{const y=p===0,m=p===e.length-1;return{element:a.element,popover:{title:`\u2728 NEW: ${a.popover.title}`,description:a.popover.description,side:a.popover.position||"bottom",align:a.popover.align||"start",showButtons:this._getButtonsForStep(a,y,m),showProgress:!0,onNextClick:()=>{this.driver.moveNext()},onPrevClick:()=>{this.driver.movePrevious()},onCloseClick:()=>{this.skipTour()}}}});this.isActive=!0,this.driver.setSteps(t),this.driver.drive()}setupDynamicRepositioning(){let e;this.resizeHandler=()=>{clearTimeout(e),e=setTimeout(()=>{this.isActive&&this.driver&&(console.log("[TourManager] Window resized, repositioning tooltip"),this.driver.refresh())},150)},this.layoutChangeHandler=()=>{this.isActive&&this.driver&&(console.log("[TourManager] Layout changed, repositioning tooltip"),setTimeout(()=>{this.driver&&this.driver.refresh()},100))},v.addEventListener("resize",this.resizeHandler),this.themeAdapter.onThemeChange(this.layoutChangeHandler)}cleanupDynamicRepositioning(){
Line truncated
|
||||
|
||||
Possible issues:
|
||||
- Driver.js library failed to load
|
||||
- JavaScript errors during initialization`))},E=document.getElementById("restart-tour-btn");if(E){E.onclick=L;return}const d=document.createElement("button");d.id="restart-tour-btn",d.textContent="Help Tour",d.title="Restart the onboarding tour",d.onclick=L,A.appendChild(d)}function y(){return typeof(window.driver?.js?.driver||window.driver?.driver||window.driver)!="function"?(console.warn("[Onboarding] Driver.js not loaded yet, will retry... window.driver:",window.driver),!1):!0}function m(){let A=0;const L=10;function E(){y()?a():(A++,A<L?setTimeout(E,500):(console.error("[Onboarding] Driver.js failed to load after multiple attempts"),t?t.handleDriverLoadFailure():new ErrorHandler().handleDriverLoadFailure()))}E()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m(),console.log("[Onboarding] System loaded")})();
|
||||
Reference in new issue
Block a user