interface adjustments for apikey interaction
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
This commit is contained in:
25
templates/Sparkle/api_keys/keys_key.tpl
vendored
25
templates/Sparkle/api_keys/keys_key.tpl
vendored
@@ -3,10 +3,10 @@
|
||||
{$adminCustomerLink}
|
||||
</td>
|
||||
<td>
|
||||
{$row['apikey']}
|
||||
<span id="apikey-{$row['id']}" data-id="{$row['id']}" title="{$lng['apikeys']['clicktoview']}">{$row['_apikey']}</span>
|
||||
</td>
|
||||
<td>
|
||||
{$row['secret']}
|
||||
<span id="secret-{$row['id']}" data-id="{$row['id']}" title="{$lng['apikeys']['clicktoview']}">{$row['_secret']}</span>
|
||||
</td>
|
||||
<td>
|
||||
{$row['allowed_from']}
|
||||
@@ -23,5 +23,24 @@
|
||||
<a href="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'delete', 'id' => $row['id']))}">
|
||||
<img src="templates/{$theme}/assets/img/icons/delete.png" alt="{$lng['panel']['delete']}" title="{$lng['panel']['delete']}" />
|
||||
</a>
|
||||
<div id="dialog-{$row['id']}" title="API-key / Secret" class="hidden api-dialog">
|
||||
<form action="{$linker->getLink(array('section' => 'apikeys'))}" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<input type="hidden" name="id" value="{$row['id']}"/>
|
||||
<table class="full hl">
|
||||
<tr>
|
||||
<th>API-key</th><td><input type="text" value="{$row['apikey']}" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Secret</th><td><input type="text" value="{$row['secret']}" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lng['apikeys']['allowed_from']}<br><small>{$lng['apikeys']['allowed_from_help']}</small></th><td><input type="text" name="allowed_from" value="{$row['allowed_from']}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lng['apikeys']['valid_until']}<br><small>{$lng['apikeys']['valid_until_help']}</small></th><td><input type="text" name="valid_until" value="{$row['valid_until']}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
8
templates/Sparkle/api_keys/keys_list.tpl
vendored
8
templates/Sparkle/api_keys/keys_list.tpl
vendored
@@ -34,11 +34,11 @@
|
||||
<table class="full hl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>API-keys</th>
|
||||
<th>{$lng['login']['username']}</th>
|
||||
<th>API-key</th>
|
||||
<th>Secret</th>
|
||||
<th>Allowed from</th>
|
||||
<th>Valid until</th>
|
||||
<th>{$lng['apikeys']['allowed_from']}</th>
|
||||
<th>{$lng['apikeys']['valid_until']}</th>
|
||||
<th>{$lng['panel']['options']}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
45
templates/Sparkle/assets/js/apikey.js
vendored
Normal file
45
templates/Sparkle/assets/js/apikey.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
function editApikey(id) {
|
||||
var sid = getUrlParameter('s');
|
||||
var page = getUrlParameter('page');
|
||||
|
||||
var apikey_id = $('#dialog-' + id + ' input[name="id"]').val();
|
||||
var allowed_from = $('#dialog-' + id + ' input[name="allowed_from"]').val();
|
||||
var valid_until = $('#dialog-' + id + ' input[name="valid_until"]').val();
|
||||
|
||||
$.ajax({
|
||||
url: "admin_index.php?s="+sid+"&page="+page+"&action=jqEditApiKey",
|
||||
type: "POST",
|
||||
data: {
|
||||
id: apikey_id, allowed_from: allowed_from, valid_until: valid_until
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
$('#dialog-' + id).dialog("close");
|
||||
location.reload();
|
||||
},
|
||||
error: function(a, b) {
|
||||
console.log(a, b);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("span[id|='apikey'], span[id|='secret']").click(function() {
|
||||
var id = $(this).attr('data-id');
|
||||
$('#dialog-' + id).dialog({
|
||||
modal : true,
|
||||
buttons : {
|
||||
Ok : function() {
|
||||
editApikey(id);
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
width : 800
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
15
templates/Sparkle/assets/js/domains.js
vendored
15
templates/Sparkle/assets/js/domains.js
vendored
@@ -1,20 +1,5 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* disable unusable php-configuration by customer settings
|
||||
*/
|
||||
|
||||
16
templates/Sparkle/assets/js/main.js
vendored
16
templates/Sparkle/assets/js/main.js
vendored
@@ -5,6 +5,22 @@ function twoDigits(value) {
|
||||
return value;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Scroll to top
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 100) {
|
||||
|
||||
2
templates/Sparkle/config.json
vendored
2
templates/Sparkle/config.json
vendored
@@ -1 +1 @@
|
||||
{"variants":{"default":{"css":["main.css"],"js":["main.js"],"description":"Default"},"froxlor":{"css":["main.css","froxlor.css"],"js":["main.js"],"description":"Froxlor"}},"author":"Roman Schmerold"}
|
||||
{"variants":{"default":{"css":["main.css"],"js":["main.js", "apikey.js"],"description":"Default"},"froxlor":{"css":["main.css","froxlor.css"],"js":["main.js", "apikey.js"],"description":"Froxlor"}},"author":"Roman Schmerold"}
|
||||
|
||||
Reference in New Issue
Block a user