diff --git a/.vscode/launch.json b/.vscode/launch.json index acc0c19c..a313677e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,14 +8,14 @@ "type": "node", "request": "launch", "name": "Launch Server", - "program": "${workspaceRoot}\\server\\index.js", + "program": "${workspaceRoot}/server/index.js", "outFiles": [] }, { "type": "node", "request": "launch", "name": "Launch Program", - "program": "${workspaceRoot}\\client:start", + "program": "${workspaceRoot}/client:start", "outFiles": [] }, { diff --git a/server/routes/api.js b/server/routes/api.js index 17626477..7d68da25 100644 --- a/server/routes/api.js +++ b/server/routes/api.js @@ -88,7 +88,7 @@ router.get('/dashboards/:id', (req, res) => { if (dashboardFile) { let filePath = path.join(privateDashboard, dashboardFile); let stats = fs.statSync(filePath); - if (stats.isFile()) { + if (stats.isFile() && filePath.endsWith('.js')) { let content = fs.readFileSync(filePath, 'utf8'); // Ensuing this dashboard is loaded into the dashboards array on the page @@ -135,7 +135,7 @@ router.get('/templates/:id', (req, res) => { if (dashboardFile) { let filePath = path.join(preconfDashboard, dashboardFile); let stats = fs.statSync(filePath); - if (stats.isFile()) { + if (stats.isFile() && filePath.endsWith('.js')) { let content = fs.readFileSync(filePath, 'utf8'); // Ensuing this dashboard is loaded into the dashboards array on the page diff --git a/src/actions/ConfigurationsActions.ts b/src/actions/ConfigurationsActions.ts index 3e722752..dab3b33e 100644 --- a/src/actions/ConfigurationsActions.ts +++ b/src/actions/ConfigurationsActions.ts @@ -23,9 +23,9 @@ class ConfigurationsActions extends AbstractActions implements IConfigurationsAc let dashboards: IDashboardConfig[] = (window as any)['dashboardDefinitions']; let templates: IDashboardConfig[] = (window as any)['dashboardTemplates']; - if (!dashboards || !dashboards.length) { - return this.failure(new Error('Could not load configuration')); - } + // if (!dashboards || !dashboards.length) { + // return this.failure(new Error('Could not load configuration')); + // } return dispatcher({ dashboards, templates }); });