add config editor elements to ihr web
parent
c80f692089
commit
51a2cc9a45
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Screenless Office - config file editor</title>
|
||||
<style type="text/css" media="screen">
|
||||
#editor {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>The Screenless Office</h3>
|
||||
<h4> edit config file <em>$cfgfile</em></h4>
|
||||
<div id="editor">$cfgdata</div>
|
||||
<form id="cfgform" action="/config/$bureau" method="post">
|
||||
<input type="hidden" value="$cfgdata" name="cfgdata_field" id="cfgdata_field" />
|
||||
<input type="submit" value="Save" name="operation" onclick="saveConfig()">
|
||||
</form>
|
||||
|
||||
#BUTTON
|
||||
|
||||
#FIELD for CFGDATA and CFGFILE
|
||||
#JAVASCRIPT to confirm and submit data
|
||||
|
||||
<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/monokai");
|
||||
editor.session.setMode("ace/mode/$mode");
|
||||
function saveConfig(){
|
||||
let cfgdata_field = document.getElementById("cfgdata_field");
|
||||
cfgdata_field.value = editor.getValue();
|
||||
if(confirm("Really overwrite $cfgfile?")){
|
||||
document.forms[0].submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue