fix(local): add middleware for local access only
This commit is contained in:
@@ -37,6 +37,15 @@ import {
|
|||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
const url = new URL(import.meta.env.VITE_WHATSAPP_URL);
|
||||||
|
const host = url.hostname;
|
||||||
|
|
||||||
|
const isLocal =
|
||||||
|
host === '127.0.0.1' ||
|
||||||
|
host === 'localhost' ||
|
||||||
|
host.startsWith('192.168.') ||
|
||||||
|
host.startsWith('10.') ||
|
||||||
|
host.startsWith('172.');
|
||||||
|
|
||||||
const allItems = [
|
const allItems = [
|
||||||
{
|
{
|
||||||
@@ -226,15 +235,19 @@ const allItems = [
|
|||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
...(isLocal
|
||||||
key: 'whatsapp-control',
|
? [
|
||||||
icon: <GlobalOutlined style={{ fontSize: '19px' }} />,
|
{
|
||||||
label: (
|
key: 'whatsapp-control',
|
||||||
<Link to="/whatsapp-control" className="fontMenus">
|
icon: <GlobalOutlined style={{ fontSize: '19px' }} />,
|
||||||
WhatsApp Control
|
label: (
|
||||||
</Link>
|
<Link to="/whatsapp-control" className="fontMenus">
|
||||||
),
|
WhatsApp Control
|
||||||
},
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
// {
|
// {
|
||||||
// key: 'jadwal-shift',
|
// key: 'jadwal-shift',
|
||||||
// icon: <CalendarOutlined style={{ fontSize: '19px' }} />,
|
// icon: <CalendarOutlined style={{ fontSize: '19px' }} />,
|
||||||
|
|||||||
Reference in New Issue
Block a user