just for rename
This commit is contained in:
55
app/views/admin/data/configuration.html
Normal file
55
app/views/admin/data/configuration.html
Normal file
@ -0,0 +1,55 @@
|
||||
{{template "admin/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">Mongodb Tool Configuration</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<form id="data_form">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label>mongodump path</label>
|
||||
<input type="text" class="form-control" name="mongodumpPath" value="{{.str.mongodumpPath}}" placeholder="">
|
||||
Please input the bin mongodump's absolute path
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>mongorestore path</label>
|
||||
<input type="text" class="form-control" name="mongorestorePath" value="{{.str.mongorestorePath}}" placeholder="">
|
||||
Please input the bin mongorestore's absolute path
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="submit" class="btn btn-success btn-s-xs">Submit</button>
|
||||
</footer>
|
||||
</section>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "admin/footer.html" .}}
|
||||
<script src="/public/admin/js/jquery-validation-1.13.0/jquery.validate.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
init_validator("#data_form");
|
||||
|
||||
$("#submit").click(function(e){
|
||||
e.preventDefault();
|
||||
var t = this;
|
||||
if($("#data_form").valid()) {
|
||||
$(t).button('loading');
|
||||
ajaxPost("/adminSetting/mongodb", getFormJsonData("data_form"), function(ret){
|
||||
$(t).button('reset')
|
||||
if(!ret.Ok) {
|
||||
art.alert(ret.Msg)
|
||||
} else {
|
||||
art.tips("Success");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{{template "admin/end.html" .}}
|
115
app/views/admin/data/index.html
Normal file
115
app/views/admin/data/index.html
Normal file
@ -0,0 +1,115 @@
|
||||
{{template "admin/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">Backup & Restore</h3></div>
|
||||
|
||||
<style>
|
||||
.break-all {
|
||||
word-break:break-all; /*支持IE,chrome,FF不支持*/
|
||||
word-wrap:break-word;/*支持IE,chrome,FF*/
|
||||
}
|
||||
</style>
|
||||
<section class="panel panel-default">
|
||||
|
||||
<div class="row wrapper">
|
||||
<div class="col-sm-5 m-b-xs">
|
||||
<button class="btn btn-primary backup-btn">Backup</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped b-t b-light">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="136px">
|
||||
Date
|
||||
</th>
|
||||
<th width="">
|
||||
Remark
|
||||
</th>
|
||||
<th>
|
||||
Path
|
||||
</th>
|
||||
<th width="170px">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $each := .backups}}
|
||||
<tr>
|
||||
<td>
|
||||
{{$each.createdTime|unixDatetime}}
|
||||
</td>
|
||||
<td>
|
||||
<textarea class="remark" data-id="{{$each.createdTime}}">{{$each.remark}}</textarea>
|
||||
</td>
|
||||
<td class="break-all">
|
||||
{{$each.path}}
|
||||
</td>
|
||||
<td>
|
||||
<button href="#" class="btn btn-sm btn-danger restore-btn" data-id="{{$each.createdTime}}">Restore</button>
|
||||
<a class="btn btn-sm btn-default download-attach" href="/adminData/download?createdTime={{$each.createdTime}}" target="_blank" title="Download" data-id=""><i class="fa fa-download"></i></a>
|
||||
<button class="btn btn-sm btn-warning delete-btn" title="Delete" data-id="{{$each.createdTime}}"><i class="fa fa-trash-o"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{template "admin/footer.html" .}}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".backup-btn").click(function(){
|
||||
ajaxGet("/adminData/backup", {}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
art.tips("Success");
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert(ret.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
// 还原
|
||||
$(".restore-btn").click(function() {
|
||||
var createdTime = $(this).data("id");
|
||||
art.confirm("Are you sure? <br />Note. Leanote will do the following steps: <br />1)Backup the current database first. <br />2) And then delete the database. <br />3) Restore database from the selected version.", function() {
|
||||
ajaxGet("/adminData/restore", {createdTime: createdTime}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
art.tips("Success");
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert(ret.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$(".delete-btn").click(function() {
|
||||
var createdTime = $(this).data("id");
|
||||
art.confirm("Are you sure?", function() {
|
||||
ajaxGet("/adminData/delete", {createdTime: createdTime}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
art.tips("Success");
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert(ret.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$(".remark").change(function() {
|
||||
var createdTime = $(this).data("id");
|
||||
var remark = $(this).val();
|
||||
ajaxPost("/adminData/updateRemark", {createdTime: createdTime, remark: remark}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
art.tips("Update Remark Success");
|
||||
} else {
|
||||
art.alert(ret.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{{template "admin/end.html" .}}
|
Reference in New Issue
Block a user