mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update sync display
This commit is contained in:
parent
89dfdfb110
commit
4f2ce200aa
8 changed files with 354 additions and 27 deletions
|
@ -1,4 +1,30 @@
|
|||
define(['loading', 'apphost', 'localsync'], function (loading, appHost) {
|
||||
define(['loading', 'apphost', 'globalize', 'syncJobList', 'events', 'localsync'], function (loading, appHost, globalize, syncJobList, events) {
|
||||
|
||||
function initSupporterInfo(view, params) {
|
||||
|
||||
view.querySelector('.btnSyncSupporter').addEventListener('click', function () {
|
||||
|
||||
requirejs(["registrationservices"], function (registrationServices) {
|
||||
registrationServices.validateFeature('sync');
|
||||
});
|
||||
});
|
||||
|
||||
view.querySelector('.supporterPromotion .mainText').innerHTML = globalize.translate('HeaderSyncRequiresSupporterMembership');
|
||||
|
||||
var apiClient = ApiClient;
|
||||
apiClient.getPluginSecurityInfo().then(function (regInfo) {
|
||||
|
||||
if (regInfo.IsMBSupporter) {
|
||||
view.querySelector('.supporterPromotionContainer').classList.add('hide');
|
||||
} else {
|
||||
view.querySelector('.supporterPromotionContainer').classList.remove('hide');
|
||||
}
|
||||
|
||||
}, function () {
|
||||
|
||||
view.querySelector('.supporterPromotionContainer').classList.remove('hide');
|
||||
});
|
||||
}
|
||||
|
||||
return function (view, params) {
|
||||
|
||||
|
@ -51,18 +77,31 @@
|
|||
view.querySelector('.localSyncStatus').classList.add('hide');
|
||||
}
|
||||
|
||||
initSupporterInfo(view, params);
|
||||
var mySyncJobList = new syncJobList({
|
||||
isLocalSync: params.mode === 'offline',
|
||||
serverId: ApiClient.serverId(),
|
||||
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
||||
element: view.querySelector('.syncActivity')
|
||||
});
|
||||
|
||||
events.on(mySyncJobList, 'jobedit', function (e, jobId, serverId) {
|
||||
|
||||
Dashboard.navigate('mysyncjob.html?id=' + jobId);
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforeshow', function () {
|
||||
var page = this;
|
||||
|
||||
refreshSyncStatus(page);
|
||||
refreshSyncStatus(view);
|
||||
|
||||
interval = setInterval(function () {
|
||||
refreshSyncStatus(page);
|
||||
}, 5000);
|
||||
if (appHost.supports('sync')) {
|
||||
interval = setInterval(function () {
|
||||
refreshSyncStatus(view);
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforehide', function () {
|
||||
var page = this;
|
||||
|
||||
loading.hide();
|
||||
|
||||
|
@ -71,5 +110,10 @@
|
|||
interval = null;
|
||||
}
|
||||
});
|
||||
|
||||
view.addEventListener('viewdestroy', function () {
|
||||
|
||||
mySyncJobList.destroy();
|
||||
});
|
||||
};
|
||||
});
|
|
@ -125,9 +125,12 @@
|
|||
html += getPluginHtml(topPlugins[i], options, installedPlugins);
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<br/>';
|
||||
html += '<br/>';
|
||||
}
|
||||
|
||||
var hasOpenTag = false;
|
||||
currentCategory = null;
|
||||
|
||||
if (options.showCategory === false) {
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
|
@ -148,7 +151,6 @@
|
|||
html += '</div>';
|
||||
html += '<br/>';
|
||||
html += '<br/>';
|
||||
html += '<br/>';
|
||||
}
|
||||
|
||||
html += '<div class="detailSectionHeader">' + category + '</div>';
|
||||
|
|
|
@ -1285,6 +1285,7 @@ var AppInfo = {};
|
|||
|
||||
define("libjass", [bowerPath + "/libjass/libjass.min", "css!" + bowerPath + "/libjass/libjass"], returnFirstDependency);
|
||||
|
||||
define("syncJobList", ["components/syncjoblist/syncjoblist"], returnFirstDependency);
|
||||
define("appfooter", ["components/appfooter/appfooter"], returnFirstDependency);
|
||||
define("dockedtabs", ["components/dockedtabs/dockedtabs"], returnFirstDependency);
|
||||
define("directorybrowser", ["components/directorybrowser/directorybrowser"], returnFirstDependency);
|
||||
|
|
|
@ -410,7 +410,7 @@
|
|||
}];
|
||||
}
|
||||
|
||||
$(document).on('pageinit', ".syncActivityPage", function () {
|
||||
$(document).on('pageinit', "#syncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -422,7 +422,7 @@
|
|||
});
|
||||
$('.supporterPromotion .mainText', page).html(Globalize.translate('HeaderSyncRequiresSupporterMembership'));
|
||||
|
||||
}).on('pageshow', ".syncActivityPage", function () {
|
||||
}).on('pageshow', "#syncActivityPage", function () {
|
||||
|
||||
if (this.id == 'syncActivityPage') {
|
||||
LibraryMenu.setTabs('syncadmin', 0, getTabs);
|
||||
|
@ -450,7 +450,7 @@
|
|||
startListening(page);
|
||||
Events.on(ApiClient, "websocketmessage", onWebSocketMessage);
|
||||
|
||||
}).on('pagebeforehide', ".syncActivityPage", function () {
|
||||
}).on('pagebeforehide', "#syncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue