mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #4654 from jellyfin/release-10.8.z
Add confirmation for 3rd party repos
Original-merge: 331fa87216
Merged-by: Bill Thornton <thornbill@users.noreply.github.com>
Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
2ce9988498
commit
b372953671
4 changed files with 54 additions and 12 deletions
|
@ -34,7 +34,9 @@
|
||||||
<div class="readOnlyContent">
|
<div class="readOnlyContent">
|
||||||
<div is="emby-collapse" title="${HeaderDeveloperInfo}">
|
<div is="emby-collapse" title="${HeaderDeveloperInfo}">
|
||||||
<div class="collapseContent">
|
<div class="collapseContent">
|
||||||
<p id="developer"></p>
|
<p>${LabelDeveloper}: <span id="developer"></span></p>
|
||||||
|
<p>${LabelRepositoryName}: <span id="repositoryName"></span></p>
|
||||||
|
<p>${LabelRepositoryUrl}: <span id="repositoryUrl"></span></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,16 @@ function renderPackage(pkg, installedPlugins, page) {
|
||||||
|
|
||||||
$('#description', page).text(pkg.description);
|
$('#description', page).text(pkg.description);
|
||||||
$('#developer', page).text(pkg.owner);
|
$('#developer', page).text(pkg.owner);
|
||||||
|
// This is a hack; the repository name and URL should be part of the global values
|
||||||
|
// for the plugin, not each individual version. So we just use the top (latest)
|
||||||
|
// version to get this information. If it's missing (no versions), then say so.
|
||||||
|
if (pkg.versions.length) {
|
||||||
|
$('#repositoryName', page).text(pkg.versions[0].repositoryName);
|
||||||
|
$('#repositoryUrl', page).text(pkg.versions[0].repositoryUrl);
|
||||||
|
} else {
|
||||||
|
$('#repositoryName', page).text(globalize.translate('Unknown'));
|
||||||
|
$('#repositoryUrl', page).text(globalize.translate('Unknown'));
|
||||||
|
}
|
||||||
|
|
||||||
if (installedPlugin) {
|
if (installedPlugin) {
|
||||||
const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '<strong>' + installedPlugin.Version + '</strong>');
|
const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '<strong>' + installedPlugin.Version + '</strong>');
|
||||||
|
@ -80,7 +90,7 @@ function alertText(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function performInstallation(page, name, guid, version) {
|
function performInstallation(page, name, guid, version) {
|
||||||
const developer = $('#developer', page).html().toLowerCase();
|
const repositoryUrl = $('#repositoryUrl', page).html().toLowerCase();
|
||||||
|
|
||||||
const alertCallback = function () {
|
const alertCallback = function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
@ -93,7 +103,9 @@ function performInstallation(page, name, guid, version) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (developer !== 'jellyfin') {
|
// Check the repository URL for the official Jellyfin repository domain, or
|
||||||
|
// present the warning for 3rd party plugins.
|
||||||
|
if (!repositoryUrl.startsWith('https://repo.jellyfin.org/')) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
let msg = globalize.translate('MessagePluginInstallDisclaimer');
|
let msg = globalize.translate('MessagePluginInstallDisclaimer');
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
|
|
|
@ -2,6 +2,7 @@ import loading from '../../../../components/loading/loading';
|
||||||
import libraryMenu from '../../../../scripts/libraryMenu';
|
import libraryMenu from '../../../../scripts/libraryMenu';
|
||||||
import globalize from '../../../../scripts/globalize';
|
import globalize from '../../../../scripts/globalize';
|
||||||
import dialogHelper from '../../../../components/dialogHelper/dialogHelper';
|
import dialogHelper from '../../../../components/dialogHelper/dialogHelper';
|
||||||
|
import confirm from '../../../../components/confirm/confirm';
|
||||||
|
|
||||||
import '../../../../elements/emby-button/emby-button';
|
import '../../../../elements/emby-button/emby-button';
|
||||||
import '../../../../elements/emby-checkbox/emby-checkbox';
|
import '../../../../elements/emby-checkbox/emby-checkbox';
|
||||||
|
@ -166,14 +167,36 @@ export default function(view) {
|
||||||
dialog.querySelector('.newPluginForm').addEventListener('submit', e => {
|
dialog.querySelector('.newPluginForm').addEventListener('submit', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
repositories.push({
|
const repositoryUrl = dialog.querySelector('#txtRepositoryUrl').value.toLowerCase();
|
||||||
Name: dialog.querySelector('#txtRepositoryName').value,
|
|
||||||
Url: dialog.querySelector('#txtRepositoryUrl').value,
|
const alertCallback = function () {
|
||||||
Enabled: true
|
repositories.push({
|
||||||
});
|
Name: dialog.querySelector('#txtRepositoryName').value,
|
||||||
|
Url: dialog.querySelector('#txtRepositoryUrl').value,
|
||||||
|
Enabled: true
|
||||||
|
});
|
||||||
|
saveList(view);
|
||||||
|
dialogHelper.close(dialog);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check the repository URL for the official Jellyfin repository domain, or
|
||||||
|
// present the warning for 3rd party plugins.
|
||||||
|
if (!repositoryUrl.startsWith('https://repo.jellyfin.org/')) {
|
||||||
|
let msg = globalize.translate('MessageRepositoryInstallDisclaimer');
|
||||||
|
msg += '<br/>';
|
||||||
|
msg += '<br/>';
|
||||||
|
msg += globalize.translate('PleaseConfirmRepositoryInstallation');
|
||||||
|
|
||||||
|
confirm(msg, globalize.translate('HeaderConfirmRepositoryInstallation')).then(function () {
|
||||||
|
alertCallback();
|
||||||
|
}).catch(() => {
|
||||||
|
console.debug('repository not installed');
|
||||||
|
dialogHelper.close(dialog);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alertCallback();
|
||||||
|
}
|
||||||
|
|
||||||
saveList(view);
|
|
||||||
dialogHelper.close(dialog);
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -337,6 +337,7 @@
|
||||||
"HeaderCodecProfileHelp": "Codec profiles indicate the limitations of a device when playing specific codecs. If a limitation applies then the media will be transcoded, even if the codec is configured for direct playback.",
|
"HeaderCodecProfileHelp": "Codec profiles indicate the limitations of a device when playing specific codecs. If a limitation applies then the media will be transcoded, even if the codec is configured for direct playback.",
|
||||||
"HeaderConfigureRemoteAccess": "Set up Remote Access",
|
"HeaderConfigureRemoteAccess": "Set up Remote Access",
|
||||||
"HeaderConfirmPluginInstallation": "Confirm Plugin Installation",
|
"HeaderConfirmPluginInstallation": "Confirm Plugin Installation",
|
||||||
|
"HeaderConfirmRepositoryInstallation": "Confirm Plugin Repository Installation",
|
||||||
"HeaderConfirmProfileDeletion": "Confirm Profile Deletion",
|
"HeaderConfirmProfileDeletion": "Confirm Profile Deletion",
|
||||||
"HeaderConfirmRevokeApiKey": "Revoke API Key",
|
"HeaderConfirmRevokeApiKey": "Revoke API Key",
|
||||||
"HeaderConnectionFailure": "Connection Failure",
|
"HeaderConnectionFailure": "Connection Failure",
|
||||||
|
@ -612,6 +613,7 @@
|
||||||
"LabelDefaultUser": "Default user",
|
"LabelDefaultUser": "Default user",
|
||||||
"LabelDefaultUserHelp": "Determine which user library should be displayed on connected devices. This can be overridden for each device using profiles.",
|
"LabelDefaultUserHelp": "Determine which user library should be displayed on connected devices. This can be overridden for each device using profiles.",
|
||||||
"LabelDeinterlaceMethod": "Deinterlacing method",
|
"LabelDeinterlaceMethod": "Deinterlacing method",
|
||||||
|
"LabelDeveloper": "Developer",
|
||||||
"LabelDeviceDescription": "Device description",
|
"LabelDeviceDescription": "Device description",
|
||||||
"LabelDidlMode": "DIDL mode",
|
"LabelDidlMode": "DIDL mode",
|
||||||
"LabelDisableCustomCss": "Disable custom CSS code for theming/branding provided from the server.",
|
"LabelDisableCustomCss": "Disable custom CSS code for theming/branding provided from the server.",
|
||||||
|
@ -1099,11 +1101,12 @@
|
||||||
"MessagePleaseEnsureInternetMetadata": "Please ensure downloading of internet metadata is enabled.",
|
"MessagePleaseEnsureInternetMetadata": "Please ensure downloading of internet metadata is enabled.",
|
||||||
"MessagePleaseWait": "Please wait. This may take a minute.",
|
"MessagePleaseWait": "Please wait. This may take a minute.",
|
||||||
"MessagePluginConfigurationRequiresLocalAccess": "To set up this plugin please sign in to your local server directly.",
|
"MessagePluginConfigurationRequiresLocalAccess": "To set up this plugin please sign in to your local server directly.",
|
||||||
"MessagePluginInstallDisclaimer": "Plugins built by community members are a great way to enhance your experience with additional features and benefits. Before installing, please be aware of the effects they may have on your server, such as longer library scans, additional background processing, and decreased system stability.",
|
"MessagePluginInstallDisclaimer": "WARNING: Installing a third party plugin carries risks. It may contain unstable or malicious code, and may change at any time. Only install plugins from authors that you trust, and please be aware of the potential effects it may have, including external service queries, longer library scans, or additional background processing.",
|
||||||
"MessagePluginInstalled": "The plugin has been successfully installed. The server will need to be restarted for changes to take effect.",
|
"MessagePluginInstalled": "The plugin has been successfully installed. The server will need to be restarted for changes to take effect.",
|
||||||
"MessagePluginInstallError": "An error occurred while installing the plugin.",
|
"MessagePluginInstallError": "An error occurred while installing the plugin.",
|
||||||
"MessageReenableUser": "See below to reenable",
|
"MessageReenableUser": "See below to reenable",
|
||||||
"MessageRenameMediaFolder": "Renaming a media library will cause all metadata to be lost, proceed with caution.",
|
"MessageRenameMediaFolder": "Renaming a media library will cause all metadata to be lost, proceed with caution.",
|
||||||
|
"MessageRepositoryInstallDisclaimer": "WARNING: Installing a third party plugin repository carries risks. It may contain unstable or malicious code, and may change at any time. Only install repositories from authors that you trust.",
|
||||||
"MessageSent": "Message sent.",
|
"MessageSent": "Message sent.",
|
||||||
"MessageSyncPlayCreateGroupDenied": "Permission required to create a group.",
|
"MessageSyncPlayCreateGroupDenied": "Permission required to create a group.",
|
||||||
"MessageSyncPlayDisabled": "SyncPlay disabled.",
|
"MessageSyncPlayDisabled": "SyncPlay disabled.",
|
||||||
|
@ -1318,6 +1321,7 @@
|
||||||
"PlayNextEpisodeAutomatically": "Play next episode automatically",
|
"PlayNextEpisodeAutomatically": "Play next episode automatically",
|
||||||
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the '+' button in 'Folders' section.",
|
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the '+' button in 'Folders' section.",
|
||||||
"PleaseConfirmPluginInstallation": "Please click OK to confirm you've read the above and wish to proceed with the plugin installation.",
|
"PleaseConfirmPluginInstallation": "Please click OK to confirm you've read the above and wish to proceed with the plugin installation.",
|
||||||
|
"PleaseConfirmRepositoryInstallation": "Please click OK to confirm you've read the above and wish to proceed with the plugin repository installation.",
|
||||||
"PleaseEnterNameOrId": "Please enter a name or an external ID.",
|
"PleaseEnterNameOrId": "Please enter a name or an external ID.",
|
||||||
"PleaseRestartServerName": "Please restart Jellyfin on {0}.",
|
"PleaseRestartServerName": "Please restart Jellyfin on {0}.",
|
||||||
"PleaseSelectTwoItems": "Please select at least two items.",
|
"PleaseSelectTwoItems": "Please select at least two items.",
|
||||||
|
@ -1710,5 +1714,6 @@
|
||||||
"MediaInfoDvBlSignalCompatibilityId": "DV bl signal compatibility id",
|
"MediaInfoDvBlSignalCompatibilityId": "DV bl signal compatibility id",
|
||||||
"Unreleased": "Not yet released",
|
"Unreleased": "Not yet released",
|
||||||
"LabelTonemappingMode": "Tone mapping mode",
|
"LabelTonemappingMode": "Tone mapping mode",
|
||||||
"TonemappingModeHelp": "Select the tone mapping mode. If you experience blown out highlights try switching to the RGB mode."
|
"TonemappingModeHelp": "Select the tone mapping mode. If you experience blown out highlights try switching to the RGB mode.",
|
||||||
|
"Unknown": "Unknown"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue