support folder delete, prevent ghs.yml see

This commit is contained in:
codeskyblue
2018-09-18 13:35:10 +08:00
parent 40f02fba65
commit 0cacad260e
6 changed files with 79 additions and 10 deletions

View File

@@ -127,6 +127,9 @@
<span class="hidden-xs">Archive</span> Zip
<span class="glyphicon glyphicon-download-alt"></span>
</a>
<button class="btn btn-default btn-xs" v-if="auth.delete" v-on:click="deletePathConfirm(f, $event)">
<span style="color:#CC3300" class="glyphicon glyphicon-trash"></span>
</button>
</template>
<template v-if="f.type == 'file'">
<a class="btn btn-default btn-xs hidden-xs" href="/{{f.path}}?download=true">
@@ -232,7 +235,7 @@
<div class="col-md-12">
<div id="footer" class="pull-right" style="margin: 2em 1em">
<a href="https://github.com/codeskyblue/gohttpserver">gohttpserver (ver:{{version}})</a>, written by <a href="https://github.com/codeskyblue">codeskyblue</a>.
Copyright 2016-2017. go1.7
Copyright 2016-2018. go1.10
</div>
</div>
</div>

View File

@@ -251,8 +251,10 @@ var vm = new Vue({
})
},
deletePathConfirm: function (f, e) {
// confirm
e.preventDefault();
if (!window.confirm("Delete " + f.name + " ?")) {
return;
}
$.ajax({
url: pathJoin([location.pathname, f.name]),
method: 'DELETE',