Skip to content

Commit acada65

Browse files
committed
opt.
1 parent 7bf3894 commit acada65

11 files changed

Lines changed: 55 additions & 17 deletions

File tree

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PLATFORM ?=
1010
ENV_FILE ?=
1111
XCARCHIVE_PATH ?=
1212
APP_PATH ?=
13+
DMG_PATH ?=
1314
TAP_REPO_PATH ?=
1415

1516
.PHONY: help deps pub-get run run-device analyze test test-one coverage \
@@ -51,10 +52,10 @@ help:
5152
' package-dmg Run scripts/release/package-dmg-from-xcarchive.sh' \
5253
' Example: make package-dmg APP_PATH="/path/Server Box.app"' \
5354
' Example: make package-dmg XCARCHIVE_PATH=/path/Runner.xcarchive' \
54-
' sync-homebrew-cask Generate ~/proj/homebrew-taps/Casks/serverbox.rb from a built DMG' \
55+
' sync-homebrew-cask Generate ~/proj/homebrew-taps/Casks/server-box.rb from a built DMG' \
5556
' Example: make sync-homebrew-cask APP_PATH="/path/Server Box.app"' \
5657
' Example: make sync-homebrew-cask XCARCHIVE_PATH=/path/Runner.xcarchive' \
57-
' Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1365.dmg'
58+
' Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1.dmg'
5859

5960
deps pub-get:
6061
$(FLUTTER) pub get
@@ -146,7 +147,7 @@ sync-homebrew-cask:
146147
echo 'APP_PATH, XCARCHIVE_PATH, or DMG_PATH is required.'; \
147148
echo 'Example: make sync-homebrew-cask APP_PATH="/path/Server Box.app"'; \
148149
echo 'Example: make sync-homebrew-cask XCARCHIVE_PATH=/path/Runner.xcarchive'; \
149-
echo 'Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1365.dmg'; \
150+
echo 'Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1.dmg'; \
150151
exit 1; \
151152
fi
152153
@if [ -n "$(APP_PATH)" ]; then \

docs/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import starlight from '@astrojs/starlight';
44

55
// https://astro.build/config
66
export default defineConfig({
7+
base: '/docs',
78
integrations: [
89
starlight({
910
title: 'Server Box',

scripts/build-cloudflare-pages.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
6+
cd "$ROOT_DIR/website"
7+
bun install --frozen-lockfile
8+
bun run build
9+
10+
cd "$ROOT_DIR/docs"
11+
bun install
12+
bun run build
13+
14+
rm -rf "$ROOT_DIR/website/dist/docs"
15+
mkdir -p "$ROOT_DIR/website/dist/docs"
16+
cp -R "$ROOT_DIR/docs/dist/." "$ROOT_DIR/website/dist/docs/"

scripts/release/release-macos-dmg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,5 +395,5 @@ if [[ "$PUBLISH_GITHUB_RELEASE" == "1" ]]; then
395395
echo "GitHub release: $APP_REPO_SLUG $RELEASE_TAG"
396396
fi
397397
if [[ "${SYNC_HOMEBREW_CASK:-1}" == "1" ]]; then
398-
echo "Homebrew cask: ${TAP_REPO_PATH:-$HOME/proj/homebrew-taps}/Casks/serverbox.rb"
398+
echo "Homebrew cask: ${TAP_REPO_PATH:-$HOME/proj/homebrew-taps}/Casks/server-box.rb"
399399
fi

scripts/release/sync-homebrew-cask.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
55
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
66
APP_NAME="${APP_NAME:-Server Box}"
7-
CASK_NAME="${CASK_NAME:-serverbox}"
7+
CASK_NAME="${CASK_NAME:-server-box}"
88
CASK_DISPLAY_NAME="${CASK_DISPLAY_NAME:-ServerBox}"
99
CASK_DESC="${CASK_DESC:-App for monitoring server status with SSH terminal, SFTP, Container management}"
1010
APP_REPO_SLUG="${APP_REPO_SLUG:-lollipopkit/flutter_server_box}"

website/jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
* Use global.d.ts instead of compilerOptions.types
3535
* to avoid limiting type declarations.
3636
*/
37-
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
37+
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte", "src/**/*.ts"]
3838
}

website/src/App.svelte

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
}
9090
9191
let locale = $state(initialLocale)
92-
let isMounted = $state(false)
9392
let copiedCommand = $state(undefined)
93+
let copyFallbackCommand = $state(undefined)
9494
9595
function applyLocale(nextLocale) {
9696
locale = nextLocale
@@ -103,12 +103,10 @@
103103
const nextLocale = locale || getInitialLocale()
104104
applyLocale(nextLocale)
105105
syncLocaleToUrl(nextLocale)
106-
107-
isMounted = true
108106
})
109107
110108
$effect(() => {
111-
if (!isMounted) return
109+
if (!locale) return
112110
113111
document.documentElement.lang = $LL.meta.lang()
114112
document.title = $LL.meta.title()
@@ -144,26 +142,30 @@
144142
}
145143
146144
async function copyCommand(command) {
145+
copiedCommand = command
146+
copyFallbackCommand = undefined
147+
147148
try {
148149
await navigator.clipboard.writeText(command)
149-
copiedCommand = command
150150
window.setTimeout(() => {
151151
if (copiedCommand === command) copiedCommand = undefined
152152
}, 1800)
153153
} catch {
154-
copiedCommand = undefined
154+
copyFallbackCommand = command
155+
window.prompt($LL.download.copyPrompt(), command)
155156
}
156157
}
157158
</script>
158159
159-
{#if locale && isMounted}
160+
{#if locale}
160161
<main class="site">
161162
<header class="site-nav" id="top">
162163
<a class="brand" href="#top" onclick={(event) => scrollToSection(event, 'top')}>ServerBox</a>
163164
<nav>
164165
<a href="#features" onclick={(event) => scrollToSection(event, 'features')}>{$LL.nav.features()}</a>
165166
<a href="#capabilities" onclick={(event) => scrollToSection(event, 'capabilities')}>{$LL.nav.capabilities()}</a>
166167
<a href="#download" onclick={(event) => scrollToSection(event, 'download')}>{$LL.nav.download()}</a>
168+
<a href="/docs/">Docs</a>
167169
</nav>
168170
<div class="nav-actions">
169171
<label class="language-switcher">
@@ -270,7 +272,15 @@
270272
aria-label={`${group.label} ${source.label}`}
271273
onclick={() => copyCommand(source.command)}
272274
>
273-
<span>{copiedCommand === source.command ? $LL.download.copied() : source.label}</span>
275+
<span>
276+
{#if copyFallbackCommand === source.command}
277+
{source.command}
278+
{:else if copiedCommand === source.command}
279+
{$LL.download.copied()}
280+
{:else}
281+
{source.label}
282+
{/if}
283+
</span>
274284
</button>
275285
{:else}
276286
<a class="download-icon-btn" href={source.href} aria-label={`${group.label} ${source.label}`}>

website/src/app.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&display=swap';
1+
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700;800&display=swap');
22

33
:root {
44
color-scheme: light;
@@ -18,8 +18,8 @@
1818
--radius-container: 12px;
1919
--radius-pill: 9999px;
2020

21-
--font-display: 'Cabinet Grotesk', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
22-
--font-body: 'Cabinet Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
21+
--font-display: 'Plus Jakarta Sans', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
22+
--font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
2323
--font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
2424
}
2525

website/src/i18n/en/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const en: BaseTranslation = {
7070
subtitle:
7171
'Choose the channel that matches your device and trust model. iOS and macOS use the App Store; Android, Linux, and Windows also have direct package downloads.',
7272
copied: 'Install command copied',
73+
copyPrompt: 'Copy this install command:',
7374
note:
7475
'Only download packages from a source you trust. For server-side push, widgets, and companion monitoring, install ServerBoxMonitor separately on your servers.',
7576
},

website/src/i18n/i18n-types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ type RootTranslation = {
181181
* I​n​s​t​a​l​l​ ​c​o​m​m​a​n​d​ ​c​o​p​i​e​d
182182
*/
183183
copied: string
184+
/**
185+
* C​o​p​y​ ​t​h​i​s​ ​i​n​s​t​a​l​l​ ​c​o​m​m​a​n​d​:
186+
*/
187+
copyPrompt: string
184188
/**
185189
* O​n​l​y​ ​d​o​w​n​l​o​a​d​ ​p​a​c​k​a​g​e​s​ ​f​r​o​m​ ​a​ ​s​o​u​r​c​e​ ​y​o​u​ ​t​r​u​s​t​.​ ​F​o​r​ ​s​e​r​v​e​r​-​s​i​d​e​ ​p​u​s​h​,​ ​w​i​d​g​e​t​s​,​ ​a​n​d​ ​c​o​m​p​a​n​i​o​n​ ​m​o​n​i​t​o​r​i​n​g​,​ ​i​n​s​t​a​l​l​ ​S​e​r​v​e​r​B​o​x​M​o​n​i​t​o​r​ ​s​e​p​a​r​a​t​e​l​y​ ​o​n​ ​y​o​u​r​ ​s​e​r​v​e​r​s​.
186190
*/
@@ -388,6 +392,10 @@ export type TranslationFunctions = {
388392
* Install command copied
389393
*/
390394
copied: () => LocalizedString
395+
/**
396+
* Copy this install command:
397+
*/
398+
copyPrompt: () => LocalizedString
391399
/**
392400
* Only download packages from a source you trust. For server-side push, widgets, and companion monitoring, install ServerBoxMonitor separately on your servers.
393401
*/

0 commit comments

Comments
 (0)