Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support configuration for dashboard url #7670

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading