From eeec2ad947ac4f2f55706a5cfb775a822c141e94 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 6 Dec 2024 18:01:32 +0700 Subject: [PATCH 01/32] =?UTF-8?q?=E0=B8=88=E0=B8=B1=E0=B8=94=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=20web=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/06_webservices/view/logView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/06_webservices/view/logView.vue b/src/modules/06_webservices/view/logView.vue index 23cc491b..d62259e5 100644 --- a/src/modules/06_webservices/view/logView.vue +++ b/src/modules/06_webservices/view/logView.vue @@ -126,7 +126,7 @@ async function fetchListApiKeyName() { dataApiName.value.push(...optionData); options.value = dataApiName.value; await onItemClick(labelDropdown.value, valDropdown.value); - await fetchListLog(); + // await fetchListLog(); }) .catch((err) => { messageError($q, err); From 0dd17e797c0d1782540df7293d15531bfe8b2272 Mon Sep 17 00:00:00 2001 From: kittapath Date: Sat, 7 Dec 2024 08:26:14 +0700 Subject: [PATCH 02/32] test build discord --- .github/workflows/release.yaml | 58 ++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2723b808..ce336e88 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ -name: release-test -run-name: release-test ${{ github.actor }} +name: release +run-name: release ${{ github.actor }} on: push: tags: @@ -9,12 +9,11 @@ env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-admin DEPLOY_HOST: frappet.com - # COMPOSE_PATH: /home/frappet/docker/bma-ehr COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-admin jobs: # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v6.1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd - release-test: + release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -68,21 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - uses: snow-actions/line-notify@v1.1.0 + - name: Notify Discord Success if: success() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - -Success✅✅✅ - Image: ${{env.IMAGE_NAME}} - Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} - By: ${{github.actor}} - - uses: snow-actions/line-notify@v1.1.0 + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} + + - name: Notify Discord Failure if: failure() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - -Failure❌❌❌ - Image: ${{env.IMAGE_NAME}} - Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} - By: ${{github.actor}} + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} From 452724aad79372683bfdab401deb68676b8219f4 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sun, 8 Dec 2024 07:07:30 +0000 Subject: [PATCH 03/32] add CI --- .onedev-buildspec.yml | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .onedev-buildspec.yml diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml new file mode 100644 index 00000000..11620175 --- /dev/null +++ b/.onedev-buildspec.yml @@ -0,0 +1,102 @@ +version: 37 +jobs: +- name: CI for UAT + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: '@tag@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-admin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-admin:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: uat-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 +- name: CI for PROD + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: '@tag@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.bangkok.go.th/bma-hrms/hrms-admin:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-admin:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: prod-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 From 493f0294e8f8bbfd2528140872ec06716b985325 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 10 Dec 2024 10:45:01 +0700 Subject: [PATCH 04/32] updated config --- .env.example | 1 + .env.production | 3 +-- docker/entrypoint.sh | 3 +-- src/api/index.ts | 6 ++---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 7808f4e0..7f8cb8c5 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ VITE_API_URI_CONFIG: "https://app.your-domain.com/api/v1" +VITE_URL_SSO: "https://app-sso.your-domain.com" VITE_MANUAL_URL: "https://app-manual.your-domain.com" \ No newline at end of file diff --git a/.env.production b/.env.production index afa876a1..df95cced 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,4 @@ -VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL -VITE_API_REPORT_URL=VITE_API_REPORT_URL VITE_API_URI_CONFIG=VITE_API_URI_CONFIG +VITE_API_REPORT_URL=VITE_API_REPORT_URL VITE_MANUAL_URL=VITE_MANUAL_URL VITE_URL_SSO: VITE_URL_SSO \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ff6c0d53..2f3ac1ac 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -8,9 +8,8 @@ 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_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file - sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file + sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file diff --git a/src/api/index.ts b/src/api/index.ts index aafcee93..6d414f75 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -3,8 +3,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; +export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; // if (process.env.VUE_APP_TEST) { // env = "test"; // } @@ -37,8 +36,7 @@ const config = ref({ API_REPORT_URI: apiUrlConfig, MEET_URI: "meet.frappet.com", API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, - API_REPORT_TEMPLATE_URI: - "https://report-server.frappet.synology.me/api/v1/report-template", + API_REPORT_TEMPLATE_URI: apiUrlConfigReport, API_LOG: apiUrlConfig, }, }); From d9f519db39ad7e84112e1a886ddaa32a6f15cf25 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 10 Dec 2024 10:47:43 +0700 Subject: [PATCH 05/32] add ex. env --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index 7f8cb8c5..c455bdd4 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ VITE_API_URI_CONFIG: "https://app.your-domain.com/api/v1" +VITE_API_REPORT_URL: "https://report.com/api/v1/" VITE_URL_SSO: "https://app-sso.your-domain.com" VITE_MANUAL_URL: "https://app-manual.your-domain.com" \ No newline at end of file From cc6c038218db758d911b9e2252bed12bd09ca0f6 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 11 Dec 2024 09:50:29 +0700 Subject: [PATCH 06/32] fixing word --- src/modules/06_webservices/view/logView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/06_webservices/view/logView.vue b/src/modules/06_webservices/view/logView.vue index d62259e5..bb097433 100644 --- a/src/modules/06_webservices/view/logView.vue +++ b/src/modules/06_webservices/view/logView.vue @@ -74,7 +74,7 @@ const columns = ref([ { name: "apiName", align: "left", - label: "API Request", + label: "API ที่เข้าถึง", sortable: false, field: "apiName", headerStyle: "font-size: 14px", @@ -95,7 +95,7 @@ const columns = ref([ { name: "apiKey", align: "left", - label: " คน request", + label: "ผู้ร้องขอ", sortable: false, field: "apiKey", headerStyle: "font-size: 14px", @@ -104,7 +104,7 @@ const columns = ref([ { name: "ipApi", align: "left", - label: " IP", + label: " IP Address", sortable: false, field: "ipApi", headerStyle: "font-size: 14px", From c4bcb0b755f84b9d268c15ffaf67b722a82f8001 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 11 Dec 2024 11:45:07 +0700 Subject: [PATCH 07/32] =?UTF-8?q?filter=20=3D=3D>=20=20=E0=B8=88=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3=20web=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/{logView.vue => historyView.vue} | 2 + src/modules/06_webservices/view/listView.vue | 192 +++++++++--------- src/modules/06_webservices/view/main.vue | 2 +- src/stores/mixin.ts | 22 ++ 4 files changed, 118 insertions(+), 100 deletions(-) rename src/modules/06_webservices/view/{logView.vue => historyView.vue} (99%) diff --git a/src/modules/06_webservices/view/logView.vue b/src/modules/06_webservices/view/historyView.vue similarity index 99% rename from src/modules/06_webservices/view/logView.vue rename to src/modules/06_webservices/view/historyView.vue index bb097433..950e5bd7 100644 --- a/src/modules/06_webservices/view/logView.vue +++ b/src/modules/06_webservices/view/historyView.vue @@ -305,6 +305,8 @@ onMounted(async () => { use-input hide-selected fill-input + :clearable="apiNameId !==''" + @clear="(apiNameId = ''), (options = dataApiName)" @update:modelValue="onSelectType" @filter="(inputValue: string,doneFn: Function) => filterSelector(inputValue, doneFn )" > diff --git a/src/modules/06_webservices/view/listView.vue b/src/modules/06_webservices/view/listView.vue index 457a6878..3c037f6c 100644 --- a/src/modules/06_webservices/view/listView.vue +++ b/src/modules/06_webservices/view/listView.vue @@ -24,10 +24,12 @@ const { messageError, success, date2Thai, + onSearchDataTable, } = useCounterMixin(); /** Table*/ const rows = ref([]); //รายการ webservices +const rowsMain = ref([]); //รายการ webservices const keyword = ref(""); //คำค้นหา รายการ webservices const visibleColumns = ref([ "name", @@ -107,6 +109,7 @@ async function fetchListWebServices() { .then(async (res) => { const data = await res.data.result; rows.value = data; + rowsMain.value = data; }) .catch((err) => { messageError($q, err); @@ -140,6 +143,14 @@ function onDeleteData(id: string) { }); } +function serchDataTable() { + rows.value = onSearchDataTable( + keyword.value, + rowsMain.value, + columns.value ? columns.value : [] + ); +} + /** hook เมื่อเรียก Components จะเรียกฟังก์ชัน 'fetchListWebServices' เรียกข้อมูลรายการ webservices*/ onMounted(() => { fetchListWebServices(); @@ -148,9 +159,6 @@ onMounted(() => {