Skip to content

Commit

Permalink
Merge pull request #60 from kilosonc/feat/badge
Browse files Browse the repository at this point in the history
fix: support badge
  • Loading branch information
kilosonc authored Jan 10, 2024
2 parents efc26e7 + 08bf1d2 commit 0bc0368
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 0 deletions.
81 changes: 81 additions & 0 deletions src/pages/instances/Pods/components/Badge.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/pages/instances/Pods/v1/index.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/pages/instances/Pods/v2/index.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/services/badge/badge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { request } from 'umi';

// eslint-disable-next-line import/prefer-default-export
export async function listBadges(resourceType: 'clusters' | 'groups' | 'applications', resourceID: number) {
return request<{
data: API.Badge[];
}>(`/apis/core/v2/${resourceType}/${resourceID}/badges`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
}
9 changes: 9 additions & 0 deletions src/services/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,13 @@ declare namespace API {
commit: string
};

export type Badge = {
id: number
name: string
svgLink: string
redirectLink: string
createdAt: string
updatedAt: string
};

}

0 comments on commit 0bc0368

Please sign in to comment.