chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
// TODO: 替换成Project接口导出的idl
// TODO: replace with idl exported by Project interface
export enum ProjectRoleType {
Owner = 'owner',
Editor = 'editor',
@@ -22,51 +22,51 @@ export enum ProjectRoleType {
export enum EProjectPermission {
/**
* 访问/查看project
* Visit/view projects
*/
View,
/**
* 编辑project基础信息
* Edit project basic information
*/
EDIT_INFO,
/**
* 删除project
* Delete project
*/
DELETE,
/**
* 发布project
* Publish project
*/
PUBLISH,
/**
* 创建project内资源
* Create project resources
*/
CREATE_RESOURCE,
/**
* project内复制资源
* Copy resources within the project
*/
COPY_RESOURCE,
/**
* 复制project/创建副本
* Copy project/create copy
*/
COPY,
/**
* 试运行plugin
* Practice running plugins
*/
TEST_RUN_PLUGIN,
/**
* 试运行workflow
* Practice running workflow
*/
TEST_RUN_WORKFLOW,
/**
* 添加project协作者
* Add project collaborators
*/
ADD_COLLABORATOR,
/**
* 删除project协作者
* Delete project collaborator
*/
DELETE_COLLABORATOR,
/**
* 回滚 APP 版本
* Roll back the APP version
*/
ROLLBACK,
}

View File

@@ -20,26 +20,26 @@ import { create } from 'zustand';
import { type ProjectRoleType } from './constants';
interface ProjectAuthStoreState {
// 每一个Project的角色数据
// Role Data for Each Project
roles: {
[projectId: string]: ProjectRoleType[];
};
// 每一个Project的角色数据的初始化状态是否完成初始化。
// The initialization status of each Project's role data, and whether the initialization has been completed.
isReady: {
[projectId: string]: boolean;
};
}
interface SpaceAuthStoreAction {
// 设置projectId对应的Project的角色
// Set the role of the Project corresponding to the projectId
setRoles: (projectId: string, role: ProjectRoleType[]) => void;
// 设置projectId对应的Project的数据是否ready
// Set whether the data of the Project corresponding to the projectId is ready
setIsReady: (projectId: string, isReady: boolean) => void;
// 回收Project数据
// Recovering Project Data
destory: (projectId) => void;
}
/**
* ProjectAuthStore设计成支持多Project切换维护多个Project的数据防止因为Project切换时序导致的bug。
* ProjectAuthStore is designed to support multi-project switching, maintain data of multiple projects, and prevent bugs caused by project switching timing.
*/
export const useProjectAuthStore = create<
ProjectAuthStoreState & SpaceAuthStoreAction

View File

@@ -23,7 +23,7 @@ export function useDestoryProject(projectId: string) {
return useEffect(
() => () => {
// 空间组件销毁时清空对应space数据
// When the space component is destroyed, empty the corresponding space data
destorySpace(projectId);
},
[],

View File

@@ -26,7 +26,7 @@ export function useProjectAuth(
projectId: string,
spaceId: string,
) {
// 获取space类型信息
// Get space type information
const space = useSpace(spaceId);
if (!space?.space_type) {
@@ -35,13 +35,13 @@ export function useProjectAuth(
);
}
// 获取space role信息
// Get space role information
const spaceRoles = useSpaceRole(spaceId);
// 获取project role信息
// Get project role information
const projectRoles = useProjectRole(projectId);
// 计算权限点
// Calculate permission spot
return calcPermission(key, {
projectRoles,
spaceRoles,