mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Create check.php
This commit is contained in:
parent
ca008a56f2
commit
dc3dd55364
39
services/proxy/html/virt/check.php
Normal file
39
services/proxy/html/virt/check.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
include 'config.php';
|
||||||
|
|
||||||
|
if (empty($ip) || empty($domen)) {
|
||||||
|
header("Location: https://preview.openpanel.org/");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="messageContainer" class="message" style="display: none;"></div>
|
||||||
|
<script>
|
||||||
|
if (window.location.hash === '#expired') {
|
||||||
|
document.getElementById('messageContainer').innerText = 'Requested proxy has expired';
|
||||||
|
document.getElementById('messageContainer').style.display = 'block';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
Temporary link for testing <?php echo $domen;?> from server IP: <?php echo $ip;?> is being generated, <br><span>please wait.</span>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function checkResponse() {
|
||||||
|
const url = window.location.href;
|
||||||
|
const subdomain = url.split('domains/')[1].split('/check')[0];
|
||||||
|
//console.log(subdomain);
|
||||||
|
const newUrl = `https://${subdomain}.openpanel.org`;
|
||||||
|
|
||||||
|
console.log(newUrl);
|
||||||
|
fetch(newUrl)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(data => {
|
||||||
|
window.location.href = `https://${subdomain}.openpanel.org`;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user