Merge branch 'develop' into nice_dev

# Conflicts:
#	src/views/MainView.vue
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-19 15:01:50 +07:00
commit 1774cf1991
5 changed files with 107 additions and 112 deletions

View file

@ -1,2 +1,3 @@
VITE_API_URI_CONFIG=VITE_API_URI_CONFIG VITE_API_URI_CONFIG=VITE_API_URI_CONFIG
VITE_URL_SSO=VITE_URL_SSO VITE_URL_SSO=VITE_URL_SSO
VITE_URL_LANDING=VITE_URL_LANDING

View file

@ -1,102 +1,102 @@
version: 37 version: 38
jobs: jobs:
- name: CI for UAT - name: CI for UAT
steps: steps:
- !CheckoutStep - !CheckoutStep
name: checkout code name: checkout code
cloneCredential: !DefaultCredential {} cloneCredential: !DefaultCredential {}
withLfs: false withLfs: false
withSubmodules: false withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !GenerateChecksumStep - !GenerateChecksumStep
name: generate package checksum name: generate package checksum
files: package-lock.json yarn.lock files: package-lock.json yarn.lock
targetFile: checksum targetFile: checksum
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetupCacheStep - !SetupCacheStep
name: set up npm cache name: set up npm cache
key: node_modules_@file:checksum@ key: node_modules_@file:checksum@
loadKeys: loadKeys:
- node_modules - node_modules
paths: paths:
- node_modules - node_modules
uploadStrategy: UPLOAD_IF_NOT_HIT uploadStrategy: UPLOAD_IF_NOT_HIT
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetBuildVersionStep - !SetBuildVersionStep
name: set build version name: set build version
buildVersion: '@tag@' buildVersion: '@tag@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep - !CommandStep
name: build & test name: build & test
runInContainer: true runInContainer: true
image: node image: node
interpreter: !DefaultInterpreter interpreter: !DefaultInterpreter
commands: | commands: |
npm install npm install
npm run build npm run build
useTTY: true useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep - !BuildImageStep
name: build docker image name: build docker image
dockerfile: ./docker/Dockerfile dockerfile: ./docker/Dockerfile
output: !RegistryOutput output: !RegistryOutput
tags: hrms-git.chin.in.th/bma-hrms/hrms-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-checkin:latest tags: '@server@/bma-hrms/hrms-checkin:@build_version@ @server@/bma-hrms/hrms-checkin:latest'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers: triggers:
- !TagCreateTrigger - !TagCreateTrigger
tags: uat-* tags: uat-*
branches: main branches: main
retryCondition: never retryCondition: never
maxRetries: 3 maxRetries: 3
retryDelay: 30 retryDelay: 30
timeout: 14400 timeout: 14400
- name: CI for PROD - name: CI for PROD
steps: steps:
- !CheckoutStep - !CheckoutStep
name: checkout code name: checkout code
cloneCredential: !DefaultCredential {} cloneCredential: !DefaultCredential {}
withLfs: false withLfs: false
withSubmodules: false withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !GenerateChecksumStep - !GenerateChecksumStep
name: generate package checksum name: generate package checksum
files: package-lock.json yarn.lock files: package-lock.json yarn.lock
targetFile: checksum targetFile: checksum
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetupCacheStep - !SetupCacheStep
name: set up npm cache name: set up npm cache
key: node_modules_@file:checksum@ key: node_modules_@file:checksum@
loadKeys: loadKeys:
- node_modules - node_modules
paths: paths:
- node_modules - node_modules
uploadStrategy: UPLOAD_IF_NOT_HIT uploadStrategy: UPLOAD_IF_NOT_HIT
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetBuildVersionStep - !SetBuildVersionStep
name: set build version name: set build version
buildVersion: '@tag@' buildVersion: '@tag@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep - !CommandStep
name: build & test name: build & test
runInContainer: true runInContainer: true
image: node image: node
interpreter: !DefaultInterpreter interpreter: !DefaultInterpreter
commands: | commands: |
npm install npm install
npm run build npm run build
useTTY: true useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep - !BuildImageStep
name: build docker image name: build docker image
dockerfile: ./docker/Dockerfile dockerfile: ./docker/Dockerfile
output: !RegistryOutput output: !RegistryOutput
tags: hrms-git.bangkok.go.th/bma-hrms/hrms-checkin:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-checkin:latest tags: '@server@/bma-hrms/hrms-checkin:@build_version@ @server@/bma-hrms/hrms-checkin:latest'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers: triggers:
- !TagCreateTrigger - !TagCreateTrigger
tags: prod-* tags: prod-*
branches: main branches: main
retryCondition: never retryCondition: never
maxRetries: 3 maxRetries: 3
retryDelay: 30 retryDelay: 30
timeout: 14400 timeout: 14400

View file

@ -1,7 +1,7 @@
# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-checkin:0.1 # docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-checkin:0.1
# Build Stage # Build Stage
FROM node:20-alpine as build-stage FROM node:20-alpine AS build-stage
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install

View file

@ -10,6 +10,7 @@ do
sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file
sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file
sed -i 's|VITE_URL_LANDING|'${VITE_URL_LANDING}'|g' $file
done done

View file

@ -19,7 +19,7 @@ const $q = useQuasar()
// landing page config url // landing page config url
const configParam = { const configParam = {
landingPageUrl: import.meta.env.VITE_URL_SSO, landingPageUrl: import.meta.env.VITE_URL_LANDING,
} }
const fullName = ref<string>('') // const fullName = ref<string>('') //
@ -141,14 +141,7 @@ function onLoad(index: number, done: Function) {
} }
// landing page redirect // landing page redirect
const landingPageUrl = ref<string>(getLandingUrl()) const landingPageUrl = ref<string>(configParam.landingPageUrl)
function getLandingUrl() {
if (window.location.hostname === "bma-ehr-checkin.frappet.synology.me") {
return `${configParam.landingPageUrl}/e-hr`;
} else {
return configParam.landingPageUrl;
}
}
/** ฟังก์ชันเรียกข้อมูลผู้ใช่งาน*/ /** ฟังก์ชันเรียกข้อมูลผู้ใช่งาน*/
async function fetchKeycloakPosition() { async function fetchKeycloakPosition() {