Skip to content

Commit

Permalink
Merge pull request #3 from MinaFoundation/fix-sidecar-removal-errors-2
Browse files Browse the repository at this point in the history
Fix browser errors caused by removed sidecar code
  • Loading branch information
ejMina226 authored Mar 5, 2024
2 parents ada4d9a + 39388a4 commit a92fa80
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 83 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
##### DB_SNARK_USER=
##### DB_SNARK_PWD=
##### DB_SNARK_DB=
##### API_HOST=

Configure these variables and save the file.

Expand Down
8 changes: 1 addition & 7 deletions config.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
DB_SIDECAR_HOST=
DB_SIDECAR_PORT=
DB_SIDECAR_USER=
DB_SIDECAR_PWD=
DB_SIDECAR_DB=
DB_SNARK_HOST=
DB_SNARK_PORT=
DB_SNARK_USER=
DB_SNARK_PWD=
DB_SNARK_DB=
API_HOST=
DB_SNARK_DB=
1 change: 0 additions & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$ShowScoreColumn = true;
$Configurl = "https://docs.google.com/spreadsheets/d/1JTp7nZiw68a-m5KoBeqPr0OOWBVO804xv6HpQNQdKPg/edit#gid=0";
$MaintenanceMode = false;
$API_HOST=getenv("API_HOST");
return array($ShowScoreColumn,$Configurl,$MaintenanceMode);

?>
77 changes: 3 additions & 74 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
<!-- Top Button and Link Section End -->
<div class="row mb-4">
<div class="col-12 col-md-6 mx-0 px-0 Link-responcive">
<div class="Sidecar-Uptime-text">
<p>Ranking for the Mina Foundation Uptime Leaderboard are based on data from the Sidecar Uptime System.</p>
</div>
<div class="Snark-work-Uptime-text">
<p>Ranking for the Mina Foundation Uptime Leaderboard are based on data from the Snark-work Uptime System.</p>
</div>
Expand Down Expand Up @@ -94,13 +91,11 @@
</div>
<div class="tableTabs col-12 col-sm-12 col-md-12 col-lg-12 col-xl-7 px-0 mx-0 mb-5">
<ul class="row nav nav-pills text-center">
<li class="nav-item left-box">
<a data-toggle="pill" class="nav-link active d-flex align-items-center justify-content-center " href="#Data-table" aria-controls="Data-table" aria-selected="true" id="table-one" onclick='showDataForTabOne (10, 1, 0)'>
<div class="beta-text">
Snark-Work Uptime System (Beta)
Snark-Work Uptime System
</div>
</a>
</li>
<!-- <div class="bottom-plate-tab"></div> -->
</ul>

Expand All @@ -116,35 +111,7 @@
<div id="loaderSpin"></div>
<!-- Data Table Section End -->
<script type="text/javascript">
var tabledata ;
var tabledataSnark ;
function getRecords(perPageCount, pageNumber ) {
console.log("getRecords");
$.ajax({
type: "GET",
url: "getPageData.php",
data: {pageNumber: pageNumber},

cache: false,
beforeSend: function() {
$('#loaderSpin').html('<div class="spinner-border d-flex mx-auto" role="status"><span class="sr-only">Loading...</span></div>');

},
success: function(response) {
tabledata = response;



if ($('#table-two').attr("aria-controls") === "Data-table-2" && $('#table-two').hasClass('active')) {
showDataForTabTwo (10, 1, 0);
}

$('#loaderSpin').html('');
},

});
}

function getRecordsForSnark(perPageCount, pageNumber ) {
console.log("getRecordsForSnark");
$.ajax({
Expand Down Expand Up @@ -190,62 +157,24 @@ function showDataForTabOne(perPageCount, pageNumber, pagestart , input ) {
$("#result").html('');
$("#result2").html('');
$("#result").html(html);
$('.Sidecar-Uptime-text').hide();
$('.Snark-work-Uptime-text').show();
},

});
}

function showDataForTabTwo(perPageCount, pageNumber, pagestart ,input ) {
if(!input){
if(!input){input = null}
input = document.getElementById('search-input').value;
if(input.length === 0) {
input = null
}
}
$.ajax({
type: "POST",
url: "showDataForTabTwo.php",
data: {perPageCount:perPageCount,pageNumber: pageNumber ,pagestart:pagestart, tabledata : tabledata , search_input : input},

cache: false,
success: function(html) {
$('#loaderSpin').html('');
$("#result").html('');
$("#result2").html('');
$("#result2").html(html);
$('.Sidecar-Uptime-text').show();
$('.Snark-work-Uptime-text').hide();
},
});
}
function search_result() {
//alert('demo');
let input = document.getElementById('search-input').value
input=input.toLowerCase();
if ($('#table-one').attr("aria-controls") === "Data-table" && $('#table-one').hasClass('active')) {
showDataForTabOne (10, 1, 0, input);
}
else if ($('#table-two').attr("aria-controls") === "Data-table-2" && $('#table-two').hasClass('active')) {
showDataForTabTwo (10, 1, 0 , input);
}

showDataForTabOne (10, 1, 0, input);
}
$(document).ready(function() {
console.log("$(document).ready");
getRecords(10, 1);
getRecordsForSnark(10, 1);
$('.Sidecar-Uptime-text').hide();

$('input[type=search]').on('search', function () {
if ($('#table-one').attr("aria-controls") === "Data-table" && $('#table-one').hasClass('active')) {
showDataForTabOne (10, 1, 0);
}
else if ($('#table-two').attr("aria-controls") === "Data-table-2" && $('#table-two').hasClass('active')) {
showDataForTabTwo (10, 1, 0);
}
showDataForTabOne (10, 1, 0);
});
});
</script>
Expand Down

0 comments on commit a92fa80

Please sign in to comment.