From 533891c03e2f645526901738ad4d1204117cdef2 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 6 Sep 2018 20:50:46 +0200 Subject: [PATCH] Stackdriver: Improved feedback for when a JWT is already uploaded in the ds config page --- .../datasource/stackdriver/config_ctrl.ts | 6 ++ .../stackdriver/partials/config.html | 83 +++++++++++-------- 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/public/app/plugins/datasource/stackdriver/config_ctrl.ts b/public/app/plugins/datasource/stackdriver/config_ctrl.ts index 7c5b1fd29e7..f72677b467a 100644 --- a/public/app/plugins/datasource/stackdriver/config_ctrl.ts +++ b/public/app/plugins/datasource/stackdriver/config_ctrl.ts @@ -15,6 +15,8 @@ export class StackdriverConfigCtrl { this.datasourceSrv = datasourceSrv; this.current.jsonData = this.current.jsonData || {}; this.current.secureJsonData = this.current.secureJsonData || {}; + this.current.secureJsonFields = this.current.secureJsonFields || {}; + console.log(this.current.secureJsonFields.privateKey); this.defaultProject = this.current.jsonData.defaultProject; this.projects = []; } @@ -74,6 +76,10 @@ export class StackdriverConfigCtrl { this.jsonText = ''; this.loadingProjects = false; this.projectsError = ''; + + this.current.jsonData = {}; + this.current.secureJsonData = {}; + this.current.secureJsonFields = {}; } async displayProjects() { diff --git a/public/app/plugins/datasource/stackdriver/partials/config.html b/public/app/plugins/datasource/stackdriver/partials/config.html index b3a8d55b5ef..138f69e7b1e 100644 --- a/public/app/plugins/datasource/stackdriver/partials/config.html +++ b/public/app/plugins/datasource/stackdriver/partials/config.html @@ -1,44 +1,59 @@ -

Stackdriver Authentication

-
-
-
- -
+
+
+
+
+ +
+
+
+
+
Or paste JSON
+
+ +
+
+ + {{valError}} +
-
-
Or paste JSON
-
- -
-
- - {{valError}} -
-
-
- - Successfully validated input format + +
+
+
+ Token URI +
-
+
+
+
+ Client Email + +
+
+
+ Client Secret + +
+ + +
-
-
- Default Project -
- -
-
- - Fetching projects...… -
+
+ Default Project +
+
-
- - {{ctrl.projectsError}} +
+ + Fetching projects...…
+
+ + {{ctrl.projectsError}} +
\ No newline at end of file