style: create images ux

This commit is contained in:
jialin
2024-11-22 10:00:34 +08:00
parent dde937f460
commit 67febd3e25
14 changed files with 150 additions and 73 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ const isProduction = env === 'production';
const t = Date.now();
export default defineConfig({
proxy: {
...proxy('http://csvhs44p420c73bdb41g-80.agent.damodel.com')
...proxy()
},
history: {
type: 'hash'
+26 -1
View File
@@ -18,10 +18,35 @@ export default function createProxyTable(target?: string) {
changeOrigin: true,
secure: false,
ws: true,
buffer: false,
selfHandleResponse: false,
pathRewrite: (pth: string) => pth.replace(`/^/${api}`, `/${api}`),
headers: {
origin: newTarget,
Connection: 'keep-alive'
Connection: 'keep-alive',
'Cache-Control': 'no-cache'
},
onProxyRes: (proxyRes: any, req: any, res: any) => {
// let body = '';
// proxyRes.on('data', (chunk) => {
// body += chunk;
// console.log('Received data from target server::::::::::', chunk);
// });
// proxyRes.on('end', () => {
// console.log('Received data from target server=================end');
// console.log(body);
// });
if (req.headers.accept === 'text/event-stream') {
res.writeHead(res.statusCode, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'X-Accel-Buffering': 'no',
'Access-Control-Allow-Origin': '*'
});
proxyRes.pipe(res);
}
}
};
return obj;
+1 -1
View File
@@ -36,7 +36,7 @@ export default [
{
name: 'text2images',
title: 'Text2Images',
path: '/playground/text-to-images',
path: '/playground/text-to-image',
key: 'text2images',
icon: 'Comment',
component: './playground/images'