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
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
*
as
chartData
from
'
../../shared/data/chart
'
;
import
{
doughnutData
,
pieData
}
from
'
../../shared/data/chart
'
;
@
Component
({
@
Component
({
selector
:
'
app-dashboard
'
,
selector
:
'
app-dashboard
'
,
...
@@ -8,73 +6,42 @@ import { doughnutData, pieData } from '../../shared/data/chart';
...
@@ -8,73 +6,42 @@ import { doughnutData, pieData } from '../../shared/data/chart';
styleUrls
:
[
'
./dashboard.component.scss
'
]
styleUrls
:
[
'
./dashboard.component.scss
'
]
})
})
export
class
DashboardComponent
implements
OnInit
{
export
class
DashboardComponent
implements
OnInit
{
public
doughnutData
=
doughnutData
;
likesCount
:
number
=
0
;
public
pieData
=
pieData
;
incidentsCount
:
number
=
0
;
constructor
()
{
dislikesCount
:
number
=
0
;
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
;
// lineChart
constructor
()
{
}
public
smallLine4ChartData
=
chartData
.
smallLine4ChartData
;
public
smallLine4ChartLabels
=
chartData
.
smallLine4ChartLabels
;
public
smallLine4ChartOptions
=
chartData
.
smallLine4ChartOptions
;
public
smallLine4ChartColors
=
chartData
.
smallLine4ChartColors
;
public
smallLine4ChartLegend
=
chartData
.
smallLine4ChartLegend
;
public
smallLine4ChartType
=
chartData
.
smallLine4ChartType
;
public
chart3
=
chartData
.
chart3
;
ngOnInit
()
{
// events
public
chartClicked
(
e
:
any
):
void
{
}
public
chartHovered
(
e
:
any
):
void
{
}
}
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 @@
...
@@ -4,7 +4,7 @@
<div
class=
"col-lg-6"
>
<div
class=
"col-lg-6"
>
<div
class=
"page-header-left"
>
<div
class=
"page-header-left"
>
<h3>
{{title}}
<h3>
{{title}}
<small>
Multikart Admin
panel
</small>
<small>
SDN Controller
panel
</small>
</h3>
</h3>
</div>
</div>
</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=
"main-header-left d-none d-lg-block"
>
<div
class=
"logo-wrapper"
><a
[routerLink]=
"'/dashboard/default'"
><img
class=
"blur-up lazyloaded"
<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>
<div
class=
"sidebar custom-scrollbar"
>
<div
class=
"sidebar custom-scrollbar"
>
<div
class=
"sidebar-user text-center"
>
<div
class=
"sidebar-user text-center"
>
<div><img
class=
"img-60 rounded-circle"
src=
"assets/images/dashboard/man.png"
alt=
"#"
>
<div><img
class=
"img-60 rounded-circle"
src=
"assets/images/dashboard/man.png"
alt=
"#"
>
</div>
</div>
<h6
class=
"mt-3 f-14"
>
JOHN
</h6>
<h6
class=
"mt-3 f-14"
>
Imesh Dilshan
</h6>
<p>
general manager.
</p>
<p>
User
</p>
</div>
</div>
<ul
class=
"sidebar-menu"
>
<ul
class=
"sidebar-menu"
>
<li
*ngFor=
"let menuItem of menuItems"
[ngClass]=
"{active: menuItem.active}"
>
<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