Skip to content

Commit 5912693

Browse files
committed
make janus-static work for web ui
1 parent e6a5d56 commit 5912693

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

extras/janus-static/manifest.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: Janus Static
2+
description: Janus WebRTC Gateway (Static Config)
3+
path: janus
4+
daemon: kvmd-janus-static
5+
place: -1

kvmd/apps/kvmd/info/extras.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
import os
24+
import re
2425

2526
from typing import Dict
2627
from typing import Optional
@@ -51,9 +52,10 @@ def __inner_get_state(self) -> Optional[Dict]:
5152
try:
5253
extras_path = self.__global_config.kvmd.info.extras
5354
extras: Dict[str, Dict] = {}
54-
for app in os.listdir(extras_path):
55-
if app[0] != "." and os.path.isdir(os.path.join(extras_path, app)):
56-
extras[app] = load_yaml_file(os.path.join(extras_path, app, "manifest.yaml"))
55+
for name in os.listdir(extras_path):
56+
if name[0] != "." and os.path.isdir(os.path.join(extras_path, name)):
57+
app = re.sub(r"[^a-zA-Z0-9_]+", "_", name)
58+
extras[app] = load_yaml_file(os.path.join(extras_path, name, "manifest.yaml"))
5759
self.__rewrite_app_daemon(extras[app])
5860
self.__rewrite_app_port(extras[app])
5961
return extras

web/share/js/kvm/session.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ export function Session() {
126126
$("webterm-window").show_hook = show_hook;
127127
$("webterm-window").close_hook = close_hook;
128128

129-
__streamer.setJanusEnabled(state.janus && (state.janus.enabled || state.janus.started));
129+
__streamer.setJanusEnabled(
130+
(state.janus && (state.janus.enabled || state.janus.started))
131+
|| (state.janus_static && (state.janus_static.enabled || state.janus_static.started))
132+
);
130133
};
131134

132135
var __formatTemp = function(temp) {

0 commit comments

Comments
 (0)