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
1a7c08a5
Commit
1a7c08a5
authored
Sep 01, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard
parent
3ab688d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
30 deletions
+33
-30
dashboard-management.component.html
.../dashboard-management/dashboard-management.component.html
+1
-1
dashboard-management.component.ts
...ge/dashboard-management/dashboard-management.component.ts
+0
-0
dashboard-viewer.component.ts
...tal-manage/dashboard-viewer/dashboard-viewer.component.ts
+2
-2
widgets.model.ts
src/app/portal-manage/models/widgets.model.ts
+19
-12
widgets.service.ts
src/app/portal-manage/services/widgets.service.ts
+9
-13
widget-list.component.html
...ortal-manage/widget-management/widget-list.component.html
+2
-2
No files found.
src/app/portal-manage/dashboard-management/dashboard-management.component.html
View file @
1a7c08a5
...
...
@@ -55,7 +55,7 @@
(
click
)="
addWidgetToDashboard
(
widget
)"
class=
"widget-item p-3 rounded-lg hover:bg-gray-100 cursor-pointer transition-colors duration-200"
>
<p
class=
"font-semibold text-gray-700"
>
{{ widget.
n
ame }}
</p>
<p
class=
"font-semibold text-gray-700"
>
{{ widget.
thN
ame }}
</p>
<p
class=
"text-xs text-gray-500"
>
Size: {{ widget.cols }}x{{ widget.rows }}
</p>
...
...
src/app/portal-manage/dashboard-management/dashboard-management.component.ts
View file @
1a7c08a5
This diff is collapsed.
Click to expand it.
src/app/portal-manage/dashboard-viewer/dashboard-viewer.component.ts
View file @
1a7c08a5
...
...
@@ -157,12 +157,12 @@ export class DashboardViewerComponent implements OnInit {
const
widgetConfig
=
widget
.
config
||
{};
return
{
id
:
widget
.
i
d
,
id
:
widget
.
widgetI
d
,
row
:
widget
.
y
,
col
:
widget
.
x
,
sizeX
:
widget
.
cols
,
sizeY
:
widget
.
rows
,
header
:
widget
.
n
ame
,
header
:
widget
.
thN
ame
,
componentName
:
widget
.
component
,
// Add componentName
componentType
:
this
.
widgetComponentMap
[
widget
.
component
],
// Attach the component Type
componentInputs
:
{
config
:
widgetConfig
}
// Pass the config object as 'config' input
...
...
src/app/portal-manage/models/widgets.model.ts
View file @
1a7c08a5
...
...
@@ -21,38 +21,45 @@ export class DatasetModel implements IDataset {
}
export
interface
IWidget
{
id
:
string
;
name
:
string
;
widgetId
:
string
;
thName
:
string
;
engName
:
string
;
component
:
string
;
cols
:
number
;
rows
:
number
;
x
:
number
;
y
:
number
;
data
:
any
;
// Legacy, to be phased out
config
:
any
;
// New: For data-driven configuration
data
:
any
;
config
:
any
;
perspective
:
any
;
}
export
class
WidgetModel
implements
IWidget
{
id
:
string
;
name
:
string
;
widgetId
:
string
;
thName
:
string
;
engName
:
string
;
component
:
string
;
cols
:
number
;
rows
:
number
;
x
:
number
;
y
:
number
;
data
:
any
;
// Legacy, to be phased out
config
:
any
;
// New: For data-driven configuration
data
:
any
;
config
:
any
;
perspective
:
any
;
constructor
(
data
:
Partial
<
IWidget
>
)
{
this
.
id
=
data
.
id
??
''
;
this
.
name
=
data
.
name
??
''
;
this
.
widgetId
=
data
.
widgetId
??
''
;
this
.
thName
=
data
.
thName
??
''
;
this
.
engName
=
data
.
engName
??
''
;
this
.
component
=
data
.
component
??
''
;
this
.
cols
=
data
.
cols
??
1
;
this
.
rows
=
data
.
rows
??
1
;
this
.
x
=
data
.
x
??
0
;
this
.
y
=
data
.
y
??
0
;
this
.
data
=
data
.
data
??
{};
// Keep for now for compatibility
this
.
config
=
data
.
config
??
{};
// Initialize new config object
this
.
data
=
data
.
data
??
{};
this
.
config
=
data
.
config
??
{};
this
.
perspective
=
data
.
perspective
??
{};
}
}
...
...
src/app/portal-manage/services/widgets.service.ts
View file @
1a7c08a5
...
...
@@ -15,28 +15,24 @@ export class WidgetService {
createStatus
:
boolean
=
true
constructor
(
private
http
:
HttpClient
)
{
}
getListWidgets
(
status
?:
string
):
Observable
<
WidgetModel
[]
>
{
if
(
status
)
{
return
this
.
http
.
get
<
WidgetModel
[]
>
(
this
.
url
+
"widget/lists?status="
+
status
)
}
else
{
return
this
.
http
.
get
<
WidgetModel
[]
>
(
this
.
url
+
"widget/lists"
)
}
return
this
.
http
.
get
<
WidgetModel
[]
>
(
this
.
url
+
"widget-registry/lists/search"
)
}
getListExcelContent
(
status
?:
string
):
Observable
<
DocumentContentModel
[]
>
{
return
this
.
http
.
get
<
DocumentContentModel
[]
>
(
this
.
url
+
"document-center/content/lists"
)
}
getWidgetById
(
widgetId
:
string
):
Observable
<
WidgetModel
>
{
return
this
.
http
.
get
<
WidgetModel
>
(
this
.
url
+
"widget/"
+
widgetId
)
return
this
.
http
.
get
<
WidgetModel
>
(
this
.
url
+
"widget
-registry
/"
+
widgetId
)
}
downloadFile
(
logId
:
string
):
Observable
<
any
>
{
return
this
.
http
.
get
(
this
.
url
+
"widget
/files/download/"
+
logId
,
{
responseType
:
'blob'
})
downloadFile
(
logId
:
string
):
Observable
<
any
>
{
return
this
.
http
.
get
(
this
.
url
+
"widget
-registry/files/download/"
+
logId
,
{
responseType
:
'blob'
})
}
createWidget
(
model
:
WidgetModel
):
Observable
<
any
>
{
let
body
:
any
=
model
return
this
.
http
.
post
(
this
.
url
+
'widget'
,
body
)
let
body
:
any
=
model
return
this
.
http
.
post
(
this
.
url
+
'widget
-registry
'
,
body
)
}
deleteWidget
(
model
:
WidgetModel
):
Observable
<
any
>
{
let
body
=
{
widgetId
:
model
.
i
d
widgetId
:
model
.
widgetI
d
}
let
option
=
{
headers
:
new
HttpHeaders
({
...
...
@@ -44,7 +40,7 @@ export class WidgetService {
}),
body
:
body
}
return
this
.
http
.
delete
<
any
>
(
this
.
url
+
'widget'
,
option
)
return
this
.
http
.
delete
<
any
>
(
this
.
url
+
'widget
-registry
'
,
option
)
}
deleteExcelContent
(
model
:
DocumentContentModel
):
Observable
<
any
>
{
let
body
=
{
...
...
@@ -61,7 +57,7 @@ export class WidgetService {
getCount
(
status
?:
string
):
Observable
<
number
>
{
return
this
.
http
.
get
<
number
>
(
this
.
url
+
"widget/count"
)
return
this
.
http
.
get
<
number
>
(
this
.
url
+
"widget
-registry
/count"
)
}
getCountContent
(
status
?:
string
):
Observable
<
number
>
{
return
this
.
http
.
get
<
number
>
(
this
.
url
+
"document-center/content/count"
)
...
...
src/app/portal-manage/widget-management/widget-list.component.html
View file @
1a7c08a5
...
...
@@ -20,7 +20,7 @@
</thead>
<tbody
class=
"bg-white divide-y divide-gray-200"
>
<tr
*
ngFor=
"let widget of widgets$ | async"
>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{ widget.
n
ame }}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{ widget.
thN
ame }}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{ widget.component }}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{ widget.cols }} x {{ widget.rows }}
</td>
<td
class=
"px-6 py-4"
>
...
...
@@ -29,7 +29,7 @@
</div>
</td>
<td
class=
"px-6 py-4 whitespace-nowrap text-right"
>
<button
(
click
)="
editWidget
(
widget
.
i
d
)"
class=
"text-indigo-600 hover:text-indigo-900"
>
Edit
</button>
<button
(
click
)="
editWidget
(
widget
.
widgetI
d
)"
class=
"text-indigo-600 hover:text-indigo-900"
>
Edit
</button>
</td>
</tr>
<!-- Show a message if there are no widgets -->
...
...
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