Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
portal-apps-manage
Commits
89f905e7
Commit
89f905e7
authored
Sep 16, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
view
parent
7682af35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
78 deletions
+104
-78
dashboard-viewer.component.html
...nagement/dashboard-viewer/dashboard-viewer.component.html
+87
-44
dashboard-viewer.component.scss
...nagement/dashboard-viewer/dashboard-viewer.component.scss
+0
-0
dashboard-viewer.component.ts
...management/dashboard-viewer/dashboard-viewer.component.ts
+17
-34
No files found.
src/app/portal-manage/dashboard-management/dashboard-viewer/dashboard-viewer.component.html
View file @
89f905e7
<!-- Error Message -->
<div
*
ngIf=
"errorMessage"
class=
"error-message"
>
<div
class=
"error-message-content"
>
<i
class=
"bi bi-exclamation-triangle-fill error-icon"
></i>
<span
class=
"error-text"
>
Error:
</span>
<span
class=
"error-description"
>
{{ errorMessage }}
</span>
</div>
</div>
<div
class=
"min-h-screen dashboard-background"
>
<!-- Enhanced Dashboard Header -->
<div
class=
"dashboard-header-container"
>
<div
class=
"header-content"
>
<div
class=
"header-flex"
>
<div
class=
"header-left"
>
<!-- Dashboard Title with Icon -->
<div
class=
"header-title-section"
>
<div
class=
"title-icon"
>
<i
class=
"bi bi-grid-3x3-gap"
></i>
</div>
<div
class=
"title-content"
>
<h1>
Dashboard Management
</h1>
<p>
Create and manage your dashboards
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Enhanced Dashboard Content Area -->
<div
class=
"dashboard-content-area"
>
<!-- View Dashboard Button -->
<!-- Dashboard Content -->
<div
class=
"dashboard-content-card"
>
<div
*
ngIf=
"!panels || panels.length === 0"
class=
"empty-state"
>
<div
class=
"empty-state-icon"
>
<i
class=
"bi bi-grid-3x3-gap"
></i>
</div>
<h3
class=
"empty-state-title"
>
Empty Dashboard
</h3>
<p
class=
"empty-state-description"
>
To get started, select a dashboard from the dropdown above or create
a new one. Then, click on a widget from the sidebar on the left to
add it to this canvas.
</p>
</div>
<!-- Dashboard Layout -->
<div
*
ngIf=
"panels.length > 0"
class=
"dashboard-layout-container"
>
<ejs-dashboardlayout
id=
"dashboard_default"
[
columns
]="
columns
"
[
cellSpacing
]="
cellSpacing
"
[
panels
]="
panels
"
#
editLayout
[
allowResizing
]="
false
"
[
allowDragging
]="
false
"
[
allowFloating
]="
allowFloating
"
[
enableRtl
]="
false
"
[
enablePersistence
]="
false
"
[
cellAspectRatio
]="
cellAspectRatio
"
[
mediaQuery
]='
mediaQuery
'
class=
"dashboard-layout"
>
<e-panels>
<e-panel
*
ngFor=
"let panel of panels"
[
id
]="
panel
.
id
"
[
sizeX
]="
panel
.
sizeX
"
[
sizeY
]="
panel
.
sizeY
"
[
row
]="
panel
.
row
"
[
col
]="
panel
.
col
"
[
minSizeX
]="
panel
.
minSizeX
"
[
minSizeY
]="
panel
.
minSizeY
"
[
maxSizeX
]="
panel
.
maxSizeX
"
[
maxSizeY
]="
panel
.
maxSizeY
"
[
zIndex
]="
999
"
>
<ng-template
#
content
>
<ng-container
[
ngComponentOutlet
]="
panel
.
componentType
"
[
ngComponentOutletInputs
]="
panel
.
componentInputs
"
></ng-container>
</ng-template>
</e-panel>
</e-panels>
</ejs-dashboardlayout>
</div>
</div>
</div>
<!-- Dashboard Viewer Container - Clean Layout -->
<div
*
ngIf=
"dashboardData"
class=
"dashboard-content-area"
>
<!-- Dashboard Content Only -->
<div
class=
"dashboard-layout-container"
>
<ejs-dashboardlayout
id=
"dashboard_default"
#
editLayout
[
cellSpacing
]="
cellSpacing
"
[
panels
]="
panels
"
[
columns
]="
columns
"
[
allowResizing
]="
false
"
[
allowDragging
]="
false
"
class=
"dashboard-layout"
>
<e-panels>
<e-panel
*
ngFor=
"let panel of panels"
[
zIndex
]="
999
"
[
row
]="
panel
.
row
"
[
col
]="
panel
.
col
"
[
sizeX
]="
panel
.
sizeX
"
[
sizeY
]="
panel
.
sizeY
"
[
id
]="
panel
.
id
"
>
<ng-template
#
header
>
<!-- No header -->
</ng-template>
<ng-template
#
content
>
<ng-container
[
ngComponentOutlet
]="
panel
.
componentType
"
[
ngComponentOutletInputs
]="
panel
.
componentInputs
"
></ng-container>
</ng-template>
</e-panel>
</e-panels>
</ejs-dashboardlayout>
</div>
</div>
src/app/portal-manage/dashboard-management/dashboard-viewer/dashboard-viewer.component.scss
View file @
89f905e7
This diff is collapsed.
Click to expand it.
src/app/portal-manage/dashboard-management/dashboard-viewer/dashboard-viewer.component.ts
View file @
89f905e7
...
...
@@ -63,13 +63,15 @@ export interface DashboardPanel extends PanelModel {
encapsulation
:
ViewEncapsulation
.
None
})
export
class
DashboardViewerComponent
implements
OnInit
,
OnDestroy
{
public
panels
:
DashboardPanel
[]
=
[];
public
cellSpacing
:
number
[]
=
[
8
,
8
];
public
mediaQuery
:
string
=
'max-width: 700px'
;
public
columns
:
number
=
6
;
public
dashboardData
:
DashboardModel
|
null
=
null
;
public
errorMessage
:
string
|
null
=
null
;
public
isFullscreen
:
boolean
=
true
;
public
allowFloating
:
boolean
=
false
;
public
cellAspectRatio
:
number
=
100
/
75
;
constructor
(
private
route
:
ActivatedRoute
,
private
dashboardDataService
:
DashboardDataService
,
...
...
@@ -78,17 +80,11 @@ export class DashboardViewerComponent implements OnInit, OnDestroy {
)
{
}
goBack
():
void
{
window
.
history
.
back
();
}
ngOnInit
():
void
{
// Set responsive columns based on screen size
this
.
setResponsiveColumns
();
// Listen for window resize events
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
setResponsiveColumns
();
});
this
.
route
.
paramMap
.
pipe
(
map
(
params
=>
params
.
get
(
'dashboardId'
)),
...
...
@@ -137,30 +133,17 @@ export class DashboardViewerComponent implements OnInit, OnDestroy {
}
ngOnDestroy
():
void
{
// Clean up event listener
window
.
removeEventListener
(
'resize'
,
()
=>
{
this
.
setResponsiveColumns
();
});
// Clean up fullscreen mode
}
private
setResponsiveColumns
():
void
{
const
width
=
window
.
innerWidth
;
if
(
width
<=
480
)
{
this
.
columns
=
2
;
this
.
cellSpacing
=
[
4
,
4
];
}
else
if
(
width
<=
768
)
{
this
.
columns
=
3
;
this
.
cellSpacing
=
[
6
,
6
];
}
else
if
(
width
<=
1024
)
{
this
.
columns
=
4
;
this
.
cellSpacing
=
[
8
,
8
];
}
else
if
(
width
<=
1200
)
{
this
.
columns
=
5
;
this
.
cellSpacing
=
[
8
,
8
];
}
else
{
this
.
columns
=
6
;
this
.
cellSpacing
=
[
8
,
8
];
private
setViewportMeta
():
void
{
let
viewport
=
document
.
querySelector
(
'meta[name="viewport"]'
);
if
(
!
viewport
)
{
viewport
=
document
.
createElement
(
'meta'
);
viewport
.
setAttribute
(
'name'
,
'viewport'
);
document
.
head
.
appendChild
(
viewport
);
}
viewport
.
setAttribute
(
'content'
,
'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'
);
}
mapWidgetsToPanels
(
widgets
:
any
[]):
DashboardPanel
[]
{
...
...
@@ -183,10 +166,10 @@ export class DashboardViewerComponent implements OnInit, OnDestroy {
return
{
id
:
`
${(
widget
as
any
).
instanceId
}
-
${
widget
.
y
}
-
${
widget
.
x
}
`
,
header
:
widget
.
thName
,
sizeX
:
widget
.
cols
,
sizeY
:
widget
.
rows
,
row
:
widget
.
y
,
col
:
widget
.
x
,
sizeX
:
widget
.
cols
||
4
,
// Default size if not specified
sizeY
:
widget
.
rows
||
3
,
// Default size if not specified
row
:
widget
.
y
||
0
,
col
:
widget
.
x
||
0
,
componentType
:
componentType
,
componentInputs
:
{
config
:
JSON
.
stringify
(
configObject
),
...
...
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