Compare commits

...

11 Commits

Author SHA1 Message Date
irfan 16e2c8fc09 Update env/env.cloud 2025-04-29 10:38:50 +00:00
irfan 65b3dd7cae Update env/env.cloud 2025-04-29 10:04:17 +00:00
shancheas 8f5fff0b91 change env name 2025-04-29 13:15:32 +07:00
Supan Adit Pratama e9152f11f4 chore: add production cloud 2025-04-28 12:34:02 +07:00
Supan Adit Pratama b37dff48e3 Merge branch 'main' of ssh://git.eigen.co.id:2222/eigen/pos-realtime-report
continuous-integration/drone/tag Build is passing Details
2024-10-04 06:03:29 +00:00
Supan Adit Pratama 9628070fcd ci: automation 2024-10-04 06:03:06 +00:00
Firman Ramdhani 51130437d7 Merge branch 'main' of ssh://git.eigen.co.id:2222/eigen/pos-realtime-report
continuous-integration/drone/tag Build is passing Details
2024-10-04 11:27:46 +07:00
Firman Ramdhani 4c6c52d59b feat: fix undefined user name 2024-10-04 11:27:43 +07:00
Supan Adit Pratama c77059971c ci: update try use caddy
continuous-integration/drone/tag Build is passing Details
2024-10-04 04:18:08 +00:00
Supan Adit Pratama 45178d1312 ci: change use npm
continuous-integration/drone/tag Build is passing Details
2024-10-04 02:48:53 +00:00
shancheas 13758c5730 fix: missing dependencies 2024-10-04 09:43:11 +07:00
9 changed files with 100 additions and 33 deletions

View File

@ -20,6 +20,40 @@ steps:
build_args: build_args:
- env_target=env.production-online - env_target=env.production-online
- release_version=${DRONE_TAG} - release_version=${DRONE_TAG}
- name: kustomize-production
image: registry.k8s.io/kustomize/kustomize:v5.0.0
environment:
DEVOPS_SSH_PRIVATE:
from_secret: DEVOPS_SSH_PRIVATE
DEVOPS_SSH_PUBLIC:
from_secret: DEVOPS_SSH_PUBLIC
commands:
- mkdir -p ~/.ssh &&
- echo $DEVOPS_SSH_PRIVATE | base64 -d > ~/.ssh/id_rsa &&
- echo $DEVOPS_SSH_PUBLIC | base64 -d > ~/.ssh/id_rsa.pub &&
- ssh-keyscan -H -p 2222 git.eigen.co.id >> ~/.ssh/known_hosts &&
- chmod 700 ~/.ssh/ &&
- chmod 600 ~/.ssh/id_rsa &&
- git clone ssh://git@git.eigen.co.id:2222/eigen/k8s-kustomize-external.git &&
- cd k8s-kustomize-external/weplay-pos-production
- kustomize edit set image registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-online=registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-online:$DRONE_TAG &&
- kustomize edit set image registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-offline=registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-offline:$DRONE_TAG &&
- git add . &&
- |-
git commit -m "feat: update $DRONE_REPO_NAME production to $DRONE_TAG" &&
- git push origin master
- name: send-message
image: plugins/webhook
settings:
urls: https://mattermost.eigen.co.id/api/v4/posts
content_type: application/json
headers:
- Authorization=Bearer 5zubexudb38uuradfa36qy98ca
template: |
{
"channel_id": "s1ekqde1c3du5p35g6budnuotc",
"message": "Build {{repo.name}} sudah selesai"
}
trigger: trigger:
ref: ref:
- refs/tags/*-production.* - refs/tags/*-production.*

View File

@ -1,4 +1,4 @@
FROM node:20-alpine as build FROM node:18-alpine as build
ARG env_target ARG env_target
ARG release_version ARG release_version
@ -12,14 +12,9 @@ COPY env/$env_target /app/.env
RUN echo -e "\n" >> /app/.env RUN echo -e "\n" >> /app/.env
RUN echo -e "APP_VERSION=${release_version}" >> /app/.env RUN echo -e "APP_VERSION=${release_version}" >> /app/.env
RUN yarn install RUN npm install
RUN npm run build
RUN yarn build FROM caddy:2.6.1-alpine
COPY caddy/Caddyfile /etc/caddy/Caddyfile
FROM nginx:1.16.0-alpine COPY --from=build /app/dist /srv
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

5
caddy/Caddyfile Normal file
View File

@ -0,0 +1,5 @@
:80 {
root * /srv
try_files {path} /index.html
file_server
}

3
env/env.cloud vendored Normal file
View File

@ -0,0 +1,3 @@
VITE_APP_MODE=production
VITE_BASE_API_URL=http://103.187.147.241:30050/api
VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api

View File

@ -1,17 +0,0 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

46
package-lock.json generated
View File

@ -8,6 +8,9 @@
"name": "pos-realtime-report", "name": "pos-realtime-report",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"ag-grid-community": "^31.3.2",
"ag-grid-enterprise": "^31.3.2",
"ag-grid-react": "^31.3.2",
"antd": "^5.21.2", "antd": "^5.21.2",
"axios": "^1.7.7", "axios": "^1.7.7",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
@ -1823,6 +1826,38 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/ag-charts-community": {
"version": "9.3.2",
"resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.2.tgz",
"integrity": "sha512-jw2llxTYzGAZ24m7eQsKS24BnJBhspZKsL03DbqH0wxLepbEcC3eeWICe+02TBQCbFVsWmSsYukjzQg3FkVWRw=="
},
"node_modules/ag-grid-community": {
"version": "31.3.4",
"resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.4.tgz",
"integrity": "sha512-jOxQO86C6eLnk1GdP24HB6aqaouFzMWizgfUwNY5MnetiWzz9ZaAmOGSnW/XBvdjXvC5Fpk3gSbvVKKQ7h9kBw=="
},
"node_modules/ag-grid-enterprise": {
"version": "31.3.4",
"resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.4.tgz",
"integrity": "sha512-kreGRsFjz41APXXchLcQFtginnrmIGQYH48p7ydz33x8v+aja06HS5yEM6NP8j+VVHX43LeXnsl5Y4TLRgSoeg==",
"dependencies": {
"ag-charts-community": "9.3.2",
"ag-grid-community": "31.3.4"
}
},
"node_modules/ag-grid-react": {
"version": "31.3.4",
"resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.4.tgz",
"integrity": "sha512-WmPASHRFGSTxCMRStWG5bRtln0Ugsdqbb3+Y8sEyGHeLw4hXqfpqie3lT9kqCOl7wPWUjCpwmFdXzRnWPmyyeg==",
"dependencies": {
"ag-grid-community": "31.3.4",
"prop-types": "^15.8.1"
},
"peerDependencies": {
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/ajv": { "node_modules/ajv": {
"version": "6.12.6", "version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@ -3521,7 +3556,6 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -3877,6 +3911,16 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/prop-types": {
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
"dependencies": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.13.1"
}
},
"node_modules/proxy-from-env": { "node_modules/proxy-from-env": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",

View File

@ -11,6 +11,9 @@
}, },
"dependencies": { "dependencies": {
"antd": "^5.21.2", "antd": "^5.21.2",
"ag-grid-community": "^31.3.2",
"ag-grid-enterprise": "^31.3.2",
"ag-grid-react": "^31.3.2",
"axios": "^1.7.7", "axios": "^1.7.7",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",

View File

@ -2,9 +2,9 @@ import axios from 'axios';
import AdminLayout from './layout'; import AdminLayout from './layout';
import { API_URL, currencyFormatter } from '@pos/base'; import { API_URL, currencyFormatter } from '@pos/base';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { Card, Col, DatePicker, notification, Row, Table, Typography } from 'antd'; import { Card, Col, DatePicker, notification, Row, Table } from 'antd';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import lodash, { filter } from 'lodash'; import lodash from 'lodash';
import { v4 } from 'uuid'; import { v4 } from 'uuid';
export default function Admin() { export default function Admin() {

View File

@ -13,9 +13,9 @@ interface AdminLayoutProps {
export default function AdminLayout(props: AdminLayoutProps) { export default function AdminLayout(props: AdminLayoutProps) {
const { children } = props; const { children } = props;
const [loadingLogout, setLoadingLogout] = useState(false); const [_loadingLogout, setLoadingLogout] = useState(false);
const user = useRecoilValue(UserDataState); const user = useRecoilValue(UserDataState);
const initialName = getInitialName(user.name); const initialName = getInitialName(user?.name ?? '');
async function handleClickLogout() { async function handleClickLogout() {
setLoadingLogout(true); setLoadingLogout(true);