';
+
+ 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/scripts/site.js b/dashboard-ui/scripts/site.js
index 5868c62238..bd9f4fe742 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1680,6 +1680,7 @@ var AppInfo = {};
window.ConnectionManager.clearData();
}
+ console.log('binding to apiclientcreated');
Events.on(ConnectionManager, 'apiclientcreated', onApiClientCreated);
if (Dashboard.isConnectMode()) {
@@ -1702,12 +1703,19 @@ var AppInfo = {};
}
} else {
+
+ console.log('loading ApiClient singleton');
+
return getRequirePromise(['apiclient']).then(function (apiClientFactory) {
+
+ console.log('creating ApiClient singleton');
+
var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio);
apiClient.enableAutomaticNetworking = false;
ConnectionManager.addApiClient(apiClient);
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
window.ApiClient = apiClient;
+ console.log('loaded ApiClient singleton');
});
}
});
@@ -1846,7 +1854,8 @@ var AppInfo = {};
browserdeviceprofile: embyWebComponentsBowerPath + "/browserdeviceprofile",
browser: embyWebComponentsBowerPath + "/browser",
qualityoptions: embyWebComponentsBowerPath + "/qualityoptions",
- connectservice: apiClientBowerPath + '/connectservice'
+ connectservice: apiClientBowerPath + '/connectservice',
+ hammer: bowerPath + "/hammerjs/hammer.min"
};
if (navigator.webkitPersistentStorage) {
@@ -1957,10 +1966,6 @@ var AppInfo = {};
define("jqmpanel", ["thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']);
- define("hammer", [bowerPath + "/hammerjs/hammer.min"], function (Hammer) {
- return Hammer;
- });
-
define("swipebox", [bowerPath + '/swipebox/src/js/jquery.swipebox.min', "css!" + bowerPath + "/swipebox/src/css/swipebox.min.css"]);
define('fetch', [bowerPath + '/fetch/fetch']);
@@ -2008,7 +2013,11 @@ var AppInfo = {};
}
if (Dashboard.isRunningInCordova() && browserInfo.android) {
- define("audiorenderer", ["scripts/htmlmediarenderer"]);
+ if (MainActivity.getChromeVersion() >= 48) {
+ define("audiorenderer", ["scripts/htmlmediarenderer"]);
+ } else {
+ define("audiorenderer", ["cordova/android/vlcplayer"]);
+ }
define("videorenderer", ["cordova/android/vlcplayer"]);
}
else if (Dashboard.isRunningInCordova() && browserInfo.safari) {
@@ -2148,7 +2157,6 @@ var AppInfo = {};
deps.push('paper-icon-button');
deps.push('paper-button');
deps.push('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js');
- deps.push('scripts/librarybrowser');
promises.push(getRequirePromise(deps));
promises.push(Globalize.ensure());
@@ -2156,6 +2164,7 @@ var AppInfo = {};
Promise.all(promises).then(function () {
+ console.log('initAfterDependencies promises resolved');
MediaController.init();
document.title = Globalize.translateDocument(document.title, 'html');
@@ -2206,6 +2215,8 @@ var AppInfo = {};
function onAppReady() {
+ console.log('Begin onAppReady');
+
var deps = [];
if (!(AppInfo.isNativeApp && browserInfo.android)) {
@@ -2248,6 +2259,7 @@ var AppInfo = {};
deps.push('scripts/sync');
deps.push('scripts/backdrops');
deps.push('scripts/librarymenu');
+ deps.push('scripts/librarybrowser');
deps.push('css!css/card.css');
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 @@
+
+
+
+