Refactor and enhance Archipelago setup and API
- Revamped GETTING_STARTED.md for clarity and completeness, detailing the Docker development environment and installation steps. - Updated Cargo.lock and Cargo.toml to replace deprecated dependencies and add new ones, including hyper-ws-listener and env_logger. - Improved WebSocket handling in the API to support upgrades and error management. - Enhanced Neode UI scripts to manage Docker containers during development. - Adjusted dummy app configurations for accurate LAN addresses. - Sorted app entries in the UI for better organization and accessibility.
This commit is contained in:
@@ -82,7 +82,7 @@ define(['./workbox-21a80088'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.79uml52ju7g"
|
||||
"revision": "0.6sndaq9c8b"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -36,7 +36,7 @@ export const dummyApps: Record<string, PackageDataEntry> = {
|
||||
'interface-addresses': {
|
||||
main: {
|
||||
'tor-address': 'bitcoin.onion',
|
||||
'lan-address': 'http://localhost:8332'
|
||||
'lan-address': 'http://localhost:18443'
|
||||
}
|
||||
},
|
||||
status: ServiceStatus.Running
|
||||
@@ -180,7 +180,7 @@ export const dummyApps: Record<string, PackageDataEntry> = {
|
||||
'interface-addresses': {
|
||||
main: {
|
||||
'tor-address': 'endurain.onion',
|
||||
'lan-address': 'http://localhost:8080'
|
||||
'lan-address': 'http://localhost:8084'
|
||||
}
|
||||
},
|
||||
status: ServiceStatus.Stopped
|
||||
@@ -288,7 +288,7 @@ export const dummyApps: Record<string, PackageDataEntry> = {
|
||||
'interface-addresses': {
|
||||
main: {
|
||||
'tor-address': 'lightning.onion',
|
||||
'lan-address': 'http://localhost:9735'
|
||||
'lan-address': 'http://localhost:8080'
|
||||
}
|
||||
},
|
||||
status: ServiceStatus.Running
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apps Grid -->
|
||||
<!-- Apps Grid (alphabetically by title, stable across run state) -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 pb-6">
|
||||
<div
|
||||
v-for="(pkg, id) in packages"
|
||||
v-for="[id, pkg] in sortedPackageEntries"
|
||||
:key="id"
|
||||
class="glass-card p-6 transition-all hover:-translate-y-1 cursor-pointer relative"
|
||||
@click="goToApp(id as string)"
|
||||
@@ -175,6 +175,14 @@ const packages = computed(() => {
|
||||
// return realPackages
|
||||
})
|
||||
|
||||
// Sorted by manifest title, case-insensitive; order stable regardless of running/stopped
|
||||
const sortedPackageEntries = computed(() => {
|
||||
const entries = Object.entries(packages.value)
|
||||
return entries.sort(([, a], [, b]) =>
|
||||
(a.manifest?.title ?? '').localeCompare(b.manifest?.title ?? '', undefined, { sensitivity: 'base' })
|
||||
)
|
||||
})
|
||||
|
||||
const uninstallModal = ref({
|
||||
show: false,
|
||||
appId: '',
|
||||
@@ -191,8 +199,17 @@ function canLaunch(pkg: any): boolean {
|
||||
|
||||
function launchApp(id: string) {
|
||||
const isDev = import.meta.env.DEV
|
||||
const pkg = packages.value[id]
|
||||
|
||||
// Special handling for apps with Docker containers
|
||||
// Get the LAN address from the package manifest
|
||||
const lanAddress = pkg?.installed?.['interface-addresses']?.main?.['lan-address']
|
||||
|
||||
if (lanAddress) {
|
||||
window.open(lanAddress, '_blank', 'noopener,noreferrer')
|
||||
return
|
||||
}
|
||||
|
||||
// Fallback: Special handling for apps with Docker containers
|
||||
const appUrls: Record<string, { dev: string, prod: string }> = {
|
||||
'atob': {
|
||||
dev: 'http://localhost:8102',
|
||||
|
||||
@@ -96,6 +96,18 @@ else
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Start Docker apps
|
||||
if /usr/local/bin/docker ps > /dev/null 2>&1; then
|
||||
echo -e "${BLUE}🏝️ Starting Archipelago Docker apps...${NC}"
|
||||
cd ..
|
||||
./start-docker-apps.sh
|
||||
cd neode-ui
|
||||
echo ""
|
||||
else
|
||||
echo -e "${YELLOW}⚠️ Skipping Docker apps (Docker not available)${NC}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Check if node_modules exists
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo -e "${YELLOW}⚠️ node_modules not found. Running npm install...${NC}"
|
||||
|
||||
@@ -63,3 +63,14 @@ echo ""
|
||||
echo -e "${GREEN}✅ All Neode development servers stopped!${NC}"
|
||||
echo ""
|
||||
|
||||
# Stop Docker containers
|
||||
echo -e "${BLUE}🐳 Stopping Docker containers...${NC}"
|
||||
if /usr/local/bin/docker ps > /dev/null 2>&1; then
|
||||
cd ..
|
||||
./stop-docker-apps.sh
|
||||
cd neode-ui
|
||||
else
|
||||
echo -e "${YELLOW} ℹ️ Docker not running${NC}"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user