58 lines
5.4 KiB
JavaScript
58 lines
5.4 KiB
JavaScript
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'},
|
|
'/account.js':{path:path.join(webRoot,'modules/account/view.js'),type:'text/javascript'},
|
|
'/page-lifecycle.js':{path:path.join(webRoot,'modules/navigation/lifecycle.js'),type:'text/javascript'},
|
|
'/navigation.js':{path:path.join(webRoot,'modules/navigation/view.js'),type:'text/javascript'},
|
|
'/workspace.js':{path:path.join(webRoot,'modules/workspace/view.js'),type:'text/javascript'},
|
|
'/bpm-sync-settings.js':{path:path.join(webRoot,'modules/bpm/sync-settings.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'},
|
|
'/mail-template-editor.js':{path:path.join(webRoot,'modules/mail/template-editor.js'),type:'text/javascript'},
|
|
'/mail-history.js':{path:path.join(webRoot,'modules/mail/history.js'),type:'text/javascript'},
|
|
'/orders.js':{path:path.join(webRoot,'modules/bpm/arrivals.js'),type:'text/javascript'},
|
|
'/record-state.js':{path:path.join(webRoot,'modules/records/state.js'),type:'text/javascript'},
|
|
'/record-table.js':{path:path.join(webRoot,'modules/records/controller.js'),type:'text/javascript'},
|
|
'/record-ui.js':{path:path.join(webRoot,'modules/records/shared.js'),type:'text/javascript'},
|
|
'/pdf-records.js':{path:path.join(webRoot,'modules/records/pdf.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},
|
|
'/order-rules-editor.js':{path:path.join(webRoot,'modules/order-rules/editor.js'),type:'text/javascript'},
|
|
'/order-rules-scopes.js':{path:path.join(webRoot,'modules/order-rules/scope-editor.js'),type:'text/javascript'},
|
|
'/order-rules-resources.js':{path:path.join(webRoot,'modules/order-rules/resources.js'),type:'text/javascript'},
|
|
'/order-rules-import.js':{path:path.join(webRoot,'modules/order-rules/import-view.js'),type:'text/javascript'},
|
|
'/order-rules-import-worker.js':{path:path.join(webRoot,'modules/order-rules/import-worker.js'),type:'text/javascript'},
|
|
'/order-rules-import-parser.js':{path:path.join(webRoot,'modules/order-rules/import-parser.js'),type:'text/javascript'},
|
|
'/vendor/sheetjs.js':{path:require.resolve('xlsx/dist/xlsx.full.min.js'),type:'text/javascript'},
|
|
'/order-rules-preview.js':{path:path.join(webRoot,'modules/order-rules/preview.js'),type:'text/javascript'},
|
|
'/order-execution.js':{path:path.join(webRoot,'modules/order-rules/execution.js'),type:'text/javascript'},
|
|
'/field-sample-picker.js':{path:path.join(webRoot,'modules/field-mappings/sample-picker.js'),type:'text/javascript'},
|
|
'/field-recognition-panel.js':{path:path.join(webRoot,'modules/field-mappings/recognition-panel.js'),type:'text/javascript'},
|
|
'/field-mappings.js':{path:path.join(webRoot,'modules/field-mappings/view.js'),type:'text/javascript'},
|
|
'/field-mappings.css':{path:path.join(webRoot,'modules/field-mappings/view.css'),type:'text/css'},
|
|
'/order-notifications-shared.js':{path:path.join(webRoot,'modules/order-notifications/shared.js'),type:'text/javascript'},
|
|
'/modules/order-notifications/detail.js':{path:path.join(webRoot,'modules/order-notifications/detail.js'),type:'text/javascript'},
|
|
'/modules/order-notifications/records.js':{path:path.join(webRoot,'modules/order-notifications/records.js'),type:'text/javascript'},
|
|
'/order-notifications.js':{path:path.join(webRoot,'modules/order-notifications/view.js'),type:'text/javascript'},
|
|
'/order-rules.js':{path:path.join(webRoot,'modules/order-rules/view.js'),type:'text/javascript'},
|
|
'/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'},
|
|
'/vendor/tom-select.js':{path:require.resolve('@tabler/core/dist/libs/tom-select/dist/js/tom-select.base.min.js'),type:'text/javascript'},
|
|
'/vendor/tom-select.css':{path:require.resolve('@tabler/core/dist/libs/tom-select/dist/css/tom-select.bootstrap5.min.css'),type:'text/css'}
|
|
};
|
|
return route=>assets[route]||previewAsset(route);
|
|
}
|
|
module.exports={createAssets,PREVIEW_CSP};
|