MT#3977 Add option in status msg to manually sync.

agranig/peering-route
Andreas Granig 13 years ago
parent 853e9e5388
commit 3c3cfff80b

@ -456,6 +456,7 @@
-%]
<script>
$('input#sync').click(function(e) {
var full_params = "";
var timer; var loaded = 0;
var ip = $('form#devsyncform input#ip').val();
$('form#devsyncform .form_messages').empty();
@ -471,7 +472,7 @@
clearTimeout(timer);
if(!loaded) {
loaded = 1;
$('form#devsyncform .form_messages').prepend('<div class="alert alert-success" style="margin:10px">Successfully pushed provisioning settings to device</div>');
$('form#devsyncform .form_messages').prepend('<div class="alert alert-success" style="margin:10px">Successfully pushed provisioning settings to device. If the device does not reboot, try to sync it <a target="_blank" href="' + autoprov_uri + '?' + full_params + '">manually</a></div>');
} else {
console.log("iframe loaded after timer");
}
@ -494,8 +495,12 @@
var input = document.createElement("input");
input.type = "hidden";
input.name = "[% p.key %]";
if(full_params.length > 0)
full_params += '&';
full_params += input.name;
[%# IF p.value.defined -%]
input.value = "[% p.value %]";
full_params += '=' + input.value;
[%# END -%]
$('form#devsyncform').append(input);
[% END -%]
@ -506,7 +511,7 @@
if(loaded) {
console.log("iframe already loaded, we're fine?");
} else {
$('form#devsyncform .form_messages').prepend('<div class="alert alert-error" style="margin:10px">Failed to push provisioning settings to device. Is the IP Address reachable from your browser?</div>');
$('form#devsyncform .form_messages').prepend('<div class="alert alert-error" style="margin:10px">Failed to push provisioning settings to device. Is the IP Address reachable from your browser? Try to trigger the sync <a target="_blank" href="' + autoprov_uri + '">manually</a></div>');
}
loaded = 1;
// TODO: get iframe by id

Loading…
Cancel
Save