Installers for all platforms and related fixes #1

Merged
LeoVasanko merged 38 commits from installer into main 2026-09-23 17:41:21 +00:00
2 changed files with 7 additions and 67 deletions
Showing only changes of commit 2c4baf693c - Show all commits
-12
View File
@@ -437,18 +437,6 @@ export async function pickFolderAndAddRoot(): Promise<string | null> {
return folder return folder
} }
/**
* Fetch the installed MediaHive version.
*/
export async function getVersion(): Promise<string> {
const response = await fetch("/api/version")
if (!response.ok) {
throw new Error(`Failed to load version: ${response.statusText}`)
}
const data = await response.json()
return data.version || "dev"
}
/** /**
* Fetch the tail of the application log. * Fetch the tail of the application log.
*/ */
+7 -55
View File
@@ -302,20 +302,7 @@
<section class="settings-section"> <section class="settings-section">
<h2 class="settings-section-title">Diagnostics</h2> <h2 class="settings-section-title">Diagnostics</h2>
<p class="settings-section-desc"> <p class="settings-section-desc">Application log for troubleshooting.</p>
Version info and application log for troubleshooting.
</p>
<div class="diag-rows">
<div class="diag-row">
<span class="diag-label">App version</span>
<span class="diag-value">{{ appVersion || "…" }}</span>
</div>
<div class="diag-row">
<span class="diag-label">Browser engine</span>
<span class="diag-value">{{ browserEngine }}</span>
</div>
</div>
<div class="diag-log-header"> <div class="diag-log-header">
<span class="diag-label">Application log</span> <span class="diag-label">Application log</span>
@@ -334,7 +321,7 @@ import { ref, watch, computed, onMounted, onUnmounted } from "vue"
import { useRouter, useRoute } from "vue-router" import { useRouter, useRoute } from "vue-router"
import { navAttrs } from "../composables/useKeyboardNavigation" import { navAttrs } from "../composables/useKeyboardNavigation"
import logoUrl from "../assets/mediahive.webp" import logoUrl from "../assets/mediahive.webp"
import { replaceRoots, pickFolderAndAddRoot, fetchPlayers, getVersion, getLog } from "../api" import { replaceRoots, pickFolderAndAddRoot, fetchPlayers, getLog } from "../api"
import type { PlayerInfo } from "../api" import type { PlayerInfo } from "../api"
import HexKeyboard from "./HexKeyboard.vue" import HexKeyboard from "./HexKeyboard.vue"
import { import {
@@ -437,10 +424,8 @@ async function refreshPlayers() {
} }
} }
const appVersion = ref("")
const appLog = ref("") const appLog = ref("")
const browserEngine = navigator.userAgent let logFetched = false
let diagnosticsFetched = false
async function refreshLog() { async function refreshLog() {
try { try {
@@ -451,16 +436,6 @@ async function refreshLog() {
} }
} }
async function refreshDiagnostics() {
try {
appVersion.value = await getVersion()
} catch (e) {
console.error("Failed to fetch version:", e)
appVersion.value = "unknown"
}
await refreshLog()
}
async function removeRoot(rootId: string) { async function removeRoot(rootId: string) {
const filtered = roots.value.filter((r) => r.root_id !== rootId) const filtered = roots.value.filter((r) => r.root_id !== rootId)
const newRoots = Object.fromEntries(filtered.map((r) => [r.root_id, r.path])) const newRoots = Object.fromEntries(filtered.map((r) => [r.root_id, r.path]))
@@ -490,9 +465,9 @@ async function addRoot() {
watch(showSettings, (visible) => { watch(showSettings, (visible) => {
if (visible) { if (visible) {
void refreshPlayers() void refreshPlayers()
if (!diagnosticsFetched) { if (!logFetched) {
diagnosticsFetched = true logFetched = true
void refreshDiagnostics() void refreshLog()
} }
} }
}) })
@@ -925,33 +900,11 @@ onUnmounted(() => {
color: #22c55e; color: #22c55e;
} }
.diag-rows {
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 16px;
}
.diag-row {
display: flex;
flex-direction: column;
gap: 2px;
padding: 8px 10px;
background: rgba(255, 255, 255, 0.05);
border-radius: 8px;
}
.diag-label { .diag-label {
font-size: 0.75rem; font-size: 0.75rem;
color: var(--text-secondary); color: var(--text-secondary);
} }
.diag-value {
font-size: 0.85rem;
color: var(--text-primary);
word-break: break-all;
}
.diag-log-header { .diag-log-header {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -979,8 +932,7 @@ onUnmounted(() => {
font-size: 0.75rem; font-size: 0.75rem;
white-space: pre-wrap; white-space: pre-wrap;
word-break: break-all; word-break: break-all;
width: 80ch; width: 100%;
max-width: 100%;
max-height: 320px; max-height: 320px;
overflow-y: auto; overflow-y: auto;
margin: 0; margin: 0;