diff --git a/ docker/Dockerfile b/ docker/Dockerfile new file mode 100644 index 0000000..62b1cee --- /dev/null +++ b/ docker/Dockerfile @@ -0,0 +1,19 @@ +# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-user:0.1 + +# Build Stage +FROM node:20-alpine as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY ./ . +RUN npm run build + +# Production Stage +FROM nginx:stable-alpine AS production-stage +RUN mkdir /app +COPY --from=build-stage /app/dist /app +COPY docker/nginx.conf /etc/nginx/nginx.conf +COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod u+x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/entrypoint.sh b/ docker/entrypoint.sh similarity index 69% rename from entrypoint.sh rename to docker/entrypoint.sh index d84bb9b..ae50dc4 100644 --- a/entrypoint.sh +++ b/ docker/entrypoint.sh @@ -8,14 +8,12 @@ for file in $ROOT_DIR/assets/app.*.js* $ROOT_DIR/js/app.*.js* $ROOT_DIR/assets/Q do echo "Processing $file ..."; - sed -i 's|VITE_REALM_KEYCLOAK|'${VITE_REALM_KEYCLOAK}'|g' $file - sed -i 's|VITE_CLIENTID_KEYCLOAK|'${VITE_CLIENTID_KEYCLOAK}'|g' $file - sed -i 's|VITE_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|g' $file sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file sed -i 's|VITE_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file - sed -i 's|VITE_CLIENTSECRET_KEYCLOAK|'${VITE_CLIENTSECRET_KEYCLOAK}'|g' $file sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file + sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file + done diff --git a/nginx.conf b/ docker/nginx.conf similarity index 100% rename from nginx.conf rename to docker/nginx.conf diff --git a/.env.production b/.env.production index 277058b..0c77635 100644 --- a/.env.production +++ b/.env.production @@ -1,13 +1,5 @@ -VITE_REALM_KEYCLOAK=VITE_REALM_KEYCLOAK -VITE_CLIENTID_KEYCLOAK=VITE_CLIENTID_KEYCLOAK -VITE_URL_KEYCLOAK=VITE_URL_KEYCLOAK VITE_API_URI_CONFIG=VITE_API_URI_CONFIG VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL -VITE_CLIENTSECRET_KEYCLOAK=VITE_CLIENTSECRET_KEYCLOAK VITE_MANUAL_URL=VITE_MANUAL_URL VITE_URL_SSO: VITE_URL_SSO -# VITE_REALM_KEYCLOAK: "bma-ehr" -# VITE_CLIENTID_KEYCLOAK: "bma-ehr-exam-vue3" -# VITE_URL_KEYCLOAK: "https://id.frappet.synology.me/" -# VITE_API_URI_CONFIG: "https://bma-ehr.frappet.synology.me/api/v1" -# VITE_API_PUBLISH_URL: "https://bma-ehr-publish.frappet.synology.me" \ No newline at end of file +VITE_API_REPORT_URL=VITE_API_REPORT_URL \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3983ecd..0a538a6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,6 +52,7 @@ jobs: with: context: . platforms: linux/amd64 + file: docker/Dockerfile push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a6b08ee..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# docker build . -t docker.frappet.com/demo/fe:latest -FROM node:latest as build-stage -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY ./ . - -RUN npm run build - -FROM nginx as production-stage - -RUN mkdir /app -COPY --from=build-stage /app/dist /app -COPY nginx.conf /etc/nginx/nginx.conf - -COPY entrypoint.sh /usr/local/bin/entrypoint.sh -RUN chmod u+x /usr/local/bin/entrypoint.sh - - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -CMD ["nginx", "-g", "daemon off;"] diff --git a/src/api/index.ts b/src/api/index.ts index b646c57..90fc5db 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -4,6 +4,7 @@ import { ref } from "vue"; const env = ref(process.env.NODE_ENV || "development"); export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG; export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL; +export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; // if (process.env.VUE_APP_TEST) { // env = "test"; @@ -15,6 +16,8 @@ const config = ref({ API_URL_SUPPORT: "https://bma-ehr.frappet.synology.me/api/v1/support", MEET_URI: "meet.frappet.com", LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me", + API_REPORT_TEMPLATE_URI: + "https://report-server.frappet.synology.me/api/v1/report-template", }, test: { API_URI: "http://localhost:5010/api/v1", @@ -27,6 +30,7 @@ const config = ref({ "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", LINK_EVALUATE_PUBLISH: apiUrlConfigPublish, + API_REPORT_TEMPLATE_URI: apiUrlConfigReport, }, }); @@ -36,6 +40,9 @@ const MEET_URI = ref(config.value[env.value].MEET_URI); const LINK_EVALUATE_PUBLISH = ref( config.value[env.value].LINK_EVALUATE_PUBLISH ); +const API_REPORT_TEMPLATE_URI = ref( + config.value[env.value].API_REPORT_TEMPLATE_URI +); export default { env: env.value, @@ -44,4 +51,5 @@ export default { API_URL_SUPPORT: API_URL_SUPPORT.value, MEET_URI: MEET_URI.value, LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value, + API_REPORT_TEMPLATE_URI: API_REPORT_TEMPLATE_URI.value, }; diff --git a/src/api/probation/api.probation.ts b/src/api/probation/api.probation.ts index 274f2a1..fdd102b 100644 --- a/src/api/probation/api.probation.ts +++ b/src/api/probation/api.probation.ts @@ -6,7 +6,7 @@ const kpiCapacity = `${env.API_URI}/kpi/capacity`; const reportProbation = `${env.API_URI}/report/probation`; export default { probationMain: (id: string) => - `${probation}/assign/probation-assign-list?personal_id=${id}`, + `${probation}/assign/assign-user-list?personal_id=${id}`, orgProfilePlacement: (id: string) => `${org}/profile/placement/${id}`, calculateDate: () => `${probation}/calculate/assign-finish`, diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts new file mode 100644 index 0000000..e8c98b4 --- /dev/null +++ b/src/api/reports/api.report.ts @@ -0,0 +1,7 @@ +import env from "../index"; + +const reportTemplate = `${env.API_REPORT_TEMPLATE_URI}`; + +export default { + reportTemplate, +}; diff --git a/src/app.config.ts b/src/app.config.ts index 0b1387d..ecbd141 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -14,6 +14,9 @@ import kpi from "./api/KPI/api.kpis"; import probation from "./api/probation/api.probation"; import development from "./api/api.development"; +/** API reports */ +import reports from "./api/reports/api.report"; + const API = { ...testtest, ...retirementResign, @@ -27,6 +30,8 @@ const API = { ...kpi, ...probation, ...development, + //reports + ...reports, }; const path = @@ -61,7 +66,9 @@ const generatePopupPath = (routeName: any, type: string) => { return `${path}/manual/chapter-6-user-transfer`; } if (routeName.includes("appealComplain")) { - return `${path}/manual/chapter-${type ? "4" : "7"}-user${type}-appeal-complain`; + return `${path}/manual/chapter-${ + type ? "4" : "7" + }-user${type}-appeal-complain`; } if (routeName.includes("KPI-evaluator")) { return `${path}/manual/chapter-9-user-KPI-evaluator`; diff --git a/src/components/Table.vue b/src/components/Table.vue index 4125e19..f33457c 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -3,10 +3,9 @@
diff --git a/src/components/TableD.vue b/src/components/TableD.vue index e8303c4..b2c5823 100644 --- a/src/components/TableD.vue +++ b/src/components/TableD.vue @@ -11,6 +11,7 @@ :pagination-label="paginationLabel" v-model:pagination="pagination" :grid="!$q.screen.gt.xs" + :rows-per-page-options="[10, 25, 50, 100]" >