mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove systemInfo from directory browser
This commit is contained in:
parent
cc1c78091b
commit
725c24a478
2 changed files with 5 additions and 30 deletions
|
@ -11,15 +11,6 @@ import '../formdialog.scss';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
import alert from '../alert';
|
import alert from '../alert';
|
||||||
|
|
||||||
function getSystemInfo() {
|
|
||||||
return systemInfo ? Promise.resolve(systemInfo) : ApiClient.getPublicSystemInfo().then(
|
|
||||||
info => {
|
|
||||||
systemInfo = info;
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDialogClosed() {
|
function onDialogClosed() {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
}
|
}
|
||||||
|
@ -83,25 +74,14 @@ function getItem(cssClass, type, path, name) {
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEditorHtml(options, systemInfo) {
|
function getEditorHtml(options) {
|
||||||
let html = '';
|
let html = '';
|
||||||
html += '<div class="formDialogContent scrollY">';
|
html += '<div class="formDialogContent scrollY">';
|
||||||
html += '<div class="dialogContentInner dialog-content-centered" style="padding-top:2em;">';
|
html += '<div class="dialogContentInner dialog-content-centered" style="padding-top:2em;">';
|
||||||
if (!options.pathReadOnly && (options.instruction || systemInfo.OperatingSystem)) {
|
if (!options.pathReadOnly && options.instruction) {
|
||||||
const instruction = options.instruction ? `${escapeHtml(options.instruction)}<br/><br/>` : '';
|
const instruction = options.instruction ? `${escapeHtml(options.instruction)}<br/><br/>` : '';
|
||||||
html += '<div class="infoBanner" style="margin-bottom:1.5em;">';
|
html += '<div class="infoBanner" style="margin-bottom:1.5em;">';
|
||||||
html += instruction;
|
html += instruction;
|
||||||
if (systemInfo.OperatingSystem.toLowerCase() === 'bsd') {
|
|
||||||
html += '<br/>';
|
|
||||||
html += '<br/>';
|
|
||||||
html += globalize.translate('MessageDirectoryPickerBSDInstruction');
|
|
||||||
html += '<br/>';
|
|
||||||
} else if (systemInfo.OperatingSystem.toLowerCase() === 'linux') {
|
|
||||||
html += '<br/>';
|
|
||||||
html += '<br/>';
|
|
||||||
html += globalize.translate('MessageDirectoryPickerLinuxInstruction');
|
|
||||||
html += '<br/>';
|
|
||||||
}
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
html += '<form style="margin:auto;">';
|
html += '<form style="margin:auto;">';
|
||||||
|
@ -234,7 +214,6 @@ function getDefaultPath(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let systemInfo;
|
|
||||||
class DirectoryBrowser {
|
class DirectoryBrowser {
|
||||||
currentDialog;
|
currentDialog;
|
||||||
|
|
||||||
|
@ -249,10 +228,8 @@ class DirectoryBrowser {
|
||||||
if (options.includeFiles != null) {
|
if (options.includeFiles != null) {
|
||||||
fileOptions.includeFiles = options.includeFiles;
|
fileOptions.includeFiles = options.includeFiles;
|
||||||
}
|
}
|
||||||
Promise.all([getSystemInfo(), getDefaultPath(options)]).then(
|
getDefaultPath(options).then(
|
||||||
responses => {
|
fetchedInitialPath => {
|
||||||
const fetchedSystemInfo = responses[0];
|
|
||||||
const fetchedInitialPath = responses[1];
|
|
||||||
const dlg = dialogHelper.createDialog({
|
const dlg = dialogHelper.createDialog({
|
||||||
size: 'small',
|
size: 'small',
|
||||||
removeOnClose: true,
|
removeOnClose: true,
|
||||||
|
@ -270,7 +247,7 @@ class DirectoryBrowser {
|
||||||
html += escapeHtml(options.header || '') || globalize.translate('HeaderSelectPath');
|
html += escapeHtml(options.header || '') || globalize.translate('HeaderSelectPath');
|
||||||
html += '</h3>';
|
html += '</h3>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += getEditorHtml(options, fetchedSystemInfo);
|
html += getEditorHtml(options);
|
||||||
dlg.innerHTML = html;
|
dlg.innerHTML = html;
|
||||||
initEditor(dlg, options, fileOptions);
|
initEditor(dlg, options, fileOptions);
|
||||||
dlg.addEventListener('close', onDialogClosed);
|
dlg.addEventListener('close', onDialogClosed);
|
||||||
|
|
|
@ -1082,8 +1082,6 @@
|
||||||
"MessageContactAdminToResetPassword": "Please contact your system administrator to reset your password.",
|
"MessageContactAdminToResetPassword": "Please contact your system administrator to reset your password.",
|
||||||
"MessageCreateAccountAt": "Create an account at {0}",
|
"MessageCreateAccountAt": "Create an account at {0}",
|
||||||
"MessageDeleteTaskTrigger": "Are you sure you wish to delete this task trigger?",
|
"MessageDeleteTaskTrigger": "Are you sure you wish to delete this task trigger?",
|
||||||
"MessageDirectoryPickerBSDInstruction": "For BSD, you may need to set up storage within your 'FreeNAS Jail' so Jellyfin can access your media.",
|
|
||||||
"MessageDirectoryPickerLinuxInstruction": "For Linux on Arch Linux, CentOS, Debian, Fedora, openSUSE, or Ubuntu, you must grant the service user at least read access to your storage locations.",
|
|
||||||
"MessageDownloadQueued": "Download queued.",
|
"MessageDownloadQueued": "Download queued.",
|
||||||
"MessageEnablingOptionLongerScans": "Enabling this option may result in significantly longer library scans.",
|
"MessageEnablingOptionLongerScans": "Enabling this option may result in significantly longer library scans.",
|
||||||
"MessageFileReadError": "There was an error reading the file. Please try again.",
|
"MessageFileReadError": "There was an error reading the file. Please try again.",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue