refactor(app): split HTTP responsibilities and own state before recovery

This commit is contained in:
abaishu0730 committed 2026-10-19 08:59:35 +08:00
1 parent 098fec1007
commit 54e5bafd86
13 files changed
+430 -264

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
const path=require('node:path');
const {previewAsset,PREVIEW_CSP}=require('../modules/storage/preview-assets.cjs');
function createAssets(){
const webRoot=require('../shared/paths.cjs').WEB_ROOT;
const assets={
'/':{path:path.join(webRoot,'index.html'),type:'text/html'},
'/app.js':{path:path.join(webRoot,'app.js'),type:'text/javascript'},
'/workspace.js':{path:path.join(webRoot,'modules/workspace/view.js'),type:'text/javascript'},
'/bpm.js':{path:path.join(webRoot,'modules/bpm/view.js'),type:'text/javascript'},
'/mail.js':{path:path.join(webRoot,'modules/mail/view.js'),type:'text/javascript'},
'/orders.js':{path:path.join(webRoot,'modules/bpm/arrivals.js'),type:'text/javascript'},
'/storage.js':{path:path.join(webRoot,'modules/storage/view.js'),type:'text/javascript'},
'/storage-preview.html':{path:path.join(webRoot,'modules/storage/preview.html'),type:'text/html',preview:true},
'/storage-preview.js':{path:path.join(webRoot,'modules/storage/preview.js'),type:'text/javascript',preview:true},
'/storage-preview-office.js':{path:path.join(webRoot,'modules/storage/preview-office.js'),type:'text/javascript',preview:true},
'/storage-preview-host.js':{path:path.join(webRoot,'modules/storage/preview-host.js'),type:'text/javascript'},
'/storage-preview.css':{path:path.join(webRoot,'modules/storage/preview.css'),type:'text/css',preview:true},
'/notifications.js':{path:path.join(webRoot,'modules/notifications/view.js'),type:'text/javascript'},
'/assistant.js':{path:path.join(webRoot,'modules/assistant/view.js'),type:'text/javascript'},
'/health.js':{path:path.join(webRoot,'modules/health/view.js'),type:'text/javascript'},
'/app.css':{path:path.join(webRoot,'app.css'),type:'text/css'},
'/vendor/tabler.css':{path:require.resolve('@tabler/core/dist/css/tabler.min.css'),type:'text/css'},
'/vendor/tabler.js':{path:require.resolve('@tabler/core/dist/js/tabler.min.js'),type:'text/javascript'}
};
return route=>assets[route]||previewAsset(route);
}
module.exports={createAssets,PREVIEW_CSP};