Compare commits
1 Commits
4a69b85cd2
...
89c0a87118
Author | SHA1 | Date |
---|---|---|
Evan | 89c0a87118 |
|
@ -98,6 +98,7 @@ func main() {
|
||||||
mux.Handle("/", k)
|
mux.Handle("/", k)
|
||||||
|
|
||||||
g := guard.New()
|
g := guard.New()
|
||||||
|
g.Skip = guard.SkipStatic
|
||||||
|
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: flagAddr,
|
Addr: flagAddr,
|
||||||
|
|
|
@ -18,9 +18,11 @@
|
||||||
<div class='columns'>
|
<div class='columns'>
|
||||||
<div class='column col-md-12'>
|
<div class='column col-md-12'>
|
||||||
<button id='submit' class='tiny'>Submit</button>
|
<button id='submit' class='tiny'>Submit</button>
|
||||||
<button id='load' class='secondary tiny'>Load</button>
|
<button id='load' class='secondary tiny'>Restore</button>
|
||||||
<button id='download' class='secondary tiny'>Download</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>
|
<a id="downloadAnchorElem" style="display:none"></a>
|
||||||
|
<button id='download' class='secondary tiny'>Download</button>
|
||||||
<span id='valid_indicator' class='label'></span>
|
<span id='valid_indicator' class='label'></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
9
main.js
9
main.js
|
@ -77,4 +77,13 @@ import 'spectre.css/dist/spectre-icons.min.css'
|
||||||
dlAnchorElem.setAttribute('download', AppName+'.json');
|
dlAnchorElem.setAttribute('download', AppName+'.json');
|
||||||
dlAnchorElem.click();
|
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
|
@ -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>
|
Loading…
Reference in New Issue