demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus; Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details, Aktionen, Löschen und Aufräumen kennen damit nur diese 6. - Backup: robocopy schließt in der Demo alle übrigen Projektordner per /XD aus (auch die automatische Sicherung). - Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis. - Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen", Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE. - build.ps1 -Demo → release\ProjectDashboard-Demo.exe und ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie die Vollversion, die ihn später am selben Ort ersetzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
19
build.ps1
19
build.ps1
@@ -9,8 +9,12 @@
|
|||||||
# and asks for the projects folder and the backup target.
|
# and asks for the projects folder and the backup target.
|
||||||
#
|
#
|
||||||
# Needs the .NET 8+ SDK (and Node.js on this PC, which is copied into the release exe).
|
# Needs the .NET 8+ SDK (and Node.js on this PC, which is copied into the release exe).
|
||||||
param([switch]$Release)
|
#
|
||||||
|
# powershell -ExecutionPolicy Bypass -File build.ps1 -Demo -> release\ProjectDashboard-Demo.exe (+ -Demo-Setup.exe)
|
||||||
|
# the free demo: at most 6 projects (edition.json in the payload). The full build is not touched.
|
||||||
|
param([switch]$Release, [switch]$Demo)
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
if ($Demo) { $Release = [switch]$true }
|
||||||
$here = $PSScriptRoot
|
$here = $PSScriptRoot
|
||||||
$launcher = Join-Path $here 'launcher'
|
$launcher = Join-Path $here 'launcher'
|
||||||
$csproj = Join-Path $launcher 'ProjectDashboard.csproj'
|
$csproj = Join-Path $launcher 'ProjectDashboard.csproj'
|
||||||
@@ -69,6 +73,11 @@ Enthaltene Software:
|
|||||||
- Lucide Icons (ISC) - node_modules\lucide-static\LICENSE
|
- Lucide Icons (ISC) - node_modules\lucide-static\LICENSE
|
||||||
"@
|
"@
|
||||||
|
|
||||||
|
# demo edition: server.js reads edition.json (WriteAllText = UTF-8 without BOM)
|
||||||
|
if ($Demo) {
|
||||||
|
[IO.File]::WriteAllText((Join-Path $payload 'edition.json'), '{ "demo": true, "limit": 6, "buyUrl": "https://sn09.itch.io/project-dashboard" }')
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host '2/3 Packen ...'
|
Write-Host '2/3 Packen ...'
|
||||||
if (Test-Path $zip) { Remove-Item $zip -Force }
|
if (Test-Path $zip) { Remove-Item $zip -Force }
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||||
@@ -81,7 +90,7 @@ dotnet publish $csproj -c Release -p:Portable=true -o $stage --nologo -v q
|
|||||||
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed ($LASTEXITCODE)" }
|
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed ($LASTEXITCODE)" }
|
||||||
$outDir = Join-Path $here 'release'
|
$outDir = Join-Path $here 'release'
|
||||||
New-Item -ItemType Directory -Force $outDir | Out-Null
|
New-Item -ItemType Directory -Force $outDir | Out-Null
|
||||||
$out = Join-Path $outDir 'ProjectDashboard.exe'
|
$out = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo.exe' } else { 'ProjectDashboard.exe' })
|
||||||
Copy-Item (Join-Path $stage 'ProjectDashboard.exe') $out -Force
|
Copy-Item (Join-Path $stage 'ProjectDashboard.exe') $out -Force
|
||||||
|
|
||||||
Remove-Item $stage, $payload, $zip -Recurse -Force
|
Remove-Item $stage, $payload, $zip -Recurse -Force
|
||||||
@@ -95,9 +104,11 @@ $iscc = @("$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe", "${env:ProgramFile
|
|||||||
if ($iscc) {
|
if ($iscc) {
|
||||||
Write-Host 'Setup bauen ...'
|
Write-Host 'Setup bauen ...'
|
||||||
$ver = (Get-Content (Join-Path $here 'package.json') -Raw | ConvertFrom-Json).version
|
$ver = (Get-Content (Join-Path $here 'package.json') -Raw | ConvertFrom-Json).version
|
||||||
& $iscc /Q "/DAppVer=$ver" (Join-Path $here 'installer\ProjectDashboard.iss')
|
$isccArgs = @('/Q', "/DAppVer=$ver")
|
||||||
|
if ($Demo) { $isccArgs += '/DDemo' }
|
||||||
|
& $iscc @isccArgs (Join-Path $here 'installer\ProjectDashboard.iss')
|
||||||
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed ($LASTEXITCODE)" }
|
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed ($LASTEXITCODE)" }
|
||||||
$setup = Join-Path $outDir 'ProjectDashboard-Setup.exe'
|
$setup = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo-Setup.exe' } else { 'ProjectDashboard-Setup.exe' })
|
||||||
Write-Host ("-> {0} ({1:N0} MB)" -f $setup, ((Get-Item $setup).Length / 1MB))
|
Write-Host ("-> {0} ({1:N0} MB)" -f $setup, ((Get-Item $setup).Length / 1MB))
|
||||||
} else {
|
} else {
|
||||||
Write-Host 'Setup übersprungen: Inno Setup 6 nicht gefunden (winget install JRSoftware.InnoSetup).'
|
Write-Host 'Setup übersprungen: Inno Setup 6 nicht gefunden (winget install JRSoftware.InnoSetup).'
|
||||||
|
|||||||
@@ -11,12 +11,23 @@
|
|||||||
#endif
|
#endif
|
||||||
#define AppName "Project Dashboard"
|
#define AppName "Project Dashboard"
|
||||||
#define AppExe "ProjectDashboard.exe"
|
#define AppExe "ProjectDashboard.exe"
|
||||||
|
; /DDemo (build.ps1 -Demo): same AppId and folder as the full version, so installing the
|
||||||
|
; full version after buying replaces the demo in place (shortcuts and settings stay)
|
||||||
|
#ifdef Demo
|
||||||
|
#define SourceExe "ProjectDashboard-Demo.exe"
|
||||||
|
#define SetupName "ProjectDashboard-Demo-Setup"
|
||||||
|
#define ShownName "Project Dashboard (Demo)"
|
||||||
|
#else
|
||||||
|
#define SourceExe "ProjectDashboard.exe"
|
||||||
|
#define SetupName "ProjectDashboard-Setup"
|
||||||
|
#define ShownName "Project Dashboard"
|
||||||
|
#endif
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId={{6F3C2E9A-4B1D-4E7A-9C55-2D8B0F1A7E31}
|
AppId={{6F3C2E9A-4B1D-4E7A-9C55-2D8B0F1A7E31}
|
||||||
AppName={#AppName}
|
AppName={#AppName}
|
||||||
AppVersion={#AppVer}
|
AppVersion={#AppVer}
|
||||||
AppVerName={#AppName} {#AppVer}
|
AppVerName={#ShownName} {#AppVer}
|
||||||
AppPublisher=Michael Media
|
AppPublisher=Michael Media
|
||||||
AppPublisherURL=https://sn09.itch.io/project-dashboard
|
AppPublisherURL=https://sn09.itch.io/project-dashboard
|
||||||
AppSupportURL=https://discord.gg/Ej4JPmCZva
|
AppSupportURL=https://discord.gg/Ej4JPmCZva
|
||||||
@@ -29,10 +40,10 @@ DefaultGroupName={#AppName}
|
|||||||
DisableProgramGroupPage=yes
|
DisableProgramGroupPage=yes
|
||||||
DisableDirPage=auto
|
DisableDirPage=auto
|
||||||
OutputDir=..\release
|
OutputDir=..\release
|
||||||
OutputBaseFilename=ProjectDashboard-Setup
|
OutputBaseFilename={#SetupName}
|
||||||
SetupIconFile=..\launcher\app.ico
|
SetupIconFile=..\launcher\app.ico
|
||||||
UninstallDisplayIcon={app}\{#AppExe}
|
UninstallDisplayIcon={app}\{#AppExe}
|
||||||
UninstallDisplayName={#AppName}
|
UninstallDisplayName={#ShownName}
|
||||||
WizardStyle=modern
|
WizardStyle=modern
|
||||||
Compression=lzma2/max
|
Compression=lzma2/max
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
@@ -55,7 +66,7 @@ german.DeleteData=Auch deine Einstellungen und Daten löschen (Liste der Projekt
|
|||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\release\{#AppExe}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\release\{#SourceExe}"; DestDir: "{app}"; DestName: "{#AppExe}"; Flags: ignoreversion
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExe}"
|
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExe}"
|
||||||
|
|||||||
@@ -86,16 +86,41 @@ function config(targetId) {
|
|||||||
return { t, excludeDirs: s.backup.excludeDirs, excludeFiles: s.backup.excludeFiles }
|
return { t, excludeDirs: s.backup.excludeDirs, excludeFiles: s.backup.excludeFiles }
|
||||||
}
|
}
|
||||||
|
|
||||||
function baseArgs(cfg) {
|
// extraXd: full paths to skip as well (demo: the projects it doesn't show)
|
||||||
|
function baseArgs(cfg, extraXd = []) {
|
||||||
return ['/E', '/FFT', '/XJ', '/R:2', '/W:5', '/COPY:DAT', '/DCOPY:T',
|
return ['/E', '/FFT', '/XJ', '/R:2', '/W:5', '/COPY:DAT', '/DCOPY:T',
|
||||||
'/XD', ...cfg.excludeDirs, '/XF', ...cfg.excludeFiles]
|
'/XD', ...cfg.excludeDirs, ...extraXd, '/XF', ...cfg.excludeFiles]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Demo edition: only these projects may be backed up. Map rootPath (lower) -> Set of
|
||||||
|
// allowed top-level folder names (lower); null = no limit (full version).
|
||||||
|
let allow = null
|
||||||
|
function limitTo(list) {
|
||||||
|
if (!list) { allow = null; return }
|
||||||
|
allow = new Map()
|
||||||
|
for (const p of list) {
|
||||||
|
const r = path.resolve(p.root).toLowerCase()
|
||||||
|
if (!allow.has(r)) allow.set(r, new Set())
|
||||||
|
allow.get(r).add(String(p.folder).split(/[\\/]/)[0].toLowerCase())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top-level folders of a projects folder that the demo doesn't cover (full paths, for /XD)
|
||||||
|
function blockedIn(root) {
|
||||||
|
const ok = allow?.get(path.resolve(root).toLowerCase())
|
||||||
|
if (!ok) return []
|
||||||
|
try {
|
||||||
|
return fs.readdirSync(root, { withFileTypes: true })
|
||||||
|
.filter((e) => e.isDirectory() && !ok.has(e.name.toLowerCase()))
|
||||||
|
.map((e) => path.join(root, e.name))
|
||||||
|
} catch { return [] }
|
||||||
}
|
}
|
||||||
|
|
||||||
// robocopy runs of a job: one per projects folder (the shown ones, or `rootList`),
|
// robocopy runs of a job: one per projects folder (the shown ones, or `rootList`),
|
||||||
// or one for a single project
|
// or one for a single project
|
||||||
function itemsFor(t, scope, rootList = roots) {
|
function itemsFor(t, scope, rootList = roots) {
|
||||||
if (scope) return [{ root: scope.root, source: path.join(scope.root, scope.folder), target: path.join(destOf(t, scope.root), scope.folder) }]
|
if (scope) return [{ root: scope.root, source: path.join(scope.root, scope.folder), target: path.join(destOf(t, scope.root), scope.folder) }]
|
||||||
return rootList.map((root) => ({ root, source: root, target: destOf(t, root) }))
|
const list = allow ? rootList.filter((root) => allow.has(path.resolve(root).toLowerCase())) : rootList
|
||||||
|
return list.map((root) => ({ root, source: root, target: destOf(t, root), xd: allow ? blockedIn(root) : [] }))
|
||||||
}
|
}
|
||||||
|
|
||||||
const stamp = () => new Date().toISOString().slice(0, 16).replace('T', '_').replace(':', '-')
|
const stamp = () => new Date().toISOString().slice(0, 16).replace('T', '_').replace(':', '-')
|
||||||
@@ -193,7 +218,7 @@ function check(scope = null, autoCopy = false, targetId = null, opts = {}) {
|
|||||||
fs.mkdirSync(it.target, { recursive: true })
|
fs.mkdirSync(it.target, { recursive: true })
|
||||||
const checkLog = path.join(logDir, `pruefung-${stamp()}-${cfg.t.id}${slug(scope?.folder ?? (items.length > 1 ? path.basename(it.root) : ''))}.log`)
|
const checkLog = path.join(logDir, `pruefung-${stamp()}-${cfg.t.id}${slug(scope?.folder ?? (items.length > 1 ? path.basename(it.root) : ''))}.log`)
|
||||||
const src = it.source
|
const src = it.source
|
||||||
const rc = await robocopy([src, it.target, ...baseArgs(cfg), '/L', '/X', '/NJH', '/NJS', '/NDL', '/NP', '/FP', '/BYTES'], checkLog, (line) => {
|
const rc = await robocopy([src, it.target, ...baseArgs(cfg, it.xd), '/L', '/X', '/NJH', '/NJS', '/NDL', '/NP', '/FP', '/BYTES'], checkLog, (line) => {
|
||||||
const p = parseLine(line)
|
const p = parseLine(line)
|
||||||
if (!p) return
|
if (!p) return
|
||||||
if (p.cls.includes('EXTRA')) { extra.n++; extra.b += p.size; return }
|
if (p.cls.includes('EXTRA')) { extra.n++; extra.b += p.size; return }
|
||||||
@@ -246,7 +271,7 @@ function startCopy() {
|
|||||||
const log = path.join(logDir, `backup-${stamp()}-${cfg.t.id}${slug(scope?.folder ?? (items.length > 1 ? path.basename(it.root) : ''))}.log`)
|
const log = path.join(logDir, `backup-${stamp()}-${cfg.t.id}${slug(scope?.folder ?? (items.length > 1 ? path.basename(it.root) : ''))}.log`)
|
||||||
const failed = new Set() // project folders with copy errors
|
const failed = new Set() // project folders with copy errors
|
||||||
const before = { files: state.progress.files, bytes: state.progress.bytes }
|
const before = { files: state.progress.files, bytes: state.progress.bytes }
|
||||||
const rc = await robocopy([it.source, it.target, ...baseArgs(cfg), '/MT:16', '/NJH', '/NDL', '/NP', '/FP', '/BYTES'], log, (line) => {
|
const rc = await robocopy([it.source, it.target, ...baseArgs(cfg, it.xd), '/MT:16', '/NJH', '/NDL', '/NP', '/FP', '/BYTES'], log, (line) => {
|
||||||
const err = line.match(ERR_RE)
|
const err = line.match(ERR_RE)
|
||||||
if (err) { const pr = projectOfPath(err[1].trim(), it.source, it.target, scope?.folder); if (pr) failed.add(pr); return }
|
if (err) { const pr = projectOfPath(err[1].trim(), it.source, it.target, scope?.folder); if (pr) failed.add(pr); return }
|
||||||
const p = parseLine(line)
|
const p = parseLine(line)
|
||||||
@@ -346,4 +371,4 @@ function getState() {
|
|||||||
return { ...state, source: roots.join(' + '), targets: list }
|
return { ...state, source: roots.join(' + '), targets: list }
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { init, check, copy, cancel, getState, lastFor, lastOnAllTargets, busy }
|
module.exports = { init, check, copy, cancel, getState, lastFor, lastOnAllTargets, busy, limitTo }
|
||||||
|
|||||||
@@ -250,6 +250,27 @@ let noneShown = false // deliberately no folder shown (dropdown "Keinen anzeig
|
|||||||
let FEATURES = { itch: false }
|
let FEATURES = { itch: false }
|
||||||
const itchOn = () => !!FEATURES.itch
|
const itchOn = () => !!FEATURES.itch
|
||||||
|
|
||||||
|
// demo edition (server: edition.json): { limit, total, buyUrl } or null in the full version
|
||||||
|
let DEMO = null
|
||||||
|
const demoFull = () => !!DEMO && DEMO.total >= DEMO.limit
|
||||||
|
function renderDemo() {
|
||||||
|
const on = !!DEMO
|
||||||
|
document.getElementById('demoBanner').hidden = !on
|
||||||
|
document.getElementById('spDemo').hidden = !on
|
||||||
|
document.getElementById('spBuy').hidden = !on
|
||||||
|
if (!on) return
|
||||||
|
document.getElementById('demoText').textContent = DEMO.total > DEMO.limit
|
||||||
|
? t('demo.banner', { n: DEMO.limit, total: DEMO.total })
|
||||||
|
: t('demo.bannerUpTo', { n: DEMO.limit })
|
||||||
|
for (const id of ['demoBuy', 'spBuy']) document.getElementById(id).href = DEMO.buyUrl
|
||||||
|
}
|
||||||
|
// "New" / "Clone" in the demo once the limit is reached: hint instead of the dialog
|
||||||
|
function demoBlocksNew() {
|
||||||
|
if (!demoFull()) return false
|
||||||
|
toast(t('demo.newBlocked', { n: DEMO.limit }), 'rocket', () => window.open(DEMO.buyUrl, '_blank'))
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
const res = await fetch(`/api/projects?target=${encodeURIComponent(curTargetId())}`)
|
const res = await fetch(`/api/projects?target=${encodeURIComponent(curTargetId())}`)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
@@ -265,6 +286,8 @@ async function load() {
|
|||||||
noneShown = !!data.noneShown
|
noneShown = !!data.noneShown
|
||||||
document.getElementById('noneBox').hidden = !noneShown
|
document.getElementById('noneBox').hidden = !noneShown
|
||||||
FEATURES = data.features ?? { itch: false }
|
FEATURES = data.features ?? { itch: false }
|
||||||
|
DEMO = data.demo ?? null
|
||||||
|
renderDemo()
|
||||||
document.body.classList.toggle('no-itch', !itchOn())
|
document.body.classList.toggle('no-itch', !itchOn())
|
||||||
renderRootPicker()
|
renderRootPicker()
|
||||||
if (editing) editing = projects.find((p) => p.name === editing.name) ?? editing
|
if (editing) editing = projects.find((p) => p.name === editing.name) ?? editing
|
||||||
@@ -328,8 +351,8 @@ document.getElementById('nFrom').addEventListener('change', () => {
|
|||||||
syncNewDlg()
|
syncNewDlg()
|
||||||
})
|
})
|
||||||
document.getElementById('nCancel').onclick = () => newDlg.close()
|
document.getElementById('nCancel').onclick = () => newDlg.close()
|
||||||
document.getElementById('btnNew').onclick = () => openNewProject('')
|
document.getElementById('btnNew').onclick = () => { if (!demoBlocksNew()) openNewProject('') }
|
||||||
document.getElementById('btnClone').onclick = () => { if (editing) openNewProject(editing.name) }
|
document.getElementById('btnClone').onclick = () => { if (editing && !demoBlocksNew()) openNewProject(editing.name) }
|
||||||
|
|
||||||
/* ── rename / move a project ──────────────────────────────────────────── */
|
/* ── rename / move a project ──────────────────────────────────────────── */
|
||||||
|
|
||||||
@@ -3428,6 +3451,7 @@ function initLang() {
|
|||||||
try { render() } catch {}
|
try { render() } catch {}
|
||||||
try { renderBackupButton() } catch {}
|
try { renderBackupButton() } catch {}
|
||||||
try { renderRootPicker() } catch {}
|
try { renderRootPicker() } catch {}
|
||||||
|
try { renderDemo() } catch {}
|
||||||
if (editing) try { openEditor(editing) } catch {}
|
if (editing) try { openEditor(editing) } catch {}
|
||||||
const sp = document.getElementById('spanel')
|
const sp = document.getElementById('spanel')
|
||||||
if (sp.classList.contains('open')) { I18N.apply(sp); try { renderAutoStatus() } catch {} }
|
if (sp.classList.contains('open')) { I18N.apply(sp); try { renderAutoStatus() } catch {} }
|
||||||
|
|||||||
@@ -55,6 +55,14 @@
|
|||||||
.updbanner[hidden] { display: none; }
|
.updbanner[hidden] { display: none; }
|
||||||
.updbanner span { flex: 1; min-width: 0; }
|
.updbanner span { flex: 1; min-width: 0; }
|
||||||
.updbanner .btn { padding: 5px 12px; }
|
.updbanner .btn { padding: 5px 12px; }
|
||||||
|
/* demo edition: slim upsell line under the header */
|
||||||
|
.demobanner { display: flex; align-items: center; gap: 10px; padding: 6px 22px; background: var(--surface-2); color: var(--text); font-size: 12.5px; border-top: 1px solid var(--border); }
|
||||||
|
.demobanner[hidden] { display: none; }
|
||||||
|
.demobanner > .i { color: var(--accent-text); }
|
||||||
|
.demobanner span { flex: 1; min-width: 0; }
|
||||||
|
.demobanner .btn { padding: 4px 11px; font-size: 12.5px; text-decoration: none; }
|
||||||
|
.about .ver.demo { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
|
||||||
|
.about [hidden] { display: none !important; }
|
||||||
.rootpick { position: relative; }
|
.rootpick { position: relative; }
|
||||||
#rootBtn { display: flex; align-items: center; gap: 5px; border: none; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 7px; cursor: pointer; max-width: 260px; }
|
#rootBtn { display: flex; align-items: center; gap: 5px; border: none; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 7px; cursor: pointer; max-width: 260px; }
|
||||||
#rootBtn h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
#rootBtn h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
@@ -817,7 +825,7 @@
|
|||||||
.about { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
|
.about { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
|
||||||
.about .anm { color: var(--text); font-weight: 600; }
|
.about .anm { color: var(--text); font-weight: 600; }
|
||||||
.about .ver { font-size: 11px; background: var(--surface-3); color: var(--muted); padding: 1px 7px; border-radius: 9px; }
|
.about .ver { font-size: 11px; background: var(--surface-3); color: var(--muted); padding: 1px 7px; border-radius: 9px; }
|
||||||
.about a.btn { margin-left: auto; }
|
.about a.btn { margin-left: auto; text-decoration: none; }
|
||||||
#spanel .pfoot { align-items: center; }
|
#spanel .pfoot { align-items: center; }
|
||||||
#spanel .pfoot .btn { flex: 0 0 auto; padding: 8px 14px; }
|
#spanel .pfoot .btn { flex: 0 0 auto; padding: 8px 14px; }
|
||||||
.spdirty { font-size: 12px; color: var(--yellow); display: flex; align-items: center; gap: 6px; visibility: hidden; }
|
.spdirty { font-size: 12px; color: var(--yellow); display: flex; align-items: center; gap: 6px; visibility: hidden; }
|
||||||
@@ -949,6 +957,11 @@
|
|||||||
<span id="updText"></span>
|
<span id="updText"></span>
|
||||||
<button class="btn primary" type="button" id="updBtn"></button>
|
<button class="btn primary" type="button" id="updBtn"></button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="demobanner" id="demoBanner" hidden>
|
||||||
|
<svg class="i"><use href="/icons.svg#sparkles"/></svg>
|
||||||
|
<span id="demoText"></span>
|
||||||
|
<a class="btn primary" id="demoBuy" target="_blank" rel="noopener"><svg class="i"><use href="/icons.svg#rocket"/></svg><span data-i18n="demo.buy">Get the full version</span></a>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section class="kpis" id="kpis"></section>
|
<section class="kpis" id="kpis"></section>
|
||||||
@@ -1270,7 +1283,9 @@
|
|||||||
<div class="about">
|
<div class="about">
|
||||||
<span class="anm" data-i18n="set.product">Project Dashboard</span>
|
<span class="anm" data-i18n="set.product">Project Dashboard</span>
|
||||||
<span class="ver" id="spVersion"></span>
|
<span class="ver" id="spVersion"></span>
|
||||||
|
<span class="ver demo" id="spDemo" data-i18n="demo.badge" hidden>Demo</span>
|
||||||
<span>© 2026 Michael Media</span>
|
<span>© 2026 Michael Media</span>
|
||||||
|
<a class="btn primary" id="spBuy" target="_blank" rel="noopener" hidden><svg class="i"><use href="/icons.svg#rocket"/></svg><span data-i18n="demo.buy">Get the full version</span></a>
|
||||||
<a class="btn" href="https://discord.gg/Ej4JPmCZva" target="_blank" rel="noopener"><svg class="i"><use href="/icons.svg#messages-square"/></svg>Discord</a>
|
<a class="btn" href="https://discord.gg/Ej4JPmCZva" target="_blank" rel="noopener"><svg class="i"><use href="/icons.svg#messages-square"/></svg>Discord</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -767,6 +767,11 @@ window.LANG = {
|
|||||||
'help.prev': 'Back',
|
'help.prev': 'Back',
|
||||||
'help.next': 'Next',
|
'help.next': 'Next',
|
||||||
'help.show': 'Show me this section',
|
'help.show': 'Show me this section',
|
||||||
|
'demo.banner': 'Demo – {n} of {total} projects shown. The full version shows all of them.',
|
||||||
|
'demo.bannerUpTo': 'Demo version – up to {n} projects.',
|
||||||
|
'demo.buy': 'Get the full version',
|
||||||
|
'demo.newBlocked': 'The demo is limited to {n} projects – click here to get the full version.',
|
||||||
|
'demo.badge': 'Demo',
|
||||||
'help.g.setup': 'Setup',
|
'help.g.setup': 'Setup',
|
||||||
'tour.setup.welcome': '<b>Welcome!</b> Let’s set up the dashboard in three short steps: project folders, backup (optional) and general settings. Use “Next” whenever you’re ready.',
|
'tour.setup.welcome': '<b>Welcome!</b> Let’s set up the dashboard in three short steps: project folders, backup (optional) and general settings. Use “Next” whenever you’re ready.',
|
||||||
'tour.setup.folders': '<b>1 · Project folders</b> – enter the folder that holds your projects (or “Browse…”). Every subfolder becomes a project. You can add several.',
|
'tour.setup.folders': '<b>1 · Project folders</b> – enter the folder that holds your projects (or “Browse…”). Every subfolder becomes a project. You can add several.',
|
||||||
@@ -1543,6 +1548,11 @@ window.LANG = {
|
|||||||
'help.prev': 'Zurück',
|
'help.prev': 'Zurück',
|
||||||
'help.next': 'Weiter',
|
'help.next': 'Weiter',
|
||||||
'help.show': 'Diesen Bereich zeigen',
|
'help.show': 'Diesen Bereich zeigen',
|
||||||
|
'demo.banner': 'Demo – {n} von {total} Projekten sichtbar. Die Vollversion zeigt alle.',
|
||||||
|
'demo.bannerUpTo': 'Demo-Version – bis zu {n} Projekte.',
|
||||||
|
'demo.buy': 'Vollversion holen',
|
||||||
|
'demo.newBlocked': 'Die Demo ist auf {n} Projekte begrenzt – hier klicken für die Vollversion.',
|
||||||
|
'demo.badge': 'Demo',
|
||||||
'help.g.setup': 'Einrichten',
|
'help.g.setup': 'Einrichten',
|
||||||
'tour.setup.welcome': '<b>Willkommen!</b> Wir richten das Dashboard in drei kurzen Schritten ein: Projektordner, Backup (optional) und Allgemein. Klick auf „Weiter“, wenn du bereit bist.',
|
'tour.setup.welcome': '<b>Willkommen!</b> Wir richten das Dashboard in drei kurzen Schritten ein: Projektordner, Backup (optional) und Allgemein. Klick auf „Weiter“, wenn du bereit bist.',
|
||||||
'tour.setup.folders': '<b>1 · Projektordner</b> – trag den Ordner ein, in dem deine Projekte liegen (oder „Durchsuchen…“). Jeder Unterordner wird ein Projekt. Mehrere sind möglich.',
|
'tour.setup.folders': '<b>1 · Projektordner</b> – trag den Ordner ein, in dem deine Projekte liegen (oder „Durchsuchen…“). Jeder Unterordner wird ein Projekt. Mehrere sind möglich.',
|
||||||
|
|||||||
20
server.js
20
server.js
@@ -50,6 +50,14 @@ const HOST = '127.0.0.1'
|
|||||||
const PORT = Number(process.env.DASHBOARD_PORT) || 4848
|
const PORT = Number(process.env.DASHBOARD_PORT) || 4848
|
||||||
const ALLOWED_HOSTS = new Set([`localhost:${PORT}`, `127.0.0.1:${PORT}`])
|
const ALLOWED_HOSTS = new Set([`localhost:${PORT}`, `127.0.0.1:${PORT}`])
|
||||||
|
|
||||||
|
// Edition: the demo build ships an edition.json next to this file (build.ps1 -Release -Demo).
|
||||||
|
// The demo shows at most DEMO_LIMIT projects; everything else works. DASHBOARD_DEMO=1 tests it from source.
|
||||||
|
const EDITION = (() => { try { return JSON.parse(fs.readFileSync(path.join(__dirname, 'edition.json'), 'utf8').replace(/^\uFEFF/, '')) } catch { return {} } })()
|
||||||
|
const DEMO = EDITION.demo === true || process.env.DASHBOARD_DEMO === '1'
|
||||||
|
const DEMO_LIMIT = Number(EDITION.limit) > 0 ? Number(EDITION.limit) : 6
|
||||||
|
const BUY_URL = typeof EDITION.buyUrl === 'string' && EDITION.buyUrl ? EDITION.buyUrl : 'https://sn09.itch.io/project-dashboard'
|
||||||
|
let demoTotal = 0 // all project folders found (the demo shows DEMO_LIMIT of them)
|
||||||
|
|
||||||
const STATUSES = ['idea', 'active', 'paused', 'done', 'archived']
|
const STATUSES = ['idea', 'active', 'paused', 'done', 'archived']
|
||||||
const PRIORITIES = ['low', 'medium', 'high']
|
const PRIORITIES = ['low', 'medium', 'high']
|
||||||
|
|
||||||
@@ -239,8 +247,13 @@ function projectList() {
|
|||||||
used.add(key.toLowerCase())
|
used.add(key.toLowerCase())
|
||||||
return { key, folder: p.folder, root: p.root, parent: p.parent }
|
return { key, folder: p.folder, root: p.root, parent: p.parent }
|
||||||
})
|
})
|
||||||
projMap = new Map(list.map((p) => [p.key, p]))
|
demoTotal = list.length
|
||||||
return list
|
// demo: a fixed set (by name, so touching a project doesn't swap it in) – every view,
|
||||||
|
// action and the backup only know these, since they all go through projMap
|
||||||
|
const shown = DEMO ? [...list].sort((a, b) => a.key.localeCompare(b.key, 'de', { sensitivity: 'base' })).slice(0, DEMO_LIMIT) : list
|
||||||
|
projMap = new Map(shown.map((p) => [p.key, p]))
|
||||||
|
backup.limitTo(DEMO ? shown.map((p) => ({ root: p.root.path, folder: p.folder })) : null)
|
||||||
|
return shown
|
||||||
}
|
}
|
||||||
|
|
||||||
function projectNames() { return projectList().map((p) => p.key) }
|
function projectNames() { return projectList().map((p) => p.key) }
|
||||||
@@ -415,6 +428,7 @@ app.get('/api/projects', handle(async (req, res) => {
|
|||||||
setupNeeded: !settings.get().roots.some((r) => fs.existsSync(r.path)),
|
setupNeeded: !settings.get().roots.some((r) => fs.existsSync(r.path)),
|
||||||
noneShown: !ROOTS.length && !!settings.get().noneShown,
|
noneShown: !ROOTS.length && !!settings.get().noneShown,
|
||||||
projects: list,
|
projects: list,
|
||||||
|
demo: DEMO ? { limit: DEMO_LIMIT, total: demoTotal, buyUrl: BUY_URL } : null,
|
||||||
totals: { ...storage.totals(list.map((p) => ({ root: ROOTS.find((r) => r.id === p.root)?.path, folder: p.folder }))), noBackup: list.filter((p) => p.git.level === 'red').length },
|
totals: { ...storage.totals(list.map((p) => ({ root: ROOTS.find((r) => r.id === p.root)?.path, folder: p.folder }))), noBackup: list.filter((p) => p.git.level === 'red').length },
|
||||||
scan: storage.state,
|
scan: storage.state,
|
||||||
cleanupAvailable: storage.available(),
|
cleanupAvailable: storage.available(),
|
||||||
@@ -523,6 +537,8 @@ app.post('/api/roots/active', (req, res) => {
|
|||||||
app.post('/api/projects/new', handle(async (req, res) => {
|
app.post('/api/projects/new', handle(async (req, res) => {
|
||||||
const s = settings.get()
|
const s = settings.get()
|
||||||
const b = req.body ?? {}
|
const b = req.body ?? {}
|
||||||
|
projectList()
|
||||||
|
if (DEMO && demoTotal >= DEMO_LIMIT) return res.status(403).json({ error: `Demo: maximal ${DEMO_LIMIT} Projekte – für mehr die Vollversion holen: ${BUY_URL}` })
|
||||||
const root = s.roots.find((r) => r.id === (b.root || s.activeRoot))
|
const root = s.roots.find((r) => r.id === (b.root || s.activeRoot))
|
||||||
if (!root || !fs.existsSync(root.path)) return res.status(400).json({ error: 'Projektordner nicht gefunden.' })
|
if (!root || !fs.existsSync(root.path)) return res.status(400).json({ error: 'Projektordner nicht gefunden.' })
|
||||||
let from = null
|
let from = null
|
||||||
|
|||||||
Reference in New Issue
Block a user