Skip to content

Commit

Permalink
feat: support configuration for dashboard url (#7670)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet authored Jun 26, 2024
1 parent 1e09398 commit d97a773
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions config-ui/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
# All plugins are loaded by default, optional plugins can be loaded
# eg. DEVLAKE_PLUGINS=github,gitlab
DEVLAKE_PLUGINS=

# Dashboard URL
DEVLAKE_DASHBOARD_URL_GITHUB=/grafana/d/KXWvOFQnz/github?orgId=1&var-repo_id=All&var-interval=WEEKDAY
DEVLAKE_DASHBOARD_URL_GITLAB=/grafana/d/msSjEq97z/gitlab?orgId=1&var-repo_id=All&var-interval=WEEKDAY
DEVLAKE_DASHBOARD_URL_BITBUCKET=/grafana/d/4LzQHZa4k/bitbucket?orgId=1&var-repo_id=All&var-interval=WEEKDAY
DEVLAKE_DASHBOARD_URL_AZUREDEVOPS=/grafana/d/ba7e3a95-80ed-4067-a54b-2a82758eb3dd/azure-devops?orgId=1&var-repo_id=All&var-interval=WEEKDAY
9 changes: 4 additions & 5 deletions config-ui/src/routes/onboard/step-4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ const Wrapper = styled.div`
`;

export const DashboardURLMap: Record<string, string> = {
github: '/grafana/d/KXWvOFQnz/github?orgId=1&var-repo_id=All&var-interval=WEEKDAY',
gitlab: '/grafana/d/msSjEq97z/gitlab?orgId=1&var-repo_id=All&var-interval=WEEKDAY',
bitbucket: '/grafana/d/4LzQHZa4k/bitbucket?orgId=1&var-repo_id=All&var-interval=WEEKDAY',
azuredevops:
'/grafana/d/ba7e3a95-80ed-4067-a54b-2a82758eb3dd/azure-devops?orgId=1&var-repo_id=All&var-interval=WEEKDAY',
github: import.meta.env.DEVLAKE_DASHBOARD_URL_GITHUB,
gitlab: import.meta.env.DEVLAKE_DASHBOARD_URL_GITLAB,
bitbucket: import.meta.env.DEVLAKE_DASHBOARD_URL_BITBUCKET,
azuredevops: import.meta.env.DEVLAKE_DASHBOARD_URL_AZUREDEVOPS,
};

const getStatus = (data: any) => {
Expand Down
4 changes: 4 additions & 0 deletions config-ui/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ interface ImportMetaEnv {
readonly DEVLAKE_COLOR_CUSTOM: string;
readonly DEVLAKE_COPYRIGHT_HIDE: boolean;
readonly DEVLAKE_PLUGINS: string;
readonly DEVLAKE_DASHBOARD_URL_GITHUB: string;
readonly DEVLAKE_DASHBOARD_URL_GITLAB: string;
readonly DEVLAKE_DASHBOARD_URL_BITBUCKET: string;
readonly DEVLAKE_DASHBOARD_URL_AZUREDEVOPS: string;
}

interface ImportMeta {
Expand Down

0 comments on commit d97a773

Please sign in to comment.