Upload via GUI (324 Dateien)

This commit is contained in:
2026-10-30 05:54:28 +00:00
parent e8b5d6b6e0
commit 9d55faa3eb
18 changed files with 1518 additions and 0 deletions
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>AeroMC-Instanz</title>
<style>
body { font-family: "Segoe UI", sans-serif; font-size: 13px; color: #d8d8d8; background: #2d2d2d; margin: 0; padding: 12px; }
label { display: block; margin-bottom: 4px; color: #a8a8a8; }
select { width: 100%; padding: 6px; background: #3d3d3d; color: #fff; border: 1px solid #555; border-radius: 4px; }
.hint { margin-top: 10px; color: #8a8a8a; font-size: 12px; }
</style>
</head>
<body>
<label for="instanz">Instanz</label>
<select id="instanz"><option value="">Lade …</option></select>
<p class="hint" id="hinweis"></p>
<script>
// bei diesen Tasten darf die Instanz leer bleiben (= alle Instanzen)
const OPTIONAL = ['com.aeromc.launcher.spielzeit', 'com.aeromc.launcher.ordner', 'com.aeromc.launcher.logs', 'com.aeromc.launcher.absturz'];
const OPTIONAL_TEXT = { 'com.aeromc.launcher.logs': 'Laufende / zuletzt gespielte', 'com.aeromc.launcher.absturz': 'Laufende / zuletzt gespielte' };
let ws, uuid, aktion, einstellungen = {}, wiederholung = null;
function frageInstanzen() {
if (ws.readyState === 1) ws.send(JSON.stringify({ event: 'sendToPlugin', action: aktion, context: uuid, payload: { frage: 'instanzen' } }));
}
function fuelle(p) {
// solange AeroMC nicht erreichbar ist, alle 2 s neu fragen - ein Neuauswählen der Taste ist dann nicht nötig
if (p.erreichbar) { clearInterval(wiederholung); wiederholung = null; }
else if (!wiederholung) wiederholung = setInterval(frageInstanzen, 2000);
const sel = document.getElementById('instanz');
const hinweis = document.getElementById('hinweis');
sel.innerHTML = '';
if (!p.erreichbar) {
sel.innerHTML = '<option value="">AeroMC nicht erreichbar</option>';
hinweis.textContent = 'AeroMC starten und unter Optionen → Allgemein „Stream Deck erlauben“ einschalten. Dieses Fenster aktualisiert sich dann selbst.';
return;
}
hinweis.textContent = '';
const leer = document.createElement('option');
leer.value = ''; leer.textContent = OPTIONAL.includes(aktion) ? (OPTIONAL_TEXT[aktion] || 'Alle Instanzen') : '– bitte wählen –';
sel.appendChild(leer);
for (const i of p.instanzen) {
const o = document.createElement('option');
o.value = i.id; o.textContent = i.name;
sel.appendChild(o);
}
sel.value = einstellungen.instanceId || '';
}
function connectElgatoStreamDeckSocket(port, inUUID, registerEvent, info, actionInfo) {
uuid = inUUID;
const a = JSON.parse(actionInfo);
aktion = a.action;
einstellungen = (a.payload && a.payload.settings) || {};
ws = new WebSocket('ws://127.0.0.1:' + port);
ws.onopen = () => {
ws.send(JSON.stringify({ event: registerEvent, uuid }));
frageInstanzen();
};
ws.onmessage = (e) => {
const m = JSON.parse(e.data);
if (m.event === 'sendToPropertyInspector') fuelle(m.payload || {});
};
document.getElementById('instanz').addEventListener('change', (ev) => {
einstellungen.instanceId = ev.target.value;
ws.send(JSON.stringify({ event: 'setSettings', context: uuid, payload: einstellungen }));
});
}
</script>
</body>
</html>