mirror of
https://github.com/coaidev/coai.git
synced 2025-05-20 05:20:15 +09:00
fix typing check
This commit is contained in:
parent
ea8331b20e
commit
b40c60edd8
@ -5,7 +5,8 @@ import {
|
|||||||
InvitationGenerateResponse,
|
InvitationGenerateResponse,
|
||||||
InvitationResponse,
|
InvitationResponse,
|
||||||
ModelChartResponse,
|
ModelChartResponse,
|
||||||
RequestChartResponse, UserResponse,
|
RequestChartResponse,
|
||||||
|
UserResponse,
|
||||||
} from "@/admin/types.ts";
|
} from "@/admin/types.ts";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
@ -92,7 +93,10 @@ export async function generateInvitation(
|
|||||||
return response.data as InvitationGenerateResponse;
|
return response.data as InvitationGenerateResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getUserList(page: number, search: string): Promise<UserResponse> {
|
export async function getUserList(
|
||||||
|
page: number,
|
||||||
|
search: string,
|
||||||
|
): Promise<UserResponse> {
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
`/admin/user/list?page=${page}&search=${search}`,
|
`/admin/user/list?page=${page}&search=${search}`,
|
||||||
);
|
);
|
||||||
|
@ -62,7 +62,7 @@ export type UserData = {
|
|||||||
is_subscribed: boolean;
|
is_subscribed: boolean;
|
||||||
total_month: number;
|
total_month: number;
|
||||||
enterprise: boolean;
|
enterprise: boolean;
|
||||||
}
|
};
|
||||||
|
|
||||||
export type UserForm = {
|
export type UserForm = {
|
||||||
data: UserData[];
|
data: UserData[];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useToast } from "@/components/ui/use-toast.ts";
|
import { useToast } from "@/components/ui/use-toast.ts";
|
||||||
import {useEffect, useRef, useState} from "react";
|
import { useState } from "react";
|
||||||
import { UserForm, UserResponse } from "@/admin/types.ts";
|
import { UserForm, UserResponse } from "@/admin/types.ts";
|
||||||
import { getUserList } from "@/admin/api.ts";
|
import { getUserList } from "@/admin/api.ts";
|
||||||
import { useEffectAsync } from "@/utils/hook.ts";
|
import { useEffectAsync } from "@/utils/hook.ts";
|
||||||
@ -13,7 +13,13 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
} from "@/components/ui/table.tsx";
|
} from "@/components/ui/table.tsx";
|
||||||
import { Button } from "@/components/ui/button.tsx";
|
import { Button } from "@/components/ui/button.tsx";
|
||||||
import {ChevronLeft, ChevronRight, MoreHorizontal, RotateCw, Search} from "lucide-react";
|
import {
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
MoreHorizontal,
|
||||||
|
RotateCw,
|
||||||
|
Search,
|
||||||
|
} from "lucide-react";
|
||||||
import { Input } from "@/components/ui/input.tsx";
|
import { Input } from "@/components/ui/input.tsx";
|
||||||
|
|
||||||
function UserTable() {
|
function UserTable() {
|
||||||
@ -43,7 +49,8 @@ function UserTable() {
|
|||||||
<Input
|
<Input
|
||||||
className={`search`}
|
className={`search`}
|
||||||
placeholder={t("admin.search-username")}
|
placeholder={t("admin.search-username")}
|
||||||
value={search} onChange={(e) => setSearch(e.target.value)}
|
value={search}
|
||||||
|
onChange={(e) => setSearch(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<Button size={`icon`} className={`flex-shrink-0 ml-2`} onClick={update}>
|
<Button size={`icon`} className={`flex-shrink-0 ml-2`} onClick={update}>
|
||||||
<Search className={`h-4 w-4`} />
|
<Search className={`h-4 w-4`} />
|
||||||
|
@ -575,11 +575,13 @@ const resources = {
|
|||||||
action: "Action",
|
action: "Action",
|
||||||
"search-username": "Search Username",
|
"search-username": "Search Username",
|
||||||
"quota-action": "Quota Change",
|
"quota-action": "Quota Change",
|
||||||
"quota-action-desc": "Please enter the quota change value (positive for increase, negative for decrease)",
|
"quota-action-desc":
|
||||||
|
"Please enter the quota change value (positive for increase, negative for decrease)",
|
||||||
"subscription-action": "Subscription Gift",
|
"subscription-action": "Subscription Gift",
|
||||||
"subscription-action-desc": "Please enter the gift subscription months",
|
"subscription-action-desc": "Please enter the gift subscription months",
|
||||||
"operate-success": "Operate Success",
|
"operate-success": "Operate Success",
|
||||||
"operate-success-prompt": "Your operation has been successfully executed.",
|
"operate-success-prompt":
|
||||||
|
"Your operation has been successfully executed.",
|
||||||
"operate-failed": "Operate Failed",
|
"operate-failed": "Operate Failed",
|
||||||
"operate-failed-prompt": "Operation failed, reason: {{reason}}",
|
"operate-failed-prompt": "Operation failed, reason: {{reason}}",
|
||||||
"updated-at": "Updated At",
|
"updated-at": "Updated At",
|
||||||
@ -876,13 +878,16 @@ const resources = {
|
|||||||
action: "Действие",
|
action: "Действие",
|
||||||
"search-username": "Поиск по имени пользователя",
|
"search-username": "Поиск по имени пользователя",
|
||||||
"quota-action": "Изменение квоты",
|
"quota-action": "Изменение квоты",
|
||||||
"quota-action-desc": "Пожалуйста, введите значение изменения квоты (положительное для увеличения, отрицательное для уменьшения)",
|
"quota-action-desc":
|
||||||
|
"Пожалуйста, введите значение изменения квоты (положительное для увеличения, отрицательное для уменьшения)",
|
||||||
"subscription-action": "Подарок подписки",
|
"subscription-action": "Подарок подписки",
|
||||||
"subscription-action-desc": "Пожалуйста, введите количество месяцев подарочной подписки",
|
"subscription-action-desc":
|
||||||
|
"Пожалуйста, введите количество месяцев подарочной подписки",
|
||||||
"operate-success": "Успешно",
|
"operate-success": "Успешно",
|
||||||
"operate-success-prompt": "Ваша операция была успешно выполнена.",
|
"operate-success-prompt": "Ваша операция была успешно выполнена.",
|
||||||
"operate-failed": "Не удалось",
|
"operate-failed": "Не удалось",
|
||||||
"operate-failed-prompt": "Не удалось выполнить операцию, причина: {{reason}}",
|
"operate-failed-prompt":
|
||||||
|
"Не удалось выполнить операцию, причина: {{reason}}",
|
||||||
"updated-at": "Обновлено",
|
"updated-at": "Обновлено",
|
||||||
"used-true": "Использовано",
|
"used-true": "Использовано",
|
||||||
"used-false": "Не использовано",
|
"used-false": "Не использовано",
|
||||||
|
Loading…
Reference in New Issue
Block a user