Files
pyTorrent/pytorrent/static/js/app.js
T
Mateusz Gruszczyński a49133de8d split js
2026-05-31 13:12:00 +02:00

87 lines
3.0 KiB
JavaScript

import { stateSource } from './state.js';
import { torrentsSource } from './torrents.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 { torrentDetailsSource } from './torrentDetails.js';
import { modalsSource } from './modals.js';
import { rssSource } from './rss.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 { plannerSource } from './planner.js';
import { pollerSource } from './poller.js';
import { profilesSource } from './profiles.js';
import { dashboardSource } from './dashboard.js';
import { chartsSource } from './charts.js';
import { operationLogsSource } from './operationLogs.js';
import { bootstrapSource } from './bootstrap.js';
export const moduleSources = [
stateSource,
torrentsSource,
mobileSource,
messagesSource,
torrentAddSource,
apiSource,
createTorrentSource,
torrentDetailsSource,
modalsSource,
rssSource,
smartQueueSource,
rtorrentConfigSource,
appearancePreferencesSource,
peerRefreshSource,
automationRulesSource,
cleanupToolsSource,
appDiagnosticsSource,
footerPreferencesSource,
liveSpeedStatsSource,
statusBarSource,
preferencesToolsSource,
diskMonitorSource,
portCheckActionsSource,
appStatusSource,
torrentStatsSource,
toolUiHelpersSource,
authUsersSource,
plannerSource,
dashboardSource,
operationLogsSource,
pollerSource,
profilesSource,
chartsSource,
bootstrapSource,
];
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();
}