36 lines
2.9 KiB
JavaScript
36 lines
2.9 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.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-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'},
|
|
'/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-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'},
|
|
'/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'}
|
|
};
|
|
return route=>assets[route]||previewAsset(route);
|
|
}
|
|
module.exports={createAssets,PREVIEW_CSP};
|