diff --git a/html/input.php b/html/input.php
index ccb559a..46e0644 100644
--- a/html/input.php
+++ b/html/input.php
@@ -5,23 +5,24 @@ $jsonFile = __DIR__ . "/input.json";
if (!file_exists($jsonFile)) {
file_put_contents($jsonFile, json_encode([]));
}
-
$data = json_decode(file_get_contents($jsonFile), true);
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["action"]) && $_POST["action"] === "add") {
$new = [
"id" => time(),
- "input_udp" => $_POST["input_udp"],
- "output_udp" => $_POST["output_udp"],
- "video_format" => $_POST["video_format"],
- "audio_format" => $_POST["audio_format"],
- "resolution" => $_POST["resolution"],
- "video_bitrate" => $_POST["video_bitrate"],
- "audio_bitrate" => $_POST["audio_bitrate"],
- "status" => $_POST["status"]
+ "input_udp" => $_POST["input_udp"] ?? "",
+ "output_udp" => $_POST["output_udp"] ?? "",
+ "video_format" => $_POST["video_format"] ?? "",
+ "audio_format" => $_POST["audio_format"] ?? "",
+ "resolution" => $_POST["resolution"] ?? "",
+ "video_bitrate" => $_POST["video_bitrate"] ?? "",
+ "audio_bitrate" => $_POST["audio_bitrate"] ?? "",
+ "status" => $_POST["status"] ?? ""
];
+
$data[] = $new;
file_put_contents($jsonFile, json_encode($data, JSON_PRETTY_PRINT));
+
echo "OK";
exit;
}
@@ -29,7 +30,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["action"]) && $_POST["
?>
-
-
-
-
Service List
-
-
-
-
- | ID |
- Input UDP |
- Output UDP |
- Video Format |
- Audio Format |
- Resolution |
- Video Bitrate |
- Audio Bitrate |
- Status |
-
+Service List
+
-
-
- | = htmlspecialchars($row["id"]) ?> |
- = htmlspecialchars($row["input_udp"]) ?> |
- = htmlspecialchars($row["output_udp"]) ?> |
- = htmlspecialchars($row["video_format"]) ?> |
- = htmlspecialchars($row["audio_format"]) ?> |
- = htmlspecialchars($row["resolution"]) ?> |
- = htmlspecialchars($row["video_bitrate"]) ?> |
- = htmlspecialchars($row["audio_bitrate"]) ?> |
- = htmlspecialchars($row["status"]) ?> |
-
-
-
+
+
+ | ID |
+ Input UDP |
+ Output UDP |
+ Video Format |
+ Audio Format |
+ Resolution |
+ Video Bitrate |
+ Audio Bitrate |
+ Status |
+
-
-
+
+
+ | = $row["id"] ?> |
+ = $row["input_udp"] ?> |
+ = $row["output_udp"] ?> |
+ = $row["video_format"] ?> |
+ = $row["audio_format"] ?> |
+ = $row["resolution"] ?> |
+ = $row["video_bitrate"] ?> |
+ = $row["audio_bitrate"] ?> |
+ = $row["status"] ?> |
+
+
-
-
-
+
+
-
+
+
-
+
+
+
+
+
+
+