forked from 0c34/govwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.setup.html
59 lines (54 loc) · 2.03 KB
/
template.setup.html
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
{{define "template.setup"}}
{{template "template.header" .}}
{{template "setup.sidebar" .}}
<div class="col-md-9">
<div class="panel panel-primary">
<div class="panel-heading">Setup/Reset</div>
<div class="panel-body">
<div class="pnl">
<span class="subheader">Setup Database</span>
<p>
Click on the Create / Reset Database button to create or reset your database.
make sure to correct the mysql credentials in /config/config.json
</p>
<form id="myform">
<input type="hidden" name="act" value="cr">
<button type="button" class="btn btn-primary" id="action">Create / Reset</button>
</form>
<br>
{{.error}}
<div class="msg-area" style="width:350px"></div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#info").delay(3000).fadeOut();
});
function pushAlert(message, cssClass){
var html = '';
html += '<div class="alert '+cssClass+' alert-dismissable">';
html += '<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> ';
html += message+'</div>';
return html
}
$("#action").on('click',function(){
var data = $("#myform").serialize();
var url = "{{.weburl}}setupaction";
var cssclass = "";
$.post(url, data)
.done(function(res){
$.each(res[0],function(key, value){
if (value.status == "0"){
cssclass = "alert-danger";
}else{
cssclass = "alert-success";
}
html = pushAlert(value.message, cssclass);
$(".msg-area").append(html)
})
})
})
</script>
{{template "template.footer"}} {{ end }}