update for test
This commit is contained in:
parent
e18fa9f15f
commit
cd839e923f
44
Dockerfile-test
Normal file
44
Dockerfile-test
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Dockerfile for a React app build and run
|
||||||
|
|
||||||
|
FROM node:18.19.1-alpine AS builder
|
||||||
|
MAINTAINER yaclty2@gmail.com
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# envs 配置
|
||||||
|
# 应用部署后的URL
|
||||||
|
ENV APP_SITE_URL ""
|
||||||
|
# 应用接口前缀
|
||||||
|
ENV APP_API_URL ""
|
||||||
|
|
||||||
|
# Copy source code to the builder
|
||||||
|
COPY package.json yarn.lock* ./
|
||||||
|
COPY public ./public
|
||||||
|
COPY src ./src
|
||||||
|
COPY index.html ./
|
||||||
|
COPY *.ts .
|
||||||
|
COPY *.json .
|
||||||
|
|
||||||
|
# Install dependencies and build the app
|
||||||
|
RUN yarn install
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
|
||||||
|
# Step 2. Production image, copy all the files and run nginx
|
||||||
|
FROM nginx:1.26-alpine3.19 AS runner
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# envs 配置
|
||||||
|
ENV APP_API_URL localhost:50000
|
||||||
|
|
||||||
|
# nginx配置文件
|
||||||
|
#COPY nginx.conf /etc/nginx/conf.d/default.conf.template
|
||||||
|
# 编译文件
|
||||||
|
COPY --from=builder /app/dist ./
|
||||||
|
# RUN /bin/sh envsubst /etc/nginx/templates/*.template /etc/nginx/conf.d
|
||||||
|
#WORKDIR /etc/nginx/conf.d/
|
||||||
|
#ENTRYPOINT sed -i "s~<!--app_url-->~<script>const APP_SITE_URL='${APP_SITE_URL}';</script>~" /app/index.html && envsubst '$APP_API_URL' < default.conf.template > default.conf && cat default.conf && nginx -g 'daemon off;'
|
||||||
|
# 暴露80端口
|
||||||
|
EXPOSE 80
|
||||||
|
# 启动Nginx服务
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
@ -27,7 +27,7 @@
|
|||||||
<div class="ldio-yzaezf3dcmj"><div></div></div>
|
<div class="ldio-yzaezf3dcmj"><div></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>Payment System resources loading ...</div>
|
<div>Payment System loading ...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -171,13 +171,7 @@ const Permission = () => {
|
|||||||
return list.filter(it => (it.value == userRole));
|
return list.filter(it => (it.value == userRole));
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// load user permission list
|
const buildPermission = (it: UserPermission)=>{
|
||||||
const loadUserPermissionList = () => {
|
|
||||||
setState({loading: true})
|
|
||||||
getUserPermissionList().then(list => {
|
|
||||||
setState({allList:[...list]})
|
|
||||||
const userRole = user?.permissions?.role ?? 'staff';
|
|
||||||
list.forEach(it=>{
|
|
||||||
it.permission_edit = !!it.permission_edit
|
it.permission_edit = !!it.permission_edit
|
||||||
it.bill_page = !!it.bill_page
|
it.bill_page = !!it.bill_page
|
||||||
it.apply_page = !!it.apply_page
|
it.apply_page = !!it.apply_page
|
||||||
@ -185,7 +179,16 @@ const Permission = () => {
|
|||||||
it.confirm_button = !!it.confirm_button
|
it.confirm_button = !!it.confirm_button
|
||||||
it.apply_button = !!it.apply_button
|
it.apply_button = !!it.apply_button
|
||||||
it.manual_payment = !!it.manual_payment
|
it.manual_payment = !!it.manual_payment
|
||||||
})
|
return it;
|
||||||
|
}
|
||||||
|
|
||||||
|
// load user permission list
|
||||||
|
const loadUserPermissionList = () => {
|
||||||
|
setState({loading: true})
|
||||||
|
getUserPermissionList().then(list => {
|
||||||
|
setState({allList:[...list]})
|
||||||
|
const userRole = user?.permissions?.role ?? 'staff';
|
||||||
|
list.forEach(it=>buildPermission(it))
|
||||||
if(userRole != 'root') {
|
if(userRole != 'root') {
|
||||||
list = list.filter(it => (it.role == userRole));
|
list = list.filter(it => (it.role == userRole));
|
||||||
}
|
}
|
||||||
@ -244,6 +247,7 @@ const Permission = () => {
|
|||||||
await process(value).then((newValue) => {
|
await process(value).then((newValue) => {
|
||||||
Toast.success(t('base.save_success'))
|
Toast.success(t('base.save_success'))
|
||||||
const newList = [...state.list];
|
const newList = [...state.list];
|
||||||
|
buildPermission(newValue)
|
||||||
newList[index] = {
|
newList[index] = {
|
||||||
...newValue
|
...newValue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user