Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docking 1.21 api #70

Open
wants to merge 27 commits into
base: camera-v1.21
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
FROM node:16-alpine AS build
FROM node:18-alpine AS node

WORKDIR /web

COPY package.json ./

RUN yarn install

COPY . .
FROM nginx:stable-alpine

RUN yarn build
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin

FROM nginx:stable-alpine
COPY ./ /usr/share/nginx/html

COPY --from=build /web/build /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

RUN sed -i '12a error_page 404 /index.html;' /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx/html

RUN sed -i '/^http {/a \
gzip on;\n\
gzip_static on;' /etc/nginx/nginx.conf
RUN apk add --no-cache git && \
npm install --force && npm run build

EXPOSE 80
RUN echo "#!/bin/sh" >> /init.sh &&\
echo "cd /usr/share/nginx/html" >> /init.sh &&\
echo "npx @import-meta-env/cli -x .env -e .env -p dist/index.html" >> /init.sh &&\
echo "nginx -g 'daemon off;'" >> /init.sh &&\
chmod +x /init.sh

CMD ["nginx", "-g", "daemon off;"]
CMD ["/init.sh"]
7 changes: 6 additions & 1 deletion web/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ interface Window {
$wujie: {
bus: EventBus;
shadowRoot?: ShadowRoot;
props?: { [key: string]: string };
props?: {
userName: string;
token: string;
signOut: (callback?: VoidFunction) => void;
goBackstage: () => void;
};
location?: object;
};
}
27 changes: 27 additions & 0 deletions web/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
root /usr/share/nginx/html/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;

add_header 'Access-Control-Allow-Origin' '*' always; # 允许所有来源
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;

if ($request_method = OPTIONS) {
add_header 'Access-Control-Allow-Origin' '*' always; # 允许所有来源
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; # 允许的 HTTP 方法
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always; # 允许的请求头
return 204; # 返回204 No Content
}
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html/dist;
}
}
2 changes: 1 addition & 1 deletion web/public/appsetting.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"serverUrl": "https://testsmarties.yamimeal.ca",
"tokenKey": "token",
"userNameKey": "userName",
"cameraAIBackstageDomain": "http://localhost:5173/"
"cameraAIBackstageDomain": "https://camerai-m.wiltechs.com/"
}
1 change: 1 addition & 0 deletions web/src/dtos/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IRecordRequest extends IPageDto {
EndTime?: string;
StartTime?: string;
Status?: IStatusType;
TeamId: string;
}

export enum IStatusType {
Expand Down
83 changes: 72 additions & 11 deletions web/src/dtos/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
export interface IAddTeamDataProps {
logoUrl?: string;
teamName: string;
}

export interface IAcceptWarnDataProps {
telephone: string;
weCom: string;
mailbox: string;
}

export interface INewTeamDtoProps {
openNewTeam: boolean;
isUploading: boolean;
Expand All @@ -19,3 +8,75 @@ export interface IAcceptWarnDtoProps {
openAcceptWran: boolean;
acceptWarnLoading: boolean;
}

export interface IGetAttachUrlProps {
fileUrl: string;
fileName: string;
id?: number;
uuid?: string;
createDate?: string;
fileSize?: number;
filePath?: string;
title?: string;
}

export interface ICreateTeamProps {
team: IAddTeamDataProps;
}

export interface IAddTeamDataProps {
avatarUrl: string;
name: string;
}

export interface ITeamListProps {
id: string;
name: string;
leaderId: string;
tenantId: string;
avatarUrl: string;
}

export enum UserStatus {
Disable,
Enable,
}

export enum UserProfileOriginType {
Off,
On,
}

export interface IUserDataItem {
id: number;
staffId: string;
name: string;
department: string;
group: string;
position: string;
positionStatus: string;
phone: string;
email: string;
wechatName: string;
isQualified: boolean;
status: UserStatus;
from: UserProfileOriginType;
isDeleted: boolean;
createdTime: string;
}

export interface IGetUserNotificationRequest {
UserProfileId?: string;
TeamId: string;
}

export interface IGetUserNotificationResponse {
userProfileNotificationDto: IUserProfileNotificationDto;
}

export interface IUserProfileNotificationDto {
id: string;
email: string;
phone: string;
workWechat: string;
}
3 changes: 2 additions & 1 deletion web/src/dtos/mine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface IMineRoleResponse {
count: 0;
count: number;
rolePermissionData: IRolePermissionItem[];
}

Expand Down Expand Up @@ -43,4 +43,5 @@ export enum FrontRolePermissionEnum {
CanExportExcelCameraAiFeedback = "CanExportExcelCameraAiFeedback",
CanViewDetailCameraAiFeedback = "CanViewDetailCameraAiFeedback",
CanEnterCameraAi = "CanEnterCameraAi",
CanCreateCameraAiTeam = "CanCreateCameraAiTeam",
}
2 changes: 2 additions & 0 deletions web/src/dtos/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IRegionListRequest extends IPageDto {
RegionId?: number;
RegionAddress?: string;
Keyword?: string;
TeamId: string;
}

export interface IRegionListResponse {
Expand Down Expand Up @@ -56,6 +57,7 @@ export interface IRegionEquipmentListRequest extends IPageDto {
TypeLabel: ICameraAiEquipmentTypeLabel;
Keyword?: string;
RegionId: number;
TeamId: string;
}

export enum ICameraAiEquipmentTypeLabel {
Expand Down
Loading