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
ba8399fd
Commit
ba8399fd
authored
Sep 14, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home
parent
23e076c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
51 deletions
+84
-51
home.component.html
src/app/portal-manage/home/home.component.html
+14
-9
home.component.ts
src/app/portal-manage/home/home.component.ts
+70
-42
No files found.
src/app/portal-manage/home/home.component.html
View file @
ba8399fd
...
@@ -144,23 +144,28 @@
...
@@ -144,23 +144,28 @@
</div>
</div>
</div>
</div>
<!-- App
lications Grid
-->
<!-- App
Categories
-->
<div
class=
"mb-12"
>
<div
class=
"mb-12"
*
ngFor=
"let category of appCategories$ | async"
>
<div
class=
"flex items-center justify-between mb-8"
>
<div
class=
"flex items-center justify-between mb-8"
>
<div>
<div
class=
"flex items-center space-x-4"
>
<h2
class=
"text-3xl font-bold bg-gradient-to-r from-gray-800 to-gray-600 bg-clip-text text-transparent mb-2"
>
<div
class=
"w-12 h-12 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center text-white text-xl shadow-lg"
>
แอปพลิเคชันที่เข้าถึงได้
<i
[
class
]="
category
.
icon
"
></i>
</h2>
</div>
<p
class=
"text-gray-600"
>
เลือกแอปพลิเคชันที่คุณต้องการใช้งาน
</p>
<div>
<h2
class=
"text-3xl font-bold bg-gradient-to-r from-gray-800 to-gray-600 bg-clip-text text-transparent mb-2"
>
{{ category.name }}
</h2>
<p
class=
"text-gray-600"
>
{{ category.description }}
</p>
</div>
</div>
</div>
<div
class=
"flex items-center space-x-2"
>
<div
class=
"flex items-center space-x-2"
>
<div
class=
"w-2 h-2 bg-green-500 rounded-full animate-pulse"
></div>
<div
class=
"w-2 h-2 bg-green-500 rounded-full animate-pulse"
></div>
<span
class=
"text-sm text-gray-600"
>
{{
(accessibleApps$ | async)?.length || 0
}} แอปพร้อมใช้งาน
</span>
<span
class=
"text-sm text-gray-600"
>
{{
category.apps.length
}} แอปพร้อมใช้งาน
</span>
</div>
</div>
</div>
</div>
<div
class=
"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"
>
<div
class=
"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"
>
<div
*
ngFor=
"let app of
accessibleApps$ | async
; let i = index"
<div
*
ngFor=
"let app of
category.apps
; let i = index"
class=
"group bg-white/80 backdrop-blur-sm rounded-2xl p-6 shadow-xl border border-white/20 hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2 cursor-pointer"
class=
"group bg-white/80 backdrop-blur-sm rounded-2xl p-6 shadow-xl border border-white/20 hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2 cursor-pointer"
(
click
)="
navigateToApp
(
app
)"
(
click
)="
navigateToApp
(
app
)"
[
style
.
animation-delay
]="(
i
*
100
)
+
'
ms
'"
>
[
style
.
animation-delay
]="(
i
*
100
)
+
'
ms
'"
>
...
...
src/app/portal-manage/home/home.component.ts
View file @
ba8399fd
...
@@ -17,6 +17,7 @@ interface AppModule {
...
@@ -17,6 +17,7 @@ interface AppModule {
icon
:
string
;
icon
:
string
;
path
:
string
;
path
:
string
;
isVisible
:
boolean
;
isVisible
:
boolean
;
category
:
'applications'
|
'services'
|
'system'
;
permissions
:
{
permissions
:
{
view
:
boolean
;
view
:
boolean
;
create
:
boolean
;
create
:
boolean
;
...
@@ -27,6 +28,14 @@ interface AppModule {
...
@@ -27,6 +28,14 @@ interface AppModule {
};
};
}
}
interface
AppCategory
{
id
:
string
;
name
:
string
;
description
:
string
;
icon
:
string
;
apps
:
AppModule
[];
}
interface
UserInfo
{
interface
UserInfo
{
fullName
:
string
;
fullName
:
string
;
email
:
string
;
email
:
string
;
...
@@ -49,6 +58,7 @@ interface UserInfo {
...
@@ -49,6 +58,7 @@ interface UserInfo {
})
})
export
class
HomeComponent
implements
OnInit
{
export
class
HomeComponent
implements
OnInit
{
accessibleApps$
:
Observable
<
AppModule
[]
>
;
accessibleApps$
:
Observable
<
AppModule
[]
>
;
appCategories$
:
Observable
<
AppCategory
[]
>
;
userInfo$
:
Observable
<
UserInfo
>
;
userInfo$
:
Observable
<
UserInfo
>
;
currentEmployee$
:
Observable
<
Employee
|
null
>
;
currentEmployee$
:
Observable
<
Employee
|
null
>
;
currentJwtEmployee$
:
Observable
<
EmployeeFromJwt
|
null
>
;
currentJwtEmployee$
:
Observable
<
EmployeeFromJwt
|
null
>
;
...
@@ -63,6 +73,7 @@ export class HomeComponent implements OnInit {
...
@@ -63,6 +73,7 @@ export class HomeComponent implements OnInit {
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
loadAccessibleApps
();
this
.
loadAccessibleApps
();
this
.
loadAppCategories
();
this
.
loadUserInfo
();
this
.
loadUserInfo
();
this
.
initializeAuth
();
this
.
initializeAuth
();
}
}
...
@@ -105,40 +116,38 @@ export class HomeComponent implements OnInit {
...
@@ -105,40 +116,38 @@ export class HomeComponent implements OnInit {
private
loadAccessibleApps
():
void
{
private
loadAccessibleApps
():
void
{
// แสดงทุกเมนูก่อน โดยไม่ต้องตรวจสอบสิทธิ์
// แสดงทุกเมนูก่อน โดยไม่ต้องตรวจสอบสิทธิ์
this
.
accessibleApps$
=
of
(
this
.
getAppModules
());
this
.
accessibleApps$
=
of
(
this
.
getAppModules
());
}
// หลังจากนี้สามารถเพิ่มการตรวจสอบสิทธิ์ได้
// this.accessibleApps$ = combineLatest([
// this.employeeAuthService.currentEmployee$,
// this.employeeAuthService.currentJwtEmployee$,
// this.menuPermissionService.getAccessibleMenus(),
// this.menuPermissionService.menuPermissions$
// ]).pipe(
// map(([currentEmployee, currentJwtEmployee, accessibleMenus, allMenus]) => {
// // ตรวจสอบ JWT employee ก่อน
// if (currentJwtEmployee) {
// return this.getAppModules().filter(app => {
// const hasJwtPermission = this.employeeAuthService.hasJwtMenuPermission(app.id, 'view');
// return hasJwtPermission;
// });
// }
// // ถ้าไม่มี JWT ให้ใช้ employee permissions
private
loadAppCategories
():
void
{
// if (!currentEmployee) {
this
.
appCategories$
=
of
(
this
.
getAppCategories
());
// return [];
}
// }
// return this.getAppModules().filter(app => {
private
getAppCategories
():
AppCategory
[]
{
// // ตรวจสอบสิทธิ์จาก employee permissions
const
apps
=
this
.
getAppModules
();
// const hasPermission = this.employeeAuthService.hasMenuPermission(app.id, 'view');
return
[
// // ตรวจสอบสิทธิ์จาก menu permissions
{
// const menu = this.findMenuByPath(allMenus, app.path);
id
:
'applications'
,
// const hasMenuPermission = menu && menu.isVisible && menu.permissions.view;
name
:
'แอปพลิเคชันที่เข้าถึงได้'
,
description
:
'แอปพลิเคชันหลักสำหรับการทำงานประจำวัน'
,
// return hasPermission || hasMenuPermission;
icon
:
'ri-apps-line'
,
// });
apps
:
apps
.
filter
(
app
=>
app
.
category
===
'applications'
)
// })
},
// );
{
id
:
'services'
,
name
:
'การบริการ'
,
description
:
'บริการต่างๆ เพื่ออำนวยความสะดวกให้พนักงาน'
,
icon
:
'ri-service-line'
,
apps
:
apps
.
filter
(
app
=>
app
.
category
===
'services'
)
},
{
id
:
'system'
,
name
:
'การตั้งค่าระบบ'
,
description
:
'การจัดการและตั้งค่าระบบสำหรับผู้ดูแลระบบ'
,
icon
:
'ri-settings-3-line'
,
apps
:
apps
.
filter
(
app
=>
app
.
category
===
'system'
)
}
];
}
}
private
loadUserInfo
():
void
{
private
loadUserInfo
():
void
{
...
@@ -198,6 +207,7 @@ export class HomeComponent implements OnInit {
...
@@ -198,6 +207,7 @@ export class HomeComponent implements OnInit {
private
getAppModules
():
AppModule
[]
{
private
getAppModules
():
AppModule
[]
{
return
[
return
[
// แอปพลิเคชันที่เข้าถึงได้
{
{
id
:
'myhr-plus'
,
id
:
'myhr-plus'
,
name
:
'myhr-plus'
,
name
:
'myhr-plus'
,
...
@@ -206,6 +216,7 @@ export class HomeComponent implements OnInit {
...
@@ -206,6 +216,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/myhr-plus.jpg'
,
icon
:
'./assets/images/logoallHR/myhr-plus.jpg'
,
path
:
'/myhr-plus'
,
path
:
'/myhr-plus'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -216,6 +227,7 @@ export class HomeComponent implements OnInit {
...
@@ -216,6 +227,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/myHR-Lite-logo-new.png'
,
icon
:
'./assets/images/logoallHR/myHR-Lite-logo-new.png'
,
path
:
'/myhr-lite'
,
path
:
'/myhr-lite'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -226,6 +238,7 @@ export class HomeComponent implements OnInit {
...
@@ -226,6 +238,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/zeemePlus.png'
,
icon
:
'./assets/images/logoallHR/zeemePlus.png'
,
path
:
'/zeeme'
,
path
:
'/zeeme'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -236,6 +249,7 @@ export class HomeComponent implements OnInit {
...
@@ -236,6 +249,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/logo_myface.png'
,
icon
:
'./assets/images/logoallHR/logo_myface.png'
,
path
:
'/myface'
,
path
:
'/myface'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -246,6 +260,7 @@ export class HomeComponent implements OnInit {
...
@@ -246,6 +260,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/mylearn-logo.png'
,
icon
:
'./assets/images/logoallHR/mylearn-logo.png'
,
path
:
'/mylearn'
,
path
:
'/mylearn'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -256,6 +271,7 @@ export class HomeComponent implements OnInit {
...
@@ -256,6 +271,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/logo_myjob.png'
,
icon
:
'./assets/images/logoallHR/logo_myjob.png'
,
path
:
'/myjob'
,
path
:
'/myjob'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -266,8 +282,10 @@ export class HomeComponent implements OnInit {
...
@@ -266,8 +282,10 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/logoallHR/mySkill-x.png'
,
icon
:
'./assets/images/logoallHR/mySkill-x.png'
,
path
:
'/myskill-x'
,
path
:
'/myskill-x'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'applications'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
// การบริการ
{
{
id
:
'dashboard'
,
id
:
'dashboard'
,
name
:
'dashboard'
,
name
:
'dashboard'
,
...
@@ -276,9 +294,22 @@ export class HomeComponent implements OnInit {
...
@@ -276,9 +294,22 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/dashboard.png'
,
icon
:
'./assets/images/icons/dashboard.png'
,
path
:
'/dashboard'
,
path
:
'/dashboard'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'services'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
id
:
'meetingBooking'
,
name
:
'meeting-booking'
,
displayName
:
'Meeting Booking'
,
description
:
'ระบบจองห้องประชุม'
,
icon
:
'./assets/images/icons/calendar.png'
,
path
:
'/portal-manage/meeting-booking'
,
isVisible
:
true
,
category
:
'services'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
// การตั้งค่าระบบ
{
id
:
'permissionManagement'
,
id
:
'permissionManagement'
,
name
:
'permission-management'
,
name
:
'permission-management'
,
displayName
:
'Permission Management'
,
displayName
:
'Permission Management'
,
...
@@ -286,6 +317,7 @@ export class HomeComponent implements OnInit {
...
@@ -286,6 +317,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/widget.png'
,
icon
:
'./assets/images/icons/widget.png'
,
path
:
'/portal-manage/permission-management'
,
path
:
'/portal-manage/permission-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -296,6 +328,7 @@ export class HomeComponent implements OnInit {
...
@@ -296,6 +328,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/users.png'
,
icon
:
'./assets/images/icons/users.png'
,
path
:
'/portal-manage/role-management'
,
path
:
'/portal-manage/role-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -306,6 +339,7 @@ export class HomeComponent implements OnInit {
...
@@ -306,6 +339,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/menu.png'
,
icon
:
'./assets/images/icons/menu.png'
,
path
:
'/portal-manage/menu-permission-management'
,
path
:
'/portal-manage/menu-permission-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -316,16 +350,7 @@ export class HomeComponent implements OnInit {
...
@@ -316,16 +350,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/users.png'
,
icon
:
'./assets/images/icons/users.png'
,
path
:
'/portal-manage/user-role-management'
,
path
:
'/portal-manage/user-role-management'
,
isVisible
:
true
,
isVisible
:
true
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
category
:
'system'
,
},
{
id
:
'meetingBooking'
,
name
:
'meeting-booking'
,
displayName
:
'Meeting Booking'
,
description
:
'ระบบจองห้องประชุม'
,
icon
:
'./assets/images/icons/calendar.png'
,
path
:
'/portal-manage/meeting-booking'
,
isVisible
:
true
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -336,6 +361,7 @@ export class HomeComponent implements OnInit {
...
@@ -336,6 +361,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/building.png'
,
icon
:
'./assets/images/icons/building.png'
,
path
:
'/portal-manage/company-management'
,
path
:
'/portal-manage/company-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -346,6 +372,7 @@ export class HomeComponent implements OnInit {
...
@@ -346,6 +372,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/widget.png'
,
icon
:
'./assets/images/icons/widget.png'
,
path
:
'/portal-manage/widget-management'
,
path
:
'/portal-manage/widget-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
},
},
{
{
...
@@ -356,6 +383,7 @@ export class HomeComponent implements OnInit {
...
@@ -356,6 +383,7 @@ export class HomeComponent implements OnInit {
icon
:
'./assets/images/icons/dashboard.png'
,
icon
:
'./assets/images/icons/dashboard.png'
,
path
:
'/portal-manage/dashboard-management'
,
path
:
'/portal-manage/dashboard-management'
,
isVisible
:
true
,
isVisible
:
true
,
category
:
'system'
,
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
permissions
:
{
view
:
true
,
create
:
false
,
edit
:
false
,
delete
:
false
,
export
:
false
,
import
:
false
}
}
}
];
];
...
...
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