1
0
Fork 0
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:
viown 2024-10-03 07:59:27 +03:00
parent cc1c78091b
commit 725c24a478
2 changed files with 5 additions and 30 deletions

View file

@ -11,15 +11,6 @@ import '../formdialog.scss';
import '../../elements/emby-button/emby-button';
import alert from '../alert';
function getSystemInfo() {
return systemInfo ? Promise.resolve(systemInfo) : ApiClient.getPublicSystemInfo().then(
info => {
systemInfo = info;
return info;
}
);
}
function onDialogClosed() {
loading.hide();
}
@ -83,25 +74,14 @@ function getItem(cssClass, type, path, name) {
return html;
}
function getEditorHtml(options, systemInfo) {
function getEditorHtml(options) {
let html = '';
html += '<div class="formDialogContent scrollY">';
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/>` : '';
html += '<div class="infoBanner" style="margin-bottom:1.5em;">';
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 += '<form style="margin:auto;">';
@ -234,7 +214,6 @@ function getDefaultPath(options) {
}
}
let systemInfo;
class DirectoryBrowser {
currentDialog;
@ -249,10 +228,8 @@ class DirectoryBrowser {
if (options.includeFiles != null) {
fileOptions.includeFiles = options.includeFiles;
}
Promise.all([getSystemInfo(), getDefaultPath(options)]).then(
responses => {
const fetchedSystemInfo = responses[0];
const fetchedInitialPath = responses[1];
getDefaultPath(options).then(
fetchedInitialPath => {
const dlg = dialogHelper.createDialog({
size: 'small',
removeOnClose: true,
@ -270,7 +247,7 @@ class DirectoryBrowser {
html += escapeHtml(options.header || '') || globalize.translate('HeaderSelectPath');
html += '</h3>';
html += '</div>';
html += getEditorHtml(options, fetchedSystemInfo);
html += getEditorHtml(options);
dlg.innerHTML = html;
initEditor(dlg, options, fileOptions);
dlg.addEventListener('close', onDialogClosed);

View file

@ -1082,8 +1082,6 @@
"MessageContactAdminToResetPassword": "Please contact your system administrator to reset your password.",
"MessageCreateAccountAt": "Create an account at {0}",
"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.",
"MessageEnablingOptionLongerScans": "Enabling this option may result in significantly longer library scans.",
"MessageFileReadError": "There was an error reading the file. Please try again.",