update
This commit is contained in:
parent
f5f0ece2e8
commit
8c9d506362
|
|
@ -66,7 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
case 'update':
|
case 'update':
|
||||||
|
|
||||||
$payload['device_id'] = $device_id;
|
$payload['device_id'] = $device_id;
|
||||||
$payload['project_id'] = "28f27590923d962388f0da125553c5";
|
$payload['project_id'] = "9163de1b4445588f30149e0c7a3c7b";
|
||||||
$payload['version'] = $version;
|
$payload['version'] = $version;
|
||||||
$payload = json_encode($payload, JSON_UNESCAPED_UNICODE);
|
$payload = json_encode($payload, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
'encrypted' => base64_encode($encrypted)
|
'encrypted' => base64_encode($encrypted)
|
||||||
];
|
];
|
||||||
|
|
||||||
$ch = curl_init('https://account.urmic.org/encoder/update_transcoder.php');
|
$ch = curl_init('https://account.urmic.org/encoder/update.php');
|
||||||
curl_setopt_array($ch, [
|
curl_setopt_array($ch, [
|
||||||
CURLOPT_POST => true,
|
CURLOPT_POST => true,
|
||||||
CURLOPT_POSTFIELDS => $postData,
|
CURLOPT_POSTFIELDS => $postData,
|
||||||
|
|
@ -94,13 +94,75 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
|
||||||
$data = json_decode($response, true);
|
$data = json_decode($response, true);
|
||||||
|
|
||||||
|
if ($data['status'] != "valid") {
|
||||||
echo '<script>alert("'
|
echo '<script>alert("'
|
||||||
. htmlspecialchars($data['message'], ENT_QUOTES)
|
. htmlspecialchars($data['message'], ENT_QUOTES)
|
||||||
. '");</script>';
|
. '");</script>';
|
||||||
|
}
|
||||||
error_log($data['status']);
|
|
||||||
|
|
||||||
if ($data['status'] == "valid") {
|
if ($data['status'] == "valid") {
|
||||||
|
echo '
|
||||||
|
<style>
|
||||||
|
#blocker {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0,0,0,0.75);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 999999;
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
|
|
||||||
|
#blockerBox {
|
||||||
|
background: #111827;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 28px 36px;
|
||||||
|
border-radius: 8px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
min-width: 320px;
|
||||||
|
box-shadow: 0 20px 50px rgba(0,0,0,.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
#blockerBox .msg {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#blockerBox .timer {
|
||||||
|
font-size: 34px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="blocker">
|
||||||
|
<div id="blockerBox">
|
||||||
|
<div class="msg">'
|
||||||
|
. htmlspecialchars($data['message'], ENT_QUOTES) .
|
||||||
|
'</div>
|
||||||
|
<div>Refreshing in</div>
|
||||||
|
<div class="timer" id="blockerTimer">100</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let seconds = 100;
|
||||||
|
const timer = document.getElementById("blockerTimer");
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
seconds--;
|
||||||
|
timer.textContent = seconds;
|
||||||
|
|
||||||
|
if (seconds <= 0) {
|
||||||
|
clearInterval(interval);
|
||||||
|
blocker.remove();
|
||||||
|
window.location.href = window.location.pathname;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
|
||||||
$public_key = "-----BEGIN PUBLIC KEY-----
|
$public_key = "-----BEGIN PUBLIC KEY-----
|
||||||
MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEAm+7Vl0fEgey2tF6v2mTn
|
MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEAm+7Vl0fEgey2tF6v2mTn
|
||||||
3C/FDGn589uY5a9rpDeZLlhjdOdFaTMWL3d8oEhmImCd+aPELpxydQ+xGxVPNOzO
|
3C/FDGn589uY5a9rpDeZLlhjdOdFaTMWL3d8oEhmImCd+aPELpxydQ+xGxVPNOzO
|
||||||
|
|
@ -213,7 +275,6 @@ EwIDAQAB
|
||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'reboot':
|
case 'reboot':
|
||||||
exec('sudo reboot');
|
exec('sudo reboot');
|
||||||
|
|
@ -386,7 +447,7 @@ include 'header.php';
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="card wide">
|
<div class="card wide">
|
||||||
Device ID :- <?php echo trim(file_get_contents('/sys/class/dmi/id/product_uuid')); ?><br>
|
Device ID :- <?php echo trim(file_get_contents('/sys/class/dmi/id/product_uuid')); ?><br>
|
||||||
Project Name :- URMI Universal Encoder / Decoder<br>
|
Project Name :- Urmi Digital Transcoder<br>
|
||||||
Software Version :- <?php echo $version; ?> <br>
|
Software Version :- <?php echo $version; ?> <br>
|
||||||
</div>
|
</div>
|
||||||
<div class="card wide">
|
<div class="card wide">
|
||||||
|
|
|
||||||
|
|
@ -432,7 +432,7 @@ include 'static.php';
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header class="top-header-1"><a href="index.php" style="color:white; text-decoration:none;">URMI Universal Digital Encoder / Decoder</a></header>
|
<header class="top-header-1"><a href="index.php" style="color:white; text-decoration:none;">URMI Digital Transcoder</a></header>
|
||||||
<header class="top-header-2">
|
<header class="top-header-2">
|
||||||
<nav aria-label="Top navigation">
|
<nav aria-label="Top navigation">
|
||||||
<a href="https://learn.urmic.org/" target="_blank">Tutorials</a>
|
<a href="https://learn.urmic.org/" target="_blank">Tutorials</a>
|
||||||
|
|
|
||||||
|
|
@ -489,8 +489,8 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
||||||
<h2>Service List</h2>
|
<h2>Service List</h2>
|
||||||
<button onclick="openAddPopup()">Add Service</button>
|
|
||||||
<div style="margin-top:10px;">
|
<div style="margin-top:10px;">
|
||||||
|
<button onclick="openAddPopup()">Add Service</button>
|
||||||
<button onclick="submitAction('start_all')">Start All</button>
|
<button onclick="submitAction('start_all')">Start All</button>
|
||||||
<button onclick="submitAction('stop_all')">Stop All</button>
|
<button onclick="submitAction('stop_all')">Stop All</button>
|
||||||
<button onclick="submitAction('update_all')">Update All</button>
|
<button onclick="submitAction('update_all')">Update All</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue