Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/frontend-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Frontend CI/CD
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
- 'v[0-9]+.[0-9]+.[0-9]+*'
paths:
- 'ui/**'
- '.github/workflows/frontend-ci-cd.yml'
Expand All @@ -29,12 +29,12 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '20.19.0'

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
version: 10.12.1

- name: Get version
id: get_version
Expand Down Expand Up @@ -130,4 +130,4 @@ jobs:
${{ env.REGISTRY }}/frontend:${{ needs.build.outputs.version }}
${{ env.REGISTRY }}/frontend:latest
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
21 changes: 21 additions & 0 deletions ui/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PLATFORM=linux/amd64
TAG=main
REGISTRY=monkeycode


# 构建前端代码
build:
pnpm run build

# 构建并加载到本地Docker
image: build
docker buildx build \
-f .Dockerfile \
--platform ${PLATFORM} \
--tag ${REGISTRY}/frontend:${TAG} \
--load \
.

save: image
docker save -o /tmp/monkeycode_frontend.tar monkeycode/frontend:main

232 changes: 232 additions & 0 deletions ui/src/api/Admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/

import request, { ContentType, RequestParams } from "./httpClient";
import {
DeleteDeleteAdminParams,
DomainAdminUser,
DomainCreateAdminReq,
DomainListAdminLoginHistoryResp,
DomainListAdminUserResp,
DomainLoginReq,
DomainSetting,
DomainUpdateSettingReq,
GetAdminLoginHistoryParams,
GetListAdminUserParams,
WebResp,
} from "./types";

/**
* @description 创建管理员
*
* @tags Admin
* @name PostCreateAdmin
* @summary 创建管理员
* @request POST:/api/v1/admin/create
* @response `200` `(WebResp & {
data?: DomainAdminUser,

})` OK
*/

export const postCreateAdmin = (
param: DomainCreateAdminReq,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: DomainAdminUser;
}
>({
path: `/api/v1/admin/create`,
method: "POST",
body: param,
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 删除管理员
*
* @tags Admin
* @name DeleteDeleteAdmin
* @summary 删除管理员
* @request DELETE:/api/v1/admin/delete
* @response `200` `(WebResp & {
data?: Record<string, any>,

})` OK
*/

export const deleteDeleteAdmin = (
query: DeleteDeleteAdminParams,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: Record<string, any>;
}
>({
path: `/api/v1/admin/delete`,
method: "DELETE",
query: query,
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 获取管理员用户列表
*
* @tags Admin
* @name GetListAdminUser
* @summary 获取管理员用户列表
* @request GET:/api/v1/admin/list
* @response `200` `(WebResp & {
data?: DomainListAdminUserResp,

})` OK
*/

export const getListAdminUser = (
query: GetListAdminUserParams,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: DomainListAdminUserResp;
}
>({
path: `/api/v1/admin/list`,
method: "GET",
query: query,
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 管理员登录
*
* @tags Admin
* @name PostAdminLogin
* @summary 管理员登录
* @request POST:/api/v1/admin/login
* @response `200` `(WebResp & {
data?: DomainAdminUser,

})` OK
*/

export const postAdminLogin = (
param: DomainLoginReq,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: DomainAdminUser;
}
>({
path: `/api/v1/admin/login`,
method: "POST",
body: param,
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 获取管理员登录历史
*
* @tags Admin
* @name GetAdminLoginHistory
* @summary 获取管理员登录历史
* @request GET:/api/v1/admin/login-history
* @response `200` `(WebResp & {
data?: DomainListAdminLoginHistoryResp,

})` OK
*/

export const getAdminLoginHistory = (
query: GetAdminLoginHistoryParams,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: DomainListAdminLoginHistoryResp;
}
>({
path: `/api/v1/admin/login-history`,
method: "GET",
query: query,
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 获取系统设置
*
* @tags Admin
* @name GetGetSetting
* @summary 获取系统设置
* @request GET:/api/v1/admin/setting
* @response `200` `(WebResp & {
data?: DomainSetting,

})` OK
*/

export const getGetSetting = (params: RequestParams = {}) =>
request<
WebResp & {
data?: DomainSetting;
}
>({
path: `/api/v1/admin/setting`,
method: "GET",
type: ContentType.Json,
format: "json",
...params,
});

/**
* @description 更新系统设置
*
* @tags Admin
* @name PutUpdateSetting
* @summary 更新系统设置
* @request PUT:/api/v1/admin/setting
* @response `200` `(WebResp & {
data?: DomainSetting,

})` OK
*/

export const putUpdateSetting = (
param: DomainUpdateSettingReq,
params: RequestParams = {},
) =>
request<
WebResp & {
data?: DomainSetting;
}
>({
path: `/api/v1/admin/setting`,
method: "PUT",
body: param,
type: ContentType.Json,
format: "json",
...params,
});
Loading