fix(add):analytics#47
Conversation
|
🤖 Fork Repository Check Complete ✅ Basic security scan completed This PR from a fork repository has passed basic safety checks. A maintainer will review the changes before running full CI/CD pipeline. This is an automated safety check for contributions from fork repositories. |
- Add @eslint/js to eslint-config - Move i18next to dependencies and add to server - Add @tiptap/core, lucide-react, date-fns to ui package - Add @types/markdown-it to server - Refactor menubar component (user changes) - Remove bun-types from frontend TypeScript config Resolves all CI typecheck and build failures.
feat(server): add ticket autoclose job,knowledge access log
cf44b85 to
ecbb631
Compare
| import { useTranslation } from "i18n"; | ||
|
|
||
| const getRatingChartConfig = (t: any) => ({ | ||
| "1星": { |
|
|
||
| <AlertTitle className="text-black flex items-center gap-2"><TriangleAlert className="h-4 w-4 text-red-600" />{t("tkt_backlog_rate_error")}</AlertTitle> | ||
| <AlertDescription className="text-black"> | ||
| 当前未处理工单占比 <span className="text-red-600 ">{data.backlogRate}%</span>,超过正常水平,建议增加处理人力。 |
| staleTime: 0, | ||
| refetchOnMount: true, | ||
| refetchOnWindowFocus: true, | ||
| staleTime: 5 * 60 * 1000, // 5分钟缓存 |
| 支付问题: "#F59E0B", | ||
| 性能问题: "#EF4444", | ||
| 界面问题: "#8B5CF6", | ||
| 服务问题: "#06B6D4", |
|
|
||
| const analyticsRouter = factory | ||
| .createApp() | ||
| .use("*", authMiddleware) |
There was a problem hiding this comment.
server/api/feedback/index.ts 可以参考这个的写法
| ratingDistribution: [ | ||
| { name: "未评分", value: unratedTickets, percentage: 0 }, | ||
| { name: "1星", value: ratingMap[1], percentage: 0 }, | ||
| { name: "2星", value: ratingMap[2], percentage: 0 }, |
| ticketId, | ||
| payload.title, | ||
| payload.description | ||
| ); |
There was a problem hiding this comment.
可以参考 server/api/kb/index.ts
server/utils/events/kb
export const Events = {
KBFavoritesSync: "kb.favorites.sync",
} as const;
添加一个 工单分析事件,然后写一个 工单分析的 listener 和 数据 repo 操作
避免创建工单时等待分析
| export const hotIssues = tentix.table( | ||
| "hot_issues", | ||
| { | ||
| id: serial("id").primaryKey().notNull(), |
There was a problem hiding this comment.
tag 没有抽离出来吗,那么怎么人工修改tag 或者添加tag,例如如果已经有一组 tag 用于使用,现在要修改tag 怎么操作,没有用到 tags 吗
| } | ||
|
|
||
| export async function getHotIssuesStats( | ||
| db: NodePgDatabase<AppSchema>, |
There was a problem hiding this comment.
db: NodePgDatabase
换成
db: ReturnType
a4ebf1c to
c738ae3
Compare
| const lowEffY = intersectionY + spacingFromCenter; | ||
|
|
||
| const titleStyle: React.CSSProperties = { | ||
| fontFamily: 'var(--typography-font-family-font-sans, Geist)', |
| import { dateRangeSchema } from "./schemas.ts"; | ||
|
|
||
| export const knowledgeBaseHitsRouter = factory | ||
| .createApp() |
|
|
||
| type DB = ReturnType<typeof connectDB>; | ||
|
|
||
| export async function markAnalyzed(db: DB, ticketId: string): Promise<void> { |
There was a problem hiding this comment.
markAnalyzed 和 markFailed 作用是什么?
|
|
||
| useEffect(() => { | ||
| const updateSize = () => { | ||
| if (chartContainerRef.current) { |
| const chartInstanceRef = useRef<echarts.ECharts | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (!chartRef.current) return; |
| useEffect(() => { | ||
| if (!chartRef.current) return; | ||
|
|
||
| // 初始化图表 |
| // 初始化图表 | ||
| const chart = echarts.init(chartRef.current, undefined, { renderer: 'svg' }); | ||
| chartInstanceRef.current = chart; | ||
|
|
| }); | ||
|
|
||
| export const knowledgeHitsQueryOptions = (filterParams?: { | ||
| startDate?: string; |
There was a problem hiding this comment.
这个文件太大了,可以把你的query单出抽出在一个文件中
No description provided.