Update LoraBell app URLs and remove outdated HTML file
- Changed LoraBell's LAN address from a local HTML file to a direct IP link in multiple files for improved accessibility. - Removed the now obsolete lorabell-info.html file from the public directory. - Updated service worker cache revision for index.html to ensure proper asset management.
This commit is contained in:
@@ -82,7 +82,7 @@ define(['./workbox-21a80088'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.nedd68ljhq8"
|
||||
"revision": "0.lheu907255"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -611,7 +611,7 @@ const staticDevApps = {
|
||||
'interface-addresses': {
|
||||
main: {
|
||||
'tor-address': 'lorabell.onion',
|
||||
'lan-address': '/lorabell-info.html'
|
||||
'lan-address': 'http://192.168.1.166'
|
||||
}
|
||||
},
|
||||
status: 'running'
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>LoraBell</title>
|
||||
<style>
|
||||
body { background: #000; color: #fff; font-family: system-ui, sans-serif; padding: 2rem; max-width: 32rem; margin: 0 auto; }
|
||||
h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
|
||||
p { color: rgba(255,255,255,0.8); margin-bottom: 0.5rem; }
|
||||
.muted { color: rgba(255,255,255,0.6); font-size: 0.875rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>LoraBell</h1>
|
||||
<p>A LoRa based doorbell</p>
|
||||
<p class="muted">This device has no web interface. It operates over LoRa radio and sends doorbell notifications to your node.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -144,7 +144,7 @@ export const dummyApps: Record<string, PackageDataEntry> = {
|
||||
'interface-addresses': {
|
||||
main: {
|
||||
'tor-address': 'lorabell.onion',
|
||||
'lan-address': '/lorabell-info.html'
|
||||
'lan-address': 'http://192.168.1.166'
|
||||
}
|
||||
},
|
||||
status: ServiceStatus.Running
|
||||
|
||||
@@ -614,8 +614,8 @@ function launchApp() {
|
||||
// TODO: Replace dummy app URLs with real URLs when apps are packaged
|
||||
const appUrls: Record<string, { dev: string, prod: string }> = {
|
||||
'lorabell': {
|
||||
dev: '/lorabell-info.html',
|
||||
prod: '/lorabell-info.html'
|
||||
dev: 'http://192.168.1.166',
|
||||
prod: 'http://192.168.1.166'
|
||||
},
|
||||
'atob': {
|
||||
dev: 'http://localhost:8102',
|
||||
|
||||
@@ -230,25 +230,11 @@ function launchApp(id: string) {
|
||||
const isDev = import.meta.env.DEV
|
||||
const pkg = packages.value[id]
|
||||
|
||||
// Get the LAN address from the package manifest
|
||||
let lanAddress = pkg?.installed?.['interface-addresses']?.main?.['lan-address']
|
||||
|
||||
// Replace localhost with the current hostname (for remote access)
|
||||
if (lanAddress && lanAddress.includes('localhost')) {
|
||||
const currentHost = window.location.hostname
|
||||
lanAddress = lanAddress.replace('localhost', currentHost)
|
||||
}
|
||||
|
||||
if (lanAddress) {
|
||||
useAppLauncherStore().open({ url: lanAddress, title: pkg?.manifest?.title || id })
|
||||
return
|
||||
}
|
||||
|
||||
// Fallback: Special handling for apps with Docker containers / no-web-interface devices
|
||||
// Explicit URLs for apps that need them (checked first to avoid package data issues)
|
||||
const appUrls: Record<string, { dev: string, prod: string }> = {
|
||||
'lorabell': {
|
||||
dev: '/lorabell-info.html',
|
||||
prod: '/lorabell-info.html'
|
||||
dev: 'http://192.168.1.166',
|
||||
prod: 'http://192.168.1.166'
|
||||
},
|
||||
'atob': {
|
||||
dev: 'http://localhost:8102',
|
||||
@@ -266,7 +252,7 @@ function launchApp(id: string) {
|
||||
|
||||
if (appUrls[id]) {
|
||||
let url = isDev ? appUrls[id].dev : appUrls[id].prod
|
||||
// Replace localhost with current hostname for remote access
|
||||
// Replace localhost with current hostname for remote access (not for external IPs like LoraBell)
|
||||
if (url.includes('localhost')) {
|
||||
const currentHost = window.location.hostname
|
||||
url = url.replace('localhost', currentHost)
|
||||
@@ -275,6 +261,20 @@ function launchApp(id: string) {
|
||||
return
|
||||
}
|
||||
|
||||
// Get the LAN address from the package
|
||||
let lanAddress = pkg?.installed?.['interface-addresses']?.main?.['lan-address']
|
||||
|
||||
// Replace localhost with the current hostname (for remote access)
|
||||
if (lanAddress && lanAddress.includes('localhost')) {
|
||||
const currentHost = window.location.hostname
|
||||
lanAddress = lanAddress.replace('localhost', currentHost)
|
||||
}
|
||||
|
||||
if (lanAddress) {
|
||||
useAppLauncherStore().open({ url: lanAddress, title: pkg?.manifest?.title || id })
|
||||
return
|
||||
}
|
||||
|
||||
// For other apps, navigate to app details which has launch functionality
|
||||
router.push(`/dashboard/apps/${id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user