Compare commits

...

3 Commits

Author SHA1 Message Date
Firman Ramdhani 29ff09d3aa feat: add setting access to change setting data 2025-05-16 10:07:20 +07:00
irfan e6481aa606 Update env/env.cloud 2025-05-13 04:52:55 +00:00
irfan 7330e38296 Update env/env.production-online 2025-05-13 04:50:20 +00:00
3 changed files with 20 additions and 5 deletions

2
env/env.cloud vendored
View File

@ -2,4 +2,4 @@ VITE_APP_MODE=production
VITE_BASE_API_URL=http://103.187.147.241:30050/api VITE_BASE_API_URL=http://103.187.147.241:30050/api
VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api
VITE_BASE_API_URL_LOCAL=https://api.sky.eigen.co.id/api VITE_BASE_API_URL_LOCAL=https://api.office.weplayground.id/api

View File

@ -1,5 +1,5 @@
VITE_APP_MODE=production VITE_APP_MODE=production
VITE_BASE_API_URL=https://api.office.weplayground.id/api VITE_BASE_API_URL=http://103.187.147.241:30050/api
VITE_BASE_API_REPORT_URL=https://api.office.weplayground.id/api VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api
VITE_BASE_API_URL_LOCAL=https://api.office.weplayground.id/api VITE_BASE_API_URL_LOCAL=http://103.187.147.241:30050/api

View File

@ -33,6 +33,13 @@ export default function AdminLayout(props: AdminLayoutProps) {
} }
} }
function checkAllowAccessSetting() {
const username = user?.username;
const allowList = ['Endy', 'superadmin'];
if (allowList.includes(username)) return true;
return false;
}
return ( return (
<Layout> <Layout>
<Header <Header
@ -81,7 +88,15 @@ export default function AdminLayout(props: AdminLayoutProps) {
}); });
}, },
}, },
], ]
.map((item) => {
const isAllowSetting = checkAllowAccessSetting();
if (!isAllowSetting && (item.key === '1' || item.type === 'divider')) {
return undefined;
}
return item;
})
.filter(Boolean) as any,
}} }}
> >
<Avatar size={35} style={{ cursor: 'pointer' }}> <Avatar size={35} style={{ cursor: 'pointer' }}>