Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4051f04e
Commit
4051f04e
authored
Nov 11, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3202 from mtanda/cloudwatch_sort
sort CloudWatch suggestion region and namspace
parents
0fb110a4
02a37d67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
pkg/api/cloudwatch/metrics.go
+10
-3
No files found.
pkg/api/cloudwatch/metrics.go
View file @
4051f04e
...
...
@@ -2,6 +2,7 @@ package cloudwatch
import
(
"encoding/json"
"sort"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/util"
...
...
@@ -69,8 +70,8 @@ func init() {
// Please update the region list in public/app/plugins/datasource/cloudwatch/partials/config.html
func
handleGetRegions
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
regions
:=
[]
string
{
"
us-east-1"
,
"us-west-2"
,
"us-west-1"
,
"eu-west-1"
,
"eu-central-1"
,
"ap-southeast
-1"
,
"
ap-southeast-2"
,
"ap-northeast-1"
,
"sa-east-1"
,
"cn-north-1
"
,
"
ap-northeast-1"
,
"ap-southeast-1"
,
"ap-southeast-2"
,
"cn-north
-1"
,
"
eu-central-1"
,
"eu-west-1"
,
"sa-east-1"
,
"us-east-1"
,
"us-west-1"
,
"us-west-2
"
,
}
result
:=
[]
interface
{}{}
...
...
@@ -82,8 +83,14 @@ func handleGetRegions(req *cwRequest, c *middleware.Context) {
}
func
handleGetNamespaces
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
result
:=
[]
interface
{}
{}
keys
:=
[]
string
{}
for
key
:=
range
metricsMap
{
keys
=
append
(
keys
,
key
)
}
sort
.
Sort
(
sort
.
StringSlice
(
keys
))
result
:=
[]
interface
{}{}
for
_
,
key
:=
range
keys
{
result
=
append
(
result
,
util
.
DynMap
{
"text"
:
key
,
"value"
:
key
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment