mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
restored network browser
This commit is contained in:
parent
33d21adbe3
commit
a721a6b7af
3 changed files with 43 additions and 13 deletions
14
ApiClient.js
14
ApiClient.js
|
@ -496,6 +496,20 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets a list of network devices from the server
|
||||
*/
|
||||
self.getNetworkDevices = function () {
|
||||
|
||||
var url = self.getUrl("Environment/NetworkDevices");
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json"
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancels a package installation
|
||||
*/
|
||||
|
|
|
@ -4,9 +4,18 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
if (path) {
|
||||
$('.networkHeadline').hide();
|
||||
} else {
|
||||
$('.networkHeadline').show();
|
||||
}
|
||||
|
||||
var promise;
|
||||
|
||||
if (path) {
|
||||
if (path === "Network") {
|
||||
promise = ApiClient.getNetworkDevices();
|
||||
}
|
||||
else if (path) {
|
||||
promise = ApiClient.getDirectoryContents(path, { includeDirectories: true });
|
||||
} else {
|
||||
promise = ApiClient.getDrives();
|
||||
|
@ -34,7 +43,7 @@
|
|||
}
|
||||
|
||||
if (parentPath == '\\') {
|
||||
parentPath = "";
|
||||
parentPath = "Network";
|
||||
}
|
||||
|
||||
html += '<li><a class="lnkDirectory" data-path="' + parentPath + '" href="#">..</a></li>';
|
||||
|
@ -47,6 +56,10 @@
|
|||
html += '<li><a class="lnkDirectory" data-path="' + folder.Path + '" href="#">' + folder.Name + '</a></li>';
|
||||
}
|
||||
|
||||
if (!path) {
|
||||
html += '<li><a class="lnkDirectory" data-path="Network" href="#">Network</a></li>';
|
||||
}
|
||||
|
||||
$('#ulDirectoryPickerList', page).html(html).listview('refresh');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
@ -60,7 +73,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
window.DirectoryBrowser = function(page) {
|
||||
window.DirectoryBrowser = function (page) {
|
||||
|
||||
var self = this;
|
||||
|
||||
|
@ -84,13 +97,16 @@
|
|||
html += '<div data-role="fieldcontain" style="margin:0;">';
|
||||
html += '<label for="txtDirectoryPickerPath" class="lblDirectoryPickerPath">Current Folder:</label>';
|
||||
html += '<input id="txtDirectoryPickerPath" name="txtDirectoryPickerPath" type="text" required="required" style="font-weight:bold;" />';
|
||||
html += '<div class="directoryPickerHeadline" style="margin-top:5px;padding:.5em;display:inline-block;">Network paths can be entered manually, e.g. <b>\\\\my-server</b></div>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="height: 320px; overflow-y: auto;">';
|
||||
html += '<ul id="ulDirectoryPickerList" data-role="listview" data-inset="true" data-auto-enhanced="false"></ul>';
|
||||
|
||||
html += '<div class="directoryPickerHeadline networkHeadline" style="margin:5px 0 1em;padding:.5em;">Network paths <b>can be entered manually</b> in the event the Network button fails to locate your devices. For example, <b>\\\\my-server</b>.</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-theme="b" data-icon="ok">OK</button>';
|
||||
html += '<button type="button" data-icon="delete" onclick="$(this).parents(\'.popup\').popup(\'close\');">Cancel</button>';
|
||||
|
@ -141,7 +157,7 @@
|
|||
|
||||
};
|
||||
|
||||
self.close = function() {
|
||||
self.close = function () {
|
||||
$('#popupDirectoryPicker', page).popup("close");
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.169" targetFramework="net45" />
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.170" targetFramework="net45" />
|
||||
<package id="ServiceStack.Common" version="3.9.58" targetFramework="net45" />
|
||||
<package id="ServiceStack.Text" version="3.9.58" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue