forked from confirmedcode/Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.hbs
More file actions
132 lines (113 loc) · 6.76 KB
/
Copy pathadmin.hbs
File metadata and controls
132 lines (113 loc) · 6.76 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
132
{{> header title="Admin" }}
<body class="text-center">
{{> nav }}
<div class="container mt-3">
<div class="col-xl-10 offset-xl-1 text-left">
{{> flash }}
<h1 class="h4 text-center mt-4 mb-4 pt-3"><strong>{{environment}} Dashboard</strong></h1>
<div class="row mt-4">
<div class="col-4 text-left mt-2">
<a href="/clients" class="btn btn-info btn-lg btn-block confirmed-blue-bg">Clients</a>
</div>
<div class="col-4 text-left mt-2">
<a href="/sources" class="btn btn-info btn-lg btn-block confirmed-blue-bg">Sources</a>
</div>
<div class="col-4 text-left mt-2">
<a href="/suricata" class="btn btn-info btn-lg btn-block confirmed-blue-bg">Suricata</a>
</div>
<div class="col-4 text-left mt-2">
<a href="/database" class="btn btn-info btn-lg btn-block confirmed-blue-bg">Database</a>
</div>
<div class="col-4 text-left mt-2">
<a href="/partners" class="btn btn-info btn-lg btn-block confirmed-blue-bg">Partners</a>
</div>
</div>
<div class="row mt-5">
<div class="col-xl-4 col-md-6 col-xs-12 text-left p-3 confirmed-bg">
<h1 class="h6 text-center"><strong>Delete User With Email</strong></h1>
<div>
<input type="text" id="deleteUserWithEmailEmail" class="form-control" placeholder="test@test.com"/>
<div class="form-check mt-1">
<input class="form-check-input" type="checkbox" id="deleteUserWithEmailBanned" name="deleteUserWithEmailBanned">
<label class="form-check-label" for="deleteUserWithEmailBanned" style="font-size: 12px; color: red;"> Mark As Banned/Abusive (rare)</label>
</div>
<textarea style="resize: none;" type="text" id="deleteUserWithEmailReason" class="form-control mt-1" placeholder="Required - Enter the reason you're deleting the user."></textarea>
<button onclick="document.getElementById('deleteUserWithEmailEmail').value='';document.getElementById('deleteUserWithEmailReason').value='';" class="btn confirmed-gray-btn btn-sm mt-2" style="width: 49%;">Clear</button>
<button id="deleteUserWithEmailButton" onclick="deleteUserWithEmail();" class="btn confirmed-blue-btn btn-sm mt-2" style="width: 49%;">Submit</button>
<input type="text" id="deleteUserWithEmailResult" class="form-control mt-2" placeholder="Result Appears Here" readonly="readonly"/>
</div>
</div>
<div class="col-xl-4 col-md-6 col-xs-12 text-left p-3 confirmed-bg">
<h1 class="h6 text-center"><strong>Delete User With ID</strong></h1>
<div>
<input type="text" id="deleteUserWithIdId" class="form-control" placeholder="aaffeeff113322"/>
<div class="form-check mt-1">
<input class="form-check-input" type="checkbox" id="deleteUserWithIdBanned" name="deleteUserWithEmailBanned">
<label class="form-check-label" for="deleteUserWithIdBanned" style="font-size: 12px; color: red;"> Mark As Banned/Abusive (rare)</label>
</div>
<textarea style="resize: none;" type="text" id="deleteUserWithIdReason" class="form-control mt-1" placeholder="Required - Enter the reason you're deleting the user."></textarea>
<button onclick="document.getElementById('deleteUserWithIdId').value='';document.getElementById('deleteUserWithIdReason').value='';" class="btn confirmed-gray-btn btn-sm mt-2" style="width: 49%;">Clear</button>
<button id="deleteUserWithIdButton" onclick="deleteUserWithId();" class="btn confirmed-blue-btn btn-sm mt-2" style="width: 49%;">Submit</button>
<input type="text" id="deleteUserWithIdResult" class="form-control mt-2" placeholder="Result Appears Here" readonly="readonly"/>
</div>
</div>
</div>
<div class="col-xl-6 offset-xl-3 col-xs-12 text-left mb-5">
<div class="container-fluid mt-3 p-3 rounded confirmed-bg">
<h1 class="h6 text-center">Your Account</h1>
<a href="/change-password" class="btn confirmed-blue-btn btn-sm btn-block">Change Password</a>
</div>
</div>
</div> <!-- column -->
</div> <!-- row -->
{{> footer}}
{{> bootstrapjs}}
<script>
function deleteUserWithEmail() {
if (confirm("This will send an email to alert the customer that you're deleting their account and cancelling their subscriptions. Proceed?")) {
document.getElementById("deleteUserWithEmailButton").disabled = true;
document.getElementById("deleteUserWithEmailResult").value = "";
var http = new XMLHttpRequest();
var url = "delete-user-with-email";
http.open("POST", url, true);
var params = "email=" + document.getElementById("deleteUserWithEmailEmail").value + "&reason=" + document.getElementById("deleteUserWithEmailReason").value + "&banned=" + document.getElementById("deleteUserWithEmailBanned").checked;
http.responseType = 'json';
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if (http.readyState == 4) {
document.getElementById("deleteUserWithEmailButton").disabled = false;
if (http.status == 200) {
document.getElementById("deleteUserWithEmailResult").value = http.response.message;
return;
}
alert("Error: " + JSON.stringify(http.response));
}
}
http.send(params);
}
}
function deleteUserWithId() {
if (confirm("This will send an email to alert the customer that you're deleting their account and cancelling their subscriptions. Proceed?")) {
document.getElementById("deleteUserWithIdButton").disabled = true;
document.getElementById("deleteUserWithIdResult").value = "";
var http = new XMLHttpRequest();
var url = "delete-user-with-id";
http.open("POST", url, true);
var params = "id=" + document.getElementById("deleteUserWithIdId").value + "&reason=" + document.getElementById("deleteUserWithIdReason").value + "&banned=" + document.getElementById("deleteUserWithIdBanned").checked;
http.responseType = 'json';
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if (http.readyState == 4) {
document.getElementById("deleteUserWithIdButton").disabled = false;
if (http.status == 200) {
document.getElementById("deleteUserWithIdResult").value = http.response.message;
return;
}
alert("Error: " + JSON.stringify(http.response));
}
}
http.send(params);
}
}
</script>
</body>