Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Templates available on home page. Fixes #84
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlyfingers committed May 1, 2017
1 parent 78946c6 commit c43bf99
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
},
{
Expand Down
4 changes: 2 additions & 2 deletions server/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/actions/ConfigurationsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
});
Expand Down

0 comments on commit c43bf99

Please sign in to comment.