Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-261
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gamage G.G.I.V.M
2023-261
Commits
dc7e0e6e
Commit
dc7e0e6e
authored
May 24, 2023
by
Imesh Dilshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard like, dislike
parent
3e713c66
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
205 additions
and
693 deletions
+205
-693
src/app/components/dashboard/dashboard.component.html
src/app/components/dashboard/dashboard.component.html
+169
-624
src/app/components/dashboard/dashboard.component.ts
src/app/components/dashboard/dashboard.component.ts
+32
-65
src/app/shared/components/breadcrumb/breadcrumb.component.html
...pp/shared/components/breadcrumb/breadcrumb.component.html
+1
-1
src/app/shared/components/sidebar/sidebar.component.html
src/app/shared/components/sidebar/sidebar.component.html
+3
-3
src/assets/images/dashboard/SDNC Scanning 1.jpg
src/assets/images/dashboard/SDNC Scanning 1.jpg
+0
-0
src/assets/images/dashboard/dislike.png
src/assets/images/dashboard/dislike.png
+0
-0
src/assets/images/dashboard/like.png
src/assets/images/dashboard/like.png
+0
-0
No files found.
src/app/components/dashboard/dashboard.component.html
View file @
dc7e0e6e
This diff is collapsed.
Click to expand it.
src/app/components/dashboard/dashboard.component.ts
View file @
dc7e0e6e
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
*
as
chartData
from
'
../../shared/data/chart
'
;
import
{
doughnutData
,
pieData
}
from
'
../../shared/data/chart
'
;
@
Component
({
selector
:
'
app-dashboard
'
,
...
...
@@ -8,73 +6,42 @@ import { doughnutData, pieData } from '../../shared/data/chart';
styleUrls
:
[
'
./dashboard.component.scss
'
]
})
export
class
DashboardComponent
implements
OnInit
{
public
doughnutData
=
doughnutData
;
public
pieData
=
pieData
;
constructor
()
{
Object
.
assign
(
this
,
{
doughnutData
,
pieData
})
}
// doughnut 2
public
view
=
chartData
.
view
;
public
doughnutChartColorScheme
=
chartData
.
doughnutChartcolorScheme
;
public
doughnutChartShowLabels
=
chartData
.
doughnutChartShowLabels
;
public
doughnutChartGradient
=
chartData
.
doughnutChartGradient
;
public
doughnutChartTooltip
=
chartData
.
doughnutChartTooltip
;
public
chart5
=
chartData
.
chart5
;
// lineChart
public
lineChartData
=
chartData
.
lineChartData
;
public
lineChartLabels
=
chartData
.
lineChartLabels
;
public
lineChartOptions
=
chartData
.
lineChartOptions
;
public
lineChartColors
=
chartData
.
lineChartColors
;
public
lineChartLegend
=
chartData
.
lineChartLegend
;
public
lineChartType
=
chartData
.
lineChartType
;
// lineChart
public
smallLineChartData
=
chartData
.
smallLineChartData
;
public
smallLineChartLabels
=
chartData
.
smallLineChartLabels
;
public
smallLineChartOptions
=
chartData
.
smallLineChartOptions
;
public
smallLineChartColors
=
chartData
.
smallLineChartColors
;
public
smallLineChartLegend
=
chartData
.
smallLineChartLegend
;
public
smallLineChartType
=
chartData
.
smallLineChartType
;
// lineChart
public
smallLine2ChartData
=
chartData
.
smallLine2ChartData
;
public
smallLine2ChartLabels
=
chartData
.
smallLine2ChartLabels
;
public
smallLine2ChartOptions
=
chartData
.
smallLine2ChartOptions
;
public
smallLine2ChartColors
=
chartData
.
smallLine2ChartColors
;
public
smallLine2ChartLegend
=
chartData
.
smallLine2ChartLegend
;
public
smallLine2ChartType
=
chartData
.
smallLine2ChartType
;
// lineChart
public
smallLine3ChartData
=
chartData
.
smallLine3ChartData
;
public
smallLine3ChartLabels
=
chartData
.
smallLine3ChartLabels
;
public
smallLine3ChartOptions
=
chartData
.
smallLine3ChartOptions
;
public
smallLine3ChartColors
=
chartData
.
smallLine3ChartColors
;
public
smallLine3ChartLegend
=
chartData
.
smallLine3ChartLegend
;
public
smallLine3ChartType
=
chartData
.
smallLine3ChartType
;
likesCount
:
number
=
0
;
incidentsCount
:
number
=
0
;
dislikesCount
:
number
=
0
;
// lineChart
public
smallLine4ChartData
=
chartData
.
smallLine4ChartData
;
public
smallLine4ChartLabels
=
chartData
.
smallLine4ChartLabels
;
public
smallLine4ChartOptions
=
chartData
.
smallLine4ChartOptions
;
public
smallLine4ChartColors
=
chartData
.
smallLine4ChartColors
;
public
smallLine4ChartLegend
=
chartData
.
smallLine4ChartLegend
;
public
smallLine4ChartType
=
chartData
.
smallLine4ChartType
;
constructor
()
{
}
public
chart3
=
chartData
.
chart3
;
// events
public
chartClicked
(
e
:
any
):
void
{
}
public
chartHovered
(
e
:
any
):
void
{
ngOnInit
()
{
}
ngOnInit
()
{
updateStats
()
{
const
totalResponses
=
this
.
likesCount
+
this
.
dislikesCount
;
const
likesPercentage
=
totalResponses
>
0
?
((
this
.
likesCount
/
totalResponses
)
*
100
).
toFixed
(
1
)
:
'
0
'
;
const
dislikesPercentage
=
totalResponses
>
0
?
((
this
.
dislikesCount
/
totalResponses
)
*
100
).
toFixed
(
1
)
:
'
0
'
;
const
likesCountElem
=
document
.
getElementById
(
'
likesCount
'
);
const
dislikesCountElem
=
document
.
getElementById
(
'
dislikesCount
'
);
const
likesPercentageElem
=
document
.
getElementById
(
'
likesPercentage
'
);
const
dislikesPercentageElem
=
document
.
getElementById
(
'
dislikesPercentage
'
);
const
incidentsCountElem
=
document
.
getElementById
(
'
incidentsCount
'
);
if
(
likesCountElem
&&
dislikesCountElem
&&
likesPercentageElem
&&
dislikesPercentageElem
&&
incidentsCountElem
)
{
likesCountElem
.
textContent
=
this
.
likesCount
.
toString
();
dislikesCountElem
.
textContent
=
this
.
dislikesCount
.
toString
();
likesPercentageElem
.
textContent
=
`(
${
likesPercentage
}
%)`
;
dislikesPercentageElem
.
textContent
=
`(
${
dislikesPercentage
}
%)`
;
incidentsCountElem
.
textContent
=
(
this
.
likesCount
+
this
.
dislikesCount
).
toString
();
}
}
handleResponse
(
response
:
string
)
{
this
.
incidentsCount
++
;
if
(
response
===
'
like
'
)
{
this
.
likesCount
++
;
}
else
if
(
response
===
'
dislike
'
)
{
this
.
dislikesCount
++
;
}
this
.
updateStats
();
}
}
src/app/shared/components/breadcrumb/breadcrumb.component.html
View file @
dc7e0e6e
...
...
@@ -4,7 +4,7 @@
<div
class=
"col-lg-6"
>
<div
class=
"page-header-left"
>
<h3>
{{title}}
<small>
Multikart Admin
panel
</small>
<small>
SDN Controller
panel
</small>
</h3>
</div>
</div>
...
...
src/app/shared/components/sidebar/sidebar.component.html
View file @
dc7e0e6e
<div
class=
"main-header-left d-none d-lg-block"
>
<div
class=
"logo-wrapper"
><a
[routerLink]=
"'/dashboard/default'"
><img
class=
"blur-up lazyloaded"
src=
"assets/images/dashboard/
multikart-logo.pn
g"
alt=
""
></a></div>
src=
"assets/images/dashboard/
SDNC Scanning 1.jp
g"
alt=
""
></a></div>
</div>
<div
class=
"sidebar custom-scrollbar"
>
<div
class=
"sidebar-user text-center"
>
<div><img
class=
"img-60 rounded-circle"
src=
"assets/images/dashboard/man.png"
alt=
"#"
>
</div>
<h6
class=
"mt-3 f-14"
>
JOHN
</h6>
<p>
general manager.
</p>
<h6
class=
"mt-3 f-14"
>
Imesh Dilshan
</h6>
<p>
User
</p>
</div>
<ul
class=
"sidebar-menu"
>
<li
*ngFor=
"let menuItem of menuItems"
[ngClass]=
"{active: menuItem.active}"
>
...
...
src/assets/images/dashboard/SDNC Scanning 1.jpg
0 → 100644
View file @
dc7e0e6e
5.45 KB
src/assets/images/dashboard/dislike.png
0 → 100644
View file @
dc7e0e6e
42.1 KB
src/assets/images/dashboard/like.png
0 → 100644
View file @
dc7e0e6e
98.7 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment