-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathadvanced.cfm
More file actions
executable file
·132 lines (98 loc) · 4.37 KB
/
advanced.cfm
File metadata and controls
executable file
·132 lines (98 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<cfif not isUserLoggedIn()>
<cflocation url="index.cfm">
</cfif>
<cfscript>
setLocale("English (us)");
</cfscript>
<cfset reload = true>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="cache-control" content="no-cache">
<!-- CSS Bootstrap-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!-- CSS Page-->
<link rel="stylesheet" type="text/css" href="css/estilo.css">
<script src="js/jquery-3.2.1.min.js"></script>
<script language="javascript">
var reload = true;
$(document).ready(function()
{
var cycle = $("#idCycle").val();
$(".repay").click(function(){
if (confirm('Are you sure to repeat all rewards payments for cycle ' + cycle + '?\nThis cannot be undone!'))
{
// Turn button inactive.
$("#btnRepay").attr("disabled", true);
// Calls Coldfusion method to save to local database.
$.get('bp_proxy.cfm?repay=true&cycle=' + cycle);
alert('Order to repeat payments was sent. Wait some minutes and check blockchain for results.');
}
else
{
alert('Operation cancelled!');
}
});
});
</script>
</head>
<body>
<section class="box-content-rewards">
<cfoutput>
<h1 class="title-baker">
Advanced
</h1>
<!--- Check if all data were fetched --->
<cfinvoke component="components.database" method="getSettings" returnVariable="settings">
<cfif #settings.recordCount# GT 0>
<cfif #settings.mode# NEQ "off">
<cfif #settings.status# EQ true>
<!--- Get baker's rewards and store them in memory cache --->
<cfinvoke component="components.tezosGateway" method="getRewards" bakerID="#application.bakerId#" returnVariable="rewards">
<!--- Get the current delivered reward cycle according to the network --->
<cfinvoke component="components.tezosGateway" method="getLastRewardsDeliveryCycle" rewards="#rewards#"
returnVariable="lastRewardsDeliveryCycle">
<cfset reload = false>
<br>
In this section there are tools to trigger advanced operations. Pay special attention and use it with great care.<br>
All actions will show a confirmation prompt after pressing the operation button, for safety.<br>
<br>
After use, wait at least 30 minutes and check blockchain for results.
<br>
<br>
<br>
<cfform name="form" action="advanced.cfm" method="post">
Repeat all payments for reward-delivered cycle (#lastRewardsDeliveryCycle#):
<input type="hidden" id="idCycle" value="#lastRewardsDeliveryCycle#">
<input type="button" class="repay" id="btnRepay" value="REPAY">
</cfform>
<cfelse>
<br><br><br><br><br><br>
<table width="100%">
<tr><td align="center"><img src="imgs/spin.gif" width="50" height="50"><br></td></tr>
<tr style="line-height:30px;text-align:center;"><td align="center">Fetching... Please wait</td></tr>
</table>
</cfif>
<cfelse>
<br>
TAPS status is set to OFF.<br>
Please go to menu option STATUS and choose another option.<br>
</cfif>
<cfelse>
<br>
There is no configuration saved on settings.<br>
Please go to SETUP first.<br>
</cfif>
</cfoutput>
</section>
<cfif #reload# EQ true>
<!--- Reload page until fetch completed --->
<script language="javascript">
setTimeout(function(){ location.reload(); }, 5000);
</script>
</cfif>
</body>
</html>