Ajax Requests auf getUrl umgebaut
This commit is contained in:
@@ -334,7 +334,7 @@ if ($devices->power != "0.0") {
|
||||
<?php endif; ?>
|
||||
<div class="float-right">
|
||||
<a id="create-backup-href"
|
||||
href="https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=createconfig&ip=<?= $devices->ip; ?>&id=<?= $devices->id; ?>">
|
||||
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
|
||||
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
|
||||
<span id="create-backup-load"></i></span></button>
|
||||
</a></div>
|
||||
@@ -356,11 +356,12 @@ if ($devices->power != "0.0") {
|
||||
$configfileCompressed = trim($config->config_compressed);
|
||||
$configid = $config->id;
|
||||
if ($configfileCleartext && $configfileCompressed) :
|
||||
$configLinks = '<a href="https://' . $_SERVER['SERVER_NAME'] . '/Device/api?do=getconfig&id=' . $configid . '&format=txt&filename=' . $configfileCleartext . '">
|
||||
TXT</a> / <a href="https://' . $_SERVER['SERVER_NAME'] . '/Device/api?do=getconfig&id=' . $configid . '&format=xml&filename=' . $configfileCompressed . '">
|
||||
|
||||
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext]) . '">
|
||||
TXT</a> / <a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'xml', 'filename' => $configfileCompressed]) . '">
|
||||
XML</a>';
|
||||
elseif ($configfileCleartext || $configfileCompressed) :
|
||||
$configLinks = '<a href="https://' . $_SERVER['SERVER_NAME'] . '/Device/api?do=getconfig&id=' . $configid . '&format=txt&filename=' . $configfileCleartext . $configfileCompressed . '">
|
||||
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext . $configfileCompressed]) . '">
|
||||
TXT</a>';
|
||||
|
||||
endif;
|
||||
@@ -674,7 +675,7 @@ if ($devices->power != "0.0") {
|
||||
$('#olt-info-button').remove();
|
||||
|
||||
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getoltinfo&ip=<?= $devices->ip; ?>", {})
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getoltinfo', 'ip' => $devices->ip]) ?>", {})
|
||||
.done(function (data) {
|
||||
if (data.success == false) {
|
||||
$('#olt-body').text('Keine OLT/ONT Daten verfügbar');
|
||||
@@ -867,7 +868,8 @@ if ($devices->power != "0.0") {
|
||||
$("body").on("blur", "#change-splitter-ports", function () {
|
||||
|
||||
var portid = $(this).closest('span').data('portid');
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=changeoltsplitter&id=<?= $devices->id; ?>&portid=" + portid + "&ports=" + $(this).val(), {})
|
||||
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'changeoltsplitter', 'id' => $devices->id]) ?>&portid=" + portid + "&ports=" + $(this).val(), {})
|
||||
.done(function (data) {
|
||||
|
||||
});
|
||||
@@ -919,7 +921,7 @@ if ($devices->power != "0.0") {
|
||||
</tr>
|
||||
</tbody></table>`);
|
||||
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getoltinfo&ip=<?= $devices->ip; ?>&portid=" + thisspan.data('portid'), {})
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getoltinfo', 'ip' => $devices->ip]) ?>&portid=" + thisspan.data('portid'), {})
|
||||
.done(function (data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
console.log('logged out');
|
||||
@@ -963,7 +965,7 @@ if ($devices->power != "0.0") {
|
||||
$('.sp-splitter-count-show').removeClass('noclick');
|
||||
|
||||
}).done(function (data) {
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getoltinfo&ip=<?= $devices->ip; ?>&portid=" + thisspan.data('portid') + "&adv=ext", {}).done(function (data) {
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getoltinfo', 'ip' => $devices->ip]) ?>&portid=" + thisspan.data('portid') + "&adv=ext", {}).done(function (data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
console.log('logged out');
|
||||
// window.location.href = "/";
|
||||
@@ -1010,7 +1012,8 @@ if ($devices->power != "0.0") {
|
||||
var thisspan = $(this).closest('table');
|
||||
$('.ont-refresh-span').html('<i class="fas fa-spinner fa-spin spinner-ico text-info"></i>');
|
||||
$('.sp-splitter-count-show').addClass('noclick');
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getoltinfo&ip=<?= $devices->ip; ?>&portid=" + thisspan.data('portid') + "&adv=ext", {}).done(function (data) {
|
||||
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getoltinfo', 'ip' => $devices->ip]) ?>&ip=<?= $devices->ip; ?>&portid=" + thisspan.data('portid') + "&adv=ext", {}).done(function (data) {
|
||||
|
||||
|
||||
if (thisspan.data('portid') == $('#ont-table').data('portid')) {
|
||||
@@ -1085,7 +1088,7 @@ if ($devices->power != "0.0") {
|
||||
$('#ont-detail-mac-refresh').data('ontid', button.data('ontid'));
|
||||
$('#ont-detail-mac-refresh').data('snr', button.data('snr'));
|
||||
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getontinfo&ip=<?= $devices->ip; ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getontinfo', 'ip' => $devices->ip]) ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
$.each(data.data.linestat, function (o, ont) {
|
||||
if (o == "lastofflinecausetitle") {
|
||||
$('#ont-detail-lastofflinecause').attr('data-original-title', ont);
|
||||
@@ -1138,7 +1141,7 @@ if ($devices->power != "0.0") {
|
||||
var button = $('#ont-detail-mac-refresh');
|
||||
$('#ont-macadresses').empty();
|
||||
$('#ont-macadresses-nomac').remove();
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getontinfomac&ip=<?= $devices->ip; ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getontinfomac', 'ip' => $devices->ip]) ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
if (typeof data.data !== 'undefined' && data.data.length > 0) {
|
||||
$('#ont-macadresses').html(`
|
||||
<tr>
|
||||
@@ -1194,7 +1197,7 @@ if ($devices->power != "0.0") {
|
||||
$('#ont-detail-refresh').data('portid', button.data('portid'));
|
||||
$('#ont-detail-refresh').data('port', button.data('port'));
|
||||
$('#ont-detail-refresh').data('ontid', button.data('ontid'));
|
||||
$.getJSON("https://<?= $_SERVER['SERVER_NAME']; ?>/Device/api?do=getontinfo&ip=<?= $devices->ip; ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
$.getJSON("<?= self::getUrl("Device", "api", ['do' => 'getontinfo', 'ip' => $devices->ip]) ?>&portid=" + button.data('portid') + "&ont=" + button.data('port') + '-' + button.data('ontid'), {}).done(function (data) {
|
||||
$.each(data.data.linestat, function (o, ont) {
|
||||
if (o == "lastofflinecausetitle") {
|
||||
$('#ont-detail-lastofflinecause').attr('data-original-title', ont);
|
||||
|
||||
Reference in New Issue
Block a user