mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Reports - Code cleanup, Added user image to Activities log, Export update
This commit is contained in:
parent
b1f6f8486a
commit
3190337abf
2 changed files with 61 additions and 17 deletions
|
@ -74,8 +74,8 @@
|
||||||
<div id="exportReportBox">
|
<div id="exportReportBox">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label>${HeaderExport}</label>
|
<label>${HeaderExport}</label>
|
||||||
<button type="button" name="btnReportExportCsv" id="btnReportExportCsv" data-icon="arrow-d">CSV</button>
|
|
||||||
<button type="button" name="btnReportExportExcel" id="btnReportExportExcel" data-icon="arrow-d">Excel</button>
|
<button type="button" name="btnReportExportExcel" id="btnReportExportExcel" data-icon="arrow-d">Excel</button>
|
||||||
|
<button type="button" name="btnReportExportCsv" id="btnReportExportCsv" data-icon="arrow-d">CSV</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
IncludeItemTypes: "Movie",
|
IncludeItemTypes: "Movie",
|
||||||
HasQueryLimit: true,
|
HasQueryLimit: true,
|
||||||
GroupBy: "None",
|
GroupBy: "None",
|
||||||
ReportView: "ReportData"
|
ReportView: "ReportData",
|
||||||
|
DisplayType: "Screen",
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTable(result) {
|
function getTable(result) {
|
||||||
|
@ -21,19 +22,21 @@
|
||||||
result.Headers.map(function (header) {
|
result.Headers.map(function (header) {
|
||||||
var cellHtml = '<th data-priority="' + 'persist' + '">';
|
var cellHtml = '<th data-priority="' + 'persist' + '">';
|
||||||
|
|
||||||
if (header.SortField) {
|
if (header.ShowHeaderLabel) {
|
||||||
cellHtml += '<a class="lnkColumnSort" href="#" data-sortfield="' + header.SortField + '" style="text-decoration:underline;">';
|
if (header.SortField) {
|
||||||
}
|
cellHtml += '<a class="lnkColumnSort" href="#" data-sortfield="' + header.SortField + '" style="text-decoration:underline;">';
|
||||||
|
}
|
||||||
|
|
||||||
cellHtml += (header.Name || ' ');
|
cellHtml += (header.Name || ' ');
|
||||||
if (header.SortField) {
|
if (header.SortField) {
|
||||||
cellHtml += '</a>';
|
cellHtml += '</a>';
|
||||||
if (header.SortField === defaultSortBy) {
|
if (header.SortField === defaultSortBy) {
|
||||||
|
|
||||||
if (query.SortOrder === "Descending") {
|
if (query.SortOrder === "Descending") {
|
||||||
cellHtml += '<span style="font-weight:bold;margin-left:5px;vertical-align:top;font-size:14px">↓</span>';
|
cellHtml += '<span style="font-weight:bold;margin-left:5px;vertical-align:top;font-size:14px">↓</span>';
|
||||||
} else {
|
} else {
|
||||||
cellHtml += '<span style="font-weight:bold;margin-left:5px;vertical-align:top;font-size:14px;">↑</span>';
|
cellHtml += '<span style="font-weight:bold;margin-left:5px;vertical-align:top;font-size:14px;">↑</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,6 +128,49 @@
|
||||||
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "LockDataImage":
|
||||||
|
if (rRow.HasLockData) {
|
||||||
|
html += '<img src="css/images/editor/lock.png" style="width:18px"/>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "UnidentifiedImage":
|
||||||
|
if (rRow.IsUnidentified) {
|
||||||
|
html += '<div class="libraryReportIndicator"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "TagsPrimaryImage":
|
||||||
|
if (!rRow.HasImageTagsPrimary) {
|
||||||
|
html += '<a href="edititemimages.html?id=' + rRow.Id + '"><img src="css/images/editor/missingprimaryimage.png" title="Missing primary image." style="width:18px"/></a>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "TagsBackdropImage":
|
||||||
|
if (!rRow.HasImageTagsBackdrop) {
|
||||||
|
if (rRow.RowType !== "Episode" && rRow.RowType !== "Season" && rRow.MediaType !== "Audio" && rRow.RowType !== "TvChannel" && rRow.RowType !== "MusicAlbum") {
|
||||||
|
html += '<a href="edititemimages.html?id=' + rRow.Id + '"><img src="css/images/editor/missingbackdrop.png" title="Missing backdrop image." style="width:18px"/></a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "TagsLogoImage":
|
||||||
|
if (!rRow.HasImageTagsLogo) {
|
||||||
|
if (rRow.RowType === "Movie" || rRow.RowType === "Trailer" || rRow.RowType === "Series" || rRow.RowType === "MusicArtist" || rRow.RowType === "BoxSet") {
|
||||||
|
html += '<a href="edititemimages.html?id=' + rRow.Id + '"><img src="css/images/editor/missinglogo.png" title="Missing logo image." style="width:18px"/></a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "UserPrimaryImage":
|
||||||
|
if (rRow.UserId) {
|
||||||
|
var userImage = ApiClient.getUserImageUrl(rRow.UserId, {
|
||||||
|
height: 24,
|
||||||
|
type: 'Primary'
|
||||||
|
|
||||||
|
});
|
||||||
|
if (userImage) {
|
||||||
|
html += '<img src="' + userImage + '" />';
|
||||||
|
} else {
|
||||||
|
html += '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "StatusImage":
|
case "StatusImage":
|
||||||
if (rRow.HasLockData) {
|
if (rRow.HasLockData) {
|
||||||
html += '<img src="css/images/editor/lock.png" style="width:18px"/>';
|
html += '<img src="css/images/editor/lock.png" style="width:18px"/>';
|
||||||
|
@ -226,7 +272,6 @@
|
||||||
var url = ApiClient.getUrl("Reports/Items/Download", query);
|
var url = ApiClient.getUrl("Reports/Items/Download", query);
|
||||||
|
|
||||||
if (url) {
|
if (url) {
|
||||||
e.preventDefault(); //stop the browser from following
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,7 +289,7 @@
|
||||||
$('#selectReportGroup', page).append('<option value="None"></option>');
|
$('#selectReportGroup', page).append('<option value="None"></option>');
|
||||||
|
|
||||||
result.map(function (header) {
|
result.map(function (header) {
|
||||||
if (header.Visible && header.CanGroup) {
|
if ((header.DisplayType === "Screen" || header.DisplayType === "ScreenExport") && header.CanGroup) {
|
||||||
if (header.FieldName.length > 0) {
|
if (header.FieldName.length > 0) {
|
||||||
var option = '<option value="' + header.FieldName + '">' + header.Name + '</option>';
|
var option = '<option value="' + header.FieldName + '">' + header.Name + '</option>';
|
||||||
$('#selectReportGroup', page).append(option);
|
$('#selectReportGroup', page).append(option);
|
||||||
|
@ -479,7 +524,6 @@
|
||||||
|
|
||||||
var filtersLoaded;
|
var filtersLoaded;
|
||||||
function reloadFiltersIfNeeded(page) {
|
function reloadFiltersIfNeeded(page) {
|
||||||
|
|
||||||
if (!filtersLoaded) {
|
if (!filtersLoaded) {
|
||||||
|
|
||||||
filtersLoaded = true;
|
filtersLoaded = true;
|
||||||
|
@ -1023,7 +1067,7 @@
|
||||||
var delimiter = '|';
|
var delimiter = '|';
|
||||||
result.map(function (item) {
|
result.map(function (item) {
|
||||||
|
|
||||||
if (item.Visible)
|
if ((item.DisplayType === "Screen" || item.DisplayType === "ScreenExport"))
|
||||||
filters = filters ? (filters + delimiter + item.FieldName) : item.FieldName;
|
filters = filters ? (filters + delimiter + item.FieldName) : item.FieldName;
|
||||||
});
|
});
|
||||||
if (!itemQuery.ReportColumns)
|
if (!itemQuery.ReportColumns)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue