You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/share/templates/peering/preferences.tt

87 lines
3.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

[% site_config.title = c.loc('Peer Host "[_1]" - Preferences',server.name) -%]
[%
helper.messages = messages;
helper.edit_preference = edit_preference;
helper.preference = preference;
helper.preference_meta = preference_meta;
helper.preference_values = preference_values;
helper.pref_groups = pref_groups;
helper.form = form;
helper.base_uri = c.uri_for_action("/peering/servers_preferences_root",
[c.req.captures.0, c.req.captures.1]);
helper.rewrite_rule_sets = rwr_sets;
helper.header_rule_sets = hdr_sets;
helper.man_aip_grp_rs = man_aip_grp_rs;
helper.sound_sets = sound_sets;
helper.top_buttons = [
{ name = c.loc('Back'), uri = c.uri_for(group.id, "servers"), icon = 'icon-arrow-left' },
{ name = c.loc('Flash Dialogic'), uri = "javascript:call_flash_dialogic('" _ c.uri_for_action("/peering/servers_flash_dialogic", [c.req.captures.0, c.req.captures.1]) _ "');", icon = 'icon-star' },
];
PROCESS 'helpers/pref_table.tt';
%]
<script type="text/javascript">
function call_flash_dialogic (url) {
console.log("calling", url);
$("#ngcp-livelog").text('');
var last_response_len = false;
$.ajax(url, {
xhrFields: {
onprogress: function(e)
{
var this_response, response = e.currentTarget.response;
if(last_response_len === false)
{
this_response = response;
last_response_len = response.length;
}
else
{
this_response = response.substring(last_response_len);
last_response_len = response.length;
}
$("#ngcp-livelog").append(this_response);
$("#ngcp-livelog")[0].scrollIntoView(false);
//console.log(this_response);
}
}
})
.done(function(data)
{
console.log('Done');
$("#ngcp-livelog").append("\nDone.\nYou can close this window now.");
$("#ngcp-livelog")[0].scrollIntoView(false);
})
.fail(function(data)
{
console.log('Error: ', data);
$("#ngcp-livelog").append("\nError.");
$("#ngcp-livelog")[0].scrollIntoView(false);
});
console.log('Request Sent');
$("#ngcp-test-modal").modal('show');
}
</script>
<div id="ngcp-test-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Flashing Dialogic ...</h3>
</div>
<div class="modal-body">
<p>Please Wait ...</p>
<pre id="ngcp-livelog"></pre>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]