diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx
index b083d0e..f0b024d 100644
--- a/src/AppRoutes.tsx
+++ b/src/AppRoutes.tsx
@@ -18,10 +18,14 @@ import Home from "./pages/Home";
import CredentialPage from "./pages/scr/dashboard/credential/credential_page";
import DashboardHome from "./pages/scr/dashboard/dashboard_home";
import ListPelayananPage from "./pages/scr/dashboard/pelayanan-surat/list_pelayanan_page";
+import DetailPelayananPage from "./pages/scr/dashboard/pelayanan-surat/detail_pelayanan_page";
+import DetailWargaPage from "./pages/scr/dashboard/warga/detail_warga_page";
+import ListWargaPage from "./pages/scr/dashboard/warga/list_warga_page";
import ListPage from "./pages/scr/dashboard/pengaduan/list_page";
import DetailPage from "./pages/scr/dashboard/pengaduan/detail_page";
import ApikeyPage from "./pages/scr/dashboard/apikey/apikey_page";
import DashboardLayout from "./pages/scr/dashboard/dashboard_layout";
+import DetailSettingPage from "./pages/scr/dashboard/setting/detail_setting_page";
import ScrLayout from "./pages/scr/scr_layout";
import DirPage from "./pages/dir/dir_page";
import NotFound from "./pages/NotFound";
@@ -99,6 +103,18 @@ export default function AppRoutes() {
path="/scr/dashboard/pelayanan-surat/list-pelayanan"
element={}
/>
+ }
+ />
+ }
+ />
+ }
+ />
}
@@ -111,6 +127,10 @@ export default function AppRoutes() {
path="/scr/dashboard/apikey/apikey"
element={}
/>
+ }
+ />
} />
diff --git a/src/clientRoutes.ts b/src/clientRoutes.ts
index 42ce0b8..9329ce6 100644
--- a/src/clientRoutes.ts
+++ b/src/clientRoutes.ts
@@ -20,9 +20,13 @@ const clientRoutes = {
"/scr/dashboard/credential/credential": "/scr/dashboard/credential/credential",
"/scr/dashboard/dashboard-home": "/scr/dashboard/dashboard-home",
"/scr/dashboard/pelayanan-surat/list-pelayanan": "/scr/dashboard/pelayanan-surat/list-pelayanan",
+ "/scr/dashboard/pelayanan-surat/detail-pelayanan": "/scr/dashboard/pelayanan-surat/detail-pelayanan",
+ "/scr/dashboard/warga/detail-warga": "/scr/dashboard/warga/detail-warga",
+ "/scr/dashboard/warga/list-warga": "/scr/dashboard/warga/list-warga",
"/scr/dashboard/pengaduan/list": "/scr/dashboard/pengaduan/list",
"/scr/dashboard/pengaduan/detail": "/scr/dashboard/pengaduan/detail",
"/scr/dashboard/apikey/apikey": "/scr/dashboard/apikey/apikey",
+ "/scr/dashboard/setting/detail-setting": "/scr/dashboard/setting/detail-setting",
"/dir/dir": "/dir/dir",
"/*": "/*"
} as const;
diff --git a/src/pages/scr/dashboard/dashboard_layout.tsx b/src/pages/scr/dashboard/dashboard_layout.tsx
index f4241b1..2fc3115 100644
--- a/src/pages/scr/dashboard/dashboard_layout.tsx
+++ b/src/pages/scr/dashboard/dashboard_layout.tsx
@@ -236,13 +236,13 @@ function NavigationDashboard() {
description: "Manage pelayanan surat",
},
{
- path: "/scr/dashboard/user",
+ path: "/scr/dashboard/warga/list-warga",
icon: ,
- label: "User",
- description: "Manage user",
+ label: "Warga",
+ description: "Manage warga",
},
{
- path: "/scr/dashboard/setting",
+ path: "/scr/dashboard/setting/detail-setting",
icon: ,
label: "Setting",
description:
diff --git a/src/pages/scr/dashboard/pelayanan-surat/detail_pelayanan_page.tsx b/src/pages/scr/dashboard/pelayanan-surat/detail_pelayanan_page.tsx
new file mode 100644
index 0000000..c088207
--- /dev/null
+++ b/src/pages/scr/dashboard/pelayanan-surat/detail_pelayanan_page.tsx
@@ -0,0 +1,370 @@
+import apiFetch from "@/lib/apiFetch";
+import {
+ Anchor,
+ Badge,
+ Button,
+ Card,
+ Container,
+ Divider,
+ Flex,
+ Grid,
+ Group,
+ Modal,
+ Stack,
+ Table,
+ Text,
+ Textarea,
+ Title,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import {
+ IconAlignJustified,
+ IconCategory,
+ IconFileCertificate,
+ IconInfoTriangle,
+ IconMapPin,
+ IconMessageReport,
+ IconPhotoScan,
+ IconUser,
+} from "@tabler/icons-react";
+import { useState } from "react";
+import { useLocation } from "react-router-dom";
+import useSwr from "swr";
+
+export default function DetailPelayananPage() {
+ const { search } = useLocation();
+ const query = new URLSearchParams(search);
+ const id = query.get("id");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+function DetailDataPelayanan() {
+ const [opened, { open, close }] = useDisclosure(false);
+ const [catModal, setCatModal] = useState<"tolak" | "terima">("tolak");
+
+ return (
+ <>
+
+
+ {catModal === "tolak" ? (
+ <>
+
+ Anda yakin ingin menolak pengaduan ini? Berikan alasan penolakan
+
+
+
+
+
+
+
+ >
+ ) : (
+ <>
+ Anda yakin ingin menerima pengaduan ini?
+
+
+
+
+ >
+ )}
+
+
+
+
+
+
+
+
+ Pelayanan Surat
+
+
+ #PGf-2345-33
+
+
+
+ antrian
+
+
+
+
+
+
+
+
+
+ Judul
+
+
+ Judul Pelayanan Surat
+
+
+
+
+
+ Lokasi
+
+
+ fwef
+
+
+
+
+
+
+
+
+
+ Kategori
+
+
+ fwef
+
+
+
+
+
+ Gambar
+
+
+ Lihat Gambar
+
+
+
+
+
+
+
+
+
+ Detail
+
+
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit.
+ Illum, corporis iusto. Suscipit veritatis quas, non nobis
+ fuga, laudantium accusantium tempora sint aliquid architecto
+ totam esse eum excepturi nostrum fugiat ut.
+
+
+
+
+
+ Keterangan
+
+
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. At
+ fugiat eligendi nesciunt dolore? Maiores a cumque vitae
+ suscipit incidunt quos beatae modi, vel, id ullam quae
+ voluptas, deserunt quas placeat.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function DetailDataHistori() {
+ const elements = [
+ { position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
+ { position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
+ { position: 39, mass: 88.906, symbol: "Y", name: "Yttrium" },
+ { position: 56, mass: 137.33, symbol: "Ba", name: "Barium" },
+ { position: 58, mass: 140.12, symbol: "Ce", name: "Cerium" },
+ ];
+
+ const rows = elements.map((element) => (
+
+ {element.position}
+ {element.name}
+ {element.symbol}
+ {element.mass}
+
+ ));
+ return (
+
+
+
+
+ Histori Pengaduan
+
+
+
+
+
+
+ Tanggal
+ Deskripsi
+ Status
+ User
+
+
+ {rows}
+
+
+
+ );
+}
+
+function DetailUserPelayanan() {
+ const [page, setPage] = useState(1);
+ const [value, setValue] = useState("");
+ const { data, mutate, isLoading } = useSwr("/", () =>
+ apiFetch.api.pengaduan.list.get({
+ query: {
+ status,
+ search: value,
+ take: "",
+ page: "",
+ },
+ }),
+ );
+
+ useShallowEffect(() => {
+ mutate();
+ }, [status, value]);
+
+ const list = data?.data || [];
+
+ return (
+
+
+
+
+
+ Warga
+
+
+
+
+
+
+
+
+ Nama
+
+
+ Amalia Dwi Yustiani
+
+
+
+
+
+ Telepon
+
+
+ 08123456789
+
+
+
+
+
+ Jumlah Pengaduan
+
+
+ 10
+
+
+
+
+
+ Jumlah Pelayanan Surat
+
+
+ 10
+
+
+
+
+
+ );
+}
diff --git a/src/pages/scr/dashboard/pelayanan-surat/list_pelayanan_page.tsx b/src/pages/scr/dashboard/pelayanan-surat/list_pelayanan_page.tsx
index 6a5c0aa..0a6d2bb 100644
--- a/src/pages/scr/dashboard/pelayanan-surat/list_pelayanan_page.tsx
+++ b/src/pages/scr/dashboard/pelayanan-surat/list_pelayanan_page.tsx
@@ -133,6 +133,8 @@ function ListPelayananSurat({ status }: { status: StatusKey }) {
mutate();
}, [status, value]);
+ const navigate = useNavigate();
+
if (isLoading)
return (
}
/>
- {/*
- Menampilkan {Number(data?.data?.length) * (page - 1) + 1} – {Math.min(10, Number(data?.data?.length) * page)} dari {Number(data?.data?.length)}
-
- */}
{list.length === 0 ? (
- No pengaduan have been added yet.
+ No pelayanan surat have been added yet.
@@ -196,6 +194,11 @@ function ListPelayananSurat({ status }: { status: StatusKey }) {
borderColor: "rgba(100,100,100,0.2)",
boxShadow: "0 0 20px rgba(0,255,200,0.08)",
}}
+ onClick={() => {
+ navigate(
+ `/scr/dashboard/pelayanan-surat/detail-pelayanan?id=${v.id}`,
+ );
+ }}
>
diff --git a/src/pages/scr/dashboard/pengaduan/detail_page.tsx b/src/pages/scr/dashboard/pengaduan/detail_page.tsx
index a5051fd..5509c67 100644
--- a/src/pages/scr/dashboard/pengaduan/detail_page.tsx
+++ b/src/pages/scr/dashboard/pengaduan/detail_page.tsx
@@ -1,301 +1,397 @@
import apiFetch from "@/lib/apiFetch";
import {
- Anchor,
- Badge,
- Card,
- Container,
- Divider,
- Flex,
- Grid,
- Group,
- Stack,
- Table,
- Text,
- Title
+ Anchor,
+ Badge,
+ Button,
+ Card,
+ Container,
+ Divider,
+ Flex,
+ Grid,
+ Group,
+ Image,
+ Modal,
+ Stack,
+ Table,
+ Text,
+ Textarea,
+ Title,
} from "@mantine/core";
-import { useShallowEffect } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import {
- IconAlignJustified,
- IconCategory,
- IconFileCertificate,
- IconInfoTriangle,
- IconMapPin,
- IconMessageReport,
- IconPhotoScan,
- IconUser
+ IconAlignJustified,
+ IconCategory,
+ IconFileCertificate,
+ IconInfoTriangle,
+ IconMapPin,
+ IconMessageReport,
+ IconPhotoScan,
+ IconUser,
} from "@tabler/icons-react";
import { useState } from "react";
import { useLocation } from "react-router-dom";
import useSwr from "swr";
export default function DetailPengaduanPage() {
- const { search } = useLocation();
- const query = new URLSearchParams(search);
- const id = query.get("id");
+ const { search } = useLocation();
+ const query = new URLSearchParams(search);
+ const id = query.get("id");
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
}
function DetailDataPengaduan() {
- return (
- ("tolak");
+ const [imageSrc, setImageSrc] = useState(null);
+ const [openedModalImage, { open: openModalImage, close: closeModalImage }] =
+ useDisclosure(false);
+
+ async function handleLihatGambar() {
+ const res = await apiFetch.api.pengaduan.image.get({
+ query: {
+ fileName: "57d5ce89-7d18-4244-9f4c-ca21b70adb7e",
+ },
+ });
+ console.error('client',res)
+ // const blob = await res.data?.blob();
+ // setImageSrc(URL.createObjectURL(blob!));
+ // openModalImage();
+ }
+
+
+ return (
+ <>
+
-
-
-
-
- Pengaduan
-
-
- #PGf-2345-33
-
-
-
+ {catModal === "tolak" ? (
+ <>
+
+ Anda yakin ingin menolak pengaduan ini? Berikan alasan penolakan
+
+
+
+
+
+
+
+ >
+ ) : (
+ <>
+ Anda yakin ingin menerima pengaduan ini?
+
+
+
+
+ >
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+ Pengaduan
+
+
+ #PGf-2345-33
+
+
+
+ antrian
+
+
+
+
+
+
+
+
+
+ Judul
+
+
+ Judul Pengaduan
+
+
+
+
+
+ Lokasi
+
+
+ fwef
+
+
+
+
+
+
+
+
+
+ Kategori
+
+
+ fwef
+
+
+
+
+
+ Gambar
+
+
+ Lihat Gambar
+
+
+
+
+
+
+
+
+
+ Detail
+
+
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit.
+ Illum, corporis iusto. Suscipit veritatis quas, non nobis
+ fuga, laudantium accusantium tempora sint aliquid architecto
+ totam esse eum excepturi nostrum fugiat ut.
+
+
+
+
+
+ Keterangan
+
+
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. At
+ fugiat eligendi nesciunt dolore? Maiores a cumque vitae
+ suscipit incidunt quos beatae modi, vel, id ullam quae
+ voluptas, deserunt quas placeat.
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- Judul
-
-
- Judul Pengaduan
-
-
-
-
-
- Lokasi
-
-
- fwef
-
-
-
-
-
-
-
-
-
- Kategori
-
-
- fwef
-
-
-
-
-
- Gambar
-
-
-
- Lihat Gambar
-
-
-
-
-
-
-
-
-
-
- Detail
-
-
-
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illum, corporis iusto. Suscipit veritatis quas, non nobis fuga, laudantium accusantium tempora sint aliquid architecto totam esse eum excepturi nostrum fugiat ut.
-
-
-
-
-
-
- Keterangan
-
-
-
- Lorem ipsum dolor, sit amet consectetur adipisicing elit. At fugiat eligendi nesciunt dolore? Maiores a cumque vitae suscipit incidunt quos beatae modi, vel, id ullam quae voluptas, deserunt quas placeat.
-
-
-
-
-
-
+ onClick={() => {
+ setCatModal("tolak");
+ open();
+ }}
+ >
+ Tolak
+
+
+
+
+
+
- );
+ >
+ );
}
function DetailDataHistori() {
- const elements = [
- { position: 6, mass: 12.011, symbol: 'C', name: 'Carbon' },
- { position: 7, mass: 14.007, symbol: 'N', name: 'Nitrogen' },
- { position: 39, mass: 88.906, symbol: 'Y', name: 'Yttrium' },
- { position: 56, mass: 137.33, symbol: 'Ba', name: 'Barium' },
- { position: 58, mass: 140.12, symbol: 'Ce', name: 'Cerium' },
- ];
+ const elements = [
+ { position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
+ { position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
+ { position: 39, mass: 88.906, symbol: "Y", name: "Yttrium" },
+ { position: 56, mass: 137.33, symbol: "Ba", name: "Barium" },
+ { position: 58, mass: 140.12, symbol: "Ce", name: "Cerium" },
+ ];
- const rows = elements.map((element) => (
-
- {element.position}
- {element.name}
- {element.symbol}
- {element.mass}
-
- ));
- return (
-
-
-
-
- Histori Pengaduan
-
-
-
-
-
-
- Tanggal
- Deskripsi
- Status
- User
-
-
- {rows}
-
-
-
-
- )
+ const rows = elements.map((element) => (
+
+ {element.position}
+ {element.name}
+ {element.symbol}
+ {element.mass}
+
+ ));
+ return (
+
+
+
+
+ Histori Pengaduan
+
+
+
+
+
+
+ Tanggal
+ Deskripsi
+ Status
+ User
+
+
+ {rows}
+
+
+
+ );
}
function DetailUserPengaduan() {
- const [page, setPage] = useState(1);
- const [value, setValue] = useState("");
- const { data, mutate, isLoading } = useSwr("/", () =>
- apiFetch.api.pengaduan.list.get({
- query: {
- status,
- search: value,
- take: "",
- page: "",
- },
- }),
- );
+ const [page, setPage] = useState(1);
+ const [value, setValue] = useState("");
+ const { data, mutate, isLoading } = useSwr("/", () =>
+ apiFetch.api.pengaduan.list.get({
+ query: {
+ status,
+ search: value,
+ take: "",
+ page: "",
+ },
+ }),
+ );
- useShallowEffect(() => {
- mutate();
- }, [status, value]);
+ useShallowEffect(() => {
+ mutate();
+ }, [status, value]);
- const list = data?.data || [];
+ const list = data?.data || [];
- return (
-
-
-
-
-
- Warga
-
-
-
-
-
-
-
-
-
- Nama
-
-
- Amalia Dwi Yustiani
-
-
-
-
-
- Telepon
-
-
- 08123456789
-
-
-
-
-
- Jumlah Pengaduan
-
-
- 10
-
-
-
-
-
- Jumlah Pelayanan Surat
-
-
- 10
-
-
-
-
- );
+ return (
+
+
+
+
+
+ Warga
+
+
+
+
+
+
+
+
+ Nama
+
+
+ Amalia Dwi Yustiani
+
+
+
+
+
+ Telepon
+
+
+ 08123456789
+
+
+
+
+
+ Jumlah Pengaduan
+
+
+ 10
+
+
+
+
+
+ Jumlah Pelayanan Surat
+
+
+ 10
+
+
+
+
+
+ );
}
diff --git a/src/pages/scr/dashboard/pengaduan/list_page.tsx b/src/pages/scr/dashboard/pengaduan/list_page.tsx
index a3e94f3..a39ed65 100644
--- a/src/pages/scr/dashboard/pengaduan/list_page.tsx
+++ b/src/pages/scr/dashboard/pengaduan/list_page.tsx
@@ -198,7 +198,9 @@ function ListPengaduan({ status }: { status: StatusKey }) {
borderColor: "rgba(100,100,100,0.2)",
boxShadow: "0 0 20px rgba(0,255,200,0.08)",
}}
- onClick={() => navigate(`/scr/dashboard/pengaduan/detail?id=${v.id}`)}
+ onClick={() =>
+ navigate(`/scr/dashboard/pengaduan/detail?id=${v.id}`)
+ }
>
diff --git a/src/pages/scr/dashboard/setting/detail_setting_page.tsx b/src/pages/scr/dashboard/setting/detail_setting_page.tsx
new file mode 100644
index 0000000..ec6e714
--- /dev/null
+++ b/src/pages/scr/dashboard/setting/detail_setting_page.tsx
@@ -0,0 +1,150 @@
+import { Button, Card, Container, Divider, Flex, Grid, Group, Input, NavLink, Stack, Table, Title } from "@mantine/core";
+import { IconCircleOff, IconGauge, IconHome2 } from "@tabler/icons-react";
+import { useLocation } from "react-router-dom";
+
+export default function DetailSettingPage() {
+ const { search } = useLocation();
+ const query = new URLSearchParams(search);
+ const type = query.get("type");
+
+ return (
+
+
+
+
+ }
+ active={type === "profile" || !type}
+ />
+ }
+ active={type === "cat-pengaduan"}
+ />
+ }
+ active={type === "cat-pelayanan"}
+ />
+ }
+ active={type === "desa"}
+ />
+
+
+
+
+ {type === "cat-pengaduan"
+ ?
+ : type === "cat-pelayanan"
+ ?
+ : type === "desa"
+ ?
+ : }
+
+
+
+
+ );
+}
+
+function ProfilePage() {
+ return (
+
+
+
+ Profile Pengguna
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+function KategoriPengaduanPage() {
+ const elements = [
+ { position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
+ { position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
+ { position: 39, mass: 88.906, symbol: "Y", name: "Yttrium" },
+ { position: 56, mass: 137.33, symbol: "Ba", name: "Barium" },
+ { position: 58, mass: 140.12, symbol: "Ce", name: "Cerium" },
+ ];
+
+ const rows = elements.map((element) => (
+
+ {element.position}
+ {element.name}
+ {element.symbol}
+ {element.mass}
+
+ ));
+ return (
+
+
+
+ Kategori Pengaduan
+
+
+
+
+
+
+
+
+ Tanggal
+ Deskripsi
+ Status
+ User
+
+
+ {rows}
+
+
+
+ )
+}
diff --git a/src/pages/scr/dashboard/warga/detail_warga_page.tsx b/src/pages/scr/dashboard/warga/detail_warga_page.tsx
new file mode 100644
index 0000000..a4a3d04
--- /dev/null
+++ b/src/pages/scr/dashboard/warga/detail_warga_page.tsx
@@ -0,0 +1,182 @@
+import apiFetch from "@/lib/apiFetch";
+import {
+ Avatar,
+ Box,
+ Card,
+ Container,
+ Divider,
+ Flex,
+ Grid,
+ Group,
+ Stack,
+ Table,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconMail, IconMapPin, IconPhone } from "@tabler/icons-react";
+import { useState } from "react";
+import { useLocation } from "react-router-dom";
+import useSwr from "swr";
+
+export default function DetailWargaPage() {
+ const { search } = useLocation();
+ const query = new URLSearchParams(search);
+ const id = query.get("id");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+function DetailDataHistori() {
+ const elements = [
+ { position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
+ { position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
+ { position: 39, mass: 88.906, symbol: "Y", name: "Yttrium" },
+ { position: 56, mass: 137.33, symbol: "Ba", name: "Barium" },
+ { position: 58, mass: 140.12, symbol: "Ce", name: "Cerium" },
+ ];
+
+ const rows = elements.map((element) => (
+
+ {element.position}
+ {element.name}
+ {element.symbol}
+ {element.mass}
+
+ ));
+ return (
+
+
+
+
+ Histori Pengaduan
+
+
+
+
+
+
+ Tanggal
+ Deskripsi
+ Status
+ User
+
+
+ {rows}
+
+
+
+ );
+}
+
+function DetailWarga() {
+ const [page, setPage] = useState(1);
+ const [value, setValue] = useState("");
+ const { data, mutate, isLoading } = useSwr("/", () =>
+ apiFetch.api.pengaduan.list.get({
+ query: {
+ status,
+ search: value,
+ take: "",
+ page: "",
+ },
+ }),
+ );
+
+ useShallowEffect(() => {
+ mutate();
+ }, [status, value]);
+
+ const list = data?.data || [];
+
+ return (
+
+
+
+ {/* Profile image */}
+
+
+ {/* Main content */}
+
+
+ Lizbeth Moore
+
+
+ Social Media Strategies
+
+
+
+
+ {/* Contact info */}
+
+
+
+
+ lizbeth.moore@email.com
+
+
+
+
+ +1 555-7788
+
+
+
+
+ Greenway Ave, Los Angeles, CA, USA
+
+
+
+
+ );
+}
diff --git a/src/pages/scr/dashboard/warga/list_warga_page.tsx b/src/pages/scr/dashboard/warga/list_warga_page.tsx
new file mode 100644
index 0000000..cb34134
--- /dev/null
+++ b/src/pages/scr/dashboard/warga/list_warga_page.tsx
@@ -0,0 +1,97 @@
+import {
+ Button,
+ Card,
+ CloseButton,
+ Container,
+ Divider,
+ Flex,
+ Input,
+ Stack,
+ Table,
+ Title,
+} from "@mantine/core";
+import { IconSearch } from "@tabler/icons-react";
+import { useState } from "react";
+import { useNavigate } from "react-router-dom";
+
+export default function ListWargaPage() {
+ const navigate = useNavigate();
+ const [value, setValue] = useState("");
+ const elements = [
+ { position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
+ { position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
+ { position: 39, mass: 88.906, symbol: "Y", name: "Yttrium" },
+ { position: 56, mass: 137.33, symbol: "Ba", name: "Barium" },
+ { position: 58, mass: 140.12, symbol: "Ce", name: "Cerium" },
+ ];
+
+ const rows = elements.map((element) => (
+
+ {element.position}
+ {element.name}
+ {element.symbol}
+ {element.mass}
+
+
+
+
+ ));
+
+ return (
+
+
+
+
+
+ List Data Warga
+
+ setValue(event.currentTarget.value)}
+ leftSection={}
+ rightSectionPointerEvents="all"
+ rightSection={
+ setValue("")}
+ style={{ display: value ? undefined : "none" }}
+ />
+ }
+ />
+
+
+
+
+
+ Tanggal
+ Deskripsi
+ Status
+ User
+ Aksi
+
+
+ {rows}
+
+
+
+
+ );
+}
diff --git a/src/server/lib/seafile.ts b/src/server/lib/seafile.ts
index 65b03ba..5c09a8e 100644
--- a/src/server/lib/seafile.ts
+++ b/src/server/lib/seafile.ts
@@ -225,49 +225,4 @@ export async function downloadFile(config: Config, remoteFile: string, localFile
export async function getFileLink(config: Config, fileName: string): Promise {
const downloadUrlResponse = await fetchWithAuth(config, `${config.URL}/${config.REPO}/file/?p=/${fileName}`);
return `🔗 Link for ${fileName}:\n${(await downloadUrlResponse.text()).replace(/"/g, '')}`
-}
-
-// function showHelp(): void {
-// return `note - simple CLI for wibu not
-// Usage:
-// not3 ls List files
-// not3 cat Show file content
-// not3 cp [remote] Upload file
-// not3 rm Remove file
-// not3 mv Rename/move file
-// not3 get [local] Download file
-// not3 link Get file link/URL
-// not3 test Test API connection
-// not3 config Edit config (~/.note.conf)
-
-// Config (~/.note.conf):
-// TOKEN=your_seafile_token
-// REPO=repos/
-// URL=your_seafile_url/api2
-
-// Version: ${version}`);
-// }
-
-// --- Main ---
-// async function not3(): Promise {
-// const [cmd, ...args] = process.argv.slice(2);
-// if (cmd === 'config') return editConfig();
-
-// const config = await loadConfig();
-// switch (cmd) {
-// case 'test': return testConnection(config);
-// case 'ls': return listFiles(config);
-// case 'cat': return args[0] ? catFile(config, args[0]) : console.error('Usage: bun note.ts cat ');
-// case 'cp': return args[0] ? uploadFile(config, args[0], args[1]) : console.error('Usage: bun note.ts cp [remote_file]');
-// case 'rm': return args[0] ? removeFile(config, args[0]) : console.error('Usage: bun note.ts rm ');
-// case 'mv': return args[1] ? moveFile(config, args[0]!, args[1]) : console.error('Usage: bun note.ts mv ');
-// case 'get': return args[0] ? downloadFile(config, args[0], args[1]) : console.error('Usage: bun note.ts get [local_file]');
-// case 'link': return args[0] ? getFileLink(config, args[0]) : console.error('Usage: bun note.ts link ');
-// default: return showHelp();
-// }
-// }
-
-// not3().catch((error) => {
-// console.error('❌ Error:', error);
-// process.exit(1);
-// });
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/server/routes/pengaduan_route.ts b/src/server/routes/pengaduan_route.ts
index bd3129c..966a033 100644
--- a/src/server/routes/pengaduan_route.ts
+++ b/src/server/routes/pengaduan_route.ts
@@ -6,7 +6,7 @@ import { mimeToExtension } from "../lib/mimetypeToExtension"
import { generateNoPengaduan } from "../lib/no-pengaduan"
import { normalizePhoneNumber } from "../lib/normalizePhone"
import { prisma } from "../lib/prisma"
-import { defaultConfigSF, uploadFile, uploadFileBase64 } from "../lib/seafile"
+import { catFile, defaultConfigSF, testConnection, uploadFile, uploadFileBase64 } from "../lib/seafile"
const PengaduanRoute = new Elysia({
prefix: "pengaduan",
@@ -487,7 +487,6 @@ const PengaduanRoute = new Elysia({
consumes: ["multipart/form-data"]
},
})
-
.get("/list", async ({ query }) => {
const { take, page, search, status } = query
const skip = !page ? 0 : (Number(page) - 1) * (!take ? 10 : Number(take))
@@ -619,6 +618,34 @@ const PengaduanRoute = new Elysia({
description: `tool untuk mendapatkan jumlah pengaduan warga`,
}
})
+ .get("/image", async ({ query, set }) => {
+ const { fileName } = query
+
+ const connect = await testConnection(defaultConfigSF)
+ console.log({connect})
+
+ const hasil = await catFile(defaultConfigSF, fileName)
+ console.log('hasilnya', hasil)
+ // Tentukan tipe MIME berdasarkan ekstensi
+ const ext = fileName.split(".").pop()?.toLowerCase();
+ const mime =
+ ext === "jpg" || ext === "jpeg"
+ ? "image/jpeg"
+ : ext === "png"
+ ? "image/png"
+ : "application/octet-stream";
+
+ set.headers["Content-Type"] = mime;
+ return new Response(hasil);
+ }, {
+ query: t.Object({
+ fileName: t.String(),
+ }),
+ detail: {
+ summary: "Gambar Pengaduan Warga",
+ description: `tool untuk mendapatkan gambar pengaduan warga`,
+ }
+ })
;
export default PengaduanRoute