';
+
+ html += '';
+ html += '';
+ html += ' | ';
+
+ html += '';
+ html += (item.AccessToken);
+ html += ' | ';
+
+ html += '';
+ html += (item.AppName || '');
+ html += ' | ';
+
+ html += '';
+ html += (item.DeviceName || '');
+ html += ' | ';
+
+ html += '';
+
+ var user = users.filter(function (u) {
+
+ return u.Id == item.UserId;
+ })[0];
+
+ if (user) {
+ html += user.Name;
+ }
+
+ html += ' | ';
+
+ html += '';
+
+ var date = parseISO8601Date(item.DateCreated, { toLocal: true });
+
+ html += date.toLocaleDateString() + ' ' + LibraryBrowser.getDisplayTime(date);
+
+ html += ' | ';
+
+ html += '
';
+
+ return html;
+
+ }).join('');
+
+ var elem = $('.resultBody', page).html(rows).parents('.tblApiKeys').table("refresh").trigger('create');
+
+ $('.btnRevoke', elem).on('click', function () {
+
+ revoke(page, this.getAttribute('data-token'));
+ });
+
+ Dashboard.hideLoadingMsg();
+ }
+
+ function loadData(page) {
+
+ Dashboard.showLoadingMsg();
+
+ ApiClient.getUsers().then(function (users) {
+
+ ApiClient.getJSON(ApiClient.getUrl('Auth/Keys')).then(function (result) {
+
+ renderKeys(page, result.Items, users);
+ });
+ });
+ }
+
+ function onSubmit() {
+ var form = this;
+ var page = $(form).parents('.page');
+
+ Dashboard.showLoadingMsg();
+
+ ApiClient.ajax({
+ type: "POST",
+ url: ApiClient.getUrl('Auth/Keys', {
+
+ App: $('#txtAppName', form).val()
+
+ })
+
+ }).then(function () {
+
+ $('.newKeyPanel', page).panel('close');
+
+ loadData(page);
+ });
+
+ return false;
+ }
+
+ pageIdOn('pageinit', "serverSecurityPage", function () {
+
+ var page = this;
+
+ $('.btnNewKey', page).on('click', function () {
+
+ $('.newKeyPanel', page).panel('toggle');
+
+ $('#txtAppName', page).val('').focus();
+
+ });
+
+ $('.newKeyForm').off('submit', onSubmit).on('submit', onSubmit);
+
+ });
+ pageIdOn('pagebeforeshow', "serverSecurityPage", function () {
+
+ var page = this;
+
+ loadData(page);
+ });
+
+})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/shared.js b/dashboard-ui/scripts/shared.js
index c0aafb969a..41c3ef6fec 100644
--- a/dashboard-ui/scripts/shared.js
+++ b/dashboard-ui/scripts/shared.js
@@ -1,4 +1,4 @@
-(function ($, document, LibraryBrowser, window) {
+(function ($, document, window) {
var currentItem;
@@ -87,4 +87,4 @@
});
-})(jQuery, document, LibraryBrowser, window);
\ No newline at end of file
+})(jQuery, document, window);
\ No newline at end of file
diff --git a/dashboard-ui/serversecurity.html b/dashboard-ui/serversecurity.html
new file mode 100644
index 0000000000..9d301b38f6
--- /dev/null
+++ b/dashboard-ui/serversecurity.html
@@ -0,0 +1,58 @@
+
+
+
+