diff --git a/server.js b/server.js index 18987ed..1661095 100644 --- a/server.js +++ b/server.js @@ -138,17 +138,17 @@ app.post("/videos/restart", async (req, res) => { }); }); -// const DB_User = process.env.DB_USER; -// const DB_Password = process.env.DB_PASSWORD; -// const DB_Host = process.env.DB_HOST; -// const DB_Port = process.env.DB_PORT; -// const DB_Name = process.env.DB_NAME; +const DB_User = process.env.DB_USER; +const DB_Password = process.env.DB_PASSWORD; +const DB_Host = process.env.DB_HOST; +const DB_Port = process.env.DB_PORT; +const DB_Name = process.env.DB_NAME; -const DB_User = "postgres"; -const DB_Password = process.env.POSTGRES_PASSWORD; -const DB_Host = "postgres"; -const DB_Port = "5432"; -const DB_Name = "postgres"; +// const DB_User = "postgres"; +// const DB_Password = process.env.POSTGRES_PASSWORD; +// const DB_Host = "postgres"; +// const DB_Port = "5432"; +// const DB_Name = "postgres"; async function index(req, res) { if (req.session.userId === undefined) { @@ -4993,7 +4993,7 @@ async function videoExport(req, res) { // Выполняем запрос, чтобы получить все данные из таблицы registrars const queryRegistrars = ` - SELECT id, serial, channels, lastkeepalive, "group", name, plate, sim, ip, port, number + SELECT id, serial, channels, lastkeepalive, "group", name, plate, sim, ip, port, number, our_registrator FROM registrars ${!templateData.isAdmin ? "WHERE serial = ANY($1)" : ""} ORDER BY id `; @@ -5022,6 +5022,7 @@ async function videoExport(req, res) { ip: registrar.ip, port: registrar.port, number: registrar.number, + ourreg: registrar.our_registrator, }); }); @@ -5037,6 +5038,7 @@ async function videoExport(req, res) { sim: registrar.sim, ip: registrar.ip, port: registrar.port, + ourreg: registrar.our_registrator, })); templateData.Groups = Object.keys(groupedRegistrars).map((groupName) => ({ diff --git a/static/templates/live.html b/static/templates/live.html index 5c32517..42c0cf5 100644 --- a/static/templates/live.html +++ b/static/templates/live.html @@ -407,33 +407,33 @@ flvPlayers.push(flvPlayer); - let hasStarted = false; + // let hasStarted = false; - const checkStarted = () => { - if (!hasStarted && videoElement.readyState >= 2) { - hasStarted = true; - console.log(`Трансляция началась для камеры ${i}`); - } - }; + // const checkStarted = () => { + // if (!hasStarted && videoElement.readyState >= 2) { + // hasStarted = true; + // console.log(`Трансляция началась для камеры ${i}`); + // } + // }; - const checkInterval = setInterval(checkStarted, 1000); + // const checkInterval = setInterval(checkStarted, 10000); - setTimeout(() => { - clearInterval(checkInterval); - if (!hasStarted) { - console.log(`Трансляция для камеры ${i} не началась, запрашиваем повторно...`); - flvPlayer.unload(); - flvPlayer.load(); - flvPlayer.play(); - // if (i > 0) { - // i--; - // } - } - }, 3000); + // setTimeout(() => { + // clearInterval(checkInterval); + // if (!hasStarted) { + // console.log(`Трансляция для камеры ${i} не началась, запрашиваем повторно...`); + // flvPlayer.unload(); + // flvPlayer.load(); + // flvPlayer.play(); + // // if (i > 0) { + // // i--; + // // } + // } + // }, 10000); videoElementIndex++; - await new Promise(resolve => setTimeout(resolve, 2000)); + await new Promise(resolve => setTimeout(resolve, 3000)); } } diff --git a/static/templates/videos/export.html b/static/templates/videos/export.html index cea375c..1164c29 100644 --- a/static/templates/videos/export.html +++ b/static/templates/videos/export.html @@ -127,6 +127,7 @@ +