Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Văn Hoàng
VCCI-News
Commits
0a8e85f9
Commit
0a8e85f9
authored
Aug 25, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixnews
parent
0fc799e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
page.tsx
src/app/admin/login/page.tsx
+16
-2
post-history-viewer.tsx
src/components/admin/post-history-viewer.tsx
+4
-5
No files found.
src/app/admin/login/page.tsx
View file @
0a8e85f9
...
@@ -26,6 +26,7 @@ import logo from "@/assets/VCCI-HCM-logo-VN-2025.png";
...
@@ -26,6 +26,7 @@ import logo from "@/assets/VCCI-HCM-logo-VN-2025.png";
import
links
,
{
resolveUploadUrl
}
from
"@/links"
;
import
links
,
{
resolveUploadUrl
}
from
"@/links"
;
import
{
loginAdmin
}
from
"@/lib/auth/admin-auth"
;
import
{
loginAdmin
}
from
"@/lib/auth/admin-auth"
;
import
useAuthStore
from
"@/store/useAuthStore"
;
import
useAuthStore
from
"@/store/useAuthStore"
;
import
{
fetchCmsFileById
,
resolveCmsFileUrl
}
from
"@/lib/api/files"
;
type
AuthMode
=
"login"
|
"forgot"
;
type
AuthMode
=
"login"
|
"forgot"
;
...
@@ -120,6 +121,19 @@ function AuthShell({
...
@@ -120,6 +121,19 @@ function AuthShell({
}
}
);
);
// Resolve logo URL: prefer logo_url, otherwise fetch file by file_id.
const
{
data
:
logoFile
}
=
useQuery
({
queryKey
:
[
"cms-file"
,
logoData
?.
file_id
],
queryFn
:
()
=>
fetchCmsFileById
(
logoData
!
.
file_id
),
enabled
:
!!
logoData
?.
file_id
&&
!
logoData
?.
logo_url
,
});
const
logoSrc
=
logoData
?.
logo_url
?
resolveUploadUrl
(
logoData
.
logo_url
)
:
logoFile
?
resolveCmsFileUrl
(
logoFile
.
path
)
:
logo
;
const
title
=
const
title
=
mode
===
"login"
mode
===
"login"
?
"Đăng nhập quản trị"
?
"Đăng nhập quản trị"
...
@@ -141,7 +155,7 @@ function AuthShell({
...
@@ -141,7 +155,7 @@ function AuthShell({
<
div
className=
"flex items-center gap-4"
>
<
div
className=
"flex items-center gap-4"
>
<
div
className=
"flex h-16 w-16 items-center justify-center rounded-2xl border border-[#063e8e]/10 bg-white shadow-sm"
>
<
div
className=
"flex h-16 w-16 items-center justify-center rounded-2xl border border-[#063e8e]/10 bg-white shadow-sm"
>
<
Image
<
Image
src=
{
logo
Data
?.
logo_url
?
resolveUploadUrl
(
logoData
.
logo_url
)
:
logo
}
src=
{
logo
Src
}
alt=
{
logoData
?.
logo_name
||
"VCCI HCM"
}
alt=
{
logoData
?.
logo_name
||
"VCCI HCM"
}
width=
{
48
}
width=
{
48
}
height=
{
48
}
height=
{
48
}
...
@@ -195,7 +209,7 @@ function AuthShell({
...
@@ -195,7 +209,7 @@ function AuthShell({
<
div
className=
"mb-8 flex items-center gap-3 lg:hidden"
>
<
div
className=
"mb-8 flex items-center gap-3 lg:hidden"
>
<
div
className=
"flex h-12 w-12 items-center justify-center rounded-2xl border border-[#063e8e]/10 bg-[#f8fbff]"
>
<
div
className=
"flex h-12 w-12 items-center justify-center rounded-2xl border border-[#063e8e]/10 bg-[#f8fbff]"
>
<
Image
<
Image
src=
{
logo
Data
?.
logo_url
?
resolveUploadUrl
(
logoData
.
logo_url
)
:
logo
}
src=
{
logo
Src
}
alt=
{
logoData
?.
logo_name
||
"VCCI HCM"
}
alt=
{
logoData
?.
logo_name
||
"VCCI HCM"
}
width=
{
36
}
width=
{
36
}
height=
{
36
}
height=
{
36
}
...
...
src/components/admin/post-history-viewer.tsx
View file @
0a8e85f9
...
@@ -182,11 +182,10 @@ interface PostHistoryViewerProps {
...
@@ -182,11 +182,10 @@ interface PostHistoryViewerProps {
export
function
PostHistoryViewer
({
postId
}:
PostHistoryViewerProps
)
{
export
function
PostHistoryViewer
({
postId
}:
PostHistoryViewerProps
)
{
const
[
isOpen
,
setIsOpen
]
=
React
.
useState
(
false
);
const
[
isOpen
,
setIsOpen
]
=
React
.
useState
(
false
);
const
{
data
,
isLoading
,
isError
,
error
}
=
useGetApiV10PostIdHistory
(
postId
,
{
// Always fetch history so the count is correct even before the user opens
query
:
{
// the panel. Previously `enabled: isOpen` caused the count to show "0 thay
enabled
:
isOpen
,
// đổi" until the panel was opened.
},
const
{
data
,
isLoading
,
isError
,
error
}
=
useGetApiV10PostIdHistory
(
postId
);
});
const
historyItems
=
React
.
useMemo
(()
=>
{
const
historyItems
=
React
.
useMemo
(()
=>
{
// useQuery's `data` IS the API response body: { responseData: [...], ... }
// useQuery's `data` IS the API response body: { responseData: [...], ... }
...
...
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