make janus-static work for web ui

This commit is contained in:
Devaev Maxim 2021-06-17 18:40:53 +03:00
parent e6a5d5648f
commit 5912693c1a
3 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1,5 @@
name: Janus Static
description: Janus WebRTC Gateway (Static Config)
path: janus
daemon: kvmd-janus-static
place: -1

View File

@ -21,6 +21,7 @@
import os
import re
from typing import Dict
from typing import Optional
@ -51,9 +52,10 @@ class ExtrasInfoSubmanager(BaseInfoSubmanager):
try:
extras_path = self.__global_config.kvmd.info.extras
extras: Dict[str, Dict] = {}
for app in os.listdir(extras_path):
if app[0] != "." and os.path.isdir(os.path.join(extras_path, app)):
extras[app] = load_yaml_file(os.path.join(extras_path, app, "manifest.yaml"))
for name in os.listdir(extras_path):
if name[0] != "." and os.path.isdir(os.path.join(extras_path, name)):
app = re.sub(r"[^a-zA-Z0-9_]+", "_", name)
extras[app] = load_yaml_file(os.path.join(extras_path, name, "manifest.yaml"))
self.__rewrite_app_daemon(extras[app])
self.__rewrite_app_port(extras[app])
return extras

View File

@ -126,7 +126,10 @@ export function Session() {
$("webterm-window").show_hook = show_hook;
$("webterm-window").close_hook = close_hook;
__streamer.setJanusEnabled(state.janus && (state.janus.enabled || state.janus.started));
__streamer.setJanusEnabled(
(state.janus && (state.janus.enabled || state.janus.started))
|| (state.janus_static && (state.janus_static.enabled || state.janus_static.started))
);
};
var __formatTemp = function(temp) {