Skip to content

给排行榜加了头像 #110

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

Merged
merged 1 commit into from
Jul 18, 2025
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
给排行榜加了头像
  • Loading branch information
safe1ine committed Jul 18, 2025
commit 67f939bb981af88b1f40f21343ec62f4f9ae4fdf
24 changes: 24 additions & 0 deletions ui/src/api/OpenAiv1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import request, { ContentType, RequestParams } from "./httpClient";
import {
DomainAcceptCompletionReq,
DomainModelListResp,
DomainReportReq,
WebResp,
} from "./types";

Expand Down Expand Up @@ -122,3 +123,26 @@ export const getModelList = (params: RequestParams = {}) =>
format: "json",
...params,
});

/**
* @description 报告
*
* @tags OpenAIV1
* @name PostReport
* @summary 报告
* @request POST:/v1/report
* @response `200` `WebResp` OK
*/

export const postReport = (
param: DomainReportReq,
params: RequestParams = {},
) =>
request<WebResp>({
path: `/v1/report`,
method: "POST",
body: param,
type: ContentType.Json,
format: "json",
...params,
});
19 changes: 19 additions & 0 deletions ui/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export enum ConstsUserPlatform {
UserPlatformCustom = "custom",
}

export enum ConstsReportAction {
ReportActionAccept = "accept",
ReportActionSuggest = "suggest",
ReportActionFileWritten = "file_written",
}

export enum ConstsModelType {
ModelTypeLLM = "llm",
ModelTypeCoder = "coder",
Expand Down Expand Up @@ -51,6 +57,7 @@ export enum ConstsModelProvider {
export enum ConstsChatRole {
ChatRoleUser = "user",
ChatRoleAssistant = "assistant",
ChatRoleSystem = "system",
}

export enum ConstsAdminStatus {
Expand Down Expand Up @@ -480,6 +487,16 @@ export interface DomainRegisterReq {
username: string;
}

export interface DomainReportReq {
action?: ConstsReportAction;
/** 内容 */
content?: string;
/** task_id or resp_id */
id?: string;
/** 工具 */
tool?: string;
}

export interface DomainSetting {
/** 创建时间 */
created_at?: number;
Expand Down Expand Up @@ -639,6 +656,8 @@ export interface DomainUser {
export interface DomainUserCodeRank {
/** 代码行数 */
lines?: number;
/** 用户信息 */
user?: DomainUser;
/** 用户名 */
username?: string;
}
Expand Down
15 changes: 9 additions & 6 deletions ui/src/pages/dashboard/components/contributionModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Stack } from '@mui/material';
import { DomainUserCodeRank } from '@/api/types';
import { Modal } from '@c-x/ui';
import { StyledItem, StyledSerialNumber, StyledText } from './statisticCard';
import { StyledItem, StyledSerialNumber } from './statisticCard';
import User from '@/components/user';

const ContributionModal = ({
open,
Expand Down Expand Up @@ -47,13 +48,15 @@ const ContributionModal = ({
minWidth: 0,
}}
>
{/* <Avatar size={24} src={item.avatar} /> */}
<StyledText className='active-user-name'>
{item.username}
</StyledText>
<User
id={item.user?.id}
username={item.user?.username}
email={item.user?.email}
avatar={item.user?.avatar_url}
deleted={item.user?.is_deleted} />
</Stack>
</StyledItem>
<Box sx={{ fontSize: 14 }}>{item.lines}</Box>
<Box sx={{ fontSize: 14 }}>{item.lines}</Box>
</Stack>
))}
</Box>
Expand Down
28 changes: 11 additions & 17 deletions ui/src/pages/dashboard/components/statisticCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { styled, Stack, Box, Button } from '@mui/material';
import { useState } from 'react';
import { styled, Stack, Box } from '@mui/material';
import { Empty } from '@c-x/ui';
import dayjs from 'dayjs';
import { useNavigate } from 'react-router-dom';
Expand All @@ -12,6 +12,7 @@ import {
DomainUserCodeRank,
DomainUserEvent,
} from '@/api/types';
import Avatar from '@/components/avatar';

const StyledCardLabel = styled('div')(({ theme }) => ({
fontSize: '14px',
Expand Down Expand Up @@ -122,26 +123,19 @@ export const ContributionCard = ({
gap={1.5}
sx={{
flex: 1,
minWidth: 0,
// cursor: 'pointer',
// '&:hover': {
// '.active-user-name': {
// color: 'primary.main',
// },
// },
minWidth: 0
}}
// onClick={() => {
// navigate(`/`)
// // window.open(`/discussion/user/${item.id}`);
// }}
>
{/* <Avatar size={24} src={item.avatar} /> */}
<StyledText className='active-user-name'>
{item.username}
<Avatar
name={item.user?.username}
src={item.user?.avatar_url}
sx={{ width: 20, height: 20, fontSize: 12 }}
/>
<StyledText className='active-user-name'>{item.username}
</StyledText>
</Stack>
</StyledItem>
<Box sx={{ fontSize: 14 }}>{item.lines}</Box>
<Box sx={{ fontSize: 14 }}>{item.lines}</Box>
</Stack>
))}
</Box>
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy