mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-17 06:23:44 +08:00
添加主题
This commit is contained in:
@@ -30,12 +30,13 @@ async function handle(
|
||||
// const matchResponse = request_data.logEntry.match(regex);
|
||||
const regex_message = /(?<="content":")(.*?)(?="}[,\]])/g;
|
||||
const matchAllMessage = request_data.logEntry.match(regex_message);
|
||||
console.log(matchAllMessage, "=====");
|
||||
// console.log(matchAllMessage, "=====");
|
||||
if (matchAllMessage.length > 0) {
|
||||
request_data.logToken =
|
||||
getTokenLength(matchAllMessage.join(" ")) +
|
||||
matchAllMessage.length * 3;
|
||||
}
|
||||
delete request_data["logEntry"];
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("[LOG]", "logToken", e);
|
||||
|
||||
@@ -5,15 +5,12 @@ import * as echarts from "echarts";
|
||||
import { DatePicker, DatePickerValue } from "@tremor/react";
|
||||
import { zhCN } from "date-fns/locale";
|
||||
import { EChartsOption } from "echarts";
|
||||
import { OptionDataItem, OptionDataValue } from "echarts/types/src/util/types";
|
||||
// import { param } from "ts-interface-checker"; // 导入 echarts
|
||||
import { essos, walden } from "@/lib/charts_theme";
|
||||
|
||||
export default function UsageByModelChart() {
|
||||
const [currentDate, setCurrentDate] = useState(new Date());
|
||||
const [searchDate, setSearchDate] = useState("");
|
||||
|
||||
const [clientSide, setClientSide] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
let ignore = false;
|
||||
// console.log('windows', window.location.href)
|
||||
@@ -57,7 +54,8 @@ export default function UsageByModelChart() {
|
||||
fetchData().then((option) => {
|
||||
if (!ignore && option && typeof window !== "undefined") {
|
||||
let chartDom = document.getElementById("usage-by-model-chart");
|
||||
let myChart = echarts.init(chartDom);
|
||||
echarts.registerTheme("default", essos);
|
||||
let myChart = echarts.init(chartDom, "default");
|
||||
option && myChart.setOption(option);
|
||||
setSearchDate(currentDateString);
|
||||
console.log("option计数", 1);
|
||||
|
||||
Reference in New Issue
Block a user