diff --git a/dashboard-ui/dlnaprofile.html b/dashboard-ui/dlnaprofile.html new file mode 100644 index 0000000000..9bd503df8e --- /dev/null +++ b/dashboard-ui/dlnaprofile.html @@ -0,0 +1,39 @@ + + + + DLNA + + +
+ +
+
+ + + +
+ +
    +
  • + + +
  • + +
+
+ +
+
+ +
+ + diff --git a/dashboard-ui/dlnaprofiles.html b/dashboard-ui/dlnaprofiles.html index 4ad335cf26..74b90a696e 100644 --- a/dashboard-ui/dlnaprofiles.html +++ b/dashboard-ui/dlnaprofiles.html @@ -14,6 +14,26 @@ Profiles +
+ +
+

Custom Profiles

+
+ New +
+
+ +

Create a custom profile to target a new device or override a system profile.

+ +
+ +
+

System Profiles

+ +

System profiles are read-only. To override a system profile, create a custom profile targeting the same device.

+ +
+
diff --git a/dashboard-ui/scripts/dlnaprofile.js b/dashboard-ui/scripts/dlnaprofile.js new file mode 100644 index 0000000000..821346777f --- /dev/null +++ b/dashboard-ui/scripts/dlnaprofile.js @@ -0,0 +1,39 @@ +(function ($, document, window) { + + function loadProfile(page) { + + Dashboard.showLoadingMsg(); + + var id = getParameterByName('id'); + var url = id ? 'Dlna/Profiles/' + id : + 'Dlna/Profiles/Default'; + + $.getJSON(ApiClient.getUrl(url)).done(function (result) { + + renderProfile(page, result); + + Dashboard.hideLoadingMsg(); + }); + } + + function renderProfile(page, profile) { + + } + + $(document).on('pageshow', "#dlnaProfilePage", function () { + + var page = this; + + loadProfile(page); + + }); + + window.DlnaProfilePage = { + + onSubmit: function() { + + return false; + } + }; + +})(jQuery, document, window); diff --git a/dashboard-ui/scripts/dlnaprofiles.js b/dashboard-ui/scripts/dlnaprofiles.js index 5f282702bb..75cbe8c8fd 100644 --- a/dashboard-ui/scripts/dlnaprofiles.js +++ b/dashboard-ui/scripts/dlnaprofiles.js @@ -1 +1,115 @@ - \ No newline at end of file +(function ($, document, window) { + + function loadProfiles(page) { + + Dashboard.showLoadingMsg(); + + $.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).done(function (result) { + + renderProfiles(page, result); + + Dashboard.hideLoadingMsg(); + }); + + } + + function renderProfiles(page, profiles) { + + renderUserProfiles(page, profiles); + renderSystemProfiles(page, profiles); + } + + function renderUserProfiles(page, profiles) { + + profiles = profiles.filter(function (p) { + return p.Type == 'User'; + }); + + var html = ''; + + html += ''; + + var elem = $('.customProfiles', page).html(html).trigger('create'); + + $('.btnDeleteProfile', elem).on('click', function () { + + var id = this.getAttribute('data-profileid'); + deleteProfile(page, id); + }); + } + + function renderSystemProfiles(page, profiles) { + + profiles = profiles.filter(function (p) { + return p.Type == 'System'; + }); + + var html = ''; + + html += ''; + + $('.systemProfiles', page).html(html).trigger('create'); + } + + function deleteProfile(page, id) { + + Dashboard.confirm("Are you sure you wish to delete this profile?", "Confirm Profile Deletion", function (result) { + + if (result) { + + Dashboard.showLoadingMsg(); + + $.ajax({ + type: "DELETE", + url: ApiClient.getUrl("Dlna/Profiles/" + id) + + }).done(function () { + + Dashboard.hideLoadingMsg(); + + loadProfiles(page); + }); + } + + }); + + } + + $(document).on('pageshow', "#dlnaProfilesPage", function () { + + var page = this; + + loadProfiles(page); + + }); + +})(jQuery, document, window); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 5a16f604e8..cc95f465a4 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1118,6 +1118,10 @@ attributes.push(createAttribute("Sample Rate", stream.SampleRate + ' khz')); } + if (stream.PixelFormat) { + attributes.push(createAttribute("Pixel Format", stream.PixelFormat)); + } + if (stream.Type != "Video") { attributes.push(createAttribute("Default", (stream.IsDefault ? 'Yes' : 'No'))); }