From df0488686c4979fb1e1c94b7b1b3559578366292 Mon Sep 17 00:00:00 2001 From: Ghassan <99238055+jojkhan@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:46:18 +0500 Subject: [PATCH] cyberpanel_snapshots --- IncBackups/static/IncBackups/IncBackups.js | 84 +++++++++------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/IncBackups/static/IncBackups/IncBackups.js b/IncBackups/static/IncBackups/IncBackups.js index 232099135..40f34de0f 100644 --- a/IncBackups/static/IncBackups/IncBackups.js +++ b/IncBackups/static/IncBackups/IncBackups.js @@ -1354,63 +1354,44 @@ app.controller('restorev2backupoage', function ($scope, $http, $timeout, $compil var data = response.data.data console.log(response.data.data) - console.log(response.data.data[0][1]) - var snaphots = response.data.data[0][1] - for (var i = 0; i < snaphots.length; i++) { - var tml = ' \n' + - ' ' + snaphots[i].id + '' + - ' \n' + - ' \n' + - ' ' + - ' \n' + - ' \n' + - ' ' + - '' + - ' ' + - ' \n'; + var snapshots = response.data.data + console.log("length 0 : "+snapshots.length) + console.log("length 0 1 : "+snapshots[0][1].length) + console.log("length 1 1 : "+snapshots[1][1].length) + for (var i = 0; i < snapshots.length; i++) { + for (var j = 0; j < snapshots[i][1].length; j++) { + var tml = '\n' + + ' ' + + console.log(snapshots[i][1][j].id) + tml += ' \n' + + '' + + '' + + '' + + ' \n' + + '\n' + '\n'; + var mp = $compile(tml)($scope); + + $('#listsnapshots').append(mp); } - - tml += '
' + snapshots[i][1][j].id + '
\n' + + ' \n' + + '
\n' + - '\n' + - '\n' + - '\n'; - var mp = $compile(tml)($scope); - - $('#listsnapshots').append(mp); } - // $scope.Snaphot_ID - // var table = document.getElementById("snapshotstable"); - // - // // Loop through the data and create a new row for each item - // for (var i = 0; i < data.length; i++) { - // // Create a new row element - // var row = table.insertRow(); - // - // // Create the first cell and set its value to the current item in the data array - // var idCell = row.insertCell(0); - // idCell.innerHTML = data[i]; - // - // // Create the second cell and add a delete button to it - // var deleteCell = row.insertCell(1); - // var deleteButton = document.createElement("button"); - // deleteButton.innerHTML = "Delete"; - // deleteButton.addEventListener("click", function() { - // // Call your delete function here - // console.log("Deleting item:", data[i]); - // }); - // deleteCell.appendChild(deleteButton); - // } } else { new PNotify({ title: 'Error!', @@ -1758,7 +1739,8 @@ app.controller('ConfigureV2Backup', function ($scope, $http, $timeout) { function listpaths(pathid, button) { - console.log("LIST PAYH FUNCTIOB CALLED WITH ID " + pathid); + console.log("ID of button used to hide " + button); + console.log(" ID of container which we hide on button press" + pathid); var pathlist = document.getElementById(pathid) if (pathlist.style.display === "none") { pathlist.style.display = "revert";