Skip to content

Commit

Permalink
fix: overview fetching job bug (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizy authored Jan 11, 2023
1 parent bdd1b45 commit f5b281f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/pages/ServiceManage/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ const Overview: React.FC<IProps> = (props: IProps) => {
const [balancing, setBalancing] = useState(false);
const modalHandler = useRef<any>();
const [hosts, setHosts] = useState([]);
const nebulaRef = useRef<{
currentSpace: any;
nebulaConnect: any;
}>({
currentSpace,
nebulaConnect,
});
nebulaRef.current.currentSpace = currentSpace;
nebulaRef.current.nebulaConnect = nebulaConnect;
useEffect(() => {
props.clear();
},[cluster])
Expand Down Expand Up @@ -127,7 +136,7 @@ const Overview: React.FC<IProps> = (props: IProps) => {
};

const getBalanceStatus = async () => {
if (!currentSpace||!nebulaConnect) return false;
if (!nebulaRef.current.currentSpace||!nebulaRef.current.nebulaConnect) return false;
const { code,data } = await props.getJobs();
if (code === 0) {
const hasRunningBalance = data.tables.find(item => item.Command.indexOf("BALANCE") && item.status === 'RUNNING');
Expand Down
2 changes: 1 addition & 1 deletion src/store/models/nebula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export function NebulaModelWrapper(serviceApi, state, _effects) {
this.update({
parts: data.tables,
});
return data.tables;
}
return data.tables;
},

async asyncGetServices() {
Expand Down

0 comments on commit f5b281f

Please sign in to comment.