fix: #1
continuous-integration/drone/tag Build is passing Details

master v0.1.1
Evan 2021-11-27 21:53:34 +08:00
parent 072c7d04d7
commit 89c0a87118
5 changed files with 16 additions and 4 deletions

View File

@ -98,6 +98,7 @@ func main() {
mux.Handle("/", k)
g := guard.New()
g.Skip = guard.SkipStatic
server := &http.Server{
Addr: flagAddr,

View File

@ -18,9 +18,11 @@
<div class='columns'>
<div class='column col-md-12'>
<button id='submit' class='tiny'>Submit</button>
<button id='load' class='secondary tiny'>Load</button>
<button id='download' class='secondary tiny'>Download</button>
<button id='load' class='secondary tiny'>Restore</button>
<button id='upload-btn' class='secondary tiny' onclick="upload.click()">Upload</button>
<input id="upload" style="display: none" type="file">
<a id="downloadAnchorElem" style="display:none"></a>
<button id='download' class='secondary tiny'>Download</button>
<span id='valid_indicator' class='label'></span>
</div>
</div>

View File

@ -77,4 +77,13 @@ import 'spectre.css/dist/spectre-icons.min.css'
dlAnchorElem.setAttribute('download', AppName+'.json');
dlAnchorElem.click();
});
document.getElementById('upload').addEventListener('change',function(e) {
var reader = new FileReader();
reader.onload = function(event) {
var jsonObj = JSON.parse(event.target.result);
editor.setValue(jsonObj);
};
reader.readAsText(e.target.files[0]);
});
})();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<!DOCTYPE html><html><head><link rel="stylesheet" href="index.e0891ed3.css"><title>{{.AppName}}</title><style>.ace_selection{background:#7f7f00!important}</style></head><body> <div class="container" style="max-width:960px;"> <div class="columns"> <h1 class="col-md-12">{{.AppName}} Config</h1> </div> <div class="columns"> <div class="col-md-12 column"> <button id="submit" class="tiny">Submit</button> <button id="load" class="secondary tiny">Load</button> <button id="download" class="secondary tiny">Download</button> <a id="downloadAnchorElem" style="display:none"></a> <span id="valid_indicator" class="label"></span> </div> </div> <br> <div class="columns"> <div class="col-md-12 column" id="editor_holder"></div> </div> </div> <script type="module" src="index.6ef506fc.js"></script> {{.ACE_JS}} <script>let AppName="{{.AppName}}";</script> </body></html>
<!DOCTYPE html><html><head><link rel="stylesheet" href="index.e0891ed3.css"><title>{{.AppName}}</title><style>.ace_selection{background:#7f7f00!important}</style></head><body> <div class="container" style="max-width:960px;"> <div class="columns"> <h1 class="col-md-12">{{.AppName}} Config</h1> </div> <div class="columns"> <div class="col-md-12 column"> <button id="submit" class="tiny">Submit</button> <button id="load" class="secondary tiny">Restore</button> <button id="upload-btn" class="secondary tiny" onclick="upload.click()">Upload</button> <input id="upload" style="display:none" type="file"> <a id="downloadAnchorElem" style="display:none"></a> <button id="download" class="secondary tiny">Download</button> <span id="valid_indicator" class="label"></span> </div> </div> <br> <div class="columns"> <div class="col-md-12 column" id="editor_holder"></div> </div> </div> <script type="module" src="index.2ccfe3bf.js"></script> {{.ACE_JS}} <script>let AppName="{{.AppName}}";</script> </body></html>