feat: Phase 0 shells, design system, server skeleton, Docker and CI
- Titano.Ui: DESIGN.md tokens (dark/light), generated 16-px icon set, styles for all standard controls, custom chrome window with snap layouts, rail, job bar, Auto/manual slider, chips, toasts. - Titano desktop shell with sections, Settings (language, theme), About and a --capture screenshot mode. - Titano Server skeleton: env/server.json configuration, self-signed TLS with fingerprint, /health, /server/info, i18n endpoint and the embedded admin panel; in-process server tests. - Docker image (multi-arch, PUID/PGID, health check), compose file, Unraid template; CI, release and nightly workflows; changelog tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
122 files changed
+6838
-22
No files matched your search
@@ -0,0 +1,10 @@
|
||||
**/bin/
|
||||
**/obj/
|
||||
artifacts/
|
||||
out/
|
||||
publish/
|
||||
tests/
|
||||
docs/
|
||||
.git/
|
||||
.github/
|
||||
**/*.user
|
||||
@@ -0,0 +1,214 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
DOTNET_NOLOGO: "1"
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
|
||||
TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and test (${{ matrix.os }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: .NET info
|
||||
run: dotnet --info
|
||||
|
||||
- name: Restore fixtures cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: tests/fixtures/external
|
||||
key: fixtures-${{ hashFiles('tests/fixtures/manifest.json') }}
|
||||
|
||||
- name: Build (warnings are errors)
|
||||
run: dotnet build Titano.slnx -c Release
|
||||
|
||||
- name: Zero-package guard
|
||||
run: dotnet "$TOOLS" package-guard
|
||||
|
||||
- name: Localization check
|
||||
run: dotnet "$TOOLS" i18n check
|
||||
|
||||
- name: XAML lint
|
||||
run: dotnet "$TOOLS" xaml-lint
|
||||
|
||||
- name: Format check
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet format whitespace Titano.slnx --verify-no-changes
|
||||
|
||||
- name: Fetch CC0 fixtures
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if dotnet "$TOOLS" --help | grep -q '^ fixtures'; then dotnet "$TOOLS" fixtures; fi
|
||||
|
||||
- name: Test · Core
|
||||
run: dotnet run --project tests/Titano.Core.Tests -c Release --no-build -- --junit out/junit/core.xml
|
||||
|
||||
- name: Test · Data (SQLite)
|
||||
run: dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --junit out/junit/data.xml
|
||||
|
||||
- name: Test · Server
|
||||
run: dotnet run --project tests/Titano.Server.Tests -c Release --no-build -- --junit out/junit/server.xml
|
||||
|
||||
- name: Test · Core.Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet run --project tests/Titano.Core.Windows.Tests -c Release --no-build -- --junit out/junit/core-windows.xml
|
||||
|
||||
- name: Test · App
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml
|
||||
|
||||
- name: Screenshots
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
src/Titano.App/bin/Release/net10.0-windows/Titano.exe --capture out/screenshots &
|
||||
wait $!
|
||||
ls -la out/screenshots
|
||||
|
||||
- name: Publish desktop programs (win-x64, self-contained single file)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
for p in Titano.App Titano.Uploader; do
|
||||
dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained \
|
||||
-p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true \
|
||||
-o "out/publish/$p"
|
||||
done
|
||||
dotnet publish src/Titano.Server/Titano.Server.csproj -c Release -r win-x64 --self-contained \
|
||||
-p:PublishSingleFile=true -o out/publish/Titano.Server
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}
|
||||
path: out/junit/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload screenshots
|
||||
if: runner.os == 'Windows' && always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: screenshots
|
||||
path: out/screenshots/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload Windows programs
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: titano-win-x64-${{ github.sha }}
|
||||
path: out/publish/
|
||||
retention-days: 14
|
||||
|
||||
postgres:
|
||||
name: PostgreSQL ${{ matrix.pg }} integration
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
pg: ["16", "17"]
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:${{ matrix.pg }}
|
||||
env:
|
||||
POSTGRES_USER: titano
|
||||
POSTGRES_PASSWORD: titano-ci
|
||||
POSTGRES_DB: titano_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U titano -d titano_test"
|
||||
--health-interval 5s --health-timeout 5s --health-retries 20
|
||||
env:
|
||||
TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=titano-ci;SslMode=disable
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
- name: Test · Data (PostgreSQL)
|
||||
run: dotnet run --project tests/Titano.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-pg${{ matrix.pg }}
|
||||
path: out/junit/
|
||||
if-no-files-found: ignore
|
||||
|
||||
docker:
|
||||
name: Docker image
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
env:
|
||||
POSTGRES_USER: titano
|
||||
POSTGRES_PASSWORD: titano-ci
|
||||
POSTGRES_DB: titano
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U titano -d titano"
|
||||
--health-interval 5s --health-timeout 5s --health-retries 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/docker/Dockerfile
|
||||
platforms: linux/amd64
|
||||
load: true
|
||||
push: false
|
||||
tags: titano-server:ci
|
||||
build-args: TITANO_VERSION=0.0.0-ci
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
- name: Smoke test (/health)
|
||||
run: |
|
||||
mkdir -p "$RUNNER_TEMP/archive" "$RUNNER_TEMP/data"
|
||||
docker run -d --name titano --network host \
|
||||
-e TITANO_DB_HOST=127.0.0.1 -e TITANO_DB_USER=titano -e TITANO_DB_PASSWORD=titano-ci -e TITANO_DB_NAME=titano \
|
||||
-e TITANO_ADMIN_USER=admin -e TITANO_ADMIN_PASSWORD=ci-password-1234 \
|
||||
-e PUID="$(id -u)" -e PGID="$(id -g)" \
|
||||
-v "$RUNNER_TEMP/archive:/archive" -v "$RUNNER_TEMP/data:/data" titano-server:ci
|
||||
for i in $(seq 1 60); do
|
||||
if curl -fsS http://127.0.0.1:8080/health; then echo; break; fi
|
||||
sleep 2
|
||||
done
|
||||
curl -fsS http://127.0.0.1:8080/api/v1/server/info
|
||||
curl -fsSk https://127.0.0.1:8443/health
|
||||
test "$(docker inspect --format '{{.State.Running}}' titano)" = "true"
|
||||
- name: Container logs
|
||||
if: always()
|
||||
run: docker logs titano || true
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Nightly image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "17 2 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
nightly:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Image name
|
||||
id: image
|
||||
run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT"
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.image.outputs.name }}:nightly
|
||||
build-args: TITANO_VERSION=0.0.0-nightly.${{ github.run_number }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -0,0 +1,206 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Existing tag to (re)publish, e.g. v0.2.0"
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
env:
|
||||
DOTNET_NOLOGO: "1"
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||
# Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO variable.
|
||||
RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }}
|
||||
|
||||
jobs:
|
||||
version:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag: ${{ steps.v.outputs.tag }}
|
||||
version: ${{ steps.v.outputs.version }}
|
||||
prerelease: ${{ steps.v.outputs.prerelease }}
|
||||
steps:
|
||||
- id: v
|
||||
run: |
|
||||
tag="${{ github.event.inputs.tag || github.ref_name }}"
|
||||
version="${tag#v}"
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [[ "$version" == *-* ]]; then echo "prerelease=true" >> "$GITHUB_OUTPUT"; else echo "prerelease=false" >> "$GITHUB_OUTPUT"; fi
|
||||
|
||||
windows:
|
||||
needs: version
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ needs.version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.version.outputs.tag }}
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: Build and test
|
||||
run: |
|
||||
dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION"
|
||||
for t in Core Data Server Core.Windows App; do
|
||||
dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml"
|
||||
done
|
||||
|
||||
- name: Publish self-contained programs
|
||||
run: |
|
||||
common="-c Release -r win-x64 --self-contained -p:TitanoVersion=$VERSION -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none"
|
||||
dotnet publish src/Titano.App/Titano.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app
|
||||
dotnet publish src/Titano.Uploader/Titano.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader
|
||||
dotnet publish src/Titano.Server/Titano.Server.csproj $common -o out/publish/server
|
||||
dotnet publish src/Titano.Setup/Titano.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup
|
||||
|
||||
- name: Sign binaries
|
||||
if: env.SIGN_PFX != ''
|
||||
env:
|
||||
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
|
||||
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$pfx = Join-Path $env:RUNNER_TEMP "sign.pfx"
|
||||
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX))
|
||||
$signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1
|
||||
Get-ChildItem out/publish -Recurse -Include *.exe | ForEach-Object {
|
||||
& $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName
|
||||
if ($LASTEXITCODE -ne 0) { throw "signtool failed for $($_.FullName)" }
|
||||
}
|
||||
Remove-Item $pfx
|
||||
|
||||
- name: Package installers and archives
|
||||
run: |
|
||||
mkdir -p out/release
|
||||
tools=src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll
|
||||
dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product Titano \
|
||||
--component "Titano=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \
|
||||
--version "$VERSION" --out "out/release/Titano-Setup-$VERSION.exe"
|
||||
dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product "Titano Uploader" \
|
||||
--component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Titano-Uploader-Setup-$VERSION.exe"
|
||||
(cd out/publish/server && 7z a -tzip "../../release/Titano-Server-win-x64-$VERSION.zip" . > /dev/null)
|
||||
(cd out/publish/app && 7z a -tzip "../../release/Titano-win-x64-portable-$VERSION.zip" . > /dev/null)
|
||||
|
||||
- name: Sign installers
|
||||
if: env.SIGN_PFX != ''
|
||||
env:
|
||||
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
|
||||
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$pfx = Join-Path $env:RUNNER_TEMP "sign.pfx"
|
||||
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX))
|
||||
$signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1
|
||||
Get-ChildItem out/release -Filter *.exe | ForEach-Object { & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName }
|
||||
Remove-Item $pfx
|
||||
|
||||
- name: Release notes
|
||||
run: |
|
||||
tag="${{ needs.version.outputs.tag }}"
|
||||
previous="$(git describe --tags --abbrev=0 "$tag^" 2>/dev/null || true)"
|
||||
range="${previous:+$previous..}$tag"
|
||||
git log --format='%h%x09%s' "$range" | dotnet src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll changelog --title "Titano ${{ needs.version.outputs.version }}" --out out/release-notes.md
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-windows
|
||||
path: |
|
||||
out/release/
|
||||
out/release-notes.md
|
||||
|
||||
docker:
|
||||
needs: version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.version.outputs.tag }}
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Image name
|
||||
id: image
|
||||
run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT"
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
build-args: TITANO_VERSION=${{ needs.version.outputs.version }}
|
||||
tags: |
|
||||
${{ steps.image.outputs.name }}:${{ needs.version.outputs.version }}
|
||||
${{ needs.version.outputs.prerelease == 'false' && format('{0}:latest', steps.image.outputs.name) || '' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
publish:
|
||||
needs: [version, windows, docker]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TAG: ${{ needs.version.outputs.tag }}
|
||||
VERSION: ${{ needs.version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.version.outputs.tag }}
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-windows
|
||||
path: out
|
||||
- name: Checksums
|
||||
run: |
|
||||
cd out/release
|
||||
sha256sum * > SHA256SUMS
|
||||
cat SHA256SUMS
|
||||
|
||||
- name: Create release in the public releases repository
|
||||
if: env.RELEASES_TOKEN != ''
|
||||
env:
|
||||
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
||||
run: |
|
||||
flags=""
|
||||
if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi
|
||||
gh release create "$TAG" out/release/* --repo "$RELEASES_REPO" --title "Titano $VERSION" --notes-file out/release-notes.md $flags
|
||||
# Keep the Unraid template, icon and EULA in the public repository up to date.
|
||||
git clone --depth 1 "https://x-access-token:${RELEASES_TOKEN}@github.com/${RELEASES_REPO}.git" public
|
||||
mkdir -p public/unraid
|
||||
cp deploy/unraid/titano.xml public/unraid/titano.xml
|
||||
dotnet run --project src/Titano.Tools -c Release -- make-icon --out "$RUNNER_TEMP/icons"
|
||||
cp "$RUNNER_TEMP/icons/titano-server-256.png" public/unraid/titano-server.png
|
||||
if [ -f docs/legal/EULA.md ]; then cp docs/legal/EULA.md public/EULA.md; fi
|
||||
cd public
|
||||
git config user.name "titano-release"
|
||||
git config user.email "titano-release@users.noreply.github.com"
|
||||
git add -A
|
||||
git diff --cached --quiet || git commit -m "chore: update Unraid template and assets for $TAG"
|
||||
git push
|
||||
|
||||
- name: Create release in this repository (no RELEASES_TOKEN configured)
|
||||
if: env.RELEASES_TOKEN == ''
|
||||
env:
|
||||
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
flags=""
|
||||
if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi
|
||||
gh release create "$TAG" out/release/* --repo "$GITHUB_REPOSITORY" --title "Titano $VERSION" --notes-file out/release-notes.md $flags
|
||||
@@ -435,3 +435,6 @@ tests/fixtures/external/
|
||||
/artifacts/
|
||||
*.junit.xml
|
||||
TestResults/
|
||||
|
||||
# Local agent tooling
|
||||
.claude/
|
||||
@@ -6,6 +6,7 @@
|
||||
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match($(TitanoVersion), '^\d+\.\d+\.\d+').Value).0</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
<InformationalVersion>$(TitanoVersion)</InformationalVersion>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<Product>Titano</Product>
|
||||
<Company>Titano</Company>
|
||||
<Copyright>© Titano</Copyright>
|
||||
@@ -34,6 +35,14 @@
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Public repository that hosts releases, update checks and the Unraid template (BRIEF §19.4). -->
|
||||
<TitanoReleasesRepo Condition="'$(TitanoReleasesRepo)' == ''">alby96/titano-releases</TitanoReleasesRepo>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AssemblyMetadata Include="TitanoReleasesRepo" Value="$(TitanoReleasesRepo)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
"""Titano UI icon set (DESIGN.md §5): 16-px grid, 1.5-px strokes, round caps/joins.
|
||||
Each icon = stroke path data + optional fill path data. Generates the WPF resource dictionary
|
||||
src/Titano.Ui/Icons/Icons.xaml and a preview sheet (icons.svg). Run: python3 branding/ui-icons/icons.py"""
|
||||
import math, os
|
||||
|
||||
def rr(x, y, w, h, r):
|
||||
return (f"M{x+r} {y} H{x+w-r} A{r} {r} 0 0 1 {x+w} {y+r} V{y+h-r} A{r} {r} 0 0 1 {x+w-r} {y+h} "
|
||||
f"H{x+r} A{r} {r} 0 0 1 {x} {y+h-r} V{y+r} A{r} {r} 0 0 1 {x+r} {y} Z")
|
||||
|
||||
def circ(cx, cy, r):
|
||||
return f"M{cx-r} {cy} A{r} {r} 0 1 0 {cx+r} {cy} A{r} {r} 0 1 0 {cx-r} {cy} Z"
|
||||
|
||||
def arc(cx, cy, r, a0, a1):
|
||||
"""Arc clockwise from a0 to a1 degrees (0 = 12 o'clock)."""
|
||||
p = lambda a: (cx + r * math.sin(math.radians(a)), cy - r * math.cos(math.radians(a)))
|
||||
x0, y0 = p(a0); x1, y1 = p(a1)
|
||||
large = 1 if (a1 - a0) % 360 > 180 else 0
|
||||
return f"M{x0:.2f} {y0:.2f} A{r} {r} 0 {large} 1 {x1:.2f} {y1:.2f}"
|
||||
|
||||
I = {}
|
||||
# Navigation
|
||||
I["Library"] = (rr(1.5,1.5,5.5,5.5,1)+rr(9,1.5,5.5,5.5,1)+rr(1.5,9,5.5,5.5,1)+rr(9,9,5.5,5.5,1), None)
|
||||
I["Import"] = ("M8 2V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5", None)
|
||||
I["Sequence"] = ("M2 12.5 L11.5 3 L13 4.5 L3.5 14 H2 Z", None)
|
||||
I["Archive"] = ("M2 4.5 H14 V13.5 H2 Z M2 2 H14 V4.5 H2 Z M6 8 H10", None)
|
||||
I["Jobs"] = ("M3 8 H13 M3 4 H13 M3 12 H9", None)
|
||||
I["Server"] = ("M4.5 12.5 A3 3 0 0 1 4.2 6.5 A4 4 0 0 1 11.9 5.5 A3.5 3.5 0 0 1 12.2 12.5 Z", None)
|
||||
I["Settings"] = (circ(8,8,2.2)+" M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4", None)
|
||||
I["About"] = (circ(8,8,6.5)+" M8 7 V11 M8 4.8 V5.2", None)
|
||||
I["Menu"] = ("M2.5 4 H13.5 M2.5 8 H13.5 M2.5 12 H13.5", None)
|
||||
I["Users"] = (circ(8,5,3)+" M2.5 14 A5.5 5.5 0 0 1 13.5 14", None)
|
||||
I["User"] = I["Users"]
|
||||
I["Logs"] = ("M3.5 1.5 H9.5 L12.5 4.5 V14.5 H3.5 Z M5.5 7 H10.5 M5.5 9.5 H10.5 M5.5 12 H8.5", None)
|
||||
# Toolbar / actions
|
||||
I["Search"] = (circ(7,7,4.5)+" M10.4 10.4 L14 14", None)
|
||||
I["Refresh"] = (arc(8,8,5.5,30,320)+" M13.2 2.6 L13.2 5.3 L10.5 5.3", None)
|
||||
I["ViewGrid"] = I["Library"]
|
||||
I["ViewList"] = ("M5.5 4 H13.5 M5.5 8 H13.5 M5.5 12 H13.5 M2.5 4 H2.6 M2.5 8 H2.6 M2.5 12 H2.6", None)
|
||||
I["ViewTimeline"] = ("M2 13.5 H14 M3.5 11 V8 M6 11 V5 M8.5 11 V7 M11 11 V3.5 M13.5 11 V9", None)
|
||||
I["ChevronDown"] = ("M4 6 L8 10 L12 6", None)
|
||||
I["ChevronUp"] = ("M4 10 L8 6 L12 10", None)
|
||||
I["ChevronRight"] = ("M6 4 L10 8 L6 12", None)
|
||||
I["ChevronLeft"] = ("M10 4 L6 8 L10 12", None)
|
||||
I["Close"] = ("M4 4 L12 12 M12 4 L4 12", None)
|
||||
I["Check"] = ("M3 8.5 L6.5 12 L13 4.5", None)
|
||||
I["Back"] = ("M13 8 H3 M7 4 L3 8 L7 12", None)
|
||||
I["Forward"] = ("M3 8 H13 M9 4 L13 8 L9 12", None)
|
||||
I["Plus"] = ("M8 3 V13 M3 8 H13", None)
|
||||
I["Minus"] = ("M3 8 H13", None)
|
||||
I["More"] = (None, circ(3.5,8,1.1)+circ(8,8,1.1)+circ(12.5,8,1.1))
|
||||
I["Play"] = (None, "M4.5 2.8 L13 8 L4.5 13.2 Z")
|
||||
I["Pause"] = (None, rr(4,3,2.6,10,0.8)+rr(9.4,3,2.6,10,0.8))
|
||||
I["Stop"] = (None, rr(3.5,3.5,9,9,1.5))
|
||||
I["Folder"] = ("M1.5 4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H13.5 A1 1 0 0 1 14.5 5.5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z", None)
|
||||
I["FolderOpen"] = ("M1.5 12.5 V4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H12.5 V6.5 M1.5 12.5 L3.5 7 H14.5 L12.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z", None)
|
||||
I["Card"] = ("M4.5 1.5 H10 L12.5 4 V13.5 A1 1 0 0 1 11.5 14.5 H4.5 A1 1 0 0 1 3.5 13.5 V2.5 A1 1 0 0 1 4.5 1.5 Z M6 3.5 V5.5 M8 3.5 V5.5 M10 4.5 V5.5", None)
|
||||
I["Drive"] = (rr(1.5,4.5,13,7,1.5)+" M4.5 8 H4.6 M7 8 H11.5", None)
|
||||
I["Eject"] = ("M3 13 H13", "M8 2.8 L13 9.5 H3 Z")
|
||||
I["Download"] = ("M8 2 V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5", None)
|
||||
I["Upload"] = ("M8 10.5 V2.5 M4.5 6 L8 2.5 L11.5 6 M2.5 13.5 H13.5", None)
|
||||
I["Sync"] = (arc(8,8,5.5,20,160)+" "+arc(8,8,5.5,200,340)+" M13.5 6.5 L13.2 9.4 L10.6 8.4 M2.5 9.5 L2.8 6.6 L5.4 7.6", None)
|
||||
I["Compare"] = (rr(1.5,2.5,13,11,1.5)+" M8 1 V15", None)
|
||||
I["Vectors"] = ("M2.5 12.5 L7 8 M7 8 H4.5 M7 8 V10.5 M9 7 L13.5 2.5 M13.5 2.5 H11 M13.5 2.5 V5", None)
|
||||
I["Regions"] = ("M1.5 9.5 C4 8 6 10.5 8.5 9 C10.5 7.8 12.5 8.5 14.5 9.5 M1.5 13.5 H14.5 M1.5 2.5 H14.5", None)
|
||||
I["CropMask"] = ("M4 1.5 V12 H14.5 M1.5 4 H12 V14.5", None)
|
||||
I["Fullscreen"] = ("M2 6 V2 H6 M10 2 H14 V6 M14 10 V14 H10 M6 14 H2 V10", None)
|
||||
I["ActualSize"] = (rr(1.5,2.5,13,11,1.5)+" M5 6 L6 5.5 V10.5 M9.5 6 L10.5 5.5 V10.5 M8 7 V7.1 M8 9.5 V9.6", None)
|
||||
I["Reset"] = (arc(8,8.5,5,300,210)+" M3.2 3.2 V6.2 H6.2", None)
|
||||
I["Warning"] = ("M8 1.8 L14.8 13.8 H1.2 Z M8 6.2 V9.6 M8 11.7 V11.8", None)
|
||||
I["ErrorCircle"] = (circ(8,8,6.5)+" M5.8 5.8 L10.2 10.2 M10.2 5.8 L5.8 10.2", None)
|
||||
I["SuccessCircle"] = (circ(8,8,6.5)+" M5 8.3 L7.1 10.3 L11 6", None)
|
||||
I["Lock"] = (rr(3,7,10,7.5,1.5)+" M5.5 7 V5 A2.5 2.5 0 0 1 10.5 5 V7", None)
|
||||
I["Key"] = (circ(5,10.5,3)+" M7.2 8.3 L13.5 2 M11.5 4 L13 5.5 M9.8 5.7 L11 6.9", None)
|
||||
I["Power"] = ("M8 1.8 V7.5 "+arc(8,8.8,5.5,40,320), None)
|
||||
I["Moon"] = ("M9.5 1.8 A6.5 6.5 0 1 0 14.2 11.2 A5.5 5.5 0 0 1 9.5 1.8 Z", None)
|
||||
I["Sun"] = (circ(8,8,3)+" M8 1 V2.5 M8 13.5 V15 M1 8 H2.5 M13.5 8 H15 M3 3 L4 4 M12 12 L13 13 M3 13 L4 12 M12 4 L13 3", None)
|
||||
I["Star"] = ("M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z", None)
|
||||
I["StarFilled"] = (None, "M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z")
|
||||
I["Tag"] = ("M1.5 2.5 A1 1 0 0 1 2.5 1.5 H7.5 L14.5 8.5 L8.5 14.5 L1.5 7.5 Z M5 5 H5.1", None)
|
||||
I["Delete"] = ("M2.5 4 H13.5 M6 4 V2.5 H10 V4 M3.8 4 L4.6 14 H11.4 L12.2 4 M6.6 6.8 V11.2 M9.4 6.8 V11.2", None)
|
||||
I["Copy"] = (rr(5,5,9.5,9.5,1.5)+" M11 5 V2.5 A1 1 0 0 0 10 1.5 H2.5 A1 1 0 0 0 1.5 2.5 V10 A1 1 0 0 0 2.5 11 H5", None)
|
||||
I["Link"] = ("M6.8 9.2 L9.2 6.8 M7.5 4.5 L9 3 A2.8 2.8 0 0 1 13 7 L11.5 8.5 M8.5 11.5 L7 13 A2.8 2.8 0 0 1 3 9 L4.5 7.5", None)
|
||||
I["ExternalLink"] = ("M9.5 2 H14 V6.5 M14 2 L7.5 8.5 M12 9.5 V13 A1 1 0 0 1 11 14 H3 A1 1 0 0 1 2 13 V5 A1 1 0 0 1 3 4 H6.5", None)
|
||||
I["Calendar"] = (rr(1.5,3,13,11.5,1.5)+" M1.5 6.5 H14.5 M5 1.5 V4 M11 1.5 V4", None)
|
||||
I["Camera"] = ("M1.5 5 A1 1 0 0 1 2.5 4 H4.5 L6 2.5 H10 L11.5 4 H13.5 A1 1 0 0 1 14.5 5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z "+circ(8,8.5,2.8), None)
|
||||
I["Chart"] = ("M2 2 V14 H14 M4.5 10.5 L7.5 7 L9.5 9 L13.5 4", None)
|
||||
I["Filmstrip"] = (rr(1.5,2.5,13,11,1.5)+" M4.5 2.5 V13.5 M11.5 2.5 V13.5 M1.5 6 H4.5 M1.5 10 H4.5 M11.5 6 H14.5 M11.5 10 H14.5", None)
|
||||
I["Layers"] = ("M8 1.8 L14.5 5.2 L8 8.6 L1.5 5.2 Z M1.5 8.2 L8 11.6 L14.5 8.2 M1.5 11 L8 14.4 L14.5 11", None)
|
||||
I["Clock"] = (circ(8,8,6.5)+" M8 4.5 V8 L10.5 9.5", None)
|
||||
I["Exposure"] = (circ(8,8,6.5)+" M3.4 12.6 L12.6 3.4 M4.5 6 H7 M5.75 4.75 V7.25 M9 10 H11.5", None)
|
||||
I["Motion"] = ("M1.5 8 C3.5 3 5.5 3 7.5 8 C9.5 13 11.5 13 14.5 8", None)
|
||||
I["Time"] = I["Clock"]
|
||||
I["Stack"] = I["Layers"]
|
||||
I["Export"] = ("M8 10 V1.8 M4.8 5 L8 1.8 L11.2 5 M5 7.5 H3 A1 1 0 0 0 2 8.5 V13.5 A1 1 0 0 0 3 14.5 H13 A1 1 0 0 0 14 13.5 V8.5 A1 1 0 0 0 13 7.5 H11", None)
|
||||
I["Render"] = (rr(1.5,2.5,13,11,1.5), "M6.5 5.5 L10.8 8 L6.5 10.5 Z")
|
||||
I["Analyse"] = ("M1.5 8.5 H4.5 L6.5 3.5 L9.5 12.5 L11.5 8.5 H14.5", None)
|
||||
I["Optimise"] = ("M7 2 L8.2 5.8 L12 7 L8.2 8.2 L7 12 L5.8 8.2 L2 7 L5.8 5.8 Z M12.5 10.5 L13 12 L14.5 12.5 L13 13 L12.5 14.5 L12 13 L10.5 12.5 L12 12 Z", None)
|
||||
I["Duplicate"] = I["Copy"]
|
||||
I["Verify"] = ("M8 1.5 L13.5 3.5 V7.5 C13.5 11 11 13.3 8 14.5 C5 13.3 2.5 11 2.5 7.5 V3.5 Z M5.5 8 L7.3 9.8 L10.6 6.3", None)
|
||||
I["Database"] = ("M2.5 3.8 C2.5 2.5 13.5 2.5 13.5 3.8 C13.5 5.1 2.5 5.1 2.5 3.8 Z M2.5 3.8 V12.2 C2.5 13.5 13.5 13.5 13.5 12.2 V3.8 M2.5 8 C2.5 9.3 13.5 9.3 13.5 8", None)
|
||||
I["Gpu"] = (rr(3.5,3.5,9,9,1.5)+" "+rr(6,6,4,4,0.5)+" M6 1.5 V3.5 M10 1.5 V3.5 M6 12.5 V14.5 M10 12.5 V14.5 M1.5 6 H3.5 M1.5 10 H3.5 M12.5 6 H14.5 M12.5 10 H14.5", None)
|
||||
I["Network"] = ("M2 6 A8.5 8.5 0 0 1 14 6 M4 8.5 A5.5 5.5 0 0 1 12 8.5 M6 11 A2.6 2.6 0 0 1 10 11", circ(8,13,1.1))
|
||||
I["Sort"] = ("M5 2.5 V13.5 M2.5 11 L5 13.5 L7.5 11 M11 13.5 V2.5 M8.5 5 L11 2.5 L13.5 5", None)
|
||||
I["Filter"] = ("M1.5 2.5 H14.5 L9.5 8.5 V13.5 L6.5 12 V8.5 Z", None)
|
||||
I["Info"] = I["About"]
|
||||
I["Image"] = (rr(1.5,2.5,13,11,1.5)+" M1.5 11 L5.5 7 L9 10.5 L11 8.5 L14.5 12", circ(10.8,5.6,1.2))
|
||||
I["Hero"] = (rr(1.5,2.5,13,11,1.5), "M8 4.8 L8.9 6.9 L11.1 7.1 L9.4 8.5 L9.9 10.7 L8 9.5 L6.1 10.7 L6.6 8.5 L4.9 7.1 L7.1 6.9 Z")
|
||||
I["Exclude"] = (circ(8,8,6.5)+" M3.4 12.6 L12.6 3.4", None)
|
||||
I["Eye"] = ("M1.5 8 C3.5 4 12.5 4 14.5 8 C12.5 12 3.5 12 1.5 8 Z "+circ(8,8,2.2), None)
|
||||
I["Wipe"] = I["Compare"]
|
||||
I["Spline"] = ("M2 13 C5 13 5 3 8 8 C11 13 11 3 14 3", circ(2,13,1.2)+circ(14,3,1.2))
|
||||
I["Keyframe"] = ("M8 2 L13 8 L8 14 L3 8 Z", None)
|
||||
I["Tray"] = ("M1.5 9.5 H5 L6.5 11.5 H9.5 L11 9.5 H14.5 M1.5 9.5 L3.5 3 H12.5 L14.5 9.5 V13.5 H1.5 Z", None)
|
||||
I["Window"] = (rr(1.5,2.5,13,11,1.5)+" M1.5 5.5 H14.5", None)
|
||||
I["Clipboard"] = (rr(2.5,2.5,11,12,1.5)+" "+rr(5.5,1.5,5,2.5,0.8), None)
|
||||
I["Cancel"] = I["ErrorCircle"]
|
||||
I["Retry"] = I["Refresh"]
|
||||
I["Grip"] = (None, circ(6,4,1)+circ(10,4,1)+circ(6,8,1)+circ(10,8,1)+circ(6,12,1)+circ(10,12,1))
|
||||
I["Dot"] = (None, circ(8,8,3.5))
|
||||
I["Ring"] = (circ(8,8,3.5), None)
|
||||
I["HalfDot"] = (circ(8,8,3.5), "M8 4.5 A3.5 3.5 0 0 1 8 11.5 Z")
|
||||
I["Triangle"] = (None, "M8 3 L13.5 12.5 H2.5 Z")
|
||||
I["TriangleRight"] = (None, "M5 3 L12 8 L5 13 Z")
|
||||
I["Cross"] = ("M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5", None)
|
||||
|
||||
out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Titano.Ui", "Icons", "Icons.xaml")
|
||||
with open(out, "w") as f:
|
||||
f.write('<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\n')
|
||||
f.write(' xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\n')
|
||||
f.write(' xmlns:ui="clr-namespace:Titano.Ui.Controls">\n')
|
||||
f.write(' <!-- Generated by branding/ui-icons/icons.py — 16-px grid, 1.5-px round strokes (DESIGN.md §5). Do not edit by hand. -->\n')
|
||||
for name, (stroke, fill) in sorted(I.items()):
|
||||
attrs = ''
|
||||
if stroke: attrs += f' Stroke="{stroke}"'
|
||||
if fill: attrs += f' Fill="{fill}"'
|
||||
f.write(f' <ui:IconData x:Key="Icon.{name}"{attrs} />\n')
|
||||
f.write('</ResourceDictionary>\n')
|
||||
|
||||
cols = 10
|
||||
names = sorted(I)
|
||||
rows = (len(names) + cols - 1) // cols
|
||||
svg = [f'<svg xmlns="http://www.w3.org/2000/svg" width="{cols*90}" height="{rows*70}" style="background:#1f1f23">']
|
||||
for k, name in enumerate(names):
|
||||
x, y = (k % cols) * 90 + 37, (k // cols) * 70 + 14
|
||||
stroke, fill = I[name]
|
||||
svg.append(f'<g transform="translate({x},{y}) scale(1.5)">')
|
||||
if fill: svg.append(f'<path d="{fill}" fill="#f2f3f5"/>')
|
||||
if stroke: svg.append(f'<path d="{stroke}" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>')
|
||||
svg.append('</g>')
|
||||
svg.append(f'<text x="{x+12}" y="{y+52}" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">{name}</text>')
|
||||
svg.append('</svg>')
|
||||
open(os.path.join(os.path.dirname(__file__), "icons.svg"), "w").write("\n".join(svg))
|
||||
print(len(I), "icons")
|
||||
@@ -0,0 +1,417 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="770" style="background:#1f1f23">
|
||||
<g transform="translate(37,14) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M8 7 V11 M8 4.8 V5.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">About</text>
|
||||
<g transform="translate(127,14) scale(1.5)">
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M5 6 L6 5.5 V10.5 M9.5 6 L10.5 5.5 V10.5 M8 7 V7.1 M8 9.5 V9.6" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ActualSize</text>
|
||||
<g transform="translate(217,14) scale(1.5)">
|
||||
<path d="M1.5 8.5 H4.5 L6.5 3.5 L9.5 12.5 L11.5 8.5 H14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Analyse</text>
|
||||
<g transform="translate(307,14) scale(1.5)">
|
||||
<path d="M2 4.5 H14 V13.5 H2 Z M2 2 H14 V4.5 H2 Z M6 8 H10" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Archive</text>
|
||||
<g transform="translate(397,14) scale(1.5)">
|
||||
<path d="M13 8 H3 M7 4 L3 8 L7 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Back</text>
|
||||
<g transform="translate(487,14) scale(1.5)">
|
||||
<path d="M3.0 3 H13.0 A1.5 1.5 0 0 1 14.5 4.5 V13.0 A1.5 1.5 0 0 1 13.0 14.5 H3.0 A1.5 1.5 0 0 1 1.5 13.0 V4.5 A1.5 1.5 0 0 1 3.0 3 Z M1.5 6.5 H14.5 M5 1.5 V4 M11 1.5 V4" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Calendar</text>
|
||||
<g transform="translate(577,14) scale(1.5)">
|
||||
<path d="M1.5 5 A1 1 0 0 1 2.5 4 H4.5 L6 2.5 H10 L11.5 4 H13.5 A1 1 0 0 1 14.5 5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z M5.2 8.5 A2.8 2.8 0 1 0 10.8 8.5 A2.8 2.8 0 1 0 5.2 8.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Camera</text>
|
||||
<g transform="translate(667,14) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M5.8 5.8 L10.2 10.2 M10.2 5.8 L5.8 10.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Cancel</text>
|
||||
<g transform="translate(757,14) scale(1.5)">
|
||||
<path d="M4.5 1.5 H10 L12.5 4 V13.5 A1 1 0 0 1 11.5 14.5 H4.5 A1 1 0 0 1 3.5 13.5 V2.5 A1 1 0 0 1 4.5 1.5 Z M6 3.5 V5.5 M8 3.5 V5.5 M10 4.5 V5.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Card</text>
|
||||
<g transform="translate(847,14) scale(1.5)">
|
||||
<path d="M2 2 V14 H14 M4.5 10.5 L7.5 7 L9.5 9 L13.5 4" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="66" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Chart</text>
|
||||
<g transform="translate(37,84) scale(1.5)">
|
||||
<path d="M3 8.5 L6.5 12 L13 4.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Check</text>
|
||||
<g transform="translate(127,84) scale(1.5)">
|
||||
<path d="M4 6 L8 10 L12 6" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ChevronDown</text>
|
||||
<g transform="translate(217,84) scale(1.5)">
|
||||
<path d="M10 4 L6 8 L10 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ChevronLeft</text>
|
||||
<g transform="translate(307,84) scale(1.5)">
|
||||
<path d="M6 4 L10 8 L6 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ChevronRight</text>
|
||||
<g transform="translate(397,84) scale(1.5)">
|
||||
<path d="M4 10 L8 6 L12 10" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ChevronUp</text>
|
||||
<g transform="translate(487,84) scale(1.5)">
|
||||
<path d="M4.0 2.5 H12.0 A1.5 1.5 0 0 1 13.5 4.0 V13.0 A1.5 1.5 0 0 1 12.0 14.5 H4.0 A1.5 1.5 0 0 1 2.5 13.0 V4.0 A1.5 1.5 0 0 1 4.0 2.5 Z M6.3 1.5 H9.7 A0.8 0.8 0 0 1 10.5 2.3 V3.2 A0.8 0.8 0 0 1 9.7 4.0 H6.3 A0.8 0.8 0 0 1 5.5 3.2 V2.3 A0.8 0.8 0 0 1 6.3 1.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Clipboard</text>
|
||||
<g transform="translate(577,84) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M8 4.5 V8 L10.5 9.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Clock</text>
|
||||
<g transform="translate(667,84) scale(1.5)">
|
||||
<path d="M4 4 L12 12 M12 4 L4 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Close</text>
|
||||
<g transform="translate(757,84) scale(1.5)">
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M8 1 V15" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Compare</text>
|
||||
<g transform="translate(847,84) scale(1.5)">
|
||||
<path d="M6.5 5 H13.0 A1.5 1.5 0 0 1 14.5 6.5 V13.0 A1.5 1.5 0 0 1 13.0 14.5 H6.5 A1.5 1.5 0 0 1 5 13.0 V6.5 A1.5 1.5 0 0 1 6.5 5 Z M11 5 V2.5 A1 1 0 0 0 10 1.5 H2.5 A1 1 0 0 0 1.5 2.5 V10 A1 1 0 0 0 2.5 11 H5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="136" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Copy</text>
|
||||
<g transform="translate(37,154) scale(1.5)">
|
||||
<path d="M4 1.5 V12 H14.5 M1.5 4 H12 V14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">CropMask</text>
|
||||
<g transform="translate(127,154) scale(1.5)">
|
||||
<path d="M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Cross</text>
|
||||
<g transform="translate(217,154) scale(1.5)">
|
||||
<path d="M2.5 3.8 C2.5 2.5 13.5 2.5 13.5 3.8 C13.5 5.1 2.5 5.1 2.5 3.8 Z M2.5 3.8 V12.2 C2.5 13.5 13.5 13.5 13.5 12.2 V3.8 M2.5 8 C2.5 9.3 13.5 9.3 13.5 8" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Database</text>
|
||||
<g transform="translate(307,154) scale(1.5)">
|
||||
<path d="M2.5 4 H13.5 M6 4 V2.5 H10 V4 M3.8 4 L4.6 14 H11.4 L12.2 4 M6.6 6.8 V11.2 M9.4 6.8 V11.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Delete</text>
|
||||
<g transform="translate(397,154) scale(1.5)">
|
||||
<path d="M4.5 8 A3.5 3.5 0 1 0 11.5 8 A3.5 3.5 0 1 0 4.5 8 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="409" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Dot</text>
|
||||
<g transform="translate(487,154) scale(1.5)">
|
||||
<path d="M8 2 V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Download</text>
|
||||
<g transform="translate(577,154) scale(1.5)">
|
||||
<path d="M3.0 4.5 H13.0 A1.5 1.5 0 0 1 14.5 6.0 V10.0 A1.5 1.5 0 0 1 13.0 11.5 H3.0 A1.5 1.5 0 0 1 1.5 10.0 V6.0 A1.5 1.5 0 0 1 3.0 4.5 Z M4.5 8 H4.6 M7 8 H11.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Drive</text>
|
||||
<g transform="translate(667,154) scale(1.5)">
|
||||
<path d="M6.5 5 H13.0 A1.5 1.5 0 0 1 14.5 6.5 V13.0 A1.5 1.5 0 0 1 13.0 14.5 H6.5 A1.5 1.5 0 0 1 5 13.0 V6.5 A1.5 1.5 0 0 1 6.5 5 Z M11 5 V2.5 A1 1 0 0 0 10 1.5 H2.5 A1 1 0 0 0 1.5 2.5 V10 A1 1 0 0 0 2.5 11 H5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Duplicate</text>
|
||||
<g transform="translate(757,154) scale(1.5)">
|
||||
<path d="M8 2.8 L13 9.5 H3 Z" fill="#f2f3f5"/>
|
||||
<path d="M3 13 H13" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Eject</text>
|
||||
<g transform="translate(847,154) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M5.8 5.8 L10.2 10.2 M10.2 5.8 L5.8 10.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="206" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ErrorCircle</text>
|
||||
<g transform="translate(37,224) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M3.4 12.6 L12.6 3.4" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Exclude</text>
|
||||
<g transform="translate(127,224) scale(1.5)">
|
||||
<path d="M8 10 V1.8 M4.8 5 L8 1.8 L11.2 5 M5 7.5 H3 A1 1 0 0 0 2 8.5 V13.5 A1 1 0 0 0 3 14.5 H13 A1 1 0 0 0 14 13.5 V8.5 A1 1 0 0 0 13 7.5 H11" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Export</text>
|
||||
<g transform="translate(217,224) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M3.4 12.6 L12.6 3.4 M4.5 6 H7 M5.75 4.75 V7.25 M9 10 H11.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Exposure</text>
|
||||
<g transform="translate(307,224) scale(1.5)">
|
||||
<path d="M9.5 2 H14 V6.5 M14 2 L7.5 8.5 M12 9.5 V13 A1 1 0 0 1 11 14 H3 A1 1 0 0 1 2 13 V5 A1 1 0 0 1 3 4 H6.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ExternalLink</text>
|
||||
<g transform="translate(397,224) scale(1.5)">
|
||||
<path d="M1.5 8 C3.5 4 12.5 4 14.5 8 C12.5 12 3.5 12 1.5 8 Z M5.8 8 A2.2 2.2 0 1 0 10.2 8 A2.2 2.2 0 1 0 5.8 8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Eye</text>
|
||||
<g transform="translate(487,224) scale(1.5)">
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M4.5 2.5 V13.5 M11.5 2.5 V13.5 M1.5 6 H4.5 M1.5 10 H4.5 M11.5 6 H14.5 M11.5 10 H14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Filmstrip</text>
|
||||
<g transform="translate(577,224) scale(1.5)">
|
||||
<path d="M1.5 2.5 H14.5 L9.5 8.5 V13.5 L6.5 12 V8.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Filter</text>
|
||||
<g transform="translate(667,224) scale(1.5)">
|
||||
<path d="M1.5 4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H13.5 A1 1 0 0 1 14.5 5.5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Folder</text>
|
||||
<g transform="translate(757,224) scale(1.5)">
|
||||
<path d="M1.5 12.5 V4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H12.5 V6.5 M1.5 12.5 L3.5 7 H14.5 L12.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">FolderOpen</text>
|
||||
<g transform="translate(847,224) scale(1.5)">
|
||||
<path d="M3 8 H13 M9 4 L13 8 L9 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="276" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Forward</text>
|
||||
<g transform="translate(37,294) scale(1.5)">
|
||||
<path d="M2 6 V2 H6 M10 2 H14 V6 M14 10 V14 H10 M6 14 H2 V10" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Fullscreen</text>
|
||||
<g transform="translate(127,294) scale(1.5)">
|
||||
<path d="M5.0 3.5 H11.0 A1.5 1.5 0 0 1 12.5 5.0 V11.0 A1.5 1.5 0 0 1 11.0 12.5 H5.0 A1.5 1.5 0 0 1 3.5 11.0 V5.0 A1.5 1.5 0 0 1 5.0 3.5 Z M6.5 6 H9.5 A0.5 0.5 0 0 1 10 6.5 V9.5 A0.5 0.5 0 0 1 9.5 10 H6.5 A0.5 0.5 0 0 1 6 9.5 V6.5 A0.5 0.5 0 0 1 6.5 6 Z M6 1.5 V3.5 M10 1.5 V3.5 M6 12.5 V14.5 M10 12.5 V14.5 M1.5 6 H3.5 M1.5 10 H3.5 M12.5 6 H14.5 M12.5 10 H14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Gpu</text>
|
||||
<g transform="translate(217,294) scale(1.5)">
|
||||
<path d="M5 4 A1 1 0 1 0 7 4 A1 1 0 1 0 5 4 ZM9 4 A1 1 0 1 0 11 4 A1 1 0 1 0 9 4 ZM5 8 A1 1 0 1 0 7 8 A1 1 0 1 0 5 8 ZM9 8 A1 1 0 1 0 11 8 A1 1 0 1 0 9 8 ZM5 12 A1 1 0 1 0 7 12 A1 1 0 1 0 5 12 ZM9 12 A1 1 0 1 0 11 12 A1 1 0 1 0 9 12 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="229" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Grip</text>
|
||||
<g transform="translate(307,294) scale(1.5)">
|
||||
<path d="M8 4.5 A3.5 3.5 0 0 1 8 11.5 Z" fill="#f2f3f5"/>
|
||||
<path d="M4.5 8 A3.5 3.5 0 1 0 11.5 8 A3.5 3.5 0 1 0 4.5 8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">HalfDot</text>
|
||||
<g transform="translate(397,294) scale(1.5)">
|
||||
<path d="M8 4.8 L8.9 6.9 L11.1 7.1 L9.4 8.5 L9.9 10.7 L8 9.5 L6.1 10.7 L6.6 8.5 L4.9 7.1 L7.1 6.9 Z" fill="#f2f3f5"/>
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Hero</text>
|
||||
<g transform="translate(487,294) scale(1.5)">
|
||||
<path d="M9.600000000000001 5.6 A1.2 1.2 0 1 0 12.0 5.6 A1.2 1.2 0 1 0 9.600000000000001 5.6 Z" fill="#f2f3f5"/>
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M1.5 11 L5.5 7 L9 10.5 L11 8.5 L14.5 12" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Image</text>
|
||||
<g transform="translate(577,294) scale(1.5)">
|
||||
<path d="M8 2V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Import</text>
|
||||
<g transform="translate(667,294) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M8 7 V11 M8 4.8 V5.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Info</text>
|
||||
<g transform="translate(757,294) scale(1.5)">
|
||||
<path d="M3 8 H13 M3 4 H13 M3 12 H9" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Jobs</text>
|
||||
<g transform="translate(847,294) scale(1.5)">
|
||||
<path d="M2 10.5 A3 3 0 1 0 8 10.5 A3 3 0 1 0 2 10.5 Z M7.2 8.3 L13.5 2 M11.5 4 L13 5.5 M9.8 5.7 L11 6.9" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="346" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Key</text>
|
||||
<g transform="translate(37,364) scale(1.5)">
|
||||
<path d="M8 2 L13 8 L8 14 L3 8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Keyframe</text>
|
||||
<g transform="translate(127,364) scale(1.5)">
|
||||
<path d="M8 1.8 L14.5 5.2 L8 8.6 L1.5 5.2 Z M1.5 8.2 L8 11.6 L14.5 8.2 M1.5 11 L8 14.4 L14.5 11" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Layers</text>
|
||||
<g transform="translate(217,364) scale(1.5)">
|
||||
<path d="M2.5 1.5 H6.0 A1 1 0 0 1 7.0 2.5 V6.0 A1 1 0 0 1 6.0 7.0 H2.5 A1 1 0 0 1 1.5 6.0 V2.5 A1 1 0 0 1 2.5 1.5 ZM10 1.5 H13.5 A1 1 0 0 1 14.5 2.5 V6.0 A1 1 0 0 1 13.5 7.0 H10 A1 1 0 0 1 9 6.0 V2.5 A1 1 0 0 1 10 1.5 ZM2.5 9 H6.0 A1 1 0 0 1 7.0 10 V13.5 A1 1 0 0 1 6.0 14.5 H2.5 A1 1 0 0 1 1.5 13.5 V10 A1 1 0 0 1 2.5 9 ZM10 9 H13.5 A1 1 0 0 1 14.5 10 V13.5 A1 1 0 0 1 13.5 14.5 H10 A1 1 0 0 1 9 13.5 V10 A1 1 0 0 1 10 9 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Library</text>
|
||||
<g transform="translate(307,364) scale(1.5)">
|
||||
<path d="M6.8 9.2 L9.2 6.8 M7.5 4.5 L9 3 A2.8 2.8 0 0 1 13 7 L11.5 8.5 M8.5 11.5 L7 13 A2.8 2.8 0 0 1 3 9 L4.5 7.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Link</text>
|
||||
<g transform="translate(397,364) scale(1.5)">
|
||||
<path d="M4.5 7 H11.5 A1.5 1.5 0 0 1 13 8.5 V13.0 A1.5 1.5 0 0 1 11.5 14.5 H4.5 A1.5 1.5 0 0 1 3 13.0 V8.5 A1.5 1.5 0 0 1 4.5 7 Z M5.5 7 V5 A2.5 2.5 0 0 1 10.5 5 V7" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Lock</text>
|
||||
<g transform="translate(487,364) scale(1.5)">
|
||||
<path d="M3.5 1.5 H9.5 L12.5 4.5 V14.5 H3.5 Z M5.5 7 H10.5 M5.5 9.5 H10.5 M5.5 12 H8.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Logs</text>
|
||||
<g transform="translate(577,364) scale(1.5)">
|
||||
<path d="M2.5 4 H13.5 M2.5 8 H13.5 M2.5 12 H13.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Menu</text>
|
||||
<g transform="translate(667,364) scale(1.5)">
|
||||
<path d="M3 8 H13" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Minus</text>
|
||||
<g transform="translate(757,364) scale(1.5)">
|
||||
<path d="M9.5 1.8 A6.5 6.5 0 1 0 14.2 11.2 A5.5 5.5 0 0 1 9.5 1.8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Moon</text>
|
||||
<g transform="translate(847,364) scale(1.5)">
|
||||
<path d="M2.4 8 A1.1 1.1 0 1 0 4.6 8 A1.1 1.1 0 1 0 2.4 8 ZM6.9 8 A1.1 1.1 0 1 0 9.1 8 A1.1 1.1 0 1 0 6.9 8 ZM11.4 8 A1.1 1.1 0 1 0 13.6 8 A1.1 1.1 0 1 0 11.4 8 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="859" y="416" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">More</text>
|
||||
<g transform="translate(37,434) scale(1.5)">
|
||||
<path d="M1.5 8 C3.5 3 5.5 3 7.5 8 C9.5 13 11.5 13 14.5 8" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Motion</text>
|
||||
<g transform="translate(127,434) scale(1.5)">
|
||||
<path d="M6.9 13 A1.1 1.1 0 1 0 9.1 13 A1.1 1.1 0 1 0 6.9 13 Z" fill="#f2f3f5"/>
|
||||
<path d="M2 6 A8.5 8.5 0 0 1 14 6 M4 8.5 A5.5 5.5 0 0 1 12 8.5 M6 11 A2.6 2.6 0 0 1 10 11" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Network</text>
|
||||
<g transform="translate(217,434) scale(1.5)">
|
||||
<path d="M7 2 L8.2 5.8 L12 7 L8.2 8.2 L7 12 L5.8 8.2 L2 7 L5.8 5.8 Z M12.5 10.5 L13 12 L14.5 12.5 L13 13 L12.5 14.5 L12 13 L10.5 12.5 L12 12 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Optimise</text>
|
||||
<g transform="translate(307,434) scale(1.5)">
|
||||
<path d="M4.8 3 H5.8 A0.8 0.8 0 0 1 6.6 3.8 V12.2 A0.8 0.8 0 0 1 5.8 13 H4.8 A0.8 0.8 0 0 1 4 12.2 V3.8 A0.8 0.8 0 0 1 4.8 3 ZM10.200000000000001 3 H11.2 A0.8 0.8 0 0 1 12.0 3.8 V12.2 A0.8 0.8 0 0 1 11.2 13 H10.200000000000001 A0.8 0.8 0 0 1 9.4 12.2 V3.8 A0.8 0.8 0 0 1 10.200000000000001 3 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="319" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Pause</text>
|
||||
<g transform="translate(397,434) scale(1.5)">
|
||||
<path d="M4.5 2.8 L13 8 L4.5 13.2 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="409" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Play</text>
|
||||
<g transform="translate(487,434) scale(1.5)">
|
||||
<path d="M8 3 V13 M3 8 H13" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Plus</text>
|
||||
<g transform="translate(577,434) scale(1.5)">
|
||||
<path d="M8 1.8 V7.5 M11.54 4.59 A5.5 5.5 0 1 1 4.46 4.59" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Power</text>
|
||||
<g transform="translate(667,434) scale(1.5)">
|
||||
<path d="M10.75 3.24 A5.5 5.5 0 1 1 4.46 3.79 M13.2 2.6 L13.2 5.3 L10.5 5.3" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Refresh</text>
|
||||
<g transform="translate(757,434) scale(1.5)">
|
||||
<path d="M1.5 9.5 C4 8 6 10.5 8.5 9 C10.5 7.8 12.5 8.5 14.5 9.5 M1.5 13.5 H14.5 M1.5 2.5 H14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Regions</text>
|
||||
<g transform="translate(847,434) scale(1.5)">
|
||||
<path d="M6.5 5.5 L10.8 8 L6.5 10.5 Z" fill="#f2f3f5"/>
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="486" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Render</text>
|
||||
<g transform="translate(37,504) scale(1.5)">
|
||||
<path d="M3.67 6.00 A5 5 0 1 1 5.50 12.83 M3.2 3.2 V6.2 H6.2" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Reset</text>
|
||||
<g transform="translate(127,504) scale(1.5)">
|
||||
<path d="M10.75 3.24 A5.5 5.5 0 1 1 4.46 3.79 M13.2 2.6 L13.2 5.3 L10.5 5.3" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Retry</text>
|
||||
<g transform="translate(217,504) scale(1.5)">
|
||||
<path d="M4.5 8 A3.5 3.5 0 1 0 11.5 8 A3.5 3.5 0 1 0 4.5 8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Ring</text>
|
||||
<g transform="translate(307,504) scale(1.5)">
|
||||
<path d="M2.5 7 A4.5 4.5 0 1 0 11.5 7 A4.5 4.5 0 1 0 2.5 7 Z M10.4 10.4 L14 14" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Search</text>
|
||||
<g transform="translate(397,504) scale(1.5)">
|
||||
<path d="M2 12.5 L11.5 3 L13 4.5 L3.5 14 H2 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Sequence</text>
|
||||
<g transform="translate(487,504) scale(1.5)">
|
||||
<path d="M4.5 12.5 A3 3 0 0 1 4.2 6.5 A4 4 0 0 1 11.9 5.5 A3.5 3.5 0 0 1 12.2 12.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Server</text>
|
||||
<g transform="translate(577,504) scale(1.5)">
|
||||
<path d="M5.8 8 A2.2 2.2 0 1 0 10.2 8 A2.2 2.2 0 1 0 5.8 8 Z M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Settings</text>
|
||||
<g transform="translate(667,504) scale(1.5)">
|
||||
<path d="M5 2.5 V13.5 M2.5 11 L5 13.5 L7.5 11 M11 13.5 V2.5 M8.5 5 L11 2.5 L13.5 5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Sort</text>
|
||||
<g transform="translate(757,504) scale(1.5)">
|
||||
<path d="M0.8 13 A1.2 1.2 0 1 0 3.2 13 A1.2 1.2 0 1 0 0.8 13 ZM12.8 3 A1.2 1.2 0 1 0 15.2 3 A1.2 1.2 0 1 0 12.8 3 Z" fill="#f2f3f5"/>
|
||||
<path d="M2 13 C5 13 5 3 8 8 C11 13 11 3 14 3" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Spline</text>
|
||||
<g transform="translate(847,504) scale(1.5)">
|
||||
<path d="M8 1.8 L14.5 5.2 L8 8.6 L1.5 5.2 Z M1.5 8.2 L8 11.6 L14.5 8.2 M1.5 11 L8 14.4 L14.5 11" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="556" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Stack</text>
|
||||
<g transform="translate(37,574) scale(1.5)">
|
||||
<path d="M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Star</text>
|
||||
<g transform="translate(127,574) scale(1.5)">
|
||||
<path d="M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="139" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">StarFilled</text>
|
||||
<g transform="translate(217,574) scale(1.5)">
|
||||
<path d="M5.0 3.5 H11.0 A1.5 1.5 0 0 1 12.5 5.0 V11.0 A1.5 1.5 0 0 1 11.0 12.5 H5.0 A1.5 1.5 0 0 1 3.5 11.0 V5.0 A1.5 1.5 0 0 1 5.0 3.5 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="229" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Stop</text>
|
||||
<g transform="translate(307,574) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M5 8.3 L7.1 10.3 L11 6" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">SuccessCircle</text>
|
||||
<g transform="translate(397,574) scale(1.5)">
|
||||
<path d="M5 8 A3 3 0 1 0 11 8 A3 3 0 1 0 5 8 Z M8 1 V2.5 M8 13.5 V15 M1 8 H2.5 M13.5 8 H15 M3 3 L4 4 M12 12 L13 13 M3 13 L4 12 M12 4 L13 3" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Sun</text>
|
||||
<g transform="translate(487,574) scale(1.5)">
|
||||
<path d="M9.88 2.83 A5.5 5.5 0 0 1 9.88 13.17 M6.12 13.17 A5.5 5.5 0 0 1 6.12 2.83 M13.5 6.5 L13.2 9.4 L10.6 8.4 M2.5 9.5 L2.8 6.6 L5.4 7.6" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Sync</text>
|
||||
<g transform="translate(577,574) scale(1.5)">
|
||||
<path d="M1.5 2.5 A1 1 0 0 1 2.5 1.5 H7.5 L14.5 8.5 L8.5 14.5 L1.5 7.5 Z M5 5 H5.1" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Tag</text>
|
||||
<g transform="translate(667,574) scale(1.5)">
|
||||
<path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M8 4.5 V8 L10.5 9.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Time</text>
|
||||
<g transform="translate(757,574) scale(1.5)">
|
||||
<path d="M1.5 9.5 H5 L6.5 11.5 H9.5 L11 9.5 H14.5 M1.5 9.5 L3.5 3 H12.5 L14.5 9.5 V13.5 H1.5 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Tray</text>
|
||||
<g transform="translate(847,574) scale(1.5)">
|
||||
<path d="M8 3 L13.5 12.5 H2.5 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="859" y="626" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Triangle</text>
|
||||
<g transform="translate(37,644) scale(1.5)">
|
||||
<path d="M5 3 L12 8 L5 13 Z" fill="#f2f3f5"/>
|
||||
</g>
|
||||
<text x="49" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">TriangleRight</text>
|
||||
<g transform="translate(127,644) scale(1.5)">
|
||||
<path d="M8 10.5 V2.5 M4.5 6 L8 2.5 L11.5 6 M2.5 13.5 H13.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Upload</text>
|
||||
<g transform="translate(217,644) scale(1.5)">
|
||||
<path d="M5 5 A3 3 0 1 0 11 5 A3 3 0 1 0 5 5 Z M2.5 14 A5.5 5.5 0 0 1 13.5 14" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="229" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">User</text>
|
||||
<g transform="translate(307,644) scale(1.5)">
|
||||
<path d="M5 5 A3 3 0 1 0 11 5 A3 3 0 1 0 5 5 Z M2.5 14 A5.5 5.5 0 0 1 13.5 14" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="319" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Users</text>
|
||||
<g transform="translate(397,644) scale(1.5)">
|
||||
<path d="M2.5 12.5 L7 8 M7 8 H4.5 M7 8 V10.5 M9 7 L13.5 2.5 M13.5 2.5 H11 M13.5 2.5 V5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="409" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Vectors</text>
|
||||
<g transform="translate(487,644) scale(1.5)">
|
||||
<path d="M8 1.5 L13.5 3.5 V7.5 C13.5 11 11 13.3 8 14.5 C5 13.3 2.5 11 2.5 7.5 V3.5 Z M5.5 8 L7.3 9.8 L10.6 6.3" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="499" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Verify</text>
|
||||
<g transform="translate(577,644) scale(1.5)">
|
||||
<path d="M2.5 1.5 H6.0 A1 1 0 0 1 7.0 2.5 V6.0 A1 1 0 0 1 6.0 7.0 H2.5 A1 1 0 0 1 1.5 6.0 V2.5 A1 1 0 0 1 2.5 1.5 ZM10 1.5 H13.5 A1 1 0 0 1 14.5 2.5 V6.0 A1 1 0 0 1 13.5 7.0 H10 A1 1 0 0 1 9 6.0 V2.5 A1 1 0 0 1 10 1.5 ZM2.5 9 H6.0 A1 1 0 0 1 7.0 10 V13.5 A1 1 0 0 1 6.0 14.5 H2.5 A1 1 0 0 1 1.5 13.5 V10 A1 1 0 0 1 2.5 9 ZM10 9 H13.5 A1 1 0 0 1 14.5 10 V13.5 A1 1 0 0 1 13.5 14.5 H10 A1 1 0 0 1 9 13.5 V10 A1 1 0 0 1 10 9 Z" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="589" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ViewGrid</text>
|
||||
<g transform="translate(667,644) scale(1.5)">
|
||||
<path d="M5.5 4 H13.5 M5.5 8 H13.5 M5.5 12 H13.5 M2.5 4 H2.6 M2.5 8 H2.6 M2.5 12 H2.6" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="679" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ViewList</text>
|
||||
<g transform="translate(757,644) scale(1.5)">
|
||||
<path d="M2 13.5 H14 M3.5 11 V8 M6 11 V5 M8.5 11 V7 M11 11 V3.5 M13.5 11 V9" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="769" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">ViewTimeline</text>
|
||||
<g transform="translate(847,644) scale(1.5)">
|
||||
<path d="M8 1.8 L14.8 13.8 H1.2 Z M8 6.2 V9.6 M8 11.7 V11.8" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="859" y="696" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Warning</text>
|
||||
<g transform="translate(37,714) scale(1.5)">
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M1.5 5.5 H14.5" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="49" y="766" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Window</text>
|
||||
<g transform="translate(127,714) scale(1.5)">
|
||||
<path d="M3.0 2.5 H13.0 A1.5 1.5 0 0 1 14.5 4.0 V12.0 A1.5 1.5 0 0 1 13.0 13.5 H3.0 A1.5 1.5 0 0 1 1.5 12.0 V4.0 A1.5 1.5 0 0 1 3.0 2.5 Z M8 1 V15" fill="none" stroke="#f2f3f5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="139" y="766" fill="#a9aeb9" font-size="10" text-anchor="middle" font-family="sans-serif">Wipe</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 37 KiB |
@@ -0,0 +1,8 @@
|
||||
TITANO_ADMIN_PASSWORD=change-me-at-first-login
|
||||
TITANO_DB_PASSWORD=choose-a-long-random-password
|
||||
TITANO_ARCHIVE=/mnt/user/Timelapse
|
||||
TITANO_DATA=./data
|
||||
TITANO_PGDATA=./pgdata
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
TZ=Europe/Rome
|
||||
@@ -0,0 +1,43 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Titano Server — multi-stage, multi-arch (linux/amd64, linux/arm64). BRIEF §14.9.
|
||||
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
ARG TARGETARCH
|
||||
ARG TITANO_VERSION=0.0.0-dev
|
||||
WORKDIR /src
|
||||
COPY global.json Directory.Build.props Directory.Build.targets Titano.slnx ./
|
||||
COPY i18n/ i18n/
|
||||
COPY src/Titano.Core/ src/Titano.Core/
|
||||
COPY src/Titano.Data/ src/Titano.Data/
|
||||
COPY src/Titano.Protocol/ src/Titano.Protocol/
|
||||
COPY src/Titano.Server/ src/Titano.Server/
|
||||
RUN dotnet publish src/Titano.Server/Titano.Server.csproj \
|
||||
-c Release -a "$TARGETARCH" --no-self-contained \
|
||||
-p:TitanoVersion="$TITANO_VERSION" -o /out \
|
||||
&& rm -f /out/*.pdb
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
||||
ARG TITANO_VERSION=0.0.0-dev
|
||||
LABEL org.opencontainers.image.title="Titano Server" \
|
||||
org.opencontainers.image.description="Time-lapse archive, uploads, jobs and rendering server" \
|
||||
org.opencontainers.image.version="$TITANO_VERSION" \
|
||||
org.opencontainers.image.licenses="LicenseRef-Titano-EULA"
|
||||
ENV TITANO_ARCHIVE_PATH=/archive \
|
||||
TITANO_DATA_PATH=/data \
|
||||
TITANO_HTTP_PORT=8080 \
|
||||
TITANO_HTTPS_PORT=8443 \
|
||||
TITANO_DB=postgres \
|
||||
PUID=1000 \
|
||||
PGID=1000 \
|
||||
DOTNET_gcServer=1 \
|
||||
DOTNET_GCHeapAffinitizeMask= \
|
||||
DOTNET_NOLOGO=1
|
||||
WORKDIR /app
|
||||
COPY --from=build /out/ ./
|
||||
COPY deploy/docker/entrypoint.sh /usr/local/bin/titano-entrypoint
|
||||
RUN chmod 0755 /usr/local/bin/titano-entrypoint && mkdir -p /archive /data
|
||||
VOLUME ["/archive", "/data"]
|
||||
EXPOSE 8080 8443
|
||||
HEALTHCHECK --interval=30s --timeout=8s --start-period=40s --retries=3 \
|
||||
CMD ["dotnet", "/app/Titano.Server.dll", "--healthcheck"]
|
||||
ENTRYPOINT ["/usr/local/bin/titano-entrypoint"]
|
||||
@@ -0,0 +1,44 @@
|
||||
# Titano Server with PostgreSQL 17. Start: docker compose up -d Admin panel: http://<host>:8080/admin
|
||||
name: titano
|
||||
|
||||
services:
|
||||
titano:
|
||||
image: ghcr.io/alby96/titano-server:latest
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8443:8443"
|
||||
environment:
|
||||
TITANO_ADMIN_USER: admin
|
||||
TITANO_ADMIN_PASSWORD: ${TITANO_ADMIN_PASSWORD:?set TITANO_ADMIN_PASSWORD in .env}
|
||||
TITANO_DB: postgres
|
||||
TITANO_DB_HOST: postgres
|
||||
TITANO_DB_NAME: titano
|
||||
TITANO_DB_USER: titano
|
||||
TITANO_DB_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env}
|
||||
TITANO_TLS_MODE: auto
|
||||
TITANO_SERVER_NAME: Titano Server
|
||||
PUID: ${PUID:-1000}
|
||||
PGID: ${PGID:-1000}
|
||||
TZ: ${TZ:-UTC}
|
||||
volumes:
|
||||
- ${TITANO_ARCHIVE:-./archive}:/archive
|
||||
- ${TITANO_DATA:-./data}:/data
|
||||
|
||||
postgres:
|
||||
image: postgres:17
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: titano
|
||||
POSTGRES_USER: titano
|
||||
POSTGRES_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env}
|
||||
volumes:
|
||||
- ${TITANO_PGDATA:-./pgdata}:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U titano -d titano"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# Runs Titano Server as PUID:PGID (Unraid/NAS convention). /data is owned by that user; /archive is left as
|
||||
# mounted (it may hold terabytes) and only checked for write access.
|
||||
set -eu
|
||||
|
||||
PUID="${PUID:-1000}"
|
||||
PGID="${PGID:-1000}"
|
||||
umask 002
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
mkdir -p /data
|
||||
chown -R "$PUID:$PGID" /data
|
||||
if ! setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- test -w "${TITANO_ARCHIVE_PATH:-/archive}"; then
|
||||
echo "warning: ${TITANO_ARCHIVE_PATH:-/archive} is not writable by $PUID:$PGID" >&2
|
||||
fi
|
||||
exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Titano.Server.dll "$@"
|
||||
fi
|
||||
|
||||
exec dotnet /app/Titano.Server.dll "$@"
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<Container version="2">
|
||||
<Name>titano-server</Name>
|
||||
<Repository>ghcr.io/alby96/titano-server:latest</Repository>
|
||||
<Registry>https://github.com/alby96/titano-releases</Registry>
|
||||
<Network>bridge</Network>
|
||||
<MyIP/>
|
||||
<Shell>sh</Shell>
|
||||
<Privileged>false</Privileged>
|
||||
<Support>https://github.com/alby96/titano-releases/issues</Support>
|
||||
<Project>https://github.com/alby96/titano-releases</Project>
|
||||
<Overview>Titano Server keeps a shared, verified archive of time-lapse photo sequences and renders them. Pair it with the official PostgreSQL 17 container.</Overview>
|
||||
<Category>MediaServer:Photos Tools:</Category>
|
||||
<WebUI>http://[IP]:[PORT:8080]/admin</WebUI>
|
||||
<TemplateURL>https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano.xml</TemplateURL>
|
||||
<Icon>https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano-server.png</Icon>
|
||||
<ExtraParams>--restart unless-stopped</ExtraParams>
|
||||
<PostArgs/>
|
||||
<CPUset/>
|
||||
<DateInstalled/>
|
||||
<DonateText/>
|
||||
<DonateLink/>
|
||||
<Requires>A PostgreSQL 16 or 17 container (official "postgres" template) with a database and user for Titano.</Requires>
|
||||
<Config Name="HTTP port" Target="8080" Default="8080" Mode="tcp" Description="Admin panel and API over HTTP." Type="Port" Display="always" Required="true" Mask="false">8080</Config>
|
||||
<Config Name="HTTPS port" Target="8443" Default="8443" Mode="tcp" Description="API over TLS for Titano clients." Type="Port" Display="always" Required="true" Mask="false">8443</Config>
|
||||
<Config Name="Archive" Target="/archive" Default="/mnt/user/Timelapse" Mode="rw" Description="Originals, sidecars, proxies and renders." Type="Path" Display="always" Required="true" Mask="false">/mnt/user/Timelapse</Config>
|
||||
<Config Name="App data" Target="/data" Default="/mnt/user/appdata/titano" Mode="rw" Description="Settings, TLS certificate, uploads in progress and logs." Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/titano</Config>
|
||||
<Config Name="Admin user" Target="TITANO_ADMIN_USER" Default="admin" Mode="" Description="Created at first start when no administrator exists." Type="Variable" Display="always" Required="true" Mask="false">admin</Config>
|
||||
<Config Name="Admin password" Target="TITANO_ADMIN_PASSWORD" Default="" Mode="" Description="Initial password; a change is required at first sign-in." Type="Variable" Display="always" Required="true" Mask="true"/>
|
||||
<Config Name="Database host" Target="TITANO_DB_HOST" Default="postgresql17" Mode="" Description="Host name or IP of the PostgreSQL container." Type="Variable" Display="always" Required="true" Mask="false">postgresql17</Config>
|
||||
<Config Name="Database port" Target="TITANO_DB_PORT" Default="5432" Mode="" Description="PostgreSQL port." Type="Variable" Display="advanced" Required="true" Mask="false">5432</Config>
|
||||
<Config Name="Database name" Target="TITANO_DB_NAME" Default="titano" Mode="" Description="Database owned by the Titano user." Type="Variable" Display="always" Required="true" Mask="false">titano</Config>
|
||||
<Config Name="Database user" Target="TITANO_DB_USER" Default="titano" Mode="" Description="PostgreSQL role." Type="Variable" Display="always" Required="true" Mask="false">titano</Config>
|
||||
<Config Name="Database password" Target="TITANO_DB_PASSWORD" Default="" Mode="" Description="PostgreSQL password." Type="Variable" Display="always" Required="true" Mask="true"/>
|
||||
<Config Name="Database TLS" Target="TITANO_DB_SSLMODE" Default="prefer" Mode="" Description="disable, prefer, require or verify-full." Type="Variable" Display="advanced" Required="false" Mask="false">prefer</Config>
|
||||
<Config Name="TLS mode" Target="TITANO_TLS_MODE" Default="auto" Mode="" Description="auto (self-signed), pem (own certificate) or proxy (behind a reverse proxy)." Type="Variable" Display="advanced" Required="false" Mask="false">auto</Config>
|
||||
<Config Name="Server name" Target="TITANO_SERVER_NAME" Default="Titano Server" Mode="" Description="Name shown to clients." Type="Variable" Display="advanced" Required="false" Mask="false">Titano Server</Config>
|
||||
<Config Name="PUID" Target="PUID" Default="99" Mode="" Description="User id that owns files." Type="Variable" Display="advanced" Required="true" Mask="false">99</Config>
|
||||
<Config Name="PGID" Target="PGID" Default="100" Mode="" Description="Group id that owns files." Type="Variable" Display="advanced" Required="true" Mask="false">100</Config>
|
||||
<Config Name="Time zone" Target="TZ" Default="Europe/Rome" Mode="" Description="Time zone of logs and schedules." Type="Variable" Display="advanced" Required="false" Mask="false">Europe/Rome</Config>
|
||||
</Container>
|
||||
+9
-4
@@ -6,7 +6,12 @@ All notable changes. Format: Keep a Changelog; versions follow SemVer; commits f
|
||||
|
||||
### Added
|
||||
- Repository foundation: solution, build rules (warnings as errors, zero-package guard), .NET 10 SDK pin.
|
||||
- `Titano.Testing`: in-house test framework and runner with JUnit XML output.
|
||||
- Localization runtime (`Loc`, CLDR plural rules, 38 shipped languages) and `i18n check/export`.
|
||||
- Brand mark geometry, SDF rasteriser, PNG encoder, ICO writer and `make-icon`.
|
||||
- Core contracts: image buffers and decoder providers, video encoder providers, domain model, atomic file writes.
|
||||
- `Titano.Testing`: in-house test framework and runner with JUnit XML output and GitHub annotations.
|
||||
- Localization runtime (`Loc`, CLDR plural rules, 38 shipped languages), `en` + `it` catalogs, `i18n check/export`.
|
||||
- Brand mark geometry, SDF rasteriser, PNG encoder, ICO writer and `make-icon` (program icons generated at build time).
|
||||
- Core contracts: image buffers and decoder providers, video encoder providers, domain model, TIFF/IFD reader, sRGB helpers, atomic file writes, logging.
|
||||
- `Titano.Ui` design system: DESIGN.md tokens (dark/light), 100+ stroke icons, styles for every standard control, custom chrome window with snap layouts, navigation rail, job bar, Auto/manual slider, chips, status glyphs, toasts, empty states.
|
||||
- Titano desktop shell: rail, job bar, status strip, sections, Settings (language, theme) and About; `--capture` screenshot mode.
|
||||
- Titano Server skeleton: configuration from environment/`server.json`, self-signed TLS with fingerprint, `/health`, `/api/v1/server/info`, `/api/v1/i18n/{culture}`, embedded admin panel (login, dashboard).
|
||||
- Docker image (multi-arch, PUID/PGID, health check), compose file with PostgreSQL 17, Unraid template.
|
||||
- CI (Windows + Linux build/test, PostgreSQL 16/17, Docker smoke test, screenshots, Windows program artifacts), release and nightly image workflows.
|
||||
@@ -14,3 +14,13 @@ One line per decision: date · decision · alternative · reason.
|
||||
| 2026-10-02 | In-house CRC-32 (`Titano.Core.Hashing.Crc32`). | System.IO.Hashing | That assembly is a NuGet package, not part of the shared framework. |
|
||||
| 2026-10-02 | Windows projects target `net10.0-windows` (platform version 7.0) without a Windows SDK projection TFM; Windows 10 APIs are reached by P/Invoke/COM. | `net10.0-windows10.0.19041.0` | Avoids the CsWinRT projection; toasts use the in-window toast host plus tray balloon. |
|
||||
| 2026-10-02 | Test projects use an explicit `TestMain` entry point. | Top-level statements | Avoids the `Program` type clash with the server's top-level program. |
|
||||
| 2026-10-02 | SQLite P/Invoke binding lives in `Titano.Data` with a library resolver (winsqlite3 on Windows, system libsqlite3 elsewhere for tests/dev); the Linux server still refuses SQLite at configuration time. | Binding in Core.Windows only | Lets repository tests run on Linux CI against both dialects. |
|
||||
| 2026-10-02 | Client preferences needed before the database opens (language, theme, window placement) are stored in `settings.json` next to the database. | Settings table only | Language and theme must apply before the first window appears. |
|
||||
| 2026-10-02 | Server Windows-service hosting will use an in-house advapi32 P/Invoke host. | Microsoft.Extensions.Hosting.WindowsServices | That assembly is a NuGet package, not part of the shared framework. |
|
||||
| 2026-10-02 | Admin panel files are embedded resources served by an in-house middleware with ETags and SPA fallback. | ManifestEmbeddedFileProvider | Its manifest generator ships in a NuGet package. |
|
||||
| 2026-10-02 | Container health check runs `Titano.Server --healthcheck` (in-process HTTP probe). | curl/wget in the image | Keeps the runtime image free of extra tools. |
|
||||
| 2026-10-02 | Container drops privileges with `setpriv` to PUID:PGID; `/data` is chowned, `/archive` only checked for write access. | Recursive chown of the archive | The archive may hold terabytes on NAS shares. |
|
||||
| 2026-10-02 | Release workflow publishes to `RELEASES_REPO` (default `<owner>/titano-releases`) when the `RELEASES_TOKEN` secret exists, otherwise to this repository. | Fail without the token | First releases work before the public repository is set up. |
|
||||
| 2026-10-02 | Release notes are generated by `Titano.Tools changelog` from `git log` piped on stdin. | Tool spawning git | Keeps the tool free of external process calls. |
|
||||
| 2026-10-02 | CI `dotnet format` gate checks whitespace formatting. | Full style/analyzer verification | Analyzer rules already fail the build (warnings as errors); style preferences stay suggestions. |
|
||||
| 2026-10-02 | Test runner exits 0 for a project with no tests and 2 when a filter matches nothing. | Always 2 | Empty projects during bootstrap are not failures; mistyped filters are. |
|
||||
+13
-1
@@ -1,5 +1,17 @@
|
||||
# Status
|
||||
|
||||
Current phase: **Phase 0 — Bootstrap** (in progress).
|
||||
Current phase: **Phase 0 — Bootstrap** complete on Linux; Windows verification runs in CI.
|
||||
Engine workstreams for Phases 1–2 and 5–6 (metadata, codecs, data, video, analysis, motion, Windows interop) are in progress.
|
||||
|
||||
## How to try it
|
||||
|
||||
```
|
||||
dotnet build Titano.slnx -c Release
|
||||
dotnet run --project src/Titano.Server # http://localhost:8080/admin (set TITANO_DATA_PATH/TITANO_ARCHIVE_PATH)
|
||||
src/Titano.App/bin/Release/net10.0-windows/Titano.exe # Windows
|
||||
docker compose -f deploy/docker/docker-compose.yml up -d # server + PostgreSQL 17
|
||||
```
|
||||
|
||||
## Next steps
|
||||
|
||||
See docs/BRIEF.md §22 for the phase plan.
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="About.Data" xml:space="preserve"><value>Data</value></data>
|
||||
<data name="About.OpenData" xml:space="preserve"><value>Data folder</value></data>
|
||||
<data name="About.Releases" xml:space="preserve"><value>Releases</value></data>
|
||||
<data name="About.Runtime" xml:space="preserve"><value>Runtime</value></data>
|
||||
<data name="About.System" xml:space="preserve"><value>System</value></data>
|
||||
<data name="About.ThirdParty" xml:space="preserve"><value>Third-party code</value></data>
|
||||
<data name="About.ThirdPartyNone" xml:space="preserve"><value>None</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Admin.About.Fingerprint" xml:space="preserve"><value>TLS SHA-256</value></data>
|
||||
<data name="Admin.About.Title" xml:space="preserve"><value>Titano Server</value></data>
|
||||
<data name="Admin.Dashboard.Api" xml:space="preserve"><value>API version</value></data>
|
||||
<data name="Admin.Dashboard.Archive" xml:space="preserve"><value>Archive</value></data>
|
||||
<data name="Admin.Dashboard.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Admin.Error.Unreachable" xml:space="preserve"><value>The server did not answer; try again.</value><comment>long</comment></data>
|
||||
<data name="Admin.Login.Failed" xml:space="preserve"><value>Wrong user name or password.</value><comment>long</comment></data>
|
||||
<data name="Admin.Login.Password" xml:space="preserve"><value>Password</value></data>
|
||||
<data name="Admin.Login.SignIn" xml:space="preserve"><value>Sign in</value></data>
|
||||
<data name="Admin.Login.SignIn.Tip" xml:space="preserve"><value>Sign in to administer this server</value></data>
|
||||
<data name="Admin.Login.User" xml:space="preserve"><value>User</value></data>
|
||||
<data name="Admin.Nav.About" xml:space="preserve"><value>About</value></data>
|
||||
<data name="Admin.Nav.About.Tip" xml:space="preserve"><value>Version and certificate fingerprint</value></data>
|
||||
<data name="Admin.Nav.Archive" xml:space="preserve"><value>Archive</value></data>
|
||||
<data name="Admin.Nav.Archive.Tip" xml:space="preserve"><value>Archive path, templates, scan and verify</value></data>
|
||||
<data name="Admin.Nav.Dashboard" xml:space="preserve"><value>Dashboard</value></data>
|
||||
<data name="Admin.Nav.Dashboard.Tip" xml:space="preserve"><value>Storage, jobs and render nodes at a glance</value></data>
|
||||
<data name="Admin.Nav.Jobs" xml:space="preserve"><value>Jobs</value></data>
|
||||
<data name="Admin.Nav.Jobs.Tip" xml:space="preserve"><value>Queue, history and render nodes</value></data>
|
||||
<data name="Admin.Nav.Logs" xml:space="preserve"><value>Logs</value></data>
|
||||
<data name="Admin.Nav.Logs.Tip" xml:space="preserve"><value>Recent log lines and downloads</value></data>
|
||||
<data name="Admin.Nav.Settings" xml:space="preserve"><value>Settings</value></data>
|
||||
<data name="Admin.Nav.Settings.Tip" xml:space="preserve"><value>Server name, ports, TLS, limits and language</value></data>
|
||||
<data name="Admin.Nav.Users" xml:space="preserve"><value>Users</value></data>
|
||||
<data name="Admin.Nav.Users.Tip" xml:space="preserve"><value>Accounts, roles and quotas</value></data>
|
||||
<data name="Admin.Role.Admin" xml:space="preserve"><value>Administrator</value></data>
|
||||
<data name="Admin.Role.Editor" xml:space="preserve"><value>Editor</value></data>
|
||||
<data name="Admin.Role.Uploader" xml:space="preserve"><value>Uploader</value></data>
|
||||
<data name="Admin.Role.Viewer" xml:space="preserve"><value>Viewer</value></data>
|
||||
<data name="Admin.SignOut.Tip" xml:space="preserve"><value>Sign out of the admin panel</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Archive.Empty" xml:space="preserve"><value>No archive yet</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Common.Auto" xml:space="preserve"><value>Auto</value></data>
|
||||
<data name="Common.Duration.Days" xml:space="preserve"><value>{0} d {1} h</value></data>
|
||||
<data name="Common.Duration.Hours" xml:space="preserve"><value>{0} h {1} m</value></data>
|
||||
<data name="Common.Duration.Minutes" xml:space="preserve"><value>{0} min</value></data>
|
||||
<data name="Common.Duration.Seconds" xml:space="preserve"><value>{0} s</value></data>
|
||||
<data name="Common.NotApplicable" xml:space="preserve"><value>n/a</value></data>
|
||||
<data name="Common.Open" xml:space="preserve"><value>Open</value></data>
|
||||
<data name="Common.OpenLogs" xml:space="preserve"><value>Open logs</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Editor.Empty" xml:space="preserve"><value>Pick a sequence in the Library</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Errors.Unexpected" xml:space="preserve"><value>Something went wrong.</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Import.Empty" xml:space="preserve"><value>Insert a card or pick a folder</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Jobs.Empty" xml:space="preserve"><value>No jobs yet</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Library.Empty" xml:space="preserve"><value>No sequences yet</value></data>
|
||||
<data name="Library.Empty.Connect" xml:space="preserve"><value>Connect to a server</value></data>
|
||||
<data name="Library.Empty.ImportCard" xml:space="preserve"><value>Import a card</value></data>
|
||||
<data name="Library.Empty.OpenArchive" xml:space="preserve"><value>Open an archive</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Server.Empty" xml:space="preserve"><value>Not connected to a server</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Settings.Advanced.DataFolder" xml:space="preserve"><value>Data folder</value></data>
|
||||
<data name="Settings.General.CheckOnStart" xml:space="preserve"><value>Check on start</value></data>
|
||||
<data name="Settings.General.Language" xml:space="preserve"><value>Language</value></data>
|
||||
<data name="Settings.General.Theme" xml:space="preserve"><value>Theme</value></data>
|
||||
<data name="Settings.General.Theme.Dark" xml:space="preserve"><value>Dark</value></data>
|
||||
<data name="Settings.General.Theme.Light" xml:space="preserve"><value>Light</value></data>
|
||||
<data name="Settings.General.Theme.System" xml:space="preserve"><value>System</value></data>
|
||||
<data name="Settings.General.Updates" xml:space="preserve"><value>Updates</value></data>
|
||||
<data name="Settings.Page.Advanced" xml:space="preserve"><value>Advanced</value></data>
|
||||
<data name="Settings.Page.Analysis" xml:space="preserve"><value>Analysis</value></data>
|
||||
<data name="Settings.Page.Archive" xml:space="preserve"><value>Archive</value></data>
|
||||
<data name="Settings.Page.Formats" xml:space="preserve"><value>Formats</value></data>
|
||||
<data name="Settings.Page.General" xml:space="preserve"><value>General</value></data>
|
||||
<data name="Settings.Page.Import" xml:space="preserve"><value>Import</value></data>
|
||||
<data name="Settings.Page.Licence" xml:space="preserve"><value>Licence</value></data>
|
||||
<data name="Settings.Page.Rendering" xml:space="preserve"><value>Rendering</value></data>
|
||||
<data name="Settings.Page.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Settings.Page.Updates" xml:space="preserve"><value>Updates</value></data>
|
||||
</root>
|
||||
+18
-3
@@ -4,7 +4,22 @@
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Shell.AppName" xml:space="preserve"><value>Titano</value></data>
|
||||
<data name="Shell.Photos.Count.one" xml:space="preserve"><value>{0:N0} photo</value></data>
|
||||
<data name="Shell.Photos.Count.other" xml:space="preserve"><value>{0:N0} photos</value></data>
|
||||
<data name="Shell.AppName" xml:space="preserve"><value>Titano</value><comment>invariant</comment></data>
|
||||
<data name="Shell.JobBar.Ready" xml:space="preserve"><value>Ready · {0} jobs queued</value></data>
|
||||
<data name="Shell.Nav.About" xml:space="preserve"><value>About</value></data>
|
||||
<data name="Shell.Nav.Archive" xml:space="preserve"><value>Archive</value></data>
|
||||
<data name="Shell.Nav.Import" xml:space="preserve"><value>Import</value></data>
|
||||
<data name="Shell.Nav.Jobs" xml:space="preserve"><value>Jobs</value></data>
|
||||
<data name="Shell.Nav.Library" xml:space="preserve"><value>Library</value></data>
|
||||
<data name="Shell.Nav.Sequence" xml:space="preserve"><value>Sequence</value></data>
|
||||
<data name="Shell.Nav.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Shell.Nav.Settings" xml:space="preserve"><value>Settings</value></data>
|
||||
<data name="Shell.Status.Connected" xml:space="preserve"><value>Connected to "{0}"</value></data>
|
||||
<data name="Shell.Status.Jobs.one" xml:space="preserve"><value>{0:N0} job</value></data>
|
||||
<data name="Shell.Status.Jobs.other" xml:space="preserve"><value>{0:N0} jobs</value></data>
|
||||
<data name="Shell.Status.NotConnected" xml:space="preserve"><value>Not connected</value></data>
|
||||
<data name="Shell.Status.Photos.one" xml:space="preserve"><value>{0:N0} photo</value></data>
|
||||
<data name="Shell.Status.Photos.other" xml:space="preserve"><value>{0:N0} photos</value></data>
|
||||
<data name="Shell.Status.Sequences.one" xml:space="preserve"><value>{0:N0} sequence</value></data>
|
||||
<data name="Shell.Status.Sequences.other" xml:space="preserve"><value>{0:N0} sequences</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Tooltips.About.OpenData" xml:space="preserve"><value>Open the folder with database, settings and logs</value></data>
|
||||
<data name="Tooltips.About.Releases" xml:space="preserve"><value>Open the public releases page in the browser</value></data>
|
||||
<data name="Tooltips.Common.Dismiss" xml:space="preserve"><value>Dismiss</value></data>
|
||||
<data name="Tooltips.Common.OpenLogs" xml:space="preserve"><value>Open the folder with the log files</value></data>
|
||||
<data name="Tooltips.Common.ResetToAuto" xml:space="preserve"><value>Return to the advisor's value</value></data>
|
||||
<data name="Tooltips.Library.Connect" xml:space="preserve"><value>Work with the archive of a Titano Server</value></data>
|
||||
<data name="Tooltips.Library.ImportCard" xml:space="preserve"><value>Copy and verify photos from a memory card</value></data>
|
||||
<data name="Tooltips.Library.OpenArchive" xml:space="preserve"><value>Use an existing archive folder on this PC or the network</value></data>
|
||||
<data name="Tooltips.Nav.About" xml:space="preserve"><value>Version, diagnostics and links</value></data>
|
||||
<data name="Tooltips.Nav.Archive" xml:space="preserve"><value>Scan, verify and maintain the archive · Ctrl+4</value></data>
|
||||
<data name="Tooltips.Nav.Import" xml:space="preserve"><value>Import photos from a card or folder · Ctrl+2</value></data>
|
||||
<data name="Tooltips.Nav.Jobs" xml:space="preserve"><value>Queue and history of long operations · Ctrl+5</value></data>
|
||||
<data name="Tooltips.Nav.Library" xml:space="preserve"><value>Browse every sequence of the archive · Ctrl+1</value></data>
|
||||
<data name="Tooltips.Nav.Sequence" xml:space="preserve"><value>Edit and render the open sequence · Ctrl+3</value></data>
|
||||
<data name="Tooltips.Nav.Server" xml:space="preserve"><value>Connection, sync and render node · Ctrl+6</value></data>
|
||||
<data name="Tooltips.Nav.Settings" xml:space="preserve"><value>Preferences of this PC · Ctrl+,</value></data>
|
||||
<data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Look for a new release when Titano starts · no data is sent</value></data>
|
||||
<data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, settings, logs and caches of this PC</value></data>
|
||||
<data name="Tooltips.Settings.Language" xml:space="preserve"><value>Language of the interface · applies immediately</value></data>
|
||||
<data name="Tooltips.Settings.OpenDataFolder" xml:space="preserve"><value>Open the data folder in Explorer</value></data>
|
||||
<data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Dark interface (default)</value></data>
|
||||
<data name="Tooltips.Settings.ThemeLight" xml:space="preserve"><value>Light interface</value></data>
|
||||
<data name="Tooltips.Settings.ThemeSystem" xml:space="preserve"><value>Follow the Windows app mode</value></data>
|
||||
<data name="Tooltips.Shell.CollapseRail" xml:space="preserve"><value>Collapse navigation to icons</value></data>
|
||||
<data name="Tooltips.Shell.ExpandRail" xml:space="preserve"><value>Show navigation names</value></data>
|
||||
<data name="Tooltips.Shell.StopJob" xml:space="preserve"><value>Stop the current job · it can be resumed later</value></data>
|
||||
<data name="Tooltips.Window.Close" xml:space="preserve"><value>Close</value></data>
|
||||
<data name="Tooltips.Window.Maximize" xml:space="preserve"><value>Maximize</value></data>
|
||||
<data name="Tooltips.Window.Minimize" xml:space="preserve"><value>Minimize</value></data>
|
||||
<data name="Tooltips.Window.Restore" xml:space="preserve"><value>Restore</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="About.Data" xml:space="preserve"><value>Dati</value></data>
|
||||
<data name="About.OpenData" xml:space="preserve"><value>Cartella dati</value></data>
|
||||
<data name="About.Releases" xml:space="preserve"><value>Versioni</value></data>
|
||||
<data name="About.Runtime" xml:space="preserve"><value>Runtime</value></data>
|
||||
<data name="About.System" xml:space="preserve"><value>Sistema</value></data>
|
||||
<data name="About.ThirdParty" xml:space="preserve"><value>Codice di terzi</value></data>
|
||||
<data name="About.ThirdPartyNone" xml:space="preserve"><value>Nessuno</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Admin.About.Fingerprint" xml:space="preserve"><value>TLS SHA-256</value></data>
|
||||
<data name="Admin.About.Title" xml:space="preserve"><value>Titano Server</value></data>
|
||||
<data name="Admin.Dashboard.Api" xml:space="preserve"><value>Versione API</value></data>
|
||||
<data name="Admin.Dashboard.Archive" xml:space="preserve"><value>Archivio</value></data>
|
||||
<data name="Admin.Dashboard.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Admin.Error.Unreachable" xml:space="preserve"><value>Il server non ha risposto; riprova.</value></data>
|
||||
<data name="Admin.Login.Failed" xml:space="preserve"><value>Nome utente o password errati.</value></data>
|
||||
<data name="Admin.Login.Password" xml:space="preserve"><value>Password</value></data>
|
||||
<data name="Admin.Login.SignIn" xml:space="preserve"><value>Accedi</value></data>
|
||||
<data name="Admin.Login.SignIn.Tip" xml:space="preserve"><value>Accedi per amministrare questo server</value></data>
|
||||
<data name="Admin.Login.User" xml:space="preserve"><value>Utente</value></data>
|
||||
<data name="Admin.Nav.About" xml:space="preserve"><value>Informazioni</value></data>
|
||||
<data name="Admin.Nav.About.Tip" xml:space="preserve"><value>Versione e impronta del certificato</value></data>
|
||||
<data name="Admin.Nav.Archive" xml:space="preserve"><value>Archivio</value></data>
|
||||
<data name="Admin.Nav.Archive.Tip" xml:space="preserve"><value>Percorso archivio, modelli, scansione e verifica</value></data>
|
||||
<data name="Admin.Nav.Dashboard" xml:space="preserve"><value>Panoramica</value></data>
|
||||
<data name="Admin.Nav.Dashboard.Tip" xml:space="preserve"><value>Spazio, attività e nodi di rendering in sintesi</value></data>
|
||||
<data name="Admin.Nav.Jobs" xml:space="preserve"><value>Attività</value></data>
|
||||
<data name="Admin.Nav.Jobs.Tip" xml:space="preserve"><value>Coda, cronologia e nodi di rendering</value></data>
|
||||
<data name="Admin.Nav.Logs" xml:space="preserve"><value>Log</value></data>
|
||||
<data name="Admin.Nav.Logs.Tip" xml:space="preserve"><value>Ultime righe di log e download</value></data>
|
||||
<data name="Admin.Nav.Settings" xml:space="preserve"><value>Impostazioni</value></data>
|
||||
<data name="Admin.Nav.Settings.Tip" xml:space="preserve"><value>Nome server, porte, TLS, limiti e lingua</value></data>
|
||||
<data name="Admin.Nav.Users" xml:space="preserve"><value>Utenti</value></data>
|
||||
<data name="Admin.Nav.Users.Tip" xml:space="preserve"><value>Account, ruoli e quote</value></data>
|
||||
<data name="Admin.Role.Admin" xml:space="preserve"><value>Amministratore</value></data>
|
||||
<data name="Admin.Role.Editor" xml:space="preserve"><value>Editor</value></data>
|
||||
<data name="Admin.Role.Uploader" xml:space="preserve"><value>Caricamento</value></data>
|
||||
<data name="Admin.Role.Viewer" xml:space="preserve"><value>Lettore</value></data>
|
||||
<data name="Admin.SignOut.Tip" xml:space="preserve"><value>Esci dal pannello di amministrazione</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Archive.Empty" xml:space="preserve"><value>Nessun archivio</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Common.Auto" xml:space="preserve"><value>Auto</value></data>
|
||||
<data name="Common.Duration.Days" xml:space="preserve"><value>{0} g {1} h</value></data>
|
||||
<data name="Common.Duration.Hours" xml:space="preserve"><value>{0} h {1} m</value></data>
|
||||
<data name="Common.Duration.Minutes" xml:space="preserve"><value>{0} min</value></data>
|
||||
<data name="Common.Duration.Seconds" xml:space="preserve"><value>{0} s</value></data>
|
||||
<data name="Common.NotApplicable" xml:space="preserve"><value>n/d</value></data>
|
||||
<data name="Common.Open" xml:space="preserve"><value>Apri</value></data>
|
||||
<data name="Common.OpenLogs" xml:space="preserve"><value>Apri log</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Editor.Empty" xml:space="preserve"><value>Scegli una sequenza in Libreria</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Errors.Unexpected" xml:space="preserve"><value>Si è verificato un problema.</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Import.Empty" xml:space="preserve"><value>Inserisci una scheda o una cartella</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Jobs.Empty" xml:space="preserve"><value>Nessuna attività</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Library.Empty" xml:space="preserve"><value>Nessuna sequenza</value></data>
|
||||
<data name="Library.Empty.Connect" xml:space="preserve"><value>Connetti a un server</value></data>
|
||||
<data name="Library.Empty.ImportCard" xml:space="preserve"><value>Importa una scheda</value></data>
|
||||
<data name="Library.Empty.OpenArchive" xml:space="preserve"><value>Apri un archivio</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Server.Empty" xml:space="preserve"><value>Non connesso a un server</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Settings.Advanced.DataFolder" xml:space="preserve"><value>Cartella dati</value></data>
|
||||
<data name="Settings.General.CheckOnStart" xml:space="preserve"><value>Controlla all'avvio</value></data>
|
||||
<data name="Settings.General.Language" xml:space="preserve"><value>Lingua</value></data>
|
||||
<data name="Settings.General.Theme" xml:space="preserve"><value>Tema</value></data>
|
||||
<data name="Settings.General.Theme.Dark" xml:space="preserve"><value>Scuro</value></data>
|
||||
<data name="Settings.General.Theme.Light" xml:space="preserve"><value>Chiaro</value></data>
|
||||
<data name="Settings.General.Theme.System" xml:space="preserve"><value>Sistema</value></data>
|
||||
<data name="Settings.General.Updates" xml:space="preserve"><value>Aggiornamenti</value></data>
|
||||
<data name="Settings.Page.Advanced" xml:space="preserve"><value>Avanzate</value></data>
|
||||
<data name="Settings.Page.Analysis" xml:space="preserve"><value>Analisi</value></data>
|
||||
<data name="Settings.Page.Archive" xml:space="preserve"><value>Archivio</value></data>
|
||||
<data name="Settings.Page.Formats" xml:space="preserve"><value>Formati</value></data>
|
||||
<data name="Settings.Page.General" xml:space="preserve"><value>Generale</value></data>
|
||||
<data name="Settings.Page.Import" xml:space="preserve"><value>Importazione</value></data>
|
||||
<data name="Settings.Page.Licence" xml:space="preserve"><value>Licenza</value></data>
|
||||
<data name="Settings.Page.Rendering" xml:space="preserve"><value>Rendering</value></data>
|
||||
<data name="Settings.Page.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Settings.Page.Updates" xml:space="preserve"><value>Aggiornamenti</value></data>
|
||||
</root>
|
||||
+17
-2
@@ -4,6 +4,21 @@
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Shell.Photos.Count.one" xml:space="preserve"><value>{0:N0} foto</value></data>
|
||||
<data name="Shell.Photos.Count.other" xml:space="preserve"><value>{0:N0} foto</value></data>
|
||||
<data name="Shell.JobBar.Ready" xml:space="preserve"><value>Pronto · {0} attività in coda</value></data>
|
||||
<data name="Shell.Nav.About" xml:space="preserve"><value>Informazioni</value></data>
|
||||
<data name="Shell.Nav.Archive" xml:space="preserve"><value>Archivio</value></data>
|
||||
<data name="Shell.Nav.Import" xml:space="preserve"><value>Importa</value></data>
|
||||
<data name="Shell.Nav.Jobs" xml:space="preserve"><value>Attività</value></data>
|
||||
<data name="Shell.Nav.Library" xml:space="preserve"><value>Libreria</value></data>
|
||||
<data name="Shell.Nav.Sequence" xml:space="preserve"><value>Sequenza</value></data>
|
||||
<data name="Shell.Nav.Server" xml:space="preserve"><value>Server</value></data>
|
||||
<data name="Shell.Nav.Settings" xml:space="preserve"><value>Impostazioni</value></data>
|
||||
<data name="Shell.Status.Connected" xml:space="preserve"><value>Connesso a «{0}»</value></data>
|
||||
<data name="Shell.Status.Jobs.one" xml:space="preserve"><value>{0:N0} attività</value></data>
|
||||
<data name="Shell.Status.Jobs.other" xml:space="preserve"><value>{0:N0} attività</value></data>
|
||||
<data name="Shell.Status.NotConnected" xml:space="preserve"><value>Non connesso</value></data>
|
||||
<data name="Shell.Status.Photos.one" xml:space="preserve"><value>{0:N0} foto</value></data>
|
||||
<data name="Shell.Status.Photos.other" xml:space="preserve"><value>{0:N0} foto</value></data>
|
||||
<data name="Shell.Status.Sequences.one" xml:space="preserve"><value>{0:N0} sequenza</value></data>
|
||||
<data name="Shell.Status.Sequences.other" xml:space="preserve"><value>{0:N0} sequenze</value></data>
|
||||
</root>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<data name="Tooltips.About.OpenData" xml:space="preserve"><value>Apri la cartella con database, impostazioni e log</value></data>
|
||||
<data name="Tooltips.About.Releases" xml:space="preserve"><value>Apri la pagina pubblica delle versioni nel browser</value></data>
|
||||
<data name="Tooltips.Common.Dismiss" xml:space="preserve"><value>Chiudi</value></data>
|
||||
<data name="Tooltips.Common.OpenLogs" xml:space="preserve"><value>Apri la cartella dei file di log</value></data>
|
||||
<data name="Tooltips.Common.ResetToAuto" xml:space="preserve"><value>Torna al valore consigliato</value></data>
|
||||
<data name="Tooltips.Library.Connect" xml:space="preserve"><value>Lavora con l'archivio di un Titano Server</value></data>
|
||||
<data name="Tooltips.Library.ImportCard" xml:space="preserve"><value>Copia e verifica le foto da una scheda di memoria</value></data>
|
||||
<data name="Tooltips.Library.OpenArchive" xml:space="preserve"><value>Usa una cartella archivio esistente su questo PC o in rete</value></data>
|
||||
<data name="Tooltips.Nav.About" xml:space="preserve"><value>Versione, diagnostica e collegamenti</value></data>
|
||||
<data name="Tooltips.Nav.Archive" xml:space="preserve"><value>Scansiona, verifica e gestisci l'archivio · Ctrl+4</value></data>
|
||||
<data name="Tooltips.Nav.Import" xml:space="preserve"><value>Importa foto da una scheda o una cartella · Ctrl+2</value></data>
|
||||
<data name="Tooltips.Nav.Jobs" xml:space="preserve"><value>Coda e cronologia delle operazioni lunghe · Ctrl+5</value></data>
|
||||
<data name="Tooltips.Nav.Library" xml:space="preserve"><value>Sfoglia tutte le sequenze dell'archivio · Ctrl+1</value></data>
|
||||
<data name="Tooltips.Nav.Sequence" xml:space="preserve"><value>Modifica e renderizza la sequenza aperta · Ctrl+3</value></data>
|
||||
<data name="Tooltips.Nav.Server" xml:space="preserve"><value>Connessione, sincronizzazione e nodo di rendering · Ctrl+6</value></data>
|
||||
<data name="Tooltips.Nav.Settings" xml:space="preserve"><value>Preferenze di questo PC · Ctrl+,</value></data>
|
||||
<data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Cerca una nuova versione all'avvio di Titano · nessun dato viene inviato</value></data>
|
||||
<data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, impostazioni, log e cache di questo PC</value></data>
|
||||
<data name="Tooltips.Settings.Language" xml:space="preserve"><value>Lingua dell'interfaccia · si applica subito</value></data>
|
||||
<data name="Tooltips.Settings.OpenDataFolder" xml:space="preserve"><value>Apri la cartella dati in Esplora file</value></data>
|
||||
<data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Interfaccia scura (predefinita)</value></data>
|
||||
<data name="Tooltips.Settings.ThemeLight" xml:space="preserve"><value>Interfaccia chiara</value></data>
|
||||
<data name="Tooltips.Settings.ThemeSystem" xml:space="preserve"><value>Segui la modalità app di Windows</value></data>
|
||||
<data name="Tooltips.Shell.CollapseRail" xml:space="preserve"><value>Riduci la navigazione alle icone</value></data>
|
||||
<data name="Tooltips.Shell.ExpandRail" xml:space="preserve"><value>Mostra i nomi della navigazione</value></data>
|
||||
<data name="Tooltips.Shell.StopJob" xml:space="preserve"><value>Ferma l'attività in corso · potrai riprenderla</value></data>
|
||||
<data name="Tooltips.Window.Close" xml:space="preserve"><value>Chiudi</value></data>
|
||||
<data name="Tooltips.Window.Maximize" xml:space="preserve"><value>Ingrandisci</value></data>
|
||||
<data name="Tooltips.Window.Minimize" xml:space="preserve"><value>Riduci a icona</value></data>
|
||||
<data name="Tooltips.Window.Restore" xml:space="preserve"><value>Ripristina</value></data>
|
||||
</root>
|
||||
@@ -1,4 +1,12 @@
|
||||
<Application x:Class="Titano.App.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
ShutdownMode="OnMainWindowClose">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Shell/SectionTemplates.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,7 +1,97 @@
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Titano.Ui.Theming;
|
||||
|
||||
namespace Titano.App;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
private FileLogSink? _log;
|
||||
|
||||
public AppEnvironment Environment { get; private set; } = null!;
|
||||
public AppSettings Settings { get; private set; } = null!;
|
||||
|
||||
public static new App Current => (App)Application.Current;
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
Environment = AppEnvironment.Detect();
|
||||
_log = new FileLogSink(Environment.LogDirectory, "titano");
|
||||
Log.SetSink(_log);
|
||||
Log.Info("app", $"Titano {typeof(App).Assembly.GetName().Version} starting; data at {Environment.DataDirectory}");
|
||||
|
||||
Settings = AppSettings.Load(Environment.SettingsPath);
|
||||
ApplyLanguage(Settings.Language);
|
||||
ThemeManager.Initialize(this, Settings.Theme);
|
||||
|
||||
DispatcherUnhandledException += OnUnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, args) => Log.Error("app", "Unhandled exception", args.ExceptionObject as Exception);
|
||||
TaskScheduler.UnobservedTaskException += (_, args) =>
|
||||
{
|
||||
Log.Error("app", "Unobserved task exception", args.Exception);
|
||||
args.SetObserved();
|
||||
};
|
||||
|
||||
var shell = new ShellViewModel(Settings);
|
||||
AsyncRelayCommand.Failed += ex => shell.ReportError(ex);
|
||||
var window = new MainWindow(shell);
|
||||
MainWindow = window;
|
||||
|
||||
var captureIndex = Array.IndexOf(e.Args, "--capture");
|
||||
if (captureIndex >= 0)
|
||||
{
|
||||
var dir = captureIndex + 1 < e.Args.Length ? e.Args[captureIndex + 1] : "screenshots";
|
||||
ScreenCapture.Run(window, shell, dir);
|
||||
return;
|
||||
}
|
||||
window.Show();
|
||||
}
|
||||
|
||||
/// <summary>Switches the UI language at run time (BRIEF §16) and remembers the choice.</summary>
|
||||
public void ApplyLanguage(string? code)
|
||||
{
|
||||
var culture = Languages.BestMatch(code is null ? CultureInfo.CurrentUICulture : CultureInfo.GetCultureInfo(code));
|
||||
CultureInfo.DefaultThreadCurrentUICulture = culture;
|
||||
CultureInfo.CurrentUICulture = culture;
|
||||
Loc.SetCulture(culture);
|
||||
foreach (Window w in Windows)
|
||||
w.FlowDirection = Loc.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
|
||||
}
|
||||
|
||||
public void SaveSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings.Save(Environment.SettingsPath);
|
||||
}
|
||||
catch (System.IO.IOException ex)
|
||||
{
|
||||
Log.Warning("app", "Settings not saved", ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
Log.Info("app", "Titano exiting");
|
||||
_log?.Dispose();
|
||||
base.OnExit(e);
|
||||
}
|
||||
|
||||
private void OnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
Log.Error("app", "Unhandled UI exception", e.Exception);
|
||||
if (MainWindow?.DataContext is ShellViewModel shell)
|
||||
{
|
||||
shell.ReportError(e.Exception);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Where the client keeps its data (BRIEF §6.2): <c>%LOCALAPPDATA%\Titano</c>, or <c>.\data</c> next to the
|
||||
/// executable when <c>portable.txt</c> exists. Never inside Documents/OneDrive (SQLite corrupts in synced folders).
|
||||
/// </summary>
|
||||
public sealed class AppEnvironment
|
||||
{
|
||||
private AppEnvironment(string dataDirectory, bool portable)
|
||||
{
|
||||
DataDirectory = dataDirectory;
|
||||
IsPortable = portable;
|
||||
Directory.CreateDirectory(DataDirectory);
|
||||
Directory.CreateDirectory(LogDirectory);
|
||||
Directory.CreateDirectory(CacheDirectory);
|
||||
}
|
||||
|
||||
public string DataDirectory { get; }
|
||||
public bool IsPortable { get; }
|
||||
public string LogDirectory => Path.Combine(DataDirectory, "logs");
|
||||
public string CacheDirectory => Path.Combine(DataDirectory, "cache");
|
||||
public string DatabasePath => Path.Combine(DataDirectory, "titano.db");
|
||||
public string SettingsPath => Path.Combine(DataDirectory, "settings.json");
|
||||
|
||||
public static AppEnvironment Detect()
|
||||
{
|
||||
var exeDir = AppContext.BaseDirectory;
|
||||
if (File.Exists(Path.Combine(exeDir, "portable.txt")))
|
||||
return new AppEnvironment(Path.Combine(exeDir, "data"), portable: true);
|
||||
var local = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
return new AppEnvironment(Path.Combine(local, "Titano"), portable: false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Titano.Core.IO;
|
||||
using Titano.Ui.Theming;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
|
||||
/// <summary>Per-user preferences needed before the database opens (language, theme, window layout).</summary>
|
||||
public sealed class AppSettings
|
||||
{
|
||||
public string? Language { get; set; }
|
||||
public AppTheme Theme { get; set; } = AppTheme.Dark;
|
||||
public bool RailCollapsed { get; set; }
|
||||
public bool CheckForUpdates { get; set; } = true;
|
||||
public bool AnonymousUsageCounts { get; set; }
|
||||
public string? LastArchivePath { get; set; }
|
||||
public WindowPlacement? Window { get; set; }
|
||||
|
||||
public sealed class WindowPlacement
|
||||
{
|
||||
public double Left { get; set; }
|
||||
public double Top { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
public bool Maximized { get; set; }
|
||||
}
|
||||
|
||||
public static AppSettings Load(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(path))
|
||||
return JsonSerializer.Deserialize(File.ReadAllText(path), AppSettingsJson.Default.AppSettings) ?? new AppSettings();
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
// A corrupt settings file must never block startup; defaults apply.
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
return new AppSettings();
|
||||
}
|
||||
|
||||
public void Save(string path) => AtomicFile.WriteAllText(path, JsonSerializer.Serialize(this, AppSettingsJson.Default.AppSettings));
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, UseStringEnumConverter = true)]
|
||||
[JsonSerializable(typeof(AppSettings))]
|
||||
internal sealed partial class AppSettingsJson : JsonSerializerContext;
|
||||
@@ -0,0 +1,34 @@
|
||||
using Titano.Core.Localization;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
|
||||
/// <summary>Culture-aware number, size and duration formatting for the UI.</summary>
|
||||
public static class Formatting
|
||||
{
|
||||
private static readonly string[] ByteUnits = ["B", "KB", "MB", "GB", "TB", "PB"];
|
||||
|
||||
/// <summary>1,536 → "1.5 KB" (decimal units, as Explorer shows for drives).</summary>
|
||||
public static string Bytes(long bytes)
|
||||
{
|
||||
double value = bytes;
|
||||
var unit = 0;
|
||||
while (value >= 1000 && unit < ByteUnits.Length - 1)
|
||||
{
|
||||
value /= 1000;
|
||||
unit++;
|
||||
}
|
||||
var format = unit == 0 || value >= 100 ? "0" : "0.#";
|
||||
return value.ToString(format, Loc.Culture) + " " + ByteUnits[unit];
|
||||
}
|
||||
|
||||
public static string Count(long n) => n.ToString("N0", Loc.Culture);
|
||||
|
||||
/// <summary>Compact duration: "2 h 00 m", "5 min", "40 s".</summary>
|
||||
public static string Duration(TimeSpan t)
|
||||
{
|
||||
if (t.TotalHours >= 24) return Loc.L("Common.Duration.Days", (int)t.TotalDays, t.Hours);
|
||||
if (t.TotalHours >= 1) return Loc.L("Common.Duration.Hours", (int)t.TotalHours, t.Minutes.ToString("00", Loc.Culture));
|
||||
if (t.TotalMinutes >= 1) return Loc.L("Common.Duration.Minutes", (int)Math.Round(t.TotalMinutes));
|
||||
return Loc.L("Common.Duration.Seconds", (int)Math.Round(t.TotalSeconds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Titano.App.Infrastructure;
|
||||
|
||||
/// <summary>Public links (BRIEF §19.4). Overridable at build time via the TitanoReleasesRepo property.</summary>
|
||||
public static class ProductLinks
|
||||
{
|
||||
public static string ReleasesRepository { get; } =
|
||||
typeof(ProductLinks).Assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyMetadataAttribute), false)
|
||||
.OfType<System.Reflection.AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(a => a.Key == "TitanoReleasesRepo")?.Value ?? "alby96/titano-releases";
|
||||
|
||||
public static string Releases => $"https://github.com/{ReleasesRepository}/releases";
|
||||
|
||||
public static string LatestReleaseApi => $"https://api.github.com/repos/{ReleasesRepository}/releases/latest";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
|
||||
/// <summary>The only shell launches the product performs (BRIEF §8.6): open a URL, reveal a folder.</summary>
|
||||
public static class ShellActions
|
||||
{
|
||||
public static void OpenUrl(string url)
|
||||
{
|
||||
if (!Uri.TryCreate(url, UriKind.Absolute, out var uri) || uri.Scheme is not ("https" or "http" or "ms-windows-store")) return;
|
||||
Process.Start(new ProcessStartInfo(uri.AbsoluteUri) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
public static void OpenFolder(string path)
|
||||
{
|
||||
if (!Directory.Exists(path)) return;
|
||||
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, Verb = "explore" });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="Titano.App.Sections.AboutView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20,16,20,20">
|
||||
<Border Style="{StaticResource Border.Panel}" Padding="28,24" HorizontalAlignment="Left" VerticalAlignment="Top" MinWidth="560">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
|
||||
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" />
|
||||
<StackPanel Margin="16,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock Text="{l:Loc Shell.AppName}" Style="{StaticResource Text.PageTitle}" FontSize="22" />
|
||||
<TextBlock Text="{Binding Version}" Style="{StaticResource Text.Secondary}" Margin="0,2,0,0" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{l:Loc About.Runtime}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Runtime}" />
|
||||
<TextBlock Grid.Row="1" Text="{l:Loc About.System}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding OperatingSystem}" />
|
||||
<TextBlock Grid.Row="2" Text="{l:Loc About.ThirdParty}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{l:Loc About.ThirdPartyNone}" />
|
||||
<TextBlock Grid.Row="3" Text="{l:Loc About.Data}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding DataFolder}" />
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
|
||||
<Button Content="{l:Loc About.Releases}" Command="{Binding OpenReleasesCommand}" ToolTip="{l:Loc Tooltips.About.Releases}" Margin="0,0,8,0" ui:ButtonIcon.Glyph="{StaticResource Icon.ExternalLink}" />
|
||||
<Button Content="{l:Loc About.OpenData}" Command="{Binding OpenDataFolderCommand}" ToolTip="{l:Loc Tooltips.About.OpenData}" ui:ButtonIcon.Glyph="{StaticResource Icon.FolderOpen}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class AboutView : UserControl
|
||||
{
|
||||
public AboutView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl x:Class="Titano.App.Sections.ArchiveView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Archive.Empty}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class ArchiveView : UserControl
|
||||
{
|
||||
public ArchiveView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl x:Class="Titano.App.Sections.ImportView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Import.Empty}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class ImportView : UserControl
|
||||
{
|
||||
public ImportView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl x:Class="Titano.App.Sections.JobsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Jobs.Empty}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class JobsView : UserControl
|
||||
{
|
||||
public JobsView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<UserControl x:Class="Titano.App.Sections.LibraryView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Library.Empty}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Empty.ImportCard}" Command="{Binding ImportCardCommand}" ToolTip="{l:Loc Tooltips.Library.ImportCard}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.OpenArchive}" Command="{Binding OpenArchiveCommand}" ToolTip="{l:Loc Tooltips.Library.OpenArchive}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.Connect}" Command="{Binding ConnectCommand}" ToolTip="{l:Loc Tooltips.Library.Connect}" />
|
||||
</StackPanel>
|
||||
</ui:EmptyState>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class LibraryView : UserControl
|
||||
{
|
||||
public LibraryView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
using System.Reflection;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Titano.Ui.Theming;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
/// <summary>Library (home): sequences of the archive (BRIEF §12.2).</summary>
|
||||
public sealed class LibraryViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Library, "Icon.Library")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
public ICommand ImportCardCommand => new RelayCommand(() => Shell.Navigate(SectionKey.Import));
|
||||
public ICommand OpenArchiveCommand => new RelayCommand(() => Shell.Navigate(SectionKey.Archive));
|
||||
public ICommand ConnectCommand => new RelayCommand(() => Shell.Navigate(SectionKey.Server));
|
||||
}
|
||||
|
||||
/// <summary>Card and folder import (BRIEF §12.4).</summary>
|
||||
public sealed class ImportViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Import, "Icon.Import")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
}
|
||||
|
||||
/// <summary>Sequence editor (BRIEF §12.3).</summary>
|
||||
public sealed class SequenceViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Sequence, "Icon.Sequence")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
public ICommand OpenLibraryCommand => new RelayCommand(() => Shell.Navigate(SectionKey.Library));
|
||||
}
|
||||
|
||||
/// <summary>Archive manager (BRIEF §12.5).</summary>
|
||||
public sealed class ArchiveViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Archive, "Icon.Archive")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
}
|
||||
|
||||
/// <summary>Job queue and history (BRIEF §12.6).</summary>
|
||||
public sealed class JobsViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Jobs, "Icon.Jobs")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
}
|
||||
|
||||
/// <summary>Server connection and sync (BRIEF §12.7).</summary>
|
||||
public sealed class ServerViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.Server, "Icon.Server")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
}
|
||||
|
||||
public sealed record LanguageOption(string Code, string Name);
|
||||
|
||||
/// <summary>Settings (BRIEF §12.8): section list on the left, controls on the right, tooltips only.</summary>
|
||||
public sealed class SettingsViewModel : SectionViewModel
|
||||
{
|
||||
private readonly AppSettings _settings;
|
||||
private string _page = "General";
|
||||
|
||||
public SettingsViewModel(ShellViewModel shell, AppSettings settings)
|
||||
: base(SectionKey.Settings, "Icon.Settings")
|
||||
{
|
||||
Shell = shell;
|
||||
_settings = settings;
|
||||
Languages = Core.Localization.Languages.Shipped
|
||||
.Select(c => new LanguageOption(c, Core.Localization.Languages.NativeName(c)))
|
||||
.ToList();
|
||||
SelectPageCommand = new RelayCommand(p =>
|
||||
{
|
||||
if (p is string page) Page = page;
|
||||
});
|
||||
}
|
||||
|
||||
public ShellViewModel Shell { get; }
|
||||
|
||||
public IReadOnlyList<string> Pages { get; } = ["General", "Advanced"];
|
||||
|
||||
public ICommand SelectPageCommand { get; }
|
||||
|
||||
public string Page
|
||||
{
|
||||
get => _page;
|
||||
set => Set(ref _page, value);
|
||||
}
|
||||
|
||||
public IReadOnlyList<LanguageOption> Languages { get; }
|
||||
|
||||
public LanguageOption SelectedLanguage
|
||||
{
|
||||
get => Languages.FirstOrDefault(l => l.Code.Equals(Loc.Culture.Name, StringComparison.OrdinalIgnoreCase)) ?? Languages[0];
|
||||
set
|
||||
{
|
||||
if (value is null) return;
|
||||
_settings.Language = value.Code;
|
||||
App.Current.ApplyLanguage(value.Code);
|
||||
App.Current.SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDarkTheme
|
||||
{
|
||||
get => _settings.Theme == AppTheme.Dark;
|
||||
set
|
||||
{
|
||||
if (value) ApplyTheme(AppTheme.Dark);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLightTheme
|
||||
{
|
||||
get => _settings.Theme == AppTheme.Light;
|
||||
set
|
||||
{
|
||||
if (value) ApplyTheme(AppTheme.Light);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSystemTheme
|
||||
{
|
||||
get => _settings.Theme == AppTheme.System;
|
||||
set
|
||||
{
|
||||
if (value) ApplyTheme(AppTheme.System);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckForUpdates
|
||||
{
|
||||
get => _settings.CheckForUpdates;
|
||||
set
|
||||
{
|
||||
_settings.CheckForUpdates = value;
|
||||
App.Current.SaveSettings();
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyTheme(AppTheme theme)
|
||||
{
|
||||
_settings.Theme = theme;
|
||||
ThemeManager.Apply(theme);
|
||||
App.Current.SaveSettings();
|
||||
OnPropertyChanged(nameof(IsDarkTheme));
|
||||
OnPropertyChanged(nameof(IsLightTheme));
|
||||
OnPropertyChanged(nameof(IsSystemTheme));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>About (BRIEF §12.9).</summary>
|
||||
public sealed class AboutViewModel(ShellViewModel shell) : SectionViewModel(SectionKey.About, "Icon.About")
|
||||
{
|
||||
public ShellViewModel Shell { get; } = shell;
|
||||
|
||||
public string Version => typeof(App).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "0.0.0";
|
||||
|
||||
public string Runtime => System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
|
||||
|
||||
public string OperatingSystem => System.Runtime.InteropServices.RuntimeInformation.OSDescription;
|
||||
|
||||
public string DataFolder => App.Current.Environment.DataDirectory;
|
||||
|
||||
public ICommand OpenDataFolderCommand => new RelayCommand(() => ShellActions.OpenFolder(DataFolder));
|
||||
|
||||
public ICommand OpenReleasesCommand => new RelayCommand(() => ShellActions.OpenUrl(ProductLinks.Releases));
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="Titano.App.Sections.SequenceView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Editor.Empty}">
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Shell.Nav.Library}" Command="{Binding OpenLibraryCommand}" ToolTip="{l:Loc Tooltips.Nav.Library}" />
|
||||
</ui:EmptyState>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class SequenceView : UserControl
|
||||
{
|
||||
public SequenceView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl x:Class="Titano.App.Sections.ServerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
|
||||
<Grid Margin="20">
|
||||
<ui:EmptyState Message="{l:Loc Server.Empty}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class ServerView : UserControl
|
||||
{
|
||||
public ServerView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<UserControl x:Class="Titano.App.Sections.SettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:s="clr-namespace:Titano.App.Sections">
|
||||
<Grid Margin="20,16,20,20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="16" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Section list -->
|
||||
<ListBox ItemsSource="{Binding Pages}" SelectedItem="{Binding Page}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={x:Static s:SettingsPageNameConverter.Instance}}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Border Grid.Column="2" Style="{StaticResource Border.Panel}" Padding="22,18">
|
||||
<Grid>
|
||||
<!-- General -->
|
||||
<StackPanel x:Name="General">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Page}" Value="General"><Setter Property="Visibility" Value="Visible" /></DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Text="{l:Loc Settings.Page.General}" Style="{StaticResource Text.PageTitle}" Margin="0,0,0,16" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="44" />
|
||||
<RowDefinition Height="44" />
|
||||
<RowDefinition Height="44" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{l:Loc Settings.General.Language}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<ComboBox Grid.Column="1" Width="240" HorizontalAlignment="Left" ItemsSource="{Binding Languages}" SelectedItem="{Binding SelectedLanguage}"
|
||||
DisplayMemberPath="Name" ToolTip="{l:Loc Tooltips.Settings.Language}" />
|
||||
<TextBlock Grid.Row="1" Text="{l:Loc Settings.General.Theme}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<RadioButton GroupName="Theme" Content="{l:Loc Settings.General.Theme.Dark}" IsChecked="{Binding IsDarkTheme}" ToolTip="{l:Loc Tooltips.Settings.ThemeDark}" Margin="0,0,20,0" />
|
||||
<RadioButton GroupName="Theme" Content="{l:Loc Settings.General.Theme.Light}" IsChecked="{Binding IsLightTheme}" ToolTip="{l:Loc Tooltips.Settings.ThemeLight}" Margin="0,0,20,0" />
|
||||
<RadioButton GroupName="Theme" Content="{l:Loc Settings.General.Theme.System}" IsChecked="{Binding IsSystemTheme}" ToolTip="{l:Loc Tooltips.Settings.ThemeSystem}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="2" Text="{l:Loc Settings.General.Updates}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<CheckBox Grid.Row="2" Grid.Column="1" Content="{l:Loc Settings.General.CheckOnStart}" IsChecked="{Binding CheckForUpdates}" ToolTip="{l:Loc Tooltips.Settings.CheckForUpdates}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Advanced -->
|
||||
<StackPanel>
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Page}" Value="Advanced"><Setter Property="Visibility" Value="Visible" /></DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Text="{l:Loc Settings.Page.Advanced}" Style="{StaticResource Text.PageTitle}" Margin="0,0,0,16" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="44" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{l:Loc Settings.Advanced.DataFolder}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBox Grid.Column="1" IsReadOnly="True" Text="{Binding Shell.About.DataFolder, Mode=OneWay}" ToolTip="{l:Loc Tooltips.Settings.DataFolder}" />
|
||||
<Button Grid.Column="2" Margin="8,0,0,0" Content="{l:Loc Common.Open}" Command="{Binding Shell.About.OpenDataFolderCommand}" ToolTip="{l:Loc Tooltips.Settings.OpenDataFolder}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using Titano.Core.Localization;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class SettingsView : UserControl
|
||||
{
|
||||
public SettingsView() => InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>Settings page id → localized page name.</summary>
|
||||
public sealed class SettingsPageNameConverter : IValueConverter
|
||||
{
|
||||
public static SettingsPageNameConverter Instance { get; } = new();
|
||||
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is string page ? Loc.L("Settings.Page." + page) : string.Empty;
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<ui:TitanoWindow x:Class="Titano.App.Shell.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:shell="clr-namespace:Titano.App.Shell"
|
||||
Title="{Binding WindowTitle}"
|
||||
Width="1440" Height="900" MinWidth="1200" MinHeight="760"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Navigation rail: full names, collapsible to icons (BRIEF §12.1). -->
|
||||
<Border x:Name="Rail" Background="{DynamicResource Brush.Chrome}" Width="128" ui:NavRail.IsCollapsed="{Binding IsRailCollapsed}">
|
||||
<DockPanel Margin="8,8,8,8" LastChildFill="False">
|
||||
<Button DockPanel.Dock="Top" Style="{StaticResource Button.IconSubtle}" HorizontalAlignment="Left" Margin="0,0,0,6"
|
||||
ui:ButtonIcon.Glyph="{StaticResource Icon.Menu}" Command="{Binding ToggleRailCommand}"
|
||||
ToolTip="{Binding RailToggleToolTip}" AutomationProperties.Name="{Binding RailToggleToolTip}" />
|
||||
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding TopSections}" Focusable="False">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type shell:SectionViewModel}">
|
||||
<ui:NavRailButton GroupName="Rail" Glyph="{Binding Glyph}" Content="{Binding Label}" Badge="{Binding Badge}"
|
||||
IsChecked="{Binding IsSelected}" ToolTip="{Binding ToolTip}" AutomationProperties.Name="{Binding Label}"
|
||||
Command="{Binding DataContext.NavigateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl DockPanel.Dock="Bottom" ItemsSource="{Binding BottomSections}" Focusable="False">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type shell:SectionViewModel}">
|
||||
<ui:NavRailButton GroupName="Rail" Glyph="{Binding Glyph}" Content="{Binding Label}" Badge="{Binding Badge}"
|
||||
IsChecked="{Binding IsSelected}" ToolTip="{Binding ToolTip}" AutomationProperties.Name="{Binding Label}"
|
||||
Command="{Binding DataContext.NavigateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:JobBar Text="{Binding JobText}" Progress="{Binding JobProgress}" IsActive="{Binding IsJobActive}" IsIndeterminate="{Binding IsJobIndeterminate}"
|
||||
StopCommand="{Binding StopJobCommand}" StopToolTip="{l:Loc Tooltips.Shell.StopJob}" />
|
||||
|
||||
<ContentControl Grid.Row="1" Content="{Binding Current}" Focusable="False" />
|
||||
|
||||
<!-- Status strip -->
|
||||
<Border Grid.Row="2" Height="30" Background="{DynamicResource Brush.Chrome}" Padding="20,0">
|
||||
<StackPanel Orientation="Horizontal" TextElement.FontSize="12" TextElement.Foreground="{DynamicResource Brush.TextMuted}">
|
||||
<TextBlock Text="{Binding SequencesText}" Margin="0,0,18,0" />
|
||||
<TextBlock Text="{Binding PhotosText}" Margin="0,0,18,0" />
|
||||
<TextBlock Text="{Binding StorageText}" Margin="0,0,18,0" />
|
||||
<TextBlock x:Name="Connection" Text="{Binding ConnectionText}" Margin="0,0,18,0" />
|
||||
<TextBlock Text="{Binding JobsText}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<ui:ToastHost x:Name="Toasts" Grid.Row="0" Grid.RowSpan="3" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ui:TitanoWindow>
|
||||
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows;
|
||||
using Titano.Ui.Controls;
|
||||
|
||||
namespace Titano.App.Shell;
|
||||
|
||||
public partial class MainWindow : TitanoWindow
|
||||
{
|
||||
private readonly ShellViewModel _shell;
|
||||
|
||||
public MainWindow(ShellViewModel shell)
|
||||
{
|
||||
_shell = shell;
|
||||
DataContext = shell;
|
||||
InitializeComponent();
|
||||
Rail.Width = shell.IsRailCollapsed ? 48 : 128;
|
||||
shell.PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.PropertyName is nameof(ShellViewModel.IsRailCollapsed) or "")
|
||||
Rail.Width = shell.IsRailCollapsed ? 48 : 128;
|
||||
if (e.PropertyName is nameof(ShellViewModel.IsConnected) or "")
|
||||
Connection.Foreground = (System.Windows.Media.Brush)FindResource(shell.IsConnected ? "Brush.Accent" : "Brush.TextMuted");
|
||||
};
|
||||
shell.PendingToasts.CollectionChanged += OnToastRequested;
|
||||
RestorePlacement();
|
||||
Closing += (_, _) => SavePlacement();
|
||||
}
|
||||
|
||||
private void OnToastRequested(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.Action != NotifyCollectionChangedAction.Add || e.NewItems is null) return;
|
||||
foreach (Toast t in e.NewItems) Toasts.Show(t);
|
||||
Dispatcher.BeginInvoke(() => _shell.PendingToasts.Clear());
|
||||
}
|
||||
|
||||
private void RestorePlacement()
|
||||
{
|
||||
var p = App.Current.Settings.Window;
|
||||
if (p is null || p.Width < MinWidth || p.Height < MinHeight) return;
|
||||
var virtualScreen = new Rect(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenTop, SystemParameters.VirtualScreenWidth, SystemParameters.VirtualScreenHeight);
|
||||
var rect = new Rect(p.Left, p.Top, p.Width, p.Height);
|
||||
if (!virtualScreen.IntersectsWith(rect)) return;
|
||||
WindowStartupLocation = WindowStartupLocation.Manual;
|
||||
Left = p.Left;
|
||||
Top = p.Top;
|
||||
Width = p.Width;
|
||||
Height = p.Height;
|
||||
if (p.Maximized) WindowState = WindowState.Maximized;
|
||||
}
|
||||
|
||||
private void SavePlacement()
|
||||
{
|
||||
var b = RestoreBounds;
|
||||
App.Current.Settings.Window = new Infrastructure.AppSettings.WindowPlacement
|
||||
{
|
||||
Left = b.Left,
|
||||
Top = b.Top,
|
||||
Width = b.Width,
|
||||
Height = b.Height,
|
||||
Maximized = WindowState == WindowState.Maximized,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Ui.Theming;
|
||||
|
||||
namespace Titano.App.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// <c>Titano.exe --capture <dir></c>: renders every section at 1440×900 in dark and light themes to PNG for
|
||||
/// visual regression and phase reports (BRIEF §20.2), then exits.
|
||||
/// </summary>
|
||||
public static class ScreenCapture
|
||||
{
|
||||
public static void Run(MainWindow window, ShellViewModel shell, string directory)
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
window.WindowStartupLocation = WindowStartupLocation.Manual;
|
||||
window.Left = -20000;
|
||||
window.Top = -20000;
|
||||
window.Width = 1440;
|
||||
window.Height = 900;
|
||||
window.ShowActivated = false;
|
||||
window.ShowInTaskbar = false;
|
||||
window.Show();
|
||||
|
||||
window.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var theme in new[] { AppTheme.Dark, AppTheme.Light })
|
||||
{
|
||||
ThemeManager.Apply(theme);
|
||||
foreach (var section in shell.AllSections)
|
||||
{
|
||||
shell.Navigate(section.Key);
|
||||
Settle(window);
|
||||
Save(window, Path.Combine(directory, $"{section.Key}-{theme.ToString().ToLowerInvariant()}.png"));
|
||||
}
|
||||
}
|
||||
Log.Info("capture", $"Screenshots written to {Path.GetFullPath(directory)}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("capture", "Capture failed", ex);
|
||||
Environment.ExitCode = 1;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void Settle(Window window)
|
||||
{
|
||||
window.UpdateLayout();
|
||||
// Let bindings, templates and deferred renders complete.
|
||||
window.Dispatcher.Invoke(DispatcherPriority.ApplicationIdle, () => { });
|
||||
window.UpdateLayout();
|
||||
}
|
||||
|
||||
private static void Save(Window window, string path)
|
||||
{
|
||||
if (VisualTreeHelper.GetChildrenCount(window) == 0) return;
|
||||
var root = (FrameworkElement)VisualTreeHelper.GetChild(window, 0);
|
||||
var dpi = VisualTreeHelper.GetDpi(window);
|
||||
var width = (int)Math.Ceiling(root.ActualWidth * dpi.DpiScaleX);
|
||||
var height = (int)Math.Ceiling(root.ActualHeight * dpi.DpiScaleY);
|
||||
if (width <= 0 || height <= 0) return;
|
||||
var bitmap = new RenderTargetBitmap(width, height, dpi.PixelsPerInchX, dpi.PixelsPerInchY, PixelFormats.Pbgra32);
|
||||
bitmap.Render(root);
|
||||
var encoder = new PngBitmapEncoder();
|
||||
encoder.Frames.Add(BitmapFrame.Create(bitmap));
|
||||
using var stream = File.Create(path);
|
||||
encoder.Save(stream);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:Titano.App.Sections">
|
||||
<!-- Section view model → view. -->
|
||||
<DataTemplate DataType="{x:Type s:LibraryViewModel}"><s:LibraryView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:ImportViewModel}"><s:ImportView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:SequenceViewModel}"><s:SequenceView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:ArchiveViewModel}"><s:ArchiveView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:JobsViewModel}"><s:JobsView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:ServerViewModel}"><s:ServerView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:SettingsViewModel}"><s:SettingsView /></DataTemplate>
|
||||
<DataTemplate DataType="{x:Type s:AboutViewModel}"><s:AboutView /></DataTemplate>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,59 @@
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Shell;
|
||||
|
||||
public enum SectionKey
|
||||
{
|
||||
Library,
|
||||
Import,
|
||||
Sequence,
|
||||
Archive,
|
||||
Jobs,
|
||||
Server,
|
||||
Settings,
|
||||
About,
|
||||
}
|
||||
|
||||
/// <summary>A top-level destination of the navigation rail.</summary>
|
||||
public abstract class SectionViewModel(SectionKey key, string iconKey) : LocalizedViewModel
|
||||
{
|
||||
private bool _isSelected;
|
||||
private int _badge;
|
||||
|
||||
public SectionKey Key { get; } = key;
|
||||
|
||||
/// <summary>Resource key of the rail icon (e.g. "Icon.Library").</summary>
|
||||
public string IconKey { get; } = iconKey;
|
||||
|
||||
public IconData? Glyph => System.Windows.Application.Current?.TryFindResource(IconKey) as IconData;
|
||||
|
||||
/// <summary>Rail label ("Library").</summary>
|
||||
public string Label => Core.Localization.Loc.L("Shell.Nav." + Key);
|
||||
|
||||
/// <summary>Rail tooltip: what the section is for.</summary>
|
||||
public string ToolTip => Core.Localization.Loc.L("Tooltips.Nav." + Key);
|
||||
|
||||
/// <summary>Window title suffix ("Titano — Import").</summary>
|
||||
public virtual string Title => Label;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _isSelected;
|
||||
set
|
||||
{
|
||||
if (Set(ref _isSelected, value) && value) OnActivated();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Count of items needing attention, shown as a rail badge.</summary>
|
||||
public int Badge
|
||||
{
|
||||
get => _badge;
|
||||
protected set => Set(ref _badge, value);
|
||||
}
|
||||
|
||||
protected virtual void OnActivated()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Sections;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Shell;
|
||||
|
||||
/// <summary>State of the main window: rail, current section, job bar and status strip (BRIEF §12.1).</summary>
|
||||
public sealed class ShellViewModel : LocalizedViewModel
|
||||
{
|
||||
private readonly AppSettings _settings;
|
||||
private SectionViewModel _current;
|
||||
private bool _isRailCollapsed;
|
||||
private string? _jobText;
|
||||
private double _jobProgress;
|
||||
private bool _jobActive;
|
||||
private bool _jobIndeterminate;
|
||||
private long _sequenceCount;
|
||||
private long _photoCount;
|
||||
private long _totalBytes;
|
||||
private string? _serverName;
|
||||
private int _jobCount;
|
||||
|
||||
public ShellViewModel(AppSettings settings)
|
||||
{
|
||||
_settings = settings;
|
||||
_isRailCollapsed = settings.RailCollapsed;
|
||||
Library = new LibraryViewModel(this);
|
||||
Import = new ImportViewModel(this);
|
||||
Sequence = new SequenceViewModel(this);
|
||||
Archive = new ArchiveViewModel(this);
|
||||
Jobs = new JobsViewModel(this);
|
||||
Server = new ServerViewModel(this);
|
||||
Settings = new SettingsViewModel(this, settings);
|
||||
About = new AboutViewModel(this);
|
||||
TopSections = [Library, Import, Sequence, Archive, Jobs, Server];
|
||||
BottomSections = [Settings, About];
|
||||
_current = Library;
|
||||
Library.IsSelected = true;
|
||||
|
||||
NavigateCommand = new RelayCommand(p =>
|
||||
{
|
||||
if (p is SectionViewModel s) Navigate(s.Key);
|
||||
else if (p is SectionKey k) Navigate(k);
|
||||
else if (p is string name && Enum.TryParse<SectionKey>(name, out var key)) Navigate(key);
|
||||
});
|
||||
ToggleRailCommand = new RelayCommand(() => IsRailCollapsed = !IsRailCollapsed);
|
||||
}
|
||||
|
||||
public LibraryViewModel Library { get; }
|
||||
public ImportViewModel Import { get; }
|
||||
public SequenceViewModel Sequence { get; }
|
||||
public ArchiveViewModel Archive { get; }
|
||||
public JobsViewModel Jobs { get; }
|
||||
public ServerViewModel Server { get; }
|
||||
public SettingsViewModel Settings { get; }
|
||||
public AboutViewModel About { get; }
|
||||
|
||||
public IReadOnlyList<SectionViewModel> TopSections { get; }
|
||||
public IReadOnlyList<SectionViewModel> BottomSections { get; }
|
||||
public IEnumerable<SectionViewModel> AllSections => TopSections.Concat(BottomSections);
|
||||
|
||||
public ICommand NavigateCommand { get; }
|
||||
public ICommand ToggleRailCommand { get; }
|
||||
|
||||
/// <summary>In-window notifications; the window binds its <see cref="ToastHost"/> here.</summary>
|
||||
public ObservableCollection<Toast> PendingToasts { get; } = [];
|
||||
|
||||
public SectionViewModel Current
|
||||
{
|
||||
get => _current;
|
||||
private set
|
||||
{
|
||||
if (Set(ref _current, value)) OnPropertyChanged(nameof(WindowTitle));
|
||||
}
|
||||
}
|
||||
|
||||
public string WindowTitle => Current == Library ? "Titano" : "Titano — " + Current.Title;
|
||||
|
||||
public bool IsRailCollapsed
|
||||
{
|
||||
get => _isRailCollapsed;
|
||||
set
|
||||
{
|
||||
if (!Set(ref _isRailCollapsed, value)) return;
|
||||
_settings.RailCollapsed = value;
|
||||
OnPropertyChanged(nameof(RailToggleToolTip));
|
||||
}
|
||||
}
|
||||
|
||||
public string RailToggleToolTip => Loc.L(IsRailCollapsed ? "Tooltips.Shell.ExpandRail" : "Tooltips.Shell.CollapseRail");
|
||||
|
||||
// ---- Job bar ----
|
||||
public string JobText => _jobActive && _jobText is not null ? _jobText : Loc.L("Shell.JobBar.Ready", _jobCount);
|
||||
public double JobProgress { get => _jobProgress; private set => Set(ref _jobProgress, value); }
|
||||
public bool IsJobActive { get => _jobActive; private set => Set(ref _jobActive, value); }
|
||||
public bool IsJobIndeterminate { get => _jobIndeterminate; private set => Set(ref _jobIndeterminate, value); }
|
||||
public ICommand? StopJobCommand { get; set; }
|
||||
|
||||
/// <summary>Updates the global job bar (and the taskbar progress through the window).</summary>
|
||||
public void SetJob(string? text, double progress, bool indeterminate = false)
|
||||
{
|
||||
_jobText = text;
|
||||
IsJobActive = text is not null;
|
||||
JobProgress = progress;
|
||||
IsJobIndeterminate = indeterminate;
|
||||
OnPropertyChanged(nameof(JobText));
|
||||
}
|
||||
|
||||
// ---- Status strip ----
|
||||
public string SequencesText => Loc.Plural("Shell.Status.Sequences", _sequenceCount);
|
||||
public string PhotosText => Loc.Plural("Shell.Status.Photos", _photoCount);
|
||||
public string StorageText => Formatting.Bytes(_totalBytes);
|
||||
public string ConnectionText => _serverName is null ? Loc.L("Shell.Status.NotConnected") : Loc.L("Shell.Status.Connected", _serverName);
|
||||
public bool IsConnected => _serverName is not null;
|
||||
public string JobsText => Loc.Plural("Shell.Status.Jobs", _jobCount);
|
||||
|
||||
public void SetLibraryTotals(long sequences, long photos, long bytes)
|
||||
{
|
||||
_sequenceCount = sequences;
|
||||
_photoCount = photos;
|
||||
_totalBytes = bytes;
|
||||
OnPropertyChanged(nameof(SequencesText));
|
||||
OnPropertyChanged(nameof(PhotosText));
|
||||
OnPropertyChanged(nameof(StorageText));
|
||||
}
|
||||
|
||||
public void SetConnection(string? serverName)
|
||||
{
|
||||
_serverName = serverName;
|
||||
OnPropertyChanged(nameof(ConnectionText));
|
||||
OnPropertyChanged(nameof(IsConnected));
|
||||
}
|
||||
|
||||
public void SetJobCount(int count)
|
||||
{
|
||||
_jobCount = count;
|
||||
OnPropertyChanged(nameof(JobsText));
|
||||
OnPropertyChanged(nameof(JobText));
|
||||
}
|
||||
|
||||
public void Navigate(SectionKey key)
|
||||
{
|
||||
var target = AllSections.First(s => s.Key == key);
|
||||
foreach (var s in AllSections) s.IsSelected = ReferenceEquals(s, target);
|
||||
Current = target;
|
||||
}
|
||||
|
||||
public void ShowToast(Toast toast) => PendingToasts.Add(toast);
|
||||
|
||||
/// <summary>Errors are one sentence saying what happened plus one action (BRIEF §0.2 rule 6).</summary>
|
||||
public void ReportError(Exception ex)
|
||||
{
|
||||
Log.Error("ui", "Operation failed", ex);
|
||||
ShowToast(new Toast
|
||||
{
|
||||
Title = Loc.L("Errors.Unexpected"),
|
||||
Message = ex.Message,
|
||||
ActionText = Loc.L("Common.OpenLogs"),
|
||||
ActionToolTip = Loc.L("Tooltips.Common.OpenLogs"),
|
||||
ActionCommand = new RelayCommand(() => ShellActions.OpenFolder(App.Current.Environment.LogDirectory)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Titano.Protocol;
|
||||
|
||||
/// <summary>Error body of every failed API call: <c>{ code, message, details }</c> (BRIEF §14.3).</summary>
|
||||
public sealed record ApiError(string Code, string Message, string? Details = null);
|
||||
|
||||
/// <summary>Upload limits announced by the server.</summary>
|
||||
public sealed record ServerLimits(long MaxUploadBytes, int ChunkSizeBytes);
|
||||
|
||||
/// <summary><c>GET /api/v1/server/info</c>.</summary>
|
||||
public sealed record ServerInfo(
|
||||
string Name,
|
||||
string Version,
|
||||
int ApiVersion,
|
||||
IReadOnlyList<string> Capabilities,
|
||||
string? TlsFingerprint,
|
||||
IReadOnlyList<string> Formats,
|
||||
ServerLimits Limits);
|
||||
|
||||
/// <summary><c>GET /health</c>.</summary>
|
||||
public sealed record HealthStatus(string Status, string Version, IReadOnlyDictionary<string, string> Checks);
|
||||
|
||||
/// <summary>Source-generated JSON contracts shared by server and clients (camelCase, enums as strings).</summary>
|
||||
[JsonSourceGenerationOptions(
|
||||
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
UseStringEnumConverter = true)]
|
||||
[JsonSerializable(typeof(ApiError))]
|
||||
[JsonSerializable(typeof(ServerInfo))]
|
||||
[JsonSerializable(typeof(HealthStatus))]
|
||||
[JsonSerializable(typeof(Dictionary<string, string>))]
|
||||
public sealed partial class ProtocolJson : JsonSerializerContext;
|
||||
@@ -0,0 +1,100 @@
|
||||
/* Titano Server admin — DESIGN.md light tokens (the web admin is light-only). */
|
||||
:root {
|
||||
--bg: #f3f3f3;
|
||||
--chrome: #ffffff;
|
||||
--surface: #ffffff;
|
||||
--card: #ffffff;
|
||||
--card-hover: #f5f5f5;
|
||||
--stroke: #e5e5e5;
|
||||
--stroke-strong: #d1d1d1;
|
||||
--text: #1a1a1a;
|
||||
--text-muted: #616161;
|
||||
--text-faint: #9e9e9e;
|
||||
--accent: #0067c0;
|
||||
--accent-hover: #1975c5;
|
||||
--on-accent: #ffffff;
|
||||
--accent-selected: #e8f1fa;
|
||||
--sun: #e08a1e;
|
||||
--success: #0f7b4f;
|
||||
--warning: #9a6700;
|
||||
--error: #c42b1c;
|
||||
--radius: 6px;
|
||||
--radius-card: 8px;
|
||||
--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html, body { height: 100%; }
|
||||
body { margin: 0; font: 13px/1.45 var(--font); color: var(--text); background: var(--bg); }
|
||||
button, input, select { font: inherit; color: inherit; }
|
||||
a { color: var(--accent); }
|
||||
.num { font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* Shell */
|
||||
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
|
||||
.sidebar { background: var(--chrome); border-right: 1px solid var(--stroke); display: flex; flex-direction: column; padding: 16px 12px; }
|
||||
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
|
||||
.brand img { width: 28px; height: 28px; }
|
||||
.brand strong { display: block; font-size: 14px; }
|
||||
.brand span { display: block; font-size: 11px; color: var(--text-muted); }
|
||||
.nav a { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; margin-bottom: 2px; }
|
||||
.nav a:hover { background: var(--card-hover); }
|
||||
.nav a[aria-current="page"] { background: var(--accent-selected); color: var(--accent); font-weight: 600; }
|
||||
.nav svg { width: 16px; height: 16px; flex: none; }
|
||||
.nav .badge { margin-left: auto; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
|
||||
.sidebar .user { margin-top: auto; border-top: 1px solid var(--stroke); padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
|
||||
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-selected); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
|
||||
.user .who { flex: 1; min-width: 0; }
|
||||
.user .who strong { display: block; }
|
||||
.user .who span { color: var(--text-muted); font-size: 11px; }
|
||||
|
||||
.main { display: flex; flex-direction: column; min-width: 0; }
|
||||
.header { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--stroke); background: var(--chrome); }
|
||||
.header h1 { font-size: 18px; font-weight: 600; margin: 0; }
|
||||
.header .meta { color: var(--text-muted); }
|
||||
.header .spacer { flex: 1; }
|
||||
.content { padding: 24px; display: grid; gap: 20px; }
|
||||
|
||||
/* Controls */
|
||||
.btn { height: 32px; min-width: 44px; padding: 0 12px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
|
||||
.btn:hover { background: var(--card-hover); border-color: var(--stroke-strong); }
|
||||
.btn:focus-visible, .input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
|
||||
.btn.primary:hover { background: var(--accent-hover); }
|
||||
.btn.subtle { border-color: transparent; background: transparent; }
|
||||
.btn.icon { width: 32px; padding: 0; }
|
||||
.btn:disabled { opacity: .4; cursor: default; }
|
||||
.input { height: 32px; width: 100%; padding: 0 10px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--card); }
|
||||
.input:hover { border-color: var(--stroke-strong); }
|
||||
.input:focus { border-color: var(--accent); outline: none; }
|
||||
.input[aria-invalid="true"] { border-color: var(--error); }
|
||||
select.input { padding-right: 24px; }
|
||||
|
||||
.panel { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-card); padding: 18px 20px; }
|
||||
.panel h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
|
||||
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
|
||||
.tile .label { color: var(--text-muted); }
|
||||
.tile .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
|
||||
.tile .value small { font-size: 13px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
|
||||
.tile .sub { color: var(--text-muted); margin-top: 6px; }
|
||||
.progress { height: 6px; border-radius: 3px; background: var(--stroke); overflow: hidden; margin-top: 10px; }
|
||||
.progress > div { height: 6px; background: var(--accent); }
|
||||
|
||||
.status-ok { color: var(--success); }
|
||||
.status-warn { color: var(--warning); }
|
||||
.status-err { color: var(--error); }
|
||||
|
||||
/* Login */
|
||||
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
|
||||
.login form { width: 360px; max-width: 100%; display: grid; gap: 14px; }
|
||||
.login .brand { padding: 0 0 8px; }
|
||||
.login label { display: grid; gap: 6px; color: var(--text-muted); }
|
||||
.login .error { color: var(--error); min-height: 18px; }
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.shell { grid-template-columns: 1fr; }
|
||||
.sidebar { flex-direction: row; overflow-x: auto; padding: 8px; }
|
||||
.sidebar .brand, .sidebar .user { display: none; }
|
||||
.nav { display: flex; gap: 4px; }
|
||||
.nav a span { display: none; }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// Same API as the desktop clients: cookie session + double-submit CSRF token for the web admin (BRIEF §14.2).
|
||||
export class ApiFailure extends Error {
|
||||
constructor(status, code, message) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
||||
const SESSION_KEY = "titano.admin.user";
|
||||
|
||||
function csrfToken() {
|
||||
const m = document.cookie.match(/(?:^|; )titano_csrf=([^;]+)/);
|
||||
return m ? decodeURIComponent(m[1]) : "";
|
||||
}
|
||||
|
||||
async function request(method, url, body) {
|
||||
const headers = { Accept: "application/json" };
|
||||
if (body !== undefined) headers["Content-Type"] = "application/json";
|
||||
if (method !== "GET") headers["X-CSRF-Token"] = csrfToken();
|
||||
const res = await fetch(url, { method, headers, credentials: "same-origin", body: body === undefined ? undefined : JSON.stringify(body) });
|
||||
if (res.status === 401 && url !== "/api/v1/auth/login") sessionStorage.removeItem(SESSION_KEY);
|
||||
if (!res.ok) {
|
||||
let err = { code: "http_" + res.status, message: res.statusText };
|
||||
try { err = await res.json(); } catch { /* non-JSON error */ }
|
||||
throw new ApiFailure(res.status, err.code, err.message);
|
||||
}
|
||||
return res.status === 204 ? null : res.json();
|
||||
}
|
||||
|
||||
export const api = {
|
||||
get: (url) => request("GET", url),
|
||||
post: (url, body) => request("POST", url, body ?? {}),
|
||||
patch: (url, body) => request("PATCH", url, body),
|
||||
del: (url) => request("DELETE", url),
|
||||
isSignedIn: () => sessionStorage.getItem(SESSION_KEY) !== null,
|
||||
user: () => JSON.parse(sessionStorage.getItem(SESSION_KEY) ?? "null"),
|
||||
async signIn(username, password) {
|
||||
const r = await request("POST", "/api/v1/auth/login", { username, password, clientName: "admin-web", cookie: true });
|
||||
sessionStorage.setItem(SESSION_KEY, JSON.stringify(r.user));
|
||||
return r;
|
||||
},
|
||||
async signOut() {
|
||||
try { await request("POST", "/api/v1/auth/logout", {}); } catch { /* already gone */ }
|
||||
sessionStorage.removeItem(SESSION_KEY);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,102 @@
|
||||
// Titano Server admin panel — vanilla ES modules, no build step (BRIEF §14.8).
|
||||
import { api, ApiFailure } from "./api.js";
|
||||
import { t, loadStrings, applyStrings } from "./i18n.js";
|
||||
import { icons } from "./icons.js";
|
||||
|
||||
const app = document.getElementById("app");
|
||||
const pages = ["dashboard", "users", "archive", "jobs", "settings", "logs", "about"];
|
||||
const pageIcon = { dashboard: "dashboard", users: "users", archive: "archive", jobs: "jobs", settings: "settings", logs: "logs", about: "about" };
|
||||
|
||||
let info = null;
|
||||
|
||||
async function start() {
|
||||
await loadStrings(navigator.language);
|
||||
info = await api.get("/api/v1/server/info").catch(() => null);
|
||||
window.addEventListener("hashchange", render);
|
||||
render();
|
||||
}
|
||||
|
||||
function currentPage() {
|
||||
const p = location.hash.replace(/^#\/?/, "");
|
||||
return pages.includes(p) ? p : "dashboard";
|
||||
}
|
||||
|
||||
function render() {
|
||||
if (!api.isSignedIn()) {
|
||||
renderLogin();
|
||||
return;
|
||||
}
|
||||
renderShell(currentPage());
|
||||
}
|
||||
|
||||
function renderLogin() {
|
||||
app.innerHTML = `
|
||||
<main class="login">
|
||||
<form novalidate>
|
||||
<div class="brand"><img src="favicon.svg" alt=""><div><strong>Titano Server</strong><span class="num">${escapeHtml(info?.name ?? "")} · v${escapeHtml(info?.version ?? "")}</span></div></div>
|
||||
<label><span data-i18n="Admin.Login.User"></span><input class="input" name="username" autocomplete="username" required></label>
|
||||
<label><span data-i18n="Admin.Login.Password"></span><input class="input" name="password" type="password" autocomplete="current-password" required></label>
|
||||
<div class="error" role="alert"></div>
|
||||
<button class="btn primary" type="submit" data-i18n="Admin.Login.SignIn" data-i18n-title="Admin.Login.SignIn.Tip"></button>
|
||||
</form>
|
||||
</main>`;
|
||||
applyStrings(app);
|
||||
const form = app.querySelector("form");
|
||||
const error = form.querySelector(".error");
|
||||
form.addEventListener("submit", async (e) => {
|
||||
e.preventDefault();
|
||||
error.textContent = "";
|
||||
const data = new FormData(form);
|
||||
try {
|
||||
await api.signIn(String(data.get("username")), String(data.get("password")));
|
||||
render();
|
||||
} catch (err) {
|
||||
error.textContent = err instanceof ApiFailure && err.status === 401 ? t("Admin.Login.Failed") : t("Admin.Error.Unreachable");
|
||||
}
|
||||
});
|
||||
form.querySelector("input").focus();
|
||||
}
|
||||
|
||||
function renderShell(page) {
|
||||
const nav = pages.map((p) => `
|
||||
<a href="#/${p}" ${p === page ? 'aria-current="page"' : ""} data-i18n-title="Admin.Nav.${cap(p)}.Tip">${icons[pageIcon[p]]}<span data-i18n="Admin.Nav.${cap(p)}"></span></a>`).join("");
|
||||
const user = api.user();
|
||||
app.innerHTML = `
|
||||
<div class="shell">
|
||||
<aside class="sidebar">
|
||||
<div class="brand"><img src="favicon.svg" alt=""><div><strong>Titano Server</strong><span class="num">${escapeHtml(info?.name ?? "")} · v${escapeHtml(info?.version ?? "")}</span></div></div>
|
||||
<nav class="nav">${nav}</nav>
|
||||
<div class="user">
|
||||
<div class="avatar">${escapeHtml((user?.username ?? "?").slice(0, 1).toUpperCase())}</div>
|
||||
<div class="who"><strong>${escapeHtml(user?.username ?? "")}</strong><span data-i18n="Admin.Role.${cap(user?.role ?? "viewer")}"></span></div>
|
||||
<button class="btn icon subtle" id="signout" data-i18n-title="Admin.SignOut.Tip" aria-label="${escapeHtml(t("Admin.SignOut.Tip"))}">${icons.power}</button>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="main">
|
||||
<header class="header"><h1 data-i18n="Admin.Nav.${cap(page)}"></h1><span class="meta" id="meta"></span><span class="spacer"></span></header>
|
||||
<section class="content" id="content"></section>
|
||||
</div>
|
||||
</div>`;
|
||||
applyStrings(app);
|
||||
app.querySelector("#signout").addEventListener("click", async () => {
|
||||
await api.signOut();
|
||||
render();
|
||||
});
|
||||
const content = app.querySelector("#content");
|
||||
import(`./pages/${page}.js`)
|
||||
.then((m) => m.render(content, { api, t, info, meta: app.querySelector("#meta") }))
|
||||
.catch(() => {
|
||||
content.innerHTML = `<div class="panel"><span data-i18n="Admin.Error.Unreachable"></span></div>`;
|
||||
applyStrings(content);
|
||||
});
|
||||
}
|
||||
|
||||
export function escapeHtml(s) {
|
||||
return String(s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c]));
|
||||
}
|
||||
|
||||
function cap(s) {
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
||||
|
||||
start();
|
||||
@@ -0,0 +1,17 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
|
||||
<rect x="0" y="0" width="256" height="256" rx="56" fill="#1a1a1e"/>
|
||||
<path d="M142.4 37.1 A92 92 0 0 1 161.0 42.1" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.14"/>
|
||||
<path d="M185.9 56.5 A92 92 0 0 1 199.5 70.1" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.22"/>
|
||||
<path d="M213.9 95.0 A92 92 0 0 1 218.9 113.6" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.3"/>
|
||||
<path d="M218.9 142.4 A92 92 0 0 1 213.9 161.0" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.37"/>
|
||||
<path d="M199.5 185.9 A92 92 0 0 1 185.9 199.5" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.45"/>
|
||||
<path d="M161.0 213.9 A92 92 0 0 1 142.4 218.9" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.53"/>
|
||||
<path d="M113.6 218.9 A92 92 0 0 1 95.0 213.9" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.61"/>
|
||||
<path d="M70.1 199.5 A92 92 0 0 1 56.5 185.9" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.69"/>
|
||||
<path d="M42.1 161.0 A92 92 0 0 1 37.1 142.4" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.77"/>
|
||||
<path d="M37.1 113.6 A92 92 0 0 1 42.1 95.0" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.84"/>
|
||||
<path d="M56.5 70.1 A92 92 0 0 1 70.1 56.5" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="0.92"/>
|
||||
<path d="M95.0 42.1 A92 92 0 0 1 113.6 37.1" fill="none" stroke="#4cc2ff" stroke-width="20" stroke-linecap="round" opacity="1.0"/>
|
||||
<circle cx="152" cy="104" r="30" fill="#f5a524"/>
|
||||
<circle cx="204" cy="204" r="40" fill="#1a1a1e" stroke="#4cc2ff" stroke-width="6"/><rect x="185" y="188" width="38" height="12" rx="4" fill="#4cc2ff"/><rect x="185" y="208" width="38" height="12" rx="4" fill="#4cc2ff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,27 @@
|
||||
// Strings come from /api/v1/i18n/{culture}, generated from the same .resx catalog as the desktop apps.
|
||||
let strings = {};
|
||||
|
||||
export async function loadStrings(culture) {
|
||||
try {
|
||||
const res = await fetch(`/api/v1/i18n/${encodeURIComponent(culture || "en")}`);
|
||||
strings = await res.json();
|
||||
} catch {
|
||||
strings = {};
|
||||
}
|
||||
document.documentElement.lang = strings.$culture || "en";
|
||||
document.documentElement.dir = strings.$rtl === "true" ? "rtl" : "ltr";
|
||||
}
|
||||
|
||||
/** Localized string for key with {0}, {1}… placeholders filled from args. */
|
||||
export function t(key, ...args) {
|
||||
const s = strings[key];
|
||||
if (s === undefined) return `⟦${key}⟧`;
|
||||
return s.replace(/\{(\d+)(?:[,:][^}]*)?\}/g, (_, i) => (args[Number(i)] ?? ""));
|
||||
}
|
||||
|
||||
/** Fills data-i18n (text), data-i18n-title (tooltip) and data-i18n-placeholder attributes. */
|
||||
export function applyStrings(root) {
|
||||
root.querySelectorAll("[data-i18n]").forEach((el) => { el.textContent = t(el.dataset.i18n); });
|
||||
root.querySelectorAll("[data-i18n-title]").forEach((el) => { el.title = t(el.dataset.i18nTitle); });
|
||||
root.querySelectorAll("[data-i18n-placeholder]").forEach((el) => { el.placeholder = t(el.dataset.i18nPlaceholder); });
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Generated from branding/ui-icons/icons.py (same 16-px set as the desktop apps).
|
||||
export const icons = {
|
||||
dashboard: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M2.5 1.5 H6.0 A1 1 0 0 1 7.0 2.5 V6.0 A1 1 0 0 1 6.0 7.0 H2.5 A1 1 0 0 1 1.5 6.0 V2.5 A1 1 0 0 1 2.5 1.5 ZM10 1.5 H13.5 A1 1 0 0 1 14.5 2.5 V6.0 A1 1 0 0 1 13.5 7.0 H10 A1 1 0 0 1 9 6.0 V2.5 A1 1 0 0 1 10 1.5 ZM2.5 9 H6.0 A1 1 0 0 1 7.0 10 V13.5 A1 1 0 0 1 6.0 14.5 H2.5 A1 1 0 0 1 1.5 13.5 V10 A1 1 0 0 1 2.5 9 ZM10 9 H13.5 A1 1 0 0 1 14.5 10 V13.5 A1 1 0 0 1 13.5 14.5 H10 A1 1 0 0 1 9 13.5 V10 A1 1 0 0 1 10 9 Z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
users: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M5 5 A3 3 0 1 0 11 5 A3 3 0 1 0 5 5 Z M2.5 14 A5.5 5.5 0 0 1 13.5 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
archive: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M2 4.5 H14 V13.5 H2 Z M2 2 H14 V4.5 H2 Z M6 8 H10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
jobs: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M3 8 H13 M3 4 H13 M3 12 H9" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
settings: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M5.8 8 A2.2 2.2 0 1 0 10.2 8 A2.2 2.2 0 1 0 5.8 8 Z M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
logs: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M3.5 1.5 H9.5 L12.5 4.5 V14.5 H3.5 Z M5.5 7 H10.5 M5.5 9.5 H10.5 M5.5 12 H8.5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
about: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M1.5 8 A6.5 6.5 0 1 0 14.5 8 A6.5 6.5 0 1 0 1.5 8 Z M8 7 V11 M8 4.8 V5.2" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
power: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 1.8 V7.5 M11.54 4.59 A5.5 5.5 0 1 1 4.46 4.59" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
moon: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M9.5 1.8 A6.5 6.5 0 1 0 14.2 11.2 A5.5 5.5 0 0 1 9.5 1.8 Z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
refresh: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M10.75 3.24 A5.5 5.5 0 1 1 4.46 3.79 M13.2 2.6 L13.2 5.3 L10.5 5.3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
close: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M4 4 L12 12 M12 4 L4 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
plus: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 3 V13 M3 8 H13" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
search: `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M2.5 7 A4.5 4.5 0 1 0 11.5 7 A4.5 4.5 0 1 0 2.5 7 Z M10.4 10.4 L14 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
||||
};
|
||||
@@ -1 +1,15 @@
|
||||
<!doctype html><title>Titano</title>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="color-scheme" content="light">
|
||||
<title>Titano Server</title>
|
||||
<link rel="icon" href="favicon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="admin.css">
|
||||
<script type="module" src="app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" aria-live="polite"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { applyStrings } from "../i18n.js";
|
||||
import { escapeHtml } from "../app.js";
|
||||
|
||||
export async function render(root, { info }) {
|
||||
root.innerHTML = `
|
||||
<div class="panel">
|
||||
<h2 data-i18n="Admin.About.Title"></h2>
|
||||
<p class="num">Titano Server ${escapeHtml(info?.version ?? "")} · API ${escapeHtml(String(info?.apiVersion ?? ""))}</p>
|
||||
<p class="num"><span data-i18n="Admin.About.Fingerprint"></span> ${escapeHtml(info?.tlsFingerprint ?? "–")}</p>
|
||||
</div>`;
|
||||
applyStrings(root);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Dashboard: storage, archive, jobs, render nodes (BRIEF §14.8). Data from the public API only.
|
||||
import { applyStrings } from "../i18n.js";
|
||||
|
||||
export async function render(root, { api, t, info, meta }) {
|
||||
const health = await api.get("/health").catch(() => null);
|
||||
meta.textContent = info ? `v${info.version} · TLS ${info.tlsFingerprint ? "auto" : "proxy"}` : "";
|
||||
root.innerHTML = `
|
||||
<div class="tiles">
|
||||
<div class="panel tile"><div class="label" data-i18n="Admin.Dashboard.Server"></div>
|
||||
<div class="value">${health?.status === "ok" ? `<span class="status-ok">●</span>` : `<span class="status-err">✕</span>`}<small>${health?.status ?? ""}</small></div>
|
||||
<div class="sub num">${info?.name ?? ""}</div></div>
|
||||
<div class="panel tile"><div class="label" data-i18n="Admin.Dashboard.Archive"></div>
|
||||
<div class="value">${health?.checks?.archive === "ok" ? `<span class="status-ok">●</span>` : `<span class="status-warn">▲</span>`}<small>${health?.checks?.archive ?? ""}</small></div></div>
|
||||
<div class="panel tile"><div class="label" data-i18n="Admin.Dashboard.Api"></div>
|
||||
<div class="value num">${info?.apiVersion ?? "–"}</div><div class="sub">${(info?.capabilities ?? []).join(" · ")}</div></div>
|
||||
</div>`;
|
||||
applyStrings(root);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Protocol;
|
||||
using Titano.Server.Configuration;
|
||||
|
||||
namespace Titano.Server.Api;
|
||||
|
||||
/// <summary><c>/health</c>, <c>/api/v1/server/info</c> and <c>/api/v1/i18n/{culture}</c>.</summary>
|
||||
public static class SystemEndpoints
|
||||
{
|
||||
private static readonly string[] AdminAreas = ["Common", "Admin"];
|
||||
|
||||
public static string Version { get; } =
|
||||
typeof(SystemEndpoints).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "0.0.0";
|
||||
|
||||
public static void Map(WebApplication app, ServerOptions options, ServerState state)
|
||||
{
|
||||
app.MapGet("/health", () =>
|
||||
{
|
||||
var checks = new Dictionary<string, string>(StringComparer.Ordinal)
|
||||
{
|
||||
["archive"] = Directory.Exists(options.ArchivePath) ? "ok" : "missing",
|
||||
["data"] = Directory.Exists(options.DataPath) ? "ok" : "missing",
|
||||
};
|
||||
return Results.Json(new HealthStatus("ok", Version, checks), ProtocolJson.Default.HealthStatus);
|
||||
});
|
||||
|
||||
var api = app.MapGroup("/api/v1");
|
||||
api.MapGet("/server/info", () => Results.Json(new ServerInfo(
|
||||
options.ServerName,
|
||||
Version,
|
||||
ApiVersion.Current,
|
||||
state.Capabilities,
|
||||
state.TlsFingerprint,
|
||||
["jpeg", "png", "tiff", "dng", "cr2", "cr3", "nef", "arw", "raf", "orf", "rw2", "pef", "heic", "webp"],
|
||||
new ServerLimits(options.MaxUploadBytes, options.ChunkSizeBytes)), ProtocolJson.Default.ServerInfo));
|
||||
|
||||
api.MapGet("/i18n/{culture}", (string culture) =>
|
||||
{
|
||||
CultureInfo ci;
|
||||
try
|
||||
{
|
||||
ci = Languages.BestMatch(CultureInfo.GetCultureInfo(culture));
|
||||
}
|
||||
catch (CultureNotFoundException)
|
||||
{
|
||||
ci = CultureInfo.GetCultureInfo("en");
|
||||
}
|
||||
var strings = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (var area in AdminAreas)
|
||||
foreach (var (k, v) in Loc.GetArea(area, ci)) strings[k] = v;
|
||||
strings["$culture"] = ci.Name;
|
||||
strings["$rtl"] = ci.TextInfo.IsRightToLeft ? "true" : "false";
|
||||
return Results.Json(strings, ProtocolJson.Default.DictionaryStringString);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Process-wide facts computed at startup.</summary>
|
||||
public sealed class ServerState
|
||||
{
|
||||
public string? TlsFingerprint { get; set; }
|
||||
public List<string> Capabilities { get; } = ["uploads", "sync", "jobs", "render-nodes", "events"];
|
||||
public DateTimeOffset StartedAt { get; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Titano.Server.Configuration;
|
||||
|
||||
public enum TlsMode
|
||||
{
|
||||
/// <summary>Self-signed certificate generated at first start (stored under /data/tls).</summary>
|
||||
Auto,
|
||||
|
||||
/// <summary>Certificate and key from PEM files.</summary>
|
||||
Pem,
|
||||
|
||||
/// <summary>Plain HTTP behind a TLS-terminating reverse proxy.</summary>
|
||||
Proxy,
|
||||
}
|
||||
|
||||
public enum DatabaseKind
|
||||
{
|
||||
Postgres,
|
||||
Sqlite,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server configuration (BRIEF §14.9): environment variables override <c>/data/server.json</c>, which overrides defaults.
|
||||
/// </summary>
|
||||
public sealed class ServerOptions
|
||||
{
|
||||
public string ServerName { get; set; } = "Titano Server";
|
||||
public string ArchivePath { get; set; } = OperatingSystem.IsWindows() ? @"C:\TitanoArchive" : "/archive";
|
||||
public string DataPath { get; set; } = OperatingSystem.IsWindows() ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Titano Server") : "/data";
|
||||
public string? AdminUser { get; set; }
|
||||
public string? AdminPassword { get; set; }
|
||||
public DatabaseKind Database { get; set; } = OperatingSystem.IsWindows() ? DatabaseKind.Sqlite : DatabaseKind.Postgres;
|
||||
public string DbHost { get; set; } = "postgres";
|
||||
public int DbPort { get; set; } = 5432;
|
||||
public string DbName { get; set; } = "titano";
|
||||
public string DbUser { get; set; } = "titano";
|
||||
public string? DbPassword { get; set; }
|
||||
public string DbSslMode { get; set; } = "prefer";
|
||||
public int HttpPort { get; set; } = 8080;
|
||||
public int HttpsPort { get; set; } = 8443;
|
||||
public TlsMode TlsMode { get; set; } = TlsMode.Auto;
|
||||
public string? TlsCert { get; set; }
|
||||
public string? TlsKey { get; set; }
|
||||
public string Language { get; set; } = "en";
|
||||
public int Workers { get; set; } = Math.Max(1, Environment.ProcessorCount / 2);
|
||||
public bool Discovery { get; set; } = true;
|
||||
public long MaxUploadBytes { get; set; } = 2L * 1024 * 1024 * 1024;
|
||||
public int ChunkSizeBytes { get; set; } = 8 * 1024 * 1024;
|
||||
public int JobHistoryDays { get; set; } = 90;
|
||||
public int TokenLifetimeDays { get; set; } = 30;
|
||||
|
||||
[JsonIgnore]
|
||||
public string LogPath => Path.Combine(DataPath, "logs");
|
||||
|
||||
[JsonIgnore]
|
||||
public string TlsPath => Path.Combine(DataPath, "tls");
|
||||
|
||||
[JsonIgnore]
|
||||
public string UploadsPath => Path.Combine(DataPath, "uploads");
|
||||
|
||||
/// <summary>Loads <c>{DataPath}/server.json</c> (if present) then applies <c>TITANO_*</c> environment variables.</summary>
|
||||
public static ServerOptions Load(IReadOnlyDictionary<string, string?>? environment = null)
|
||||
{
|
||||
var env = environment ?? ReadEnvironment();
|
||||
string? Env(string name) => env.TryGetValue(name, out var v) && !string.IsNullOrWhiteSpace(v) ? v : null;
|
||||
|
||||
var dataPath = Env("TITANO_DATA_PATH") ?? new ServerOptions().DataPath;
|
||||
var options = new ServerOptions();
|
||||
var file = Path.Combine(dataPath, "server.json");
|
||||
if (File.Exists(file))
|
||||
{
|
||||
try
|
||||
{
|
||||
options = JsonSerializer.Deserialize(File.ReadAllText(file), ServerOptionsJson.Default.ServerOptions) ?? options;
|
||||
}
|
||||
catch (JsonException ex)
|
||||
{
|
||||
throw new InvalidOperationException($"{file} is not valid JSON: {ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
options.DataPath = dataPath;
|
||||
|
||||
options.ServerName = Env("TITANO_SERVER_NAME") ?? options.ServerName;
|
||||
options.ArchivePath = Env("TITANO_ARCHIVE_PATH") ?? options.ArchivePath;
|
||||
options.AdminUser = Env("TITANO_ADMIN_USER") ?? options.AdminUser;
|
||||
options.AdminPassword = Env("TITANO_ADMIN_PASSWORD") ?? options.AdminPassword;
|
||||
if (Env("TITANO_DB") is { } db) options.Database = Enum.Parse<DatabaseKind>(db, ignoreCase: true);
|
||||
options.DbHost = Env("TITANO_DB_HOST") ?? options.DbHost;
|
||||
if (Env("TITANO_DB_PORT") is { } port) options.DbPort = int.Parse(port, System.Globalization.CultureInfo.InvariantCulture);
|
||||
options.DbName = Env("TITANO_DB_NAME") ?? options.DbName;
|
||||
options.DbUser = Env("TITANO_DB_USER") ?? options.DbUser;
|
||||
options.DbPassword = Env("TITANO_DB_PASSWORD") ?? options.DbPassword;
|
||||
options.DbSslMode = Env("TITANO_DB_SSLMODE") ?? options.DbSslMode;
|
||||
if (Env("TITANO_HTTP_PORT") is { } http) options.HttpPort = int.Parse(http, System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (Env("TITANO_HTTPS_PORT") is { } https) options.HttpsPort = int.Parse(https, System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (Env("TITANO_TLS_MODE") is { } tls) options.TlsMode = Enum.Parse<TlsMode>(tls, ignoreCase: true);
|
||||
options.TlsCert = Env("TITANO_TLS_CERT") ?? options.TlsCert;
|
||||
options.TlsKey = Env("TITANO_TLS_KEY") ?? options.TlsKey;
|
||||
options.Language = Env("TITANO_LANG") ?? options.Language;
|
||||
if (Env("TITANO_WORKERS") is { } workers) options.Workers = Math.Max(1, int.Parse(workers, System.Globalization.CultureInfo.InvariantCulture));
|
||||
if (Env("TITANO_DISCOVERY") is { } discovery) options.Discovery = bool.Parse(discovery);
|
||||
options.Validate();
|
||||
return options;
|
||||
}
|
||||
|
||||
private static Dictionary<string, string?> ReadEnvironment()
|
||||
{
|
||||
// Variables may differ only by case on Linux (no_proxy/NO_PROXY); the last one wins.
|
||||
var result = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (System.Collections.DictionaryEntry e in Environment.GetEnvironmentVariables()) result[(string)e.Key] = (string?)e.Value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (!OperatingSystem.IsWindows() && Database == DatabaseKind.Sqlite)
|
||||
throw new InvalidOperationException("TITANO_DB=sqlite is supported on Windows only; use postgres (BRIEF §14.9).");
|
||||
if (TlsMode == TlsMode.Pem && (string.IsNullOrEmpty(TlsCert) || string.IsNullOrEmpty(TlsKey)))
|
||||
throw new InvalidOperationException("TITANO_TLS_MODE=pem requires TITANO_TLS_CERT and TITANO_TLS_KEY.");
|
||||
// Port 0 asks the OS for a free port (used by the in-process test host).
|
||||
if (HttpPort is < 0 or > 65535 || HttpsPort is < 0 or > 65535)
|
||||
throw new InvalidOperationException("Ports must be between 0 and 65535.");
|
||||
}
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, UseStringEnumConverter = true, PropertyNameCaseInsensitive = true)]
|
||||
[JsonSerializable(typeof(ServerOptions))]
|
||||
internal sealed partial class ServerOptionsJson : JsonSerializerContext;
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Titano.Server.Configuration;
|
||||
|
||||
namespace Titano.Server.Hosting;
|
||||
|
||||
/// <summary>
|
||||
/// TLS certificate for Kestrel (BRIEF §14.2): self-signed ECDSA P-256 generated once and kept in /data/tls
|
||||
/// (mode auto), loaded from PEM files (mode pem), or none (mode proxy).
|
||||
/// </summary>
|
||||
public static class CertificateStore
|
||||
{
|
||||
public static X509Certificate2? Load(ServerOptions options, ILogger logger)
|
||||
{
|
||||
switch (options.TlsMode)
|
||||
{
|
||||
case TlsMode.Proxy:
|
||||
return null;
|
||||
case TlsMode.Pem:
|
||||
{
|
||||
var pem = X509Certificate2.CreateFromPemFile(options.TlsCert!, options.TlsKey);
|
||||
return Exportable(pem);
|
||||
}
|
||||
default:
|
||||
{
|
||||
Directory.CreateDirectory(options.TlsPath);
|
||||
var path = Path.Combine(options.TlsPath, "server.pfx");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var existing = X509CertificateLoader.LoadPkcs12FromFile(path, password: null, X509KeyStorageFlags.Exportable);
|
||||
if (existing.NotAfter > DateTime.UtcNow.AddDays(30)) return existing;
|
||||
logger.LogWarning("Self-signed certificate expires {NotAfter:u}; generating a new one (clients will see a new fingerprint).", existing.NotAfter);
|
||||
}
|
||||
var created = CreateSelfSigned(options.ServerName);
|
||||
File.WriteAllBytes(path, created.Export(X509ContentType.Pkcs12));
|
||||
if (!OperatingSystem.IsWindows()) File.SetUnixFileMode(path, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||
logger.LogInformation("Generated self-signed TLS certificate, SHA-256 fingerprint {Fingerprint}", Fingerprint(created));
|
||||
return created;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>SHA-256 fingerprint as colon-separated upper-case hex, as shown to users for trust-on-first-use.</summary>
|
||||
public static string Fingerprint(X509Certificate2 certificate) =>
|
||||
string.Join(':', certificate.GetCertHash(HashAlgorithmName.SHA256).Select(b => b.ToString("X2", System.Globalization.CultureInfo.InvariantCulture)));
|
||||
|
||||
public static X509Certificate2 CreateSelfSigned(string serverName)
|
||||
{
|
||||
using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256);
|
||||
var request = new CertificateRequest(new X500DistinguishedName($"CN={Sanitize(serverName)}, O=Titano"), key, HashAlgorithmName.SHA256);
|
||||
var san = new SubjectAlternativeNameBuilder();
|
||||
san.AddDnsName("localhost");
|
||||
try
|
||||
{
|
||||
var host = Dns.GetHostName();
|
||||
san.AddDnsName(host);
|
||||
foreach (var address in Dns.GetHostAddresses(host).Where(a => a.AddressFamily is AddressFamily.InterNetwork or AddressFamily.InterNetworkV6))
|
||||
san.AddIpAddress(address);
|
||||
}
|
||||
catch (SocketException)
|
||||
{
|
||||
// Without name resolution the certificate still covers localhost.
|
||||
}
|
||||
san.AddIpAddress(IPAddress.Loopback);
|
||||
request.CertificateExtensions.Add(san.Build());
|
||||
request.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, true));
|
||||
request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, true));
|
||||
request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension([new Oid("1.3.6.1.5.5.7.3.1")], false));
|
||||
using var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddYears(5));
|
||||
return Exportable(certificate);
|
||||
}
|
||||
|
||||
private static X509Certificate2 Exportable(X509Certificate2 certificate) =>
|
||||
X509CertificateLoader.LoadPkcs12(certificate.Export(X509ContentType.Pkcs12), password: null, X509KeyStorageFlags.Exportable);
|
||||
|
||||
private static string Sanitize(string name) => new(name.Where(c => char.IsLetterOrDigit(c) || c is ' ' or '-' or '.').Take(60).ToArray());
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Frozen;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Titano.Server.Hosting;
|
||||
|
||||
/// <summary>
|
||||
/// Serves the admin panel from embedded resources named <c>admin/…</c> (no build step, single-file friendly),
|
||||
/// with strong ETags, conditional GET and SPA fallback to <c>index.html</c>.
|
||||
/// </summary>
|
||||
public sealed class EmbeddedStaticFiles
|
||||
{
|
||||
private static readonly FrozenDictionary<string, string> ContentTypes = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
[".html"] = "text/html; charset=utf-8",
|
||||
[".js"] = "text/javascript; charset=utf-8",
|
||||
[".mjs"] = "text/javascript; charset=utf-8",
|
||||
[".css"] = "text/css; charset=utf-8",
|
||||
[".svg"] = "image/svg+xml",
|
||||
[".png"] = "image/png",
|
||||
[".json"] = "application/json; charset=utf-8",
|
||||
[".ico"] = "image/x-icon",
|
||||
[".woff2"] = "font/woff2",
|
||||
}.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private readonly FrozenDictionary<string, (byte[] Content, string ETag, string ContentType)> _files;
|
||||
|
||||
public EmbeddedStaticFiles(Assembly assembly, string prefix)
|
||||
{
|
||||
var files = new Dictionary<string, (byte[], string, string)>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var name in assembly.GetManifestResourceNames().Where(n => n.StartsWith(prefix, StringComparison.Ordinal)))
|
||||
{
|
||||
using var stream = assembly.GetManifestResourceStream(name)!;
|
||||
using var ms = new MemoryStream();
|
||||
stream.CopyTo(ms);
|
||||
var bytes = ms.ToArray();
|
||||
var path = name[prefix.Length..].Replace('\\', '/');
|
||||
var etag = "\"" + Convert.ToHexString(SHA256.HashData(bytes).AsSpan(0, 12)) + "\"";
|
||||
var type = ContentTypes.TryGetValue(Path.GetExtension(path), out var t) ? t : "application/octet-stream";
|
||||
files[path] = (bytes, etag, type);
|
||||
}
|
||||
_files = files.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public int Count => _files.Count;
|
||||
|
||||
public async Task<bool> TryServeAsync(HttpContext context, string relativePath)
|
||||
{
|
||||
var path = relativePath.TrimStart('/');
|
||||
if (path.Length == 0) path = "index.html";
|
||||
if (!_files.TryGetValue(path, out var file))
|
||||
{
|
||||
// Client-side routes (no extension) fall back to the shell.
|
||||
if (Path.HasExtension(path) || !_files.TryGetValue("index.html", out file)) return false;
|
||||
}
|
||||
var response = context.Response;
|
||||
response.Headers.ETag = file.ETag;
|
||||
response.Headers.CacheControl = path.EndsWith(".html", StringComparison.OrdinalIgnoreCase) ? "no-cache" : "public, max-age=3600";
|
||||
response.Headers.XContentTypeOptions = "nosniff";
|
||||
if (context.Request.Headers.IfNoneMatch == file.ETag)
|
||||
{
|
||||
response.StatusCode = StatusCodes.Status304NotModified;
|
||||
return true;
|
||||
}
|
||||
response.ContentType = file.ContentType;
|
||||
response.ContentLength = file.Content.Length;
|
||||
if (!HttpMethods.IsHead(context.Request.Method)) await response.Body.WriteAsync(file.Content, context.RequestAborted);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using Titano.Core.Diagnostics;
|
||||
using CoreLogLevel = Titano.Core.Diagnostics.LogLevel;
|
||||
using MsLogLevel = Microsoft.Extensions.Logging.LogLevel;
|
||||
|
||||
namespace Titano.Server.Hosting;
|
||||
|
||||
/// <summary>In-house structured file logging for ASP.NET Core (rotating daily files under /data/logs).</summary>
|
||||
public sealed class FileLoggerProvider(FileLogSink sink) : ILoggerProvider
|
||||
{
|
||||
public ILogger CreateLogger(string categoryName) => new FileLogger(sink, categoryName);
|
||||
|
||||
public void Dispose() => sink.Dispose();
|
||||
|
||||
private sealed class FileLogger(FileLogSink sink, string category) : ILogger
|
||||
{
|
||||
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
|
||||
|
||||
public bool IsEnabled(MsLogLevel logLevel) => logLevel >= MsLogLevel.Information;
|
||||
|
||||
public void Log<TState>(MsLogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
|
||||
{
|
||||
if (!IsEnabled(logLevel)) return;
|
||||
var level = logLevel switch
|
||||
{
|
||||
MsLogLevel.Trace => CoreLogLevel.Trace,
|
||||
MsLogLevel.Debug => CoreLogLevel.Debug,
|
||||
MsLogLevel.Information => CoreLogLevel.Info,
|
||||
MsLogLevel.Warning => CoreLogLevel.Warning,
|
||||
_ => CoreLogLevel.Error,
|
||||
};
|
||||
sink.Write(level, category, formatter(state, exception), exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Bridges engine logging (Titano.Core.Diagnostics.Log) into ASP.NET Core logging.</summary>
|
||||
public sealed class LoggerSink(ILoggerFactory factory) : ILogSink
|
||||
{
|
||||
public void Write(CoreLogLevel level, string category, string message, Exception? exception)
|
||||
{
|
||||
var logger = factory.CreateLogger("Titano." + category);
|
||||
var ms = level switch
|
||||
{
|
||||
CoreLogLevel.Trace => MsLogLevel.Trace,
|
||||
CoreLogLevel.Debug => MsLogLevel.Debug,
|
||||
CoreLogLevel.Info => MsLogLevel.Information,
|
||||
CoreLogLevel.Warning => MsLogLevel.Warning,
|
||||
_ => MsLogLevel.Error,
|
||||
};
|
||||
#pragma warning disable CA2254 // Engine messages are preformatted.
|
||||
logger.Log(ms, exception, message);
|
||||
#pragma warning restore CA2254
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Titano.Server.Configuration;
|
||||
|
||||
namespace Titano.Server.Hosting;
|
||||
|
||||
/// <summary>
|
||||
/// <c>Titano.Server --healthcheck</c>: probes the local /health endpoint and exits 0/1, so the container
|
||||
/// HEALTHCHECK needs no curl/wget in the image.
|
||||
/// </summary>
|
||||
public static class HealthProbe
|
||||
{
|
||||
public static async Task<int> RunAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var port = ServerOptions.Load().HttpPort;
|
||||
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
||||
using var response = await http.GetAsync(new Uri($"http://127.0.0.1:{port}/health")).ConfigureAwait(false);
|
||||
return response.IsSuccessStatusCode ? 0 : 1;
|
||||
}
|
||||
catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException or InvalidOperationException)
|
||||
{
|
||||
await Console.Error.WriteLineAsync(ex.Message).ConfigureAwait(false);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Protocol;
|
||||
using Titano.Server.Api;
|
||||
using Titano.Server.Configuration;
|
||||
|
||||
namespace Titano.Server.Hosting;
|
||||
|
||||
/// <summary>Builds the Titano Server web application from <see cref="ServerOptions"/> (used by Program and tests).</summary>
|
||||
public static class ServerHost
|
||||
{
|
||||
public static WebApplication Build(ServerOptions options, string[] args)
|
||||
{
|
||||
Directory.CreateDirectory(options.DataPath);
|
||||
Directory.CreateDirectory(options.LogPath);
|
||||
|
||||
var builder = WebApplication.CreateSlimBuilder(args);
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Logging.AddSimpleConsole(c => c.SingleLine = true);
|
||||
builder.Logging.AddProvider(new FileLoggerProvider(new FileLogSink(options.LogPath, "server")));
|
||||
builder.Logging.AddFilter("Microsoft.AspNetCore", Microsoft.Extensions.Logging.LogLevel.Warning);
|
||||
builder.Logging.AddFilter("Microsoft.Hosting.Lifetime", Microsoft.Extensions.Logging.LogLevel.Information);
|
||||
|
||||
using var bootLoggerFactory = LoggerFactory.Create(l => l.AddSimpleConsole(c => c.SingleLine = true));
|
||||
var certificate = CertificateStore.Load(options, bootLoggerFactory.CreateLogger("Titano.Server"));
|
||||
var state = new ServerState { TlsFingerprint = certificate is null ? null : CertificateStore.Fingerprint(certificate) };
|
||||
|
||||
builder.WebHost.ConfigureKestrel(k =>
|
||||
{
|
||||
k.AddServerHeader = false;
|
||||
k.Limits.MaxRequestBodySize = options.ChunkSizeBytes + 64 * 1024;
|
||||
k.ListenAnyIP(options.HttpPort);
|
||||
if (certificate is not null) k.ListenAnyIP(options.HttpsPort, l =>
|
||||
{
|
||||
l.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
l.UseHttps(certificate);
|
||||
});
|
||||
});
|
||||
builder.Services.AddSingleton(options);
|
||||
builder.Services.AddSingleton(state);
|
||||
builder.Services.ConfigureHttpJsonOptions(j => j.SerializerOptions.TypeInfoResolverChain.Insert(0, ProtocolJson.Default));
|
||||
if (options.TlsMode == TlsMode.Proxy)
|
||||
{
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(f =>
|
||||
{
|
||||
f.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost;
|
||||
f.KnownIPNetworks.Clear();
|
||||
f.KnownProxies.Clear();
|
||||
});
|
||||
}
|
||||
|
||||
var app = builder.Build();
|
||||
Log.SetSink(new LoggerSink(app.Services.GetRequiredService<ILoggerFactory>()));
|
||||
var logger = app.Logger;
|
||||
logger.LogInformation("Titano Server {Version} · archive {Archive} · data {Data} · TLS {Tls}{Fingerprint}",
|
||||
SystemEndpoints.Version, options.ArchivePath, options.DataPath, options.TlsMode,
|
||||
state.TlsFingerprint is null ? string.Empty : " · SHA-256 " + state.TlsFingerprint);
|
||||
|
||||
if (options.TlsMode == TlsMode.Proxy) app.UseForwardedHeaders();
|
||||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
context.Response.Headers[ApiVersion.Header] = ApiVersion.Current.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
context.Response.Headers.XContentTypeOptions = "nosniff";
|
||||
context.Response.Headers["Referrer-Policy"] = "no-referrer";
|
||||
try
|
||||
{
|
||||
await next(context);
|
||||
}
|
||||
catch (Exception ex) when (!context.Response.HasStarted && ex is not OperationCanceledException)
|
||||
{
|
||||
logger.LogError(ex, "Unhandled error on {Method} {Path}", context.Request.Method, context.Request.Path);
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
await context.Response.WriteAsJsonAsync(new ApiError("internal", "Unexpected server error."), ProtocolJson.Default.ApiError);
|
||||
}
|
||||
});
|
||||
|
||||
var admin = new EmbeddedStaticFiles(typeof(ServerHost).Assembly, "admin/");
|
||||
app.MapGet("/", () => Results.Redirect("/admin/"));
|
||||
app.MapMethods("/admin/{**path}", ["GET", "HEAD"], async (HttpContext context, string? path) =>
|
||||
{
|
||||
// Relative asset URLs need the trailing slash.
|
||||
if (!context.Request.Path.Value!.EndsWith('/') && string.IsNullOrEmpty(path))
|
||||
{
|
||||
context.Response.Redirect("/admin/");
|
||||
return;
|
||||
}
|
||||
if (!await admin.TryServeAsync(context, path ?? string.Empty)) context.Response.StatusCode = StatusCodes.Status404NotFound;
|
||||
});
|
||||
|
||||
SystemEndpoints.Map(app, options, state);
|
||||
|
||||
app.MapFallback("/api/{**path}", () => Results.Json(new ApiError("not_found", "No such endpoint."), ProtocolJson.Default.ApiError, statusCode: 404));
|
||||
app.Lifetime.ApplicationStopping.Register(() => logger.LogInformation("Titano Server stopping"));
|
||||
return app;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,11 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var app = builder.Build();
|
||||
app.MapGet("/health", () => Results.Ok(new { status = "ok" }));
|
||||
app.Run();
|
||||
using Titano.Server.Configuration;
|
||||
using Titano.Server.Hosting;
|
||||
|
||||
if (args.Contains("--healthcheck")) return await HealthProbe.RunAsync();
|
||||
|
||||
var app = ServerHost.Build(ServerOptions.Load(), args);
|
||||
await app.RunAsync();
|
||||
return 0;
|
||||
|
||||
/// <summary>Entry point type, visible to the in-process test host.</summary>
|
||||
public partial class Program;
|
||||
@@ -0,0 +1,90 @@
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Titano.Tools.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// Builds release notes from Conventional Commits. Reads <c>git log --format=%h%x09%s</c> lines from stdin
|
||||
/// (or <c>--in file</c>) and writes Markdown grouped by type.
|
||||
/// </summary>
|
||||
internal sealed partial class ChangelogCommand : ICommand
|
||||
{
|
||||
private static readonly (string Type, string Heading)[] Sections =
|
||||
[
|
||||
("feat", "Added"),
|
||||
("fix", "Fixed"),
|
||||
("perf", "Performance"),
|
||||
("security", "Security"),
|
||||
("i18n", "Localization"),
|
||||
("docs", "Documentation"),
|
||||
];
|
||||
|
||||
public string Name => "changelog";
|
||||
public string Summary => "Release notes from Conventional Commits on stdin (--title, --out file)";
|
||||
|
||||
public async Task<int> RunAsync(string[] args)
|
||||
{
|
||||
var a = new Args(args);
|
||||
IReadOnlyList<string> input = a.Get("in") is { } file ? await File.ReadAllLinesAsync(file) : ReadStdin();
|
||||
var markdown = Render(input, a.Get("title"));
|
||||
if (a.Get("out") is { } outFile)
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(outFile))!);
|
||||
await File.WriteAllTextAsync(outFile, markdown, new UTF8Encoding(false));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(markdown);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
internal static string Render(IEnumerable<string> lines, string? title)
|
||||
{
|
||||
var groups = new Dictionary<string, List<string>>(StringComparer.Ordinal);
|
||||
var breaking = new List<string>();
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var tab = line.IndexOf('\t');
|
||||
var hash = tab > 0 ? line[..tab] : string.Empty;
|
||||
var subject = tab > 0 ? line[(tab + 1)..] : line;
|
||||
var m = Conventional().Match(subject);
|
||||
if (!m.Success) continue;
|
||||
var type = m.Groups["type"].Value.ToLowerInvariant();
|
||||
var scope = m.Groups["scope"].Success ? $"**{m.Groups["scope"].Value}**: " : string.Empty;
|
||||
var entry = $"- {scope}{m.Groups["desc"].Value.Trim()}{(hash.Length > 0 ? $" ({hash})" : string.Empty)}";
|
||||
if (m.Groups["bang"].Success) breaking.Add(entry);
|
||||
if (!groups.TryGetValue(type, out var list)) groups[type] = list = [];
|
||||
list.Add(entry);
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
if (title is not null) sb.Append("# ").AppendLine(title).AppendLine();
|
||||
if (breaking.Count > 0)
|
||||
{
|
||||
sb.AppendLine("### Breaking changes");
|
||||
foreach (var e in breaking) sb.AppendLine(e);
|
||||
sb.AppendLine();
|
||||
}
|
||||
foreach (var (type, heading) in Sections)
|
||||
{
|
||||
if (!groups.TryGetValue(type, out var entries)) continue;
|
||||
sb.Append("### ").AppendLine(heading);
|
||||
foreach (var e in entries) sb.AppendLine(e);
|
||||
sb.AppendLine();
|
||||
}
|
||||
if (sb.Length == 0) sb.AppendLine("Maintenance release.");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static List<string> ReadStdin()
|
||||
{
|
||||
var lines = new List<string>();
|
||||
if (!Console.IsInputRedirected) return lines;
|
||||
while (Console.In.ReadLine() is { } line) lines.Add(line);
|
||||
return lines;
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"^(?<type>[a-zA-Z]+)(?:\((?<scope>[^)]+)\))?(?<bang>!)?:\s*(?<desc>.+)$")]
|
||||
private static partial Regex Conventional();
|
||||
}
|
||||
@@ -83,6 +83,8 @@ internal sealed partial class I18nCommand : ICommand
|
||||
foreach (var (file, key) in UsedKeys(root))
|
||||
{
|
||||
if (en.ContainsKey(key)) continue;
|
||||
// Prefix lookups such as L("Settings.Page." + page) are satisfied by any key under the prefix.
|
||||
if (key.EndsWith('.') && en.Keys.Any(k => k.StartsWith(key, StringComparison.Ordinal))) continue;
|
||||
// Plural lookups reference the stem; any suffix satisfies them.
|
||||
if (en.Keys.Any(k => k.StartsWith(key + ".", StringComparison.Ordinal) && PluralSuffix().IsMatch(k[(key.Length + 1)..]))) continue;
|
||||
errors.Add($"{Path.GetRelativePath(root, file)}: unknown key {key}");
|
||||
|
||||
@@ -7,6 +7,7 @@ var commands = new ICommand[]
|
||||
new I18nCommand(),
|
||||
new XamlLintCommand(),
|
||||
new PackageGuardCommand(),
|
||||
new ChangelogCommand(),
|
||||
};
|
||||
|
||||
if (args.Length == 0 || args[0] is "-h" or "--help" or "help")
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Advisor-aware slider (BRIEF §10.4, DESIGN §4): in Auto the track is accent with an "Auto · value" pill whose
|
||||
/// tooltip carries the advisor's reason; touching the slider switches to manual (sun track, value shown, reset
|
||||
/// button returns to Auto). When not applicable the value reads "n/a" with the reason in the tooltip.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PartSlider, Type = typeof(Slider))]
|
||||
public class AutoSlider : Control
|
||||
{
|
||||
public const string PartSlider = "PART_Slider";
|
||||
|
||||
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(nameof(Header), typeof(string), typeof(AutoSlider));
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(nameof(Value), typeof(double), typeof(AutoSlider),
|
||||
new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValueChanged));
|
||||
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(nameof(Minimum), typeof(double), typeof(AutoSlider), new PropertyMetadata(0.0));
|
||||
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(nameof(Maximum), typeof(double), typeof(AutoSlider), new PropertyMetadata(1.0));
|
||||
public static readonly DependencyProperty SmallChangeProperty = DependencyProperty.Register(nameof(SmallChange), typeof(double), typeof(AutoSlider), new PropertyMetadata(0.01));
|
||||
public static readonly DependencyProperty IsSnapToTickEnabledProperty = DependencyProperty.Register(nameof(IsSnapToTickEnabled), typeof(bool), typeof(AutoSlider), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register(nameof(TickFrequency), typeof(double), typeof(AutoSlider), new PropertyMetadata(1.0));
|
||||
public static readonly DependencyProperty IsAutoProperty = DependencyProperty.Register(nameof(IsAuto), typeof(bool), typeof(AutoSlider),
|
||||
new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
|
||||
public static readonly DependencyProperty AutoValueProperty = DependencyProperty.Register(nameof(AutoValue), typeof(double), typeof(AutoSlider), new PropertyMetadata(0.0, OnAutoValueChanged));
|
||||
public static readonly DependencyProperty AutoReasonProperty = DependencyProperty.Register(nameof(AutoReason), typeof(string), typeof(AutoSlider));
|
||||
public static readonly DependencyProperty IsApplicableProperty = DependencyProperty.Register(nameof(IsApplicable), typeof(bool), typeof(AutoSlider), new PropertyMetadata(true));
|
||||
public static readonly DependencyProperty NotApplicableReasonProperty = DependencyProperty.Register(nameof(NotApplicableReason), typeof(string), typeof(AutoSlider));
|
||||
public static readonly DependencyProperty ValueFormatProperty = DependencyProperty.Register(nameof(ValueFormat), typeof(string), typeof(AutoSlider), new PropertyMetadata("0.##", OnFormatChanged));
|
||||
public static readonly DependencyProperty DisplayValueProperty = DependencyProperty.Register(nameof(DisplayValue), typeof(string), typeof(AutoSlider), new PropertyMetadata(string.Empty));
|
||||
public static readonly DependencyProperty AutoTextProperty = DependencyProperty.Register(nameof(AutoText), typeof(string), typeof(AutoSlider), new PropertyMetadata(string.Empty));
|
||||
public static readonly DependencyProperty SliderToolTipProperty = DependencyProperty.Register(nameof(SliderToolTip), typeof(object), typeof(AutoSlider));
|
||||
|
||||
public static readonly RoutedCommand ResetCommand = new(nameof(ResetCommand), typeof(AutoSlider));
|
||||
|
||||
private Slider? _slider;
|
||||
private bool _syncing;
|
||||
|
||||
static AutoSlider()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoSlider), new FrameworkPropertyMetadata(typeof(AutoSlider)));
|
||||
}
|
||||
|
||||
public AutoSlider()
|
||||
{
|
||||
CommandBindings.Add(new CommandBinding(ResetCommand, (_, _) => ResetToAuto()));
|
||||
UpdateTexts();
|
||||
}
|
||||
|
||||
public string? Header { get => (string?)GetValue(HeaderProperty); set => SetValue(HeaderProperty, value); }
|
||||
public double Value { get => (double)GetValue(ValueProperty); set => SetValue(ValueProperty, value); }
|
||||
public double Minimum { get => (double)GetValue(MinimumProperty); set => SetValue(MinimumProperty, value); }
|
||||
public double Maximum { get => (double)GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); }
|
||||
public double SmallChange { get => (double)GetValue(SmallChangeProperty); set => SetValue(SmallChangeProperty, value); }
|
||||
public bool IsSnapToTickEnabled { get => (bool)GetValue(IsSnapToTickEnabledProperty); set => SetValue(IsSnapToTickEnabledProperty, value); }
|
||||
public double TickFrequency { get => (double)GetValue(TickFrequencyProperty); set => SetValue(TickFrequencyProperty, value); }
|
||||
public bool IsAuto { get => (bool)GetValue(IsAutoProperty); set => SetValue(IsAutoProperty, value); }
|
||||
public double AutoValue { get => (double)GetValue(AutoValueProperty); set => SetValue(AutoValueProperty, value); }
|
||||
public string? AutoReason { get => (string?)GetValue(AutoReasonProperty); set => SetValue(AutoReasonProperty, value); }
|
||||
public bool IsApplicable { get => (bool)GetValue(IsApplicableProperty); set => SetValue(IsApplicableProperty, value); }
|
||||
public string? NotApplicableReason { get => (string?)GetValue(NotApplicableReasonProperty); set => SetValue(NotApplicableReasonProperty, value); }
|
||||
public string ValueFormat { get => (string)GetValue(ValueFormatProperty); set => SetValue(ValueFormatProperty, value); }
|
||||
|
||||
/// <summary>Formatted current value (read by the template).</summary>
|
||||
public string DisplayValue { get => (string)GetValue(DisplayValueProperty); private set => SetValue(DisplayValueProperty, value); }
|
||||
|
||||
/// <summary>"Auto · 41" pill text; the "Auto" word comes from the catalog (Common.Auto).</summary>
|
||||
public string AutoText { get => (string)GetValue(AutoTextProperty); private set => SetValue(AutoTextProperty, value); }
|
||||
|
||||
/// <summary>Tooltip of the slider track: what moving it does.</summary>
|
||||
public object? SliderToolTip { get => GetValue(SliderToolTipProperty); set => SetValue(SliderToolTipProperty, value); }
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
if (_slider is not null)
|
||||
{
|
||||
_slider.ValueChanged -= OnSliderValueChanged;
|
||||
_slider.PreviewMouseDown -= OnSliderTouched;
|
||||
_slider.PreviewKeyDown -= OnSliderTouched;
|
||||
}
|
||||
base.OnApplyTemplate();
|
||||
_slider = GetTemplateChild(PartSlider) as Slider;
|
||||
if (_slider is not null)
|
||||
{
|
||||
_slider.Value = IsAuto ? AutoValue : Value;
|
||||
_slider.ValueChanged += OnSliderValueChanged;
|
||||
_slider.PreviewMouseDown += OnSliderTouched;
|
||||
_slider.PreviewKeyDown += OnSliderTouched;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns the control to the advisor's value.</summary>
|
||||
public void ResetToAuto()
|
||||
{
|
||||
IsAuto = true;
|
||||
Value = AutoValue;
|
||||
UpdateTexts();
|
||||
}
|
||||
|
||||
private void OnSliderTouched(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e is KeyEventArgs k && k.Key is not (Key.Left or Key.Right or Key.Up or Key.Down or Key.PageUp or Key.PageDown or Key.Home or Key.End)) return;
|
||||
IsAuto = false;
|
||||
}
|
||||
|
||||
private void OnSliderValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (_syncing) return;
|
||||
Value = e.NewValue;
|
||||
}
|
||||
|
||||
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var s = (AutoSlider)d;
|
||||
if (s._slider is not null && !s._syncing)
|
||||
{
|
||||
s._syncing = true;
|
||||
s._slider.Value = (double)e.NewValue;
|
||||
s._syncing = false;
|
||||
}
|
||||
s.UpdateTexts();
|
||||
}
|
||||
|
||||
private static void OnAutoValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var s = (AutoSlider)d;
|
||||
if (s.IsAuto) s.Value = (double)e.NewValue;
|
||||
s.UpdateTexts();
|
||||
}
|
||||
|
||||
private static void OnFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((AutoSlider)d).UpdateTexts();
|
||||
|
||||
private void UpdateTexts()
|
||||
{
|
||||
var culture = Core.Localization.Loc.Culture;
|
||||
DisplayValue = Value.ToString(ValueFormat, culture);
|
||||
AutoText = Core.Localization.Loc.L("Common.Auto") + " · " + AutoValue.ToString(ValueFormat, culture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Titano.Core.Branding;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>The Titano mark drawn as vectors from <see cref="BrandMark"/> geometry (plate optional).</summary>
|
||||
public sealed class BrandMarkIcon : FrameworkElement
|
||||
{
|
||||
public static readonly DependencyProperty ShowPlateProperty = DependencyProperty.Register(
|
||||
nameof(ShowPlate), typeof(bool), typeof(BrandMarkIcon), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
private static readonly Brush Accent = Frozen(new SolidColorBrush(Color.FromRgb(BrandMark.Accent.R, BrandMark.Accent.G, BrandMark.Accent.B)));
|
||||
private static readonly Brush Sun = Frozen(new SolidColorBrush(Color.FromRgb(BrandMark.Sun.R, BrandMark.Sun.G, BrandMark.Sun.B)));
|
||||
private static readonly Brush Plate = Frozen(new SolidColorBrush(Color.FromRgb(BrandMark.Plate.R, BrandMark.Plate.G, BrandMark.Plate.B)));
|
||||
|
||||
public bool ShowPlate
|
||||
{
|
||||
get => (bool)GetValue(ShowPlateProperty);
|
||||
set => SetValue(ShowPlateProperty, value);
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
var s = double.IsInfinity(availableSize.Width) ? 16 : Math.Min(availableSize.Width, double.IsInfinity(availableSize.Height) ? availableSize.Width : availableSize.Height);
|
||||
return new Size(s, s);
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext dc)
|
||||
{
|
||||
var size = Math.Min(ActualWidth, ActualHeight);
|
||||
if (size <= 0) return;
|
||||
var scale = size / BrandMark.Canvas;
|
||||
dc.PushTransform(new ScaleTransform(scale, scale));
|
||||
if (ShowPlate)
|
||||
dc.DrawRoundedRectangle(Plate, null, new Rect(0, 0, BrandMark.Canvas, BrandMark.Canvas), BrandMark.PlateRadius, BrandMark.PlateRadius);
|
||||
// Below ~24 px keep the stroke at least ~1.3 device pixels.
|
||||
var stroke = Math.Max(BrandMark.StrokeWidth, 1.3 / scale);
|
||||
for (var i = 0; i < BrandMark.TickCount; i++)
|
||||
{
|
||||
var (a0, a1) = BrandMark.TickAngles(i);
|
||||
var (x0, y0) = BrandMark.Polar(a0);
|
||||
var (x1, y1) = BrandMark.Polar(a1);
|
||||
var figure = new PathFigure { StartPoint = new Point(x0, y0) };
|
||||
figure.Segments.Add(new ArcSegment(new Point(x1, y1), new Size(BrandMark.RingRadius, BrandMark.RingRadius), 0, false, SweepDirection.Clockwise, true));
|
||||
var geometry = new PathGeometry([figure]);
|
||||
var pen = new Pen(Accent, stroke) { StartLineCap = PenLineCap.Round, EndLineCap = PenLineCap.Round };
|
||||
dc.PushOpacity(BrandMark.TickOpacity(i));
|
||||
dc.DrawGeometry(null, pen, geometry);
|
||||
dc.Pop();
|
||||
}
|
||||
dc.DrawEllipse(Sun, null, new Point(BrandMark.SunX, BrandMark.SunY), BrandMark.SunRadius, BrandMark.SunRadius);
|
||||
dc.Pop();
|
||||
}
|
||||
|
||||
private static Brush Frozen(SolidColorBrush b)
|
||||
{
|
||||
b.Freeze();
|
||||
return b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>24-px pill (DESIGN §4). Selected or recommended chips use the accent border and text.</summary>
|
||||
public class Chip : ContentControl
|
||||
{
|
||||
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(nameof(IsSelected), typeof(bool), typeof(Chip));
|
||||
public static readonly DependencyProperty IsRecommendedProperty = DependencyProperty.Register(nameof(IsRecommended), typeof(bool), typeof(Chip));
|
||||
public static readonly DependencyProperty RemoveCommandProperty = DependencyProperty.Register(nameof(RemoveCommand), typeof(ICommand), typeof(Chip));
|
||||
public static readonly DependencyProperty RemoveCommandParameterProperty = DependencyProperty.Register(nameof(RemoveCommandParameter), typeof(object), typeof(Chip));
|
||||
public static readonly DependencyProperty RemoveToolTipProperty = DependencyProperty.Register(nameof(RemoveToolTip), typeof(object), typeof(Chip));
|
||||
|
||||
static Chip()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(Chip), new FrameworkPropertyMetadata(typeof(Chip)));
|
||||
}
|
||||
|
||||
public bool IsSelected { get => (bool)GetValue(IsSelectedProperty); set => SetValue(IsSelectedProperty, value); }
|
||||
public bool IsRecommended { get => (bool)GetValue(IsRecommendedProperty); set => SetValue(IsRecommendedProperty, value); }
|
||||
|
||||
/// <summary>When set, a small ✕ button removes the chip (filters, tags).</summary>
|
||||
public ICommand? RemoveCommand { get => (ICommand?)GetValue(RemoveCommandProperty); set => SetValue(RemoveCommandProperty, value); }
|
||||
|
||||
public object? RemoveCommandParameter { get => GetValue(RemoveCommandParameterProperty); set => SetValue(RemoveCommandParameterProperty, value); }
|
||||
public object? RemoveToolTip { get => GetValue(RemoveToolTipProperty); set => SetValue(RemoveToolTipProperty, value); }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>Attached brushes that let one control template serve every button variant (DESIGN §4 states).</summary>
|
||||
public static class ControlState
|
||||
{
|
||||
public static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.RegisterAttached("HoverBackground", typeof(Brush), typeof(ControlState));
|
||||
public static readonly DependencyProperty PressedBackgroundProperty = DependencyProperty.RegisterAttached("PressedBackground", typeof(Brush), typeof(ControlState));
|
||||
public static readonly DependencyProperty HoverBorderBrushProperty = DependencyProperty.RegisterAttached("HoverBorderBrush", typeof(Brush), typeof(ControlState));
|
||||
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(ControlState), new FrameworkPropertyMetadata(new CornerRadius(6)));
|
||||
public static readonly DependencyProperty AccentProperty = DependencyProperty.RegisterAttached("Accent", typeof(Brush), typeof(ControlState), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static Brush? GetHoverBackground(DependencyObject d) => (Brush?)d.GetValue(HoverBackgroundProperty);
|
||||
public static void SetHoverBackground(DependencyObject d, Brush? v) => d.SetValue(HoverBackgroundProperty, v);
|
||||
public static Brush? GetPressedBackground(DependencyObject d) => (Brush?)d.GetValue(PressedBackgroundProperty);
|
||||
public static void SetPressedBackground(DependencyObject d, Brush? v) => d.SetValue(PressedBackgroundProperty, v);
|
||||
public static Brush? GetHoverBorderBrush(DependencyObject d) => (Brush?)d.GetValue(HoverBorderBrushProperty);
|
||||
public static void SetHoverBorderBrush(DependencyObject d, Brush? v) => d.SetValue(HoverBorderBrushProperty, v);
|
||||
public static CornerRadius GetCornerRadius(DependencyObject d) => (CornerRadius)d.GetValue(CornerRadiusProperty);
|
||||
public static void SetCornerRadius(DependencyObject d, CornerRadius v) => d.SetValue(CornerRadiusProperty, v);
|
||||
|
||||
/// <summary>Fill colour of slider tracks and progress (accent = Auto, sun = manual).</summary>
|
||||
public static Brush? GetAccent(DependencyObject d) => (Brush?)d.GetValue(AccentProperty);
|
||||
|
||||
public static void SetAccent(DependencyObject d, Brush? v) => d.SetValue(AccentProperty, v);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>null → Collapsed, otherwise Visible.</summary>
|
||||
public sealed class NullToCollapsedConverter : IValueConverter
|
||||
{
|
||||
public static NullToCollapsedConverter Instance { get; } = new();
|
||||
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is null || value is string { Length: 0 } ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>true → Collapsed (inverse of BooleanToVisibilityConverter).</summary>
|
||||
public sealed class InverseBoolToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public static InverseBoolToVisibilityConverter Instance { get; } = new();
|
||||
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is true ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>0 → Collapsed, any other number → Visible.</summary>
|
||||
public sealed class ZeroToCollapsedConverter : IValueConverter
|
||||
{
|
||||
public static ZeroToCollapsedConverter Instance { get; } = new();
|
||||
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value switch
|
||||
{
|
||||
int i => i == 0 ? Visibility.Collapsed : Visibility.Visible,
|
||||
long l => l == 0 ? Visibility.Collapsed : Visibility.Visible,
|
||||
double d => d == 0 ? Visibility.Collapsed : Visibility.Visible,
|
||||
_ => Visibility.Collapsed,
|
||||
};
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>Empty state: the mark, one sentence and the action buttons supplied as content (BRIEF §0.2 rule 6).</summary>
|
||||
public class EmptyState : ContentControl
|
||||
{
|
||||
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(nameof(Message), typeof(string), typeof(EmptyState));
|
||||
|
||||
static EmptyState()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(EmptyState), new FrameworkPropertyMetadata(typeof(EmptyState)));
|
||||
}
|
||||
|
||||
public string? Message { get => (string?)GetValue(MessageProperty); set => SetValue(MessageProperty, value); }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace Titano.Ui.Controls;
|
||||
|
||||
/// <summary>Attached field helpers: placeholder text and an inline leading icon for text inputs.</summary>
|
||||
public static class Field
|
||||
{
|
||||
public static readonly DependencyProperty PlaceholderProperty = DependencyProperty.RegisterAttached(
|
||||
"Placeholder", typeof(string), typeof(Field), new FrameworkPropertyMetadata(null));
|
||||
|
||||
public static readonly DependencyProperty GlyphProperty = DependencyProperty.RegisterAttached(
|
||||
"Glyph", typeof(IconData), typeof(Field), new FrameworkPropertyMetadata(null));
|
||||
|
||||
public static string? GetPlaceholder(DependencyObject d) => (string?)d.GetValue(PlaceholderProperty);
|
||||
|
||||
public static void SetPlaceholder(DependencyObject d, string? value) => d.SetValue(PlaceholderProperty, value);
|
||||
|
||||
public static IconData? GetGlyph(DependencyObject d) => (IconData?)d.GetValue(GlyphProperty);
|
||||
|
||||
public static void SetGlyph(DependencyObject d, IconData? value) => d.SetValue(GlyphProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>Attached glyph for buttons: renders an <see cref="IconData"/> before (or instead of) the content.</summary>
|
||||
public static class ButtonIcon
|
||||
{
|
||||
public static readonly DependencyProperty GlyphProperty = DependencyProperty.RegisterAttached(
|
||||
"Glyph", typeof(IconData), typeof(ButtonIcon), new FrameworkPropertyMetadata(null));
|
||||
|
||||
public static IconData? GetGlyph(DependencyObject d) => (IconData?)d.GetValue(GlyphProperty);
|
||||
|
||||
public static void SetGlyph(DependencyObject d, IconData? value) => d.SetValue(GlyphProperty, value);
|
||||
}
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user