fix: add worker, create cluster

This commit is contained in:
jialin
2025-12-17 14:59:07 +08:00
parent 5e48d75ead
commit bd6f4b3f76
14 changed files with 234 additions and 103 deletions
@@ -0,0 +1,25 @@
import { useEffect, useState } from 'react';
import { querySystemConfig } from '../apis';
import { SystemConfig } from '../config/types';
export default function useSystemConfig() {
const [systemConfig, setSystemConfig] = useState<SystemConfig>(
{} as SystemConfig
);
const fetchSystemConfig = async () => {
try {
const data = await querySystemConfig();
setSystemConfig(data);
} catch (error) {
// handle error if needed
setSystemConfig({} as SystemConfig);
}
};
useEffect(() => {
fetchSystemConfig();
}, []);
return { systemConfig };
}