Skip to content

Commit

Permalink
fix: resolve desktop monitoring issue (labring#5019)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Sep 3, 2024
1 parent 45c7f08 commit c81a55d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/desktop/src/components/signin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default function SigninComponent() {
? (t('common:loading') || 'Loading') + '...'
: t('common:log_in') || 'Log In'}
</Button>
{hasBaiduToken && getBaiduId() ? <Box></Box> : <AuthList />}
<AuthList />
</>
)}
</Flex>
Expand Down
12 changes: 7 additions & 5 deletions frontend/desktop/src/pages/api/desktop/getResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
for (const volume of pod.spec.volumes) {
if (!volume.persistentVolumeClaim?.claimName) continue;
const pvcName = volume.persistentVolumeClaim.claimName;
const pvc = await kc
.makeApiClient(k8s.CoreV1Api)
.readNamespacedPersistentVolumeClaim(pvcName, namespace);
const storage = pvc?.body?.spec?.resources?.requests?.storage || '0';
totalStorageRequests += parseResourceValue(storage);
try {
const pvc = await kc
.makeApiClient(k8s.CoreV1Api)
.readNamespacedPersistentVolumeClaim(pvcName, namespace);
const storage = pvc?.body?.spec?.resources?.requests?.storage || '0';
totalStorageRequests += parseResourceValue(storage);
} catch (error) {}
}
}

Expand Down

0 comments on commit c81a55d

Please sign in to comment.