docs(reference): import Dune: Awakening server-manager references
Phase 2 references for the host-agent Dune adapter, moved out of volatile /tmp
into docs/reference-repos/ (per Commander). Three upstream projects, .git +
node_modules + compiled binaries stripped (16MB source). Nested AI-instruction
files (.claude/, CLAUDE.md) removed so they don't pollute Corrosion sessions.
- icehunter/ dune-admin (Go+React) — 4 control planes; SETUP_DOCKER.md is the
closest analog to our agent's Dune docker control plane (compose
lifecycle, docker logs, RabbitMQ-via-exec, dune Postgres schema)
- adainrivers/ Rust/Tauri desktop — SSH+k8s BattleGroup control, maintenance
daemon, in-game admin console (Rust idiom reference)
- the4rchangel/ Node web UI replacing battlegroup.bat — matches the Commander's
Hyper-V self-host path + game-config schema
See docs/reference-repos/README.md for the full index + how we use each.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
28
docs/reference-repos/icehunter/web/src/utils/clipboard.ts
Normal file
28
docs/reference-repos/icehunter/web/src/utils/clipboard.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// copyText copies to the clipboard. navigator.clipboard only exists in a secure
|
||||
// context (HTTPS or localhost); dune-admin is commonly served over plain HTTP on
|
||||
// a LAN IP, where it's undefined — so fall back to a hidden textarea +
|
||||
// document.execCommand('copy'), which works in insecure contexts.
|
||||
export async function copyText(text: string): Promise<boolean> {
|
||||
if (window.isSecureContext && navigator.clipboard?.writeText) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
return true
|
||||
}
|
||||
catch { /* fall through to the legacy path */ }
|
||||
}
|
||||
try {
|
||||
const ta = document.createElement('textarea')
|
||||
ta.value = text
|
||||
ta.setAttribute('readonly', '')
|
||||
ta.style.position = 'fixed'
|
||||
ta.style.top = '-9999px'
|
||||
document.body.appendChild(ta)
|
||||
ta.select()
|
||||
const ok = document.execCommand('copy')
|
||||
document.body.removeChild(ta)
|
||||
return ok
|
||||
}
|
||||
catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
36
docs/reference-repos/icehunter/web/src/utils/icons.ts
Normal file
36
docs/reference-repos/icehunter/web/src/utils/icons.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// VITE_ICON_BASE_URL: base URL for item icons served from R2 (e.g. https://icons.example.com).
|
||||
// When set, icons load from <base>/<template_id>.webp.
|
||||
// When unset, no icon URL is produced and components fall back to category placeholders.
|
||||
const ICON_BASE = ((import.meta.env.VITE_CDN_BASE_URL as string) ?? 'https://assets.dune.layout.tools')?.replace(
|
||||
/\/$/,
|
||||
'',
|
||||
)
|
||||
|
||||
export function iconUrl(templateId: string, variant: 'detail' | 'thumb' = 'detail'): string | null {
|
||||
if (!ICON_BASE) return null
|
||||
return `${ICON_BASE}/${variant}/${templateId}.webp`
|
||||
}
|
||||
|
||||
// Category → colour used when no icon image is available.
|
||||
const CATEGORY_COLORS: Record<string, string> = {
|
||||
'schematics': '#7c6f3e',
|
||||
'items/weapons': '#8b3030',
|
||||
'items/garment': '#2d5a3d',
|
||||
'items/augment': '#1e4a7c',
|
||||
'items/utility': '#5a3d7c',
|
||||
'items/misc': '#4a4a4a',
|
||||
'items/vehicles': '#7c4a1e',
|
||||
}
|
||||
|
||||
export function categoryColor(category: string): string {
|
||||
for (const [prefix, color] of Object.entries(CATEGORY_COLORS)) {
|
||||
if (category.startsWith(prefix)) return color
|
||||
}
|
||||
return '#3a3a3a'
|
||||
}
|
||||
|
||||
const QUALITY_LABELS = ['Standard', 'Refined', 'Superior', 'Masterwork', 'Pristine', 'Flawless']
|
||||
|
||||
export function qualityLabel(q: number): string {
|
||||
return QUALITY_LABELS[q] ?? `Q${q}`
|
||||
}
|
||||
Reference in New Issue
Block a user