Files
pyTorrent/pytorrent/static/js/app.js
T
Mateusz Gruszczyński 1068aba11c splij all js
2026-05-31 13:30:32 +02:00

187 lines
7.6 KiB
JavaScript

import { stateCoreSource } from './stateCore.js';
import { columnStateSource } from './columnState.js';
import { runtimeStateSource } from './runtimeState.js';
import { sharedUiSource } from './sharedUi.js';
import { torrentFilterHelpersSource } from './torrentFilterHelpers.js';
import { torrentFilterUiSource } from './torrentFilterUi.js';
import { torrentTrackerFiltersSource } from './torrentTrackerFilters.js';
import { torrentTableStateSource } from './torrentTableState.js';
import { torrentActionStateSource } from './torrentActionState.js';
import { torrentRowRendererSource } from './torrentRowRenderer.js';
import { torrentTableRendererSource } from './torrentTableRenderer.js';
import { mobileSource } from './mobile.js';
import { messagesSource } from './messages.js';
import { torrentAddSource } from './torrentAdd.js';
import { apiSource } from './api.js';
import { createTorrentSource } from './createTorrent.js';
import { torrentGeneralDetailsSource } from './torrentGeneralDetails.js';
import { torrentFileDetailsSource } from './torrentFileDetails.js';
import { torrentChunkDetailsSource } from './torrentChunkDetails.js';
import { torrentPeerDetailsSource } from './torrentPeerDetails.js';
import { torrentTrackerDetailsSource } from './torrentTrackerDetails.js';
import { mobileTorrentDetailsSource } from './mobileTorrentDetails.js';
import { torrentDetailsLoaderSource } from './torrentDetailsLoader.js';
import { pathPickerToolsSource } from './pathPickerTools.js';
import { columnManagerSource } from './columnManager.js';
import { jobToolsSource } from './jobTools.js';
import { labelToolsSource } from './labelTools.js';
import { ratioToolsSource } from './ratioTools.js';
import { rssToolsSource } from './rssTools.js';
import { backupToolsSource } from './backupTools.js';
import { smartQueueSource } from './smartQueue.js';
import { rtorrentConfigSource } from './rtorrentConfig.js';
import { appearancePreferencesSource } from './appearancePreferences.js';
import { peerRefreshSource } from './peerRefresh.js';
import { automationRulesSource } from './automationRules.js';
import { cleanupToolsSource } from './cleanupTools.js';
import { appDiagnosticsSource } from './appDiagnostics.js';
import { footerPreferencesSource } from './footerPreferences.js';
import { liveSpeedStatsSource } from './liveSpeedStats.js';
import { statusBarSource } from './statusBar.js';
import { preferencesToolsSource } from './preferencesTools.js';
import { diskMonitorSource } from './diskMonitor.js';
import { portCheckActionsSource } from './portCheckActions.js';
import { appStatusSource } from './appStatus.js';
import { torrentStatsSource } from './torrentStats.js';
import { toolUiHelpersSource } from './toolUiHelpers.js';
import { authUsersSource } from './authUsers.js';
import { plannerToolsUiSource } from './plannerToolsUi.js';
import { plannerSpeedControlsSource } from './plannerSpeedControls.js';
import { plannerSettingsSource } from './plannerSettings.js';
import { plannerPreviewHistorySource } from './plannerPreviewHistory.js';
import { plannerActionsSource } from './plannerActions.js';
import { smartViewsSource } from './smartViews.js';
import { notificationCenterSource } from './notificationCenter.js';
import { diagnosticsDashboardSource } from './diagnosticsDashboard.js';
import { dashboardToolsSource } from './dashboardTools.js';
import { operationLogsSource } from './operationLogs.js';
import { pollerSettingsSource } from './pollerSettings.js';
import { toolsModalSource } from './toolsModal.js';
import { toolPaneEventsSource } from './toolPaneEvents.js';
import { rssEventsSource } from './rssEvents.js';
import { smartQueueEventsSource } from './smartQueueEvents.js';
import { backupCleanupRtconfigEventsSource } from './backupCleanupRtconfigEvents.js';
import { automationEventsSource } from './automationEvents.js';
import { labelSmartEventsSource } from './labelSmartEvents.js';
import { torrentSelectionEventsSource } from './torrentSelectionEvents.js';
import { torrentTableEventsSource } from './torrentTableEvents.js';
import { preferenceEventsSource } from './preferenceEvents.js';
import { keyboardEventsSource } from './keyboardEvents.js';
import { speedLimitControlsSource } from './speedLimitControls.js';
import { themeMobileControlsSource } from './themeMobileControls.js';
import { jobSettingsSource } from './jobSettings.js';
import { profileListSource } from './profileList.js';
import { profileFormSource } from './profileForm.js';
import { profileActionsSource } from './profileActions.js';
import { profileSelectionSource } from './profileSelection.js';
import { realtimeChartsSource } from './realtimeCharts.js';
import { trafficHistoryDataSource } from './trafficHistoryData.js';
import { trafficChartRendererSource } from './trafficChartRenderer.js';
import { initialSnapshotSource } from './initialSnapshot.js';
import { footerStatusRefreshSource } from './footerStatusRefresh.js';
import { systemStatsSocketSource } from './systemStatsSocket.js';
import { mobileSelectEventsSource } from './mobileSelectEvents.js';
import { bootstrapRuntimeSource } from './bootstrapRuntime.js';
export const moduleSources = [
stateCoreSource,
columnStateSource,
runtimeStateSource,
sharedUiSource,
torrentFilterHelpersSource,
torrentFilterUiSource,
torrentTrackerFiltersSource,
torrentTableStateSource,
torrentActionStateSource,
torrentRowRendererSource,
torrentTableRendererSource,
mobileSource,
messagesSource,
torrentAddSource,
apiSource,
createTorrentSource,
torrentGeneralDetailsSource,
torrentFileDetailsSource,
torrentChunkDetailsSource,
torrentPeerDetailsSource,
torrentTrackerDetailsSource,
mobileTorrentDetailsSource,
torrentDetailsLoaderSource,
pathPickerToolsSource,
columnManagerSource,
jobToolsSource,
labelToolsSource,
ratioToolsSource,
rssToolsSource,
backupToolsSource,
smartQueueSource,
rtorrentConfigSource,
appearancePreferencesSource,
peerRefreshSource,
automationRulesSource,
cleanupToolsSource,
appDiagnosticsSource,
footerPreferencesSource,
liveSpeedStatsSource,
statusBarSource,
preferencesToolsSource,
diskMonitorSource,
portCheckActionsSource,
appStatusSource,
torrentStatsSource,
toolUiHelpersSource,
authUsersSource,
plannerToolsUiSource,
plannerSpeedControlsSource,
plannerSettingsSource,
plannerPreviewHistorySource,
plannerActionsSource,
smartViewsSource,
notificationCenterSource,
diagnosticsDashboardSource,
dashboardToolsSource,
operationLogsSource,
pollerSettingsSource,
toolsModalSource,
toolPaneEventsSource,
rssEventsSource,
smartQueueEventsSource,
backupCleanupRtconfigEventsSource,
automationEventsSource,
labelSmartEventsSource,
torrentSelectionEventsSource,
torrentTableEventsSource,
preferenceEventsSource,
keyboardEventsSource,
speedLimitControlsSource,
themeMobileControlsSource,
jobSettingsSource,
profileListSource,
profileFormSource,
profileActionsSource,
profileSelectionSource,
realtimeChartsSource,
trafficHistoryDataSource,
trafficChartRendererSource,
initialSnapshotSource,
footerStatusRefreshSource,
systemStatsSocketSource,
mobileSelectEventsSource,
bootstrapRuntimeSource,
];
export function buildRuntimeSource(){
return `(() => {\n${moduleSources.join('\n')}\n})();\n`;
}
export function startApp(){
const runtimeSource = buildRuntimeSource();
// Keep the original shared lexical scope while loading the source from smaller ES modules.
// `io` is passed explicitly so Socket.IO remains available inside the generated runtime.
return Function('io', runtimeSource)(window.io);
}
if(typeof window !== 'undefined' && !window.PYTORRENT_DISABLE_AUTOSTART){
startApp();
}