mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
Added SCRIPT_ROOT parameter. Fixes #52.
Adds a new javascript parameter that holds the webroot of the app. This allows the the javascript calls to properly identify that they're running in a subfolder/different webroot and direct their queries there.
This commit is contained in:
parent
ff842f66e2
commit
ea79c01aff
@ -97,7 +97,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-flat btn-default pull-left"
|
||||
data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', '/admin/history');location.reload();">Clear
|
||||
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', $SCRIPT_ROOT + '/admin/history');location.reload();">Clear
|
||||
History</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -91,7 +91,7 @@
|
||||
modal.find('.modal-body p').text(info);
|
||||
modal.find('#button_revoke_confirm').click(function() {
|
||||
var postdata = {'action': 'revoke_user_privielges', 'data': username}
|
||||
applyChanges(postdata, '/admin/manageuser');
|
||||
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser');
|
||||
modal.modal('hide');
|
||||
})
|
||||
modal.modal('show');
|
||||
@ -104,7 +104,7 @@
|
||||
modal.find('.modal-body p').text(info);
|
||||
modal.find('#button_delete_confirm').click(function() {
|
||||
var postdata = {'action': 'delete_user', 'data': username}
|
||||
applyChanges(postdata, '/admin/manageuser', false, true);
|
||||
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser', false, true);
|
||||
modal.modal('hide');
|
||||
})
|
||||
modal.modal('show');
|
||||
@ -128,7 +128,7 @@
|
||||
'is_admin' : is_admin
|
||||
}
|
||||
};
|
||||
applyChanges(postdata, '/admin/manageuser');
|
||||
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -76,14 +76,14 @@
|
||||
});
|
||||
$(document.body).on('click', '.setting-toggle-button', function() {
|
||||
var setting = $(this).prop('id');
|
||||
applyChanges('','/admin/setting/' + setting + '/toggle', false, true)
|
||||
applyChanges('', $SCRIPT_ROOT + '/admin/setting/' + setting + '/toggle', false, true)
|
||||
});
|
||||
|
||||
$(document.body).on('click', '.setting-save-button', function() {
|
||||
var setting = $(this).prop('id');
|
||||
var value = $(this).parents('tr').find('#value')[0].value;
|
||||
var postdata = {'value': value};
|
||||
applyChanges(postdata, '/admin/setting/' + setting + '/edit', false, true)
|
||||
applyChanges(postdata, $SCRIPT_ROOT + '/admin/setting/' + setting + '/edit', false, true)
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -163,7 +163,9 @@
|
||||
</footer>
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
|
||||
</script>
|
||||
{% block scripts %}
|
||||
<!-- jQuery 2.2.0 -->
|
||||
<script src="{{ url_for('static', filename='adminlte2/plugins/jQuery/jQuery-2.2.0.min.js') }}"></script>
|
||||
|
@ -240,7 +240,7 @@
|
||||
});
|
||||
$(document.body).on("click", ".button_dnssec", function() {
|
||||
var domain = $(this).prop('id');
|
||||
getdnssec('/domain/' + domain + '/dnssec');
|
||||
getdnssec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -204,7 +204,7 @@
|
||||
modal.find('.modal-body p').text(info);
|
||||
modal.find('#button_apply_confirm').click(function() {
|
||||
var data = getTableData(table);
|
||||
applyChanges(data, '/domain/' + domain + '/apply', true);
|
||||
applyChanges(data, $SCRIPT_ROOT + '/domain/' + domain + '/apply', true);
|
||||
modal.modal('hide');
|
||||
})
|
||||
modal.modal('show');
|
||||
@ -253,7 +253,7 @@
|
||||
//handle update_from_master button
|
||||
$(document.body).on("click", ".button_update_from_master", function (e) {
|
||||
var domain = $(this).prop('id');
|
||||
applyChanges({'domain': domain}, '/domain/' + domain + '/update');
|
||||
applyChanges({'domain': domain}, $SCRIPT_ROOT + '/domain/' + domain + '/update');
|
||||
});
|
||||
|
||||
{% if record_helper_setting %}
|
||||
|
@ -165,7 +165,7 @@
|
||||
'enable_otp' : enable_otp
|
||||
}
|
||||
};
|
||||
applyChanges(postdata, '/user/profile');
|
||||
applyChanges(postdata, $SCRIPT_ROOT + '/user/profile');
|
||||
location.reload();
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user