From a45169d328091b659e492890046fad06a4d709c3 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:26:53 +0800 Subject: [PATCH 1/7] Setup .env for default --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 9709ce0..9744809 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ VITE_BACKEND=http://localhost:4320/api/ -#VITE_BACKEND=https://ocboapps.davaocity.gov.ph/esign-server/api/ +# VITE_BACKEND=https://ocboapps.davaocity.gov.ph/esign-server/api/ # VITE_BACKEND=http://192.168.7.163/server/api/ VITE_HEAD=ARCH. KHASHAYAR L. TOGHYANI VITE_PESO=₱ From d68d9699bf7139029143ce228b693cf3dc547a5b Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:27:16 +0800 Subject: [PATCH 2/7] Updated index.html --- backend/Dockerfile | 10 ++++++---- index.html | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 350ec34..32334f6 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,13 +1,15 @@ FROM golang:1.25.3 AS build +ENV GIN_MODE=release +ENV PORT=4320 WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . -RUN GOOS=linux GOARCH=amd64 GOAMD64=v1 go build -pgo=auto -ldflags="-s -w" -o bin/esign-server main.go +RUN GOOS=linux GOARCH=amd64 GOAMD64=v1 go build -pgo=auto -ldflags="-s -w" -o /bin/esign-server main.go FROM alpine:latest WORKDIR /app -COPY --from=build /app/bin/esign-server . -EXPOSE 4320 -CMD ["./esign-server"] \ No newline at end of file +COPY --from=build /bin/esign-server ./server +EXPOSE $PORT +CMD ["./server"] \ No newline at end of file diff --git a/index.html b/index.html index 48829a6..2bf4428 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,8 @@ - + + From 5837a1d5ea6dd14fea79fdeea9f9f0c0caeb715b Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:27:45 +0800 Subject: [PATCH 3/7] Fixed background display --- src/index.sass | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.sass b/src/index.sass index 0d42bad..46459c5 100644 --- a/src/index.sass +++ b/src/index.sass @@ -15,10 +15,7 @@ z-index: -1 opacity: 1 background-attachment: fixed - - // @media only screen and (max-width: views.$mobile) - // background-image: url('/src/assets/images/svg/background-mobile.svg') - // height: 100% + background-size: cover .close-text padding: 3rem 0 0 0 From 49080523b74504848c9f04c50a18d091d99c1ecd Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:27:56 +0800 Subject: [PATCH 4/7] Adjusted classes --- src/styles/classes.sass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/styles/classes.sass b/src/styles/classes.sass index a5fb9f4..84f05df 100644 --- a/src/styles/classes.sass +++ b/src/styles/classes.sass @@ -2,7 +2,10 @@ @use 'sass:color' .fullscreen - position: absolute + display: flex + align-items: center + justify-content: center + position: fixed top: 0 left: 0 width: 100vw From 015984c4cf55db6ac452cd340e35033736cf405d Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:28:07 +0800 Subject: [PATCH 5/7] Added clearing cache --- src/pages/IndexPage/Index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/IndexPage/Index.tsx b/src/pages/IndexPage/Index.tsx index 4ae2ac8..3641eb4 100644 --- a/src/pages/IndexPage/Index.tsx +++ b/src/pages/IndexPage/Index.tsx @@ -42,7 +42,12 @@ export default () => { sessionStorage.setItem('registered', JSON.stringify([...registeredNameList])) } + const clearCache = async () => { + caches.keys() + } + onMount(async () => { + await clearCache() await getAssessors() await getRegistered() }) From 596c11cd2314437564516c1acc036ff2b92beac7 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:28:23 +0800 Subject: [PATCH 6/7] Added placeholder on input component --- src/components/Input/Input.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Input/Input.tsx b/src/components/Input/Input.tsx index 990d391..139823f 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/Input/Input.tsx @@ -8,6 +8,7 @@ interface Props { onChange: Setter onKeyDown?: (event: KeyboardEvent) => void isPassword?: boolean + placeholder?: string } export default (props: Props) => { @@ -17,7 +18,7 @@ export default (props: Props) => { {props.label} - + ) From 6a5ef64d35a1e62866257d6c8011f19e6cf79edc Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 30 Oct 2025 16:33:54 +0800 Subject: [PATCH 7/7] Added filter search --- src/pages/AssessorPage/Assessor.tsx | 66 ++++++++++++++++------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index b292998..fc4671a 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -3,7 +3,7 @@ import { Logo, Page, Row, Padding, ModalButton, Button, Clickable, Link, Modal, import { FiLogOut } from 'solid-icons/fi' import { Tabs } from '@kobalte/core/tabs' import { ofetch } from 'ofetch' -import { onMount, createSignal, Show } from 'solid-js' +import { onMount, createSignal, Show, createEffect } from 'solid-js' import dayjs from 'dayjs' import { checkConnection, createPdf } from '../../utils/functions' import { FaSolidThumbsUp } from 'solid-icons/fa' @@ -55,18 +55,18 @@ export default () => { } } - const handleFilterChange = (value: string) => { - // setFilter(value) - if (value.trim() === '') { - setApplicationList(fullIDList()) - setNameList(fullNameList()) - } else { - const filteredApplications = fullIDList().filter((app) => app.toLowerCase().includes(value.toLowerCase())) - const filteredNames = fullNameList().slice(0, filteredApplications.length) - setApplicationList(filteredApplications) - setNameList(filteredNames) - } - } + // const handleFilterChange = (value: string) => { + // // setFilter(value) + // if (value.trim() === '') { + // setApplicationList(fullIDList()) + // setNameList(fullNameList()) + // } else { + // const filteredApplications = fullIDList().filter((app) => app.toLowerCase().includes(value.toLowerCase())) + // const filteredNames = fullNameList().slice(0, filteredApplications.length) + // setApplicationList(filteredApplications) + // setNameList(filteredNames) + // } + // } const getPrintDetails = async (id: number) => { const response = await ofetch(API + 'get-printdetails-electrical/' + id) @@ -161,8 +161,8 @@ export default () => { const approversignId = await geteSignId(276) getApprovedDate(approversignId, applicationNo) - const assessorId = await getEmployeeId(op.result7[0]) - const assessorsignId = await geteSignId(assessorId) + // const assessorId = await getEmployeeId(op.result7[0]) + // const assessorsignId = await geteSignId(assessorId) getAssessedDate(op.result11[0]) } @@ -171,22 +171,20 @@ export default () => { return total } - const getListForPrinting = async (query?: string) => { + const getListForPrinting = async () => { try { const response = await ofetch(API + 'get-listopprinting-electrical', { parseResponse: JSON.parse }) - const filteredApplications = response.result.filter((item: any) => - item - .toString() - .toLowerCase() - .includes((query ?? '').toLowerCase()) - ) - const filteredNames = response.result2.filter((item: any) => - item.toString().toLowerCase().includes((query ?? '').toLowerCase()) - ) - // setApplicationList(response.result) - // setNameList(response.result2) - setApplicationList(filteredApplications) - setNameList(filteredNames) + + if (filter() !== '' && filter().trim().length !== 0) { + const filteredApplications = response.result.filter((item: string) => item.includes(filter())) + const filteredIndices = response.result.map((item: string, index: number) => (item.includes(filter()) ? index : -1)).filter((index: number) => index !== -1) + const filteredNames = filteredIndices.map((index: number) => response.result2[index]) + setApplicationList(filteredApplications) + setNameList(filteredNames) + return + } + setApplicationList(response.result) + setNameList(response.result2) } catch (error) { console.error(error) } @@ -352,6 +350,14 @@ export default () => { } }) + createEffect(async () => { + if (filter() !== '') { + await getListForPrinting() + } else if (filter() === '') { + await getListForPrinting() + } + }) + return ( <> @@ -451,7 +457,7 @@ export default () => { - +