Skip to content

Update clouds and bump version #133

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

Merged
merged 4 commits into from
Mar 20, 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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grafana/azure-sdk",
"version": "0.0.1",
"version": "0.0.2",
"description": "Common Azure features for Grafana",
"main": "dist/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"@grafana/data": "10.2.3",
"@grafana/eslint-config": "^7.0.0",
"@grafana/runtime": "10.2.3",
"@grafana/runtime": "nightly",
"@grafana/tsconfig": "^1.3.0-rc1",
"@grafana/ui": "10.2.3",
"@rollup/plugin-commonjs": "25.0.7",
Expand Down
26 changes: 9 additions & 17 deletions src/clouds.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
import { AzureSettings, config } from '@grafana/runtime';

// TODO: Remove when the list of clouds added directly to @grafana/runtime
// https://github.com/grafana/grafana/pull/84039
interface AzureSettings2 extends AzureSettings {
clouds?: AzureCloudInfo[];
}

export interface AzureCloudInfo {
name: string;
displayName: string;
}
import { AzureCloudInfo, config } from '@grafana/runtime';

const predefinedClouds: AzureCloudInfo[] = [
{
name: 'AzureCloud', displayName: 'Azure'
name: 'AzureCloud',
displayName: 'Azure',
},
{
name: 'AzureChinaCloud', displayName: 'Azure China'
name: 'AzureChinaCloud',
displayName: 'Azure China',
},
{
name: 'AzureUSGovernment', displayName: 'Azure US Government'
}
name: 'AzureUSGovernment',
displayName: 'Azure US Government',
},
];

export function getAzureClouds(): AzureCloudInfo[] {
const settingsEx = (config.azure as unknown as AzureSettings2);
const settingsEx = config.azure;

// Return list of clouds from Grafana configuration if they are provided
if (Array.isArray(settingsEx.clouds)) {
Expand Down
Loading