-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c810d92
commit 6a38019
Showing
7 changed files
with
229 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const express = require(`express`); | ||
const router = express.Router(); | ||
const Project = require(`../models/Project`); | ||
const Feature = require(`../models/Feature`); | ||
const FeatureStatus = require(`../models/FeatureStatus`); | ||
let totalProjects = 0; | ||
let totalFeatures = 0; | ||
let totalIssuesSolved = 0; | ||
|
||
router.get(`/`, (req, res) => { | ||
Project.findAll(async function (results) { | ||
if (!results || results !== null) { | ||
totalProjects = results.length; | ||
} | ||
}); | ||
|
||
Feature.findAll(async function (features) { | ||
totalFeatures = 0; | ||
features.forEach((feature) => { | ||
if (feature.FeatureStatusID !== FeatureStatus.STATUS.CLOSED) { | ||
totalFeatures++; | ||
} | ||
}); | ||
}); | ||
|
||
Feature.findAll(async function (features) { | ||
totalIssuesSolved = 0; | ||
features.forEach((feature) => { | ||
if (feature.FeatureStatusID === FeatureStatus.STATUS.CLOSED) { | ||
totalIssuesSolved++; | ||
} | ||
}); | ||
}); | ||
|
||
res.render("admin/dashboard", { | ||
totalProjects: totalProjects, | ||
totalFeatures: totalFeatures, | ||
totalIssuesSolved: totalIssuesSolved, | ||
}); | ||
}); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="row-db"> | ||
<div class="column-db"> | ||
<div class="card-db"> | ||
<p><i class="fa fa fa-lightbulb-o i-size" aria-hidden="true"></i></p> | ||
<h3>{{totalProjects}}</h3> | ||
<p>Projects</p> | ||
</div> | ||
</div> | ||
|
||
<div class="column-db"> | ||
<div class="card-db"> | ||
<p><i class="fa fa-folder-open-o i-size" aria-hidden="true"></i></p> | ||
<h3>{{totalFeatures}}</h3> | ||
<p>New Features</p> | ||
</div> | ||
</div> | ||
|
||
<div class="column-db"> | ||
<div class="card-db"> | ||
<p><i class="fa fa-bug i-size" aria-hidden="true"></i></p> | ||
<h3>0</h3> | ||
<p>Bugs Reported</p> | ||
</div> | ||
</div> | ||
|
||
<div class="column-db"> | ||
<div class="card-db"> | ||
<p><i class="fa fa-check i-size"></i></p> | ||
<h3>{{totalIssuesSolved}}</h3> | ||
<p>Issues Solved</p> | ||
</div> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters