style: create images ux
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user