mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:02:49 +08:00

* Update the generator to include version * Add versioned APIs * Update imports * Prettier
28 lines
742 B
TypeScript
28 lines
742 B
TypeScript
import { t } from '@grafana/i18n';
|
|
|
|
import { RepositorySpec } from '../../../api/clients/provisioning/v0alpha1';
|
|
import { RepositoryFormData } from '../types';
|
|
import { specToData } from '../utils/data';
|
|
|
|
export function getDefaultValues(repository?: RepositorySpec): RepositoryFormData {
|
|
if (!repository) {
|
|
return {
|
|
type: 'github',
|
|
title: t('provisioning.get-default-values.title.repository', 'Repository'),
|
|
token: '',
|
|
url: '',
|
|
branch: 'main',
|
|
generateDashboardPreviews: false,
|
|
readOnly: false,
|
|
prWorkflow: true,
|
|
path: 'grafana/',
|
|
sync: {
|
|
enabled: false,
|
|
target: 'instance',
|
|
intervalSeconds: 60,
|
|
},
|
|
};
|
|
}
|
|
return specToData(repository);
|
|
}
|