's'
This commit is contained in:
@@ -176,6 +176,8 @@ export default function LiveControlApp() {
|
||||
const [currentProc, setCurrentProc] = useState("");
|
||||
const [urlConfig, setUrlConfig] = useState("");
|
||||
const [douyinUrl, setDouyinUrl] = useState("");
|
||||
const [businessYoutubeKey, setBusinessYoutubeKey] = useState("");
|
||||
const [syncYoutubeIni, setSyncYoutubeIni] = useState(false);
|
||||
const [apkPath, setApkPath] = useState("/sdcard/app.apk");
|
||||
const [androidSerial, setAndroidSerial] = useState("");
|
||||
const [hubCfgSnapshot, setHubCfgSnapshot] = useState<Record<string, unknown> | null>(null);
|
||||
@@ -268,9 +270,13 @@ export default function LiveControlApp() {
|
||||
useEffect(() => {
|
||||
void (async () => {
|
||||
try {
|
||||
const b = await fetchJson<{ streams?: { douyin_input_url?: string } }>("/hub/business/douyinyoutube");
|
||||
const b = await fetchJson<{
|
||||
streams?: { douyin_input_url?: string; youtube_rtmp_key?: string };
|
||||
}>("/hub/business/douyinyoutube");
|
||||
const u = b.streams?.douyin_input_url;
|
||||
if (u) setDouyinUrl(u);
|
||||
const k = b.streams?.youtube_rtmp_key;
|
||||
if (k !== undefined && k !== null) setBusinessYoutubeKey(k);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
@@ -366,12 +372,23 @@ export default function LiveControlApp() {
|
||||
const saveBusinessMeta = async () => {
|
||||
setBusy("save:meta");
|
||||
try {
|
||||
await fetchJson("/hub/business/douyinyoutube", {
|
||||
const data = await fetchJson<{ message?: string }>("/hub/business/douyinyoutube", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ streams: { douyin_input_url: douyinUrl } }),
|
||||
body: JSON.stringify({
|
||||
streams: {
|
||||
douyin_input_url: douyinUrl,
|
||||
youtube_rtmp_key: businessYoutubeKey,
|
||||
},
|
||||
sync_youtube_ini: syncYoutubeIni,
|
||||
}),
|
||||
});
|
||||
notify(t("业务元数据已同步", "Business metadata saved"));
|
||||
const detail = (data.message || "").trim();
|
||||
notify(
|
||||
detail.length > 0 && detail.length < 280
|
||||
? detail
|
||||
: t("业务元数据已同步", "Business metadata saved"),
|
||||
);
|
||||
} catch (e) {
|
||||
notify((e as Error).message);
|
||||
} finally {
|
||||
@@ -1104,6 +1121,10 @@ export default function LiveControlApp() {
|
||||
setUrlConfig={setUrlConfig}
|
||||
douyinUrl={douyinUrl}
|
||||
setDouyinUrl={setDouyinUrl}
|
||||
businessYoutubeKey={businessYoutubeKey}
|
||||
setBusinessYoutubeKey={setBusinessYoutubeKey}
|
||||
syncYoutubeIni={syncYoutubeIni}
|
||||
setSyncYoutubeIni={setSyncYoutubeIni}
|
||||
onRunProcess={(a) => void runProcess(a)}
|
||||
onSaveUrlConfig={(c) => void saveUrlConfig(c)}
|
||||
onSaveBusinessMeta={() => void saveBusinessMeta()}
|
||||
@@ -1122,6 +1143,10 @@ export default function LiveControlApp() {
|
||||
setUrlConfig={setUrlConfig}
|
||||
douyinUrl={douyinUrl}
|
||||
setDouyinUrl={setDouyinUrl}
|
||||
businessYoutubeKey={businessYoutubeKey}
|
||||
setBusinessYoutubeKey={setBusinessYoutubeKey}
|
||||
syncYoutubeIni={syncYoutubeIni}
|
||||
setSyncYoutubeIni={setSyncYoutubeIni}
|
||||
onRunProcess={(a) => void runProcess(a)}
|
||||
onSaveUrlConfig={(c) => void saveUrlConfig(c)}
|
||||
onSaveBusinessMeta={() => void saveBusinessMeta()}
|
||||
|
||||
Reference in New Issue
Block a user