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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user