mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge branch master into standalone
This commit is contained in:
commit
e60f01b3a3
50 changed files with 860 additions and 300 deletions
|
@ -5,6 +5,7 @@
|
|||
<div class="sectionTitleContainer sectionTitleContainer-cards flex align-items-center">
|
||||
<h2 class="sectionTitle sectionTitle-cards">${HeaderDevices}</h2>
|
||||
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://docs.jellyfin.org/general/server/devices.html">${Help}</a>
|
||||
<button id="deviceDeleteAll" is="emby-button" type="button" class="raised button-alt">${DeleteAll}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div is="emby-itemscontainer" class="devicesList vertical-wrap" data-multiselect="false"></div>
|
||||
|
|
|
@ -10,10 +10,32 @@ import 'cardStyle';
|
|||
|
||||
/* eslint-disable indent */
|
||||
|
||||
// Local cache of loaded
|
||||
let deviceIds = [];
|
||||
|
||||
function canDelete(deviceId) {
|
||||
return deviceId !== ApiClient.deviceId();
|
||||
}
|
||||
|
||||
function deleteAllDevices(page) {
|
||||
const msg = globalize.translate('DeleteDevicesConfirmation');
|
||||
|
||||
require(['confirm'], async function (confirm) {
|
||||
await confirm({
|
||||
text: msg,
|
||||
title: globalize.translate('HeaderDeleteDevices'),
|
||||
confirmText: globalize.translate('ButtonDelete'),
|
||||
primary: 'delete'
|
||||
});
|
||||
|
||||
loading.show();
|
||||
await Promise.all(
|
||||
deviceIds.filter(canDelete).map((id) => ApiClient.deleteDevice(id))
|
||||
);
|
||||
loadData(page);
|
||||
});
|
||||
}
|
||||
|
||||
function deleteDevice(page, id) {
|
||||
const msg = globalize.translate('DeleteDeviceConfirmation');
|
||||
|
||||
|
@ -23,16 +45,10 @@ import 'cardStyle';
|
|||
title: globalize.translate('HeaderDeleteDevice'),
|
||||
confirmText: globalize.translate('Delete'),
|
||||
primary: 'delete'
|
||||
}).then(function () {
|
||||
}).then(async () => {
|
||||
loading.show();
|
||||
ApiClient.ajax({
|
||||
type: 'DELETE',
|
||||
url: ApiClient.getUrl('Devices', {
|
||||
Id: id
|
||||
})
|
||||
}).then(function () {
|
||||
loadData(page);
|
||||
});
|
||||
await ApiClient.deleteDevice(id);
|
||||
loadData(page);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -129,6 +145,7 @@ import 'cardStyle';
|
|||
loading.show();
|
||||
ApiClient.getJSON(ApiClient.getUrl('Devices')).then(function (result) {
|
||||
load(page, result.Items);
|
||||
deviceIds = result.Items.map((device) => device.Id);
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
@ -145,6 +162,9 @@ import 'cardStyle';
|
|||
view.addEventListener('viewshow', function () {
|
||||
loadData(this);
|
||||
});
|
||||
}
|
||||
|
||||
view.querySelector('#deviceDeleteAll').addEventListener('click', function() {
|
||||
deleteAllDevices(view);
|
||||
});
|
||||
}
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -649,7 +649,10 @@ function reloadFromItem(instance, page, params, item, user) {
|
|||
const itemBirthLocation = page.querySelector('#itemBirthLocation');
|
||||
|
||||
if (item.Type == 'Person' && item.ProductionLocations && item.ProductionLocations.length) {
|
||||
const gmap = '<a is="emby-linkbutton" class="button-link textlink" target="_blank" href="https://maps.google.com/maps?q=' + item.ProductionLocations[0] + '">' + item.ProductionLocations[0] + '</a>';
|
||||
let gmap = item.ProductionLocations[0];
|
||||
if (!layoutManager.tv && appHost.supports('externallinks')) {
|
||||
gmap = `<a is="emby-linkbutton" class="button-link textlink" target="_blank" href="https://maps.google.com/maps?q=${gmap}">${gmap}</a>`;
|
||||
}
|
||||
itemBirthLocation.classList.remove('hide');
|
||||
itemBirthLocation.innerHTML = globalize.translate('BirthPlaceValue', gmap);
|
||||
} else {
|
||||
|
@ -1066,7 +1069,7 @@ function renderDetails(page, item, apiClient, context, isStatic) {
|
|||
reloadUserDataButtons(page, item);
|
||||
|
||||
// Don't allow redirection to other websites from the TV layout
|
||||
if (!layoutManager.tv) {
|
||||
if (!layoutManager.tv && appHost.supports('externallinks')) {
|
||||
renderLinks(page, item);
|
||||
}
|
||||
|
||||
|
@ -1724,7 +1727,7 @@ function renderCollectionItemType(page, parentItem, type, items) {
|
|||
html += '</div>';
|
||||
const collectionItems = page.querySelector('.collectionItems');
|
||||
collectionItems.insertAdjacentHTML('beforeend', html);
|
||||
imageLoader.lazyChildren(collectionItems);
|
||||
imageLoader.lazyChildren(collectionItems.lastChild);
|
||||
}
|
||||
|
||||
function renderMusicVideos(page, item, user) {
|
||||
|
|
|
@ -248,7 +248,7 @@ import 'emby-itemscontainer';
|
|||
tabContent.querySelector('.btnNewCollection').addEventListener('click', () => {
|
||||
import('collectionEditor').then(({default: collectionEditor}) => {
|
||||
const serverId = ApiClient.serverInfo().Id;
|
||||
new collectionEditor.showEditor({
|
||||
new collectionEditor({
|
||||
items: [],
|
||||
serverId: serverId
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'emby-button';
|
|||
if (!pageData) {
|
||||
pageData = data[key] = {
|
||||
query: {
|
||||
SortBy: 'SortName',
|
||||
SortBy: 'Random',
|
||||
SortOrder: 'Ascending',
|
||||
IncludeItemTypes: 'Movie',
|
||||
Recursive: true,
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'emby-button';
|
|||
if (!pageData) {
|
||||
pageData = data[key] = {
|
||||
query: {
|
||||
SortBy: 'SortName',
|
||||
SortBy: 'Random',
|
||||
SortOrder: 'Ascending',
|
||||
IncludeItemTypes: 'Series',
|
||||
Recursive: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue