fix: remove first umijs in prod html
This commit is contained in:
@@ -19,9 +19,6 @@ export default defineConfig({
|
|||||||
history: {
|
history: {
|
||||||
type: 'hash'
|
type: 'hash'
|
||||||
},
|
},
|
||||||
// https: {
|
|
||||||
// http2: true
|
|
||||||
// },
|
|
||||||
base: process.env.npm_config_base || '/',
|
base: process.env.npm_config_base || '/',
|
||||||
...(isProduction
|
...(isProduction
|
||||||
? {
|
? {
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
class DeleteCssPlugin {
|
|
||||||
constructor(options) {
|
|
||||||
this.options = options || {};
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(compiler) {
|
|
||||||
compiler.hooks.done.tap('DeleteCssPlugin', (stats) => {
|
|
||||||
const outputPath =
|
|
||||||
this.options.outputPath || path.resolve(__dirname, 'dist');
|
|
||||||
|
|
||||||
fs.readdir(outputPath, (err, files) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(`Failed to read directory: ${outputPath}`, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
files.forEach((file) => {
|
|
||||||
if (file.endsWith('.css')) {
|
|
||||||
const filePath = path.join(outputPath, file);
|
|
||||||
fs.unlink(filePath, (err) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(`Failed to delete file: ${filePath}`, err);
|
|
||||||
} else {
|
|
||||||
console.log(`Deleted: ${filePath}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = DeleteCssPlugin;
|
|
||||||
@@ -10,6 +10,9 @@ export default (api: IApi) => {
|
|||||||
? info.version || info.commitId
|
? info.version || info.commitId
|
||||||
: `dev-${info.commitId}`
|
: `dev-${info.commitId}`
|
||||||
);
|
);
|
||||||
|
if (env === 'production') {
|
||||||
|
$('script[src^="/js/umi"]').first?.().remove?.();
|
||||||
|
}
|
||||||
return $;
|
return $;
|
||||||
});
|
});
|
||||||
api.onStart(() => {
|
api.onStart(() => {
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ export default {
|
|||||||
documentation: 'https://docs.gpustack.ai/',
|
documentation: 'https://docs.gpustack.ai/',
|
||||||
github: 'https://github.com/gpustack/gpustack',
|
github: 'https://github.com/gpustack/gpustack',
|
||||||
discord: 'https://discord.gg/VXYJzuaqwD',
|
discord: 'https://discord.gg/VXYJzuaqwD',
|
||||||
site: 'https://seal.io/'
|
site: 'https://gpustack.ai/'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default {
|
|||||||
'resources.table.total': 'Total',
|
'resources.table.total': 'Total',
|
||||||
'resources.table.used': 'Used',
|
'resources.table.used': 'Used',
|
||||||
'resources.table.wokers': 'workers',
|
'resources.table.wokers': 'workers',
|
||||||
|
'resources.worker.linuxormaxos': 'Linux or MacOS',
|
||||||
'resources.table.unified': 'Unified Memory',
|
'resources.table.unified': 'Unified Memory',
|
||||||
'resources.worker.add.step1': 'Get Token',
|
'resources.worker.add.step1': 'Get Token',
|
||||||
'resources.worker.add.step2': 'Register Worker',
|
'resources.worker.add.step2': 'Register Worker',
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default {
|
|||||||
'resources.table.used': '已用',
|
'resources.table.used': '已用',
|
||||||
'resources.table.wokers': 'workers',
|
'resources.table.wokers': 'workers',
|
||||||
'resources.table.unified': '统一内存',
|
'resources.table.unified': '统一内存',
|
||||||
|
'resources.worker.linuxormaxos': 'Linux 或 MacOS',
|
||||||
'resources.worker.add.step1': '获取 Token',
|
'resources.worker.add.step1': '获取 Token',
|
||||||
'resources.worker.add.step2': '注册 Worker',
|
'resources.worker.add.step2': '注册 Worker',
|
||||||
'resources.worker.add.step2.tips':
|
'resources.worker.add.step2.tips':
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const Models: React.FC = () => {
|
|||||||
const { setChunkRequest } = useSetChunkRequest();
|
const { setChunkRequest } = useSetChunkRequest();
|
||||||
const { setChunkRequest: setModelInstanceChunkRequest } =
|
const { setChunkRequest: setModelInstanceChunkRequest } =
|
||||||
useSetChunkRequest();
|
useSetChunkRequest();
|
||||||
const [total, setTotal] = useState(100);
|
const [total, setTotal] = useState(0);
|
||||||
const [modelInstances, setModelInstances] = useState<any[]>([]);
|
const [modelInstances, setModelInstances] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [dataSource, setDataSource] = useState<ListItem[]>([]);
|
const [dataSource, setDataSource] = useState<ListItem[]>([]);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<h3>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
|
<h3>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
|
||||||
<h4>Linux Or MacOS </h4>
|
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
|
||||||
<HighlightCode code={addWorkerGuide.mac.getToken}></HighlightCode>
|
<HighlightCode code={addWorkerGuide.mac.getToken}></HighlightCode>
|
||||||
<h4>Windows </h4>
|
<h4>Windows </h4>
|
||||||
<HighlightCode code={addWorkerGuide.win.getToken}></HighlightCode>
|
<HighlightCode code={addWorkerGuide.win.getToken}></HighlightCode>
|
||||||
@@ -46,7 +46,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
}}
|
}}
|
||||||
></span>
|
></span>
|
||||||
</h3>
|
</h3>
|
||||||
<h4>Linux Or MacOS </h4>
|
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
|
||||||
<HighlightCode
|
<HighlightCode
|
||||||
code={addWorkerGuide.mac.registerWorker(origin)}
|
code={addWorkerGuide.mac.registerWorker(origin)}
|
||||||
></HighlightCode>
|
></HighlightCode>
|
||||||
|
|||||||
Reference in New Issue
Block a user