Fixes in dashboard for save php ini in server
This commit is contained in:
parent
05025fbdb5
commit
56157e4adb
3 changed files with 118 additions and 29 deletions
|
|
@ -5,40 +5,84 @@
|
|||
<%block name="content">
|
||||
<h3>${_('Edit php.ini')}</h3>
|
||||
<div class="form">
|
||||
<div id="php_ini">
|
||||
<div id="php_ini" style="height:600px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<form method="post" name="save_php_ini" id="save_php_ini">
|
||||
<input type="submit" name="php_ini" value="${_('Save php.ini')}" id="php_ini" />
|
||||
</form>
|
||||
</p>
|
||||
</%block>
|
||||
<%block name="jscript_block">
|
||||
<script src=" https://cdnjs.cloudflare.com/ajax/libs/ace/1.43.3/ace.min.js"></script>
|
||||
<script>
|
||||
|
||||
$.ajax({
|
||||
url: "${url_for('phpserver_app.get_php_server', php_server_id=php_server_id)}",
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (data) {
|
||||
|
||||
console.log(data);
|
||||
|
||||
if(data.log.error) {
|
||||
|
||||
$('#php_ini').html(data.log.message);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
alert('Error: '+data.status+' '+data.statusText);
|
||||
|
||||
}
|
||||
});
|
||||
$(document).ready( function (e) {
|
||||
|
||||
$('#layer_loading').show();
|
||||
|
||||
var editor = ace.edit("php_ini");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
$.ajax({
|
||||
url: "${url_for('phpserver_app.get_php_server', php_server_id=php_server_id)}",
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
data: {},
|
||||
success: function (data) {
|
||||
|
||||
$('#layer_loading').hide();
|
||||
|
||||
console.log(data);
|
||||
|
||||
if(data.log.error) {
|
||||
|
||||
$('#php_ini').html(data.log.message);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
file=JSON.parse(data.result.message);
|
||||
|
||||
//console.log(file);
|
||||
|
||||
//$('#php_ini').html(file.file);
|
||||
//editor.setValue(file.file, -1);
|
||||
editor.session.setValue(file.file);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
$('#layer_loading').hide();
|
||||
|
||||
alert('Error: '+data.status+' '+data.statusText);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
editor = ace.edit("php_ini");
|
||||
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/ini");
|
||||
|
||||
});
|
||||
|
||||
options={'url': '${url_for("phpserver_app.save_php_ini", php_server_id=php_server_id)}', 'loading': '#layer_loading', 'success': function (data) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$('#del_phpserver').sendPost(options);
|
||||
|
||||
$('#save_php_ini').click( function (e) {
|
||||
|
||||
//console.log(editor.session.getValue());
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</%block>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue