Compare commits
8 Commits
amalia/15-
...
amalia/20-
| Author | SHA1 | Date | |
|---|---|---|---|
| c782f956e0 | |||
| 515ee01d53 | |||
| 058dd95b4f | |||
| ef2183ffb7 | |||
| 9afe9297e0 | |||
| f98fb51cfd | |||
| 3b8eabc111 | |||
| 88ddb7527e |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bun-react-template",
|
"name": "bun-react-template",
|
||||||
"version": "0.1.9",
|
"version": "0.1.12",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ interface APIUser {
|
|||||||
gender: string
|
gender: string
|
||||||
isWithoutOTP: boolean
|
isWithoutOTP: boolean
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
|
isApprover: boolean
|
||||||
role: string
|
role: string
|
||||||
village: string
|
village: string
|
||||||
group: string
|
group: string
|
||||||
@@ -118,7 +119,8 @@ function UsersIndexPage() {
|
|||||||
idGroup: '',
|
idGroup: '',
|
||||||
idPosition: '',
|
idPosition: '',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
isWithoutOTP: false
|
isWithoutOTP: false,
|
||||||
|
isApprover: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// Options Data (Shared for both Add and Edit modals)
|
// Options Data (Shared for both Add and Edit modals)
|
||||||
@@ -212,7 +214,8 @@ function UsersIndexPage() {
|
|||||||
idGroup: user.idGroup,
|
idGroup: user.idGroup,
|
||||||
idPosition: user.idPosition,
|
idPosition: user.idPosition,
|
||||||
isActive: user.isActive,
|
isActive: user.isActive,
|
||||||
isWithoutOTP: user.isWithoutOTP
|
isWithoutOTP: user.isWithoutOTP,
|
||||||
|
isApprover: user.isApprover
|
||||||
})
|
})
|
||||||
setVillageSearch(user.village)
|
setVillageSearch(user.village)
|
||||||
openEdit()
|
openEdit()
|
||||||
@@ -544,6 +547,12 @@ function UsersIndexPage() {
|
|||||||
checked={editForm.isWithoutOTP}
|
checked={editForm.isWithoutOTP}
|
||||||
onChange={(event) => setEditForm(f => ({ ...f, isWithoutOTP: event.currentTarget.checked }))}
|
onChange={(event) => setEditForm(f => ({ ...f, isWithoutOTP: event.currentTarget.checked }))}
|
||||||
/>
|
/>
|
||||||
|
<Switch
|
||||||
|
label="Approver"
|
||||||
|
description="Grant approver privileges to this user"
|
||||||
|
checked={editForm.isApprover}
|
||||||
|
onChange={(event) => setEditForm(f => ({ ...f, isApprover: event.currentTarget.checked }))}
|
||||||
|
/>
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ function AppVillagesIndexPage() {
|
|||||||
<Select
|
<Select
|
||||||
label="Gender"
|
label="Gender"
|
||||||
placeholder="Select gender"
|
placeholder="Select gender"
|
||||||
data={['Male', 'Female']}
|
data={[{ label: 'Male', value: 'M' }, { label: 'Female', value: 'F' }]}
|
||||||
mt="sm"
|
mt="sm"
|
||||||
required
|
required
|
||||||
value={form.gender}
|
value={form.gender}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Center,
|
Center,
|
||||||
Container,
|
Container,
|
||||||
|
Divider,
|
||||||
Group,
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
Menu,
|
Menu,
|
||||||
@@ -77,7 +78,7 @@ import { notifications } from '@mantine/notifications'
|
|||||||
import { type Role, useLogout, useSession } from '@/frontend/hooks/useAuth'
|
import { type Role, useLogout, useSession } from '@/frontend/hooks/useAuth'
|
||||||
import { usePresence } from '@/frontend/hooks/usePresence'
|
import { usePresence } from '@/frontend/hooks/usePresence'
|
||||||
|
|
||||||
const validTabs = ['overview', 'operators', 'bugs', 'app-logs', 'activity-logs', 'database', 'project', 'api-keys', 'settings'] as const
|
const validTabs = ['overview', 'operators', 'bugs', 'app-logs', 'activity-logs', 'database', 'project', 'settings', 'api-keys'] as const
|
||||||
|
|
||||||
export const Route = createFileRoute('/dev')({
|
export const Route = createFileRoute('/dev')({
|
||||||
validateSearch: (search: Record<string, unknown>) => ({
|
validateSearch: (search: Record<string, unknown>) => ({
|
||||||
@@ -117,8 +118,9 @@ const navItems = [
|
|||||||
// { label: 'Activity Logs', icon: TbActivity, key: 'activity-logs' },
|
// { label: 'Activity Logs', icon: TbActivity, key: 'activity-logs' },
|
||||||
{ label: 'Database', icon: TbDatabase, key: 'database' },
|
{ label: 'Database', icon: TbDatabase, key: 'database' },
|
||||||
{ label: 'Project', icon: TbSitemap, key: 'project' },
|
{ label: 'Project', icon: TbSitemap, key: 'project' },
|
||||||
{ label: 'API Keys', icon: TbKey, key: 'api-keys' },
|
{ label: 'App Config', icon: TbSettings, key: 'settings' },
|
||||||
{ label: 'Settings', icon: TbSettings, key: 'settings' },
|
{ divider: true, key: '__divider-external__' },
|
||||||
|
{ label: 'Desa Mandiri Keys', icon: TbKey, key: 'api-keys' },
|
||||||
]
|
]
|
||||||
|
|
||||||
function DevPage() {
|
function DevPage() {
|
||||||
@@ -201,7 +203,8 @@ function DevPage() {
|
|||||||
<AppShell.Section grow>
|
<AppShell.Section grow>
|
||||||
<Stack gap={4}>
|
<Stack gap={4}>
|
||||||
{navItems.map((item) => {
|
{navItems.map((item) => {
|
||||||
const Icon = item.icon
|
if (item.divider) return <Divider key={item.key} my={4} />
|
||||||
|
const Icon = item.icon!
|
||||||
if (collapsed) {
|
if (collapsed) {
|
||||||
return (
|
return (
|
||||||
<Tooltip key={item.key} label={item.label} position="right">
|
<Tooltip key={item.key} label={item.label} position="right">
|
||||||
@@ -1590,7 +1593,7 @@ function SettingsPanel() {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Group justify="space-between">
|
<Group justify="space-between">
|
||||||
<div>
|
<div>
|
||||||
<Title order={3}>Application Settings</Title>
|
<Title order={3}>App Config</Title>
|
||||||
<Text size="sm" c="dimmed">Manage the URL API and API Key for each application.</Text>
|
<Text size="sm" c="dimmed">Manage the URL API and API Key for each application.</Text>
|
||||||
</div>
|
</div>
|
||||||
<Button leftSection={<TbApps size={16} />} onClick={openAdd}>Add App</Button>
|
<Button leftSection={<TbApps size={16} />} onClick={openAdd}>Add App</Button>
|
||||||
@@ -1798,8 +1801,8 @@ function ApiKeysPanel() {
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Group justify="space-between">
|
<Group justify="space-between">
|
||||||
<div>
|
<div>
|
||||||
<Title order={3}>API Keys</Title>
|
<Title order={3}>Desa Mandiri Keys</Title>
|
||||||
<Text size="sm" c="dimmed">Kelola API key untuk akses endpoint /api/ai/*</Text>
|
<Text size="sm" c="dimmed">Manage access tokens for the Desa Mandiri system</Text>
|
||||||
</div>
|
</div>
|
||||||
<Button leftSection={<TbKey size={14} />} onClick={openCreate}>
|
<Button leftSection={<TbKey size={14} />} onClick={openCreate}>
|
||||||
Buat Key Baru
|
Buat Key Baru
|
||||||
|
|||||||
Reference in New Issue
Block a user