chore: download progress

This commit is contained in:
jialin
2025-02-27 18:03:28 +08:00
parent 8464e0ea3f
commit 295b4b3b72
14 changed files with 441 additions and 289 deletions
@@ -5,7 +5,7 @@ import { useIntl } from '@umijs/max';
import { Button, Modal } from 'antd';
import _ from 'lodash';
import React, { useMemo, useState } from 'react';
import { OPENAI_COMPATIBLE } from '../apis';
import { GPUSTACK_API } from '../apis';
type ViewModalProps = {
systemMessage?: string;
@@ -47,7 +47,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
const intl = useIntl();
const [lang, setLang] = useState(langMap.shell);
const BaseURL = `${window.location.origin}/${OPENAI_COMPATIBLE}`;
const BaseURL = `${window.location.origin}/${GPUSTACK_API}`;
const formatPyParams = (params: any) => {
return _.keys(params).reduce((acc: string, key: string) => {
@@ -70,7 +70,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
const printLog = logcommand ? `print(response.${logcommand})` : '';
if (lang === langMap.shell) {
const code = `curl ${window.location.origin}/${OPENAI_COMPATIBLE}/${api} \\\n-H "Content-Type: application/json" \\\n-H "Authorization: Bearer $\{YOUR_GPUSTACK_API_KEY}" \\\n-d '${JSON.stringify(
const code = `curl ${window.location.origin}/${GPUSTACK_API}/${api} \\\n-H "Content-Type: application/json" \\\n-H "Authorization: Bearer $\{YOUR_GPUSTACK_API_KEY}" \\\n-d '${JSON.stringify(
{
...parameters,
...payload