Initial xentral_oss_20.3.c9ffacf
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
/**
|
||||
* Hide the search field and the table footer with export functions.
|
||||
* todo: check functionality and usage!
|
||||
*/
|
||||
#snapaddy_address_filter,
|
||||
#snapaddy_address_paginate,
|
||||
#snapaddy_address_paginate + .dt-buttons{display: none;}
|
||||
|
||||
#sipgate_user_form #api-test{
|
||||
text-decoration: underline;
|
||||
}
|
||||
#sipgate_user_form #api-test:hover{
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#api-test-result.api_fail{
|
||||
color: firebrick;
|
||||
}
|
||||
#api-test-result.api_success{
|
||||
color: darkgreen;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* On mouseover change the password input to text and change back
|
||||
*
|
||||
* @type {HTMLElement}
|
||||
*/
|
||||
let snapForm = document.getElementById('tabs');
|
||||
if (snapForm) {
|
||||
/*
|
||||
* Find all input fields in 'tabs' div.
|
||||
*/
|
||||
let inputs = snapForm.getElementsByTagName('input');
|
||||
for (let i=0; i<inputs.length; i++) {
|
||||
if (inputs[i].type.toLowerCase() !== "password") {
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* On mouseenter, change the type from password to text
|
||||
*/
|
||||
inputs[i].addEventListener("mouseenter", function( event ) {
|
||||
event.target.type = 'text';
|
||||
}, false);
|
||||
/*
|
||||
* On mouseout, change the type from text to password
|
||||
*/
|
||||
inputs[i].addEventListener("mouseout", function( event ) {
|
||||
event.target.type = 'password';
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
$('#sipgate_webhook').val(
|
||||
window.location.href
|
||||
.replace('=sipgate', '=callcenter&provider=sipgate')
|
||||
.replace('=edit', '=call')
|
||||
);
|
||||
|
||||
|
||||
$('#api-test').click(function (e) {
|
||||
e.preventDefault();
|
||||
console.log('api test');
|
||||
let key = $('#api-key').val();
|
||||
let resultField = $('#api-test-result');
|
||||
if (!key) {
|
||||
resultField.html('<span class="api_fail">API Key ist leer.</span>');
|
||||
return;
|
||||
}
|
||||
let url = 'index.php?module=sipgate&action=apicheck';
|
||||
resultField
|
||||
.attr('class', '')
|
||||
.html('Lädt ...');
|
||||
|
||||
$.post(url, {key: key})
|
||||
.done(function(msg, status, xhr){
|
||||
console.log(msg, status, xhr);
|
||||
console.warn(msg.key);
|
||||
console.warn(msg.class);
|
||||
if (msg.key && msg.class) {
|
||||
resultField.append('<span class="' + + '">' + msg.key + '</span>');
|
||||
resultField
|
||||
.attr('class', msg.class)
|
||||
.html(msg.key);
|
||||
} else {
|
||||
resultField
|
||||
.attr('class', 'api_fail')
|
||||
.html('Server Fehler');
|
||||
}
|
||||
})
|
||||
.fail(function(xhr, status, error) {
|
||||
resultField
|
||||
.attr('class', 'api_fail')
|
||||
.html('Der Test schlug fehl.');
|
||||
console.error(status, error, xhr);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function call(id, dummy)
|
||||
{
|
||||
$.ajax({
|
||||
url: 'index.php?module=sipgate&action=call&id='+id,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {},
|
||||
success: function(data) {
|
||||
if(data)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user