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
533891c0
Commit
533891c0
authored
Sep 06, 2018
by
Erik Sundell
Committed by
Daniel Lee
Sep 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stackdriver: Improved feedback for when a JWT is already uploaded in the ds config page
parent
b1db6a7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
33 deletions
+55
-33
public/app/plugins/datasource/stackdriver/config_ctrl.ts
+6
-0
public/app/plugins/datasource/stackdriver/partials/config.html
+49
-33
No files found.
public/app/plugins/datasource/stackdriver/config_ctrl.ts
View file @
533891c0
...
...
@@ -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
()
{
...
...
public/app/plugins/datasource/stackdriver/partials/config.html
View file @
533891c0
<h3>
Stackdriver Authentication
</h3>
<div
class=
"gf-form-group"
ng-if=
"!ctrl.inputDataValid"
>
<div
class=
"gf-form"
>
<form>
<dash-upload
on-upload=
"ctrl.onUpload(dash)"
></dash-upload>
</form>
<div
ng-if=
"!ctrl.current.jsonData.clientEmail && !ctrl.inputDataValid"
>
<div
class=
"gf-form-group"
ng-if=
"!ctrl.inputDataValid"
>
<div
class=
"gf-form"
>
<form>
<dash-upload
on-upload=
"ctrl.onUpload(dash)"
></dash-upload>
</form>
</div>
</div>
</div>
<div
class=
"gf-form-group"
>
<h5
class=
"section-heading"
ng-if=
"!ctrl.inputDataValid"
>
Or paste JSON
</h5>
<div
class=
"gf-form"
ng-if=
"!ctrl.inputDataValid"
>
<textarea
rows=
"10"
data-share-panel-url=
""
class=
"gf-form-input"
ng-model=
"ctrl.jsonText"
ng-paste=
"ctrl.onPasteJwt($event)"
></textarea>
<div
class=
"gf-form-group"
>
<h5
class=
"section-heading"
ng-if=
"!ctrl.inputDataValid"
>
Or paste JSON
</h5>
<div
class=
"gf-form"
ng-if=
"!ctrl.inputDataValid"
>
<textarea
rows=
"10"
data-share-panel-url=
""
class=
"gf-form-input"
ng-model=
"ctrl.jsonText"
ng-paste=
"ctrl.onPasteJwt($event)"
></textarea>
</div>
<div
ng-repeat=
"valError in ctrl.validationErrors"
class=
"text-error p-l-1"
>
<i
class=
"fa fa-warning"
></i>
{{valError}}
</div>
</div>
<div
ng-repeat=
"valError in ctrl.validationErrors"
class=
"text-error p-l-1"
>
<i
class=
"fa fa-warning"
></i>
{{valError}}
</div>
<div
class=
"gf-form-group"
ng-if=
"ctrl.inputDataValid || ctrl.current.jsonData.clientEmail"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-9"
>
Token URI
</span>
<input
class=
"gf-form-input width-30"
disabled
type=
"text"
ng-model=
'ctrl.current.jsonData.tokenUri'
/>
</div>
</div>
<div
ng-if=
"ctrl.inputDataValid
"
>
<div
class=
"
text-success p-l-1
"
>
<
i
class=
"fa fa-info"
></i
>
Successfully validated input format
<div
class=
"gf-form-inline
"
>
<div
class=
"
gf-form
"
>
<
span
class=
"gf-form-label width-9"
>
Client Email
</span
>
<input
class=
"gf-form-input width-30"
disabled
type=
"text"
ng-model=
"ctrl.current.jsonData.clientEmail"
/>
</div>
<br
/>
</div>
<div
class=
"gf-form"
ng-if=
"ctrl.current.secureJsonFields.privateKey"
>
<span
class=
"gf-form-label width-9"
>
Client Secret
</span>
<input
type=
"text"
class=
"gf-form-input max-width-12"
disabled=
"disabled"
value=
"configured"
>
</div>
<div
class=
"gf-form"
>
<a
class=
"btn btn-secondary gf-form-btn"
href=
"#"
ng-click=
"ctrl.resetValidationMessages()"
>
Reset form
</a>
</div>
<br
/>
<div
class=
"gf-form-group"
ng-if=
"ctrl.inputDataValid"
>
<div
class=
"gf-form"
ng-if=
"ctrl.inputDataValid"
>
<span
class=
"gf-form-label width-10"
>
Default Project
</span>
<div
class=
"gf-form-select-wrapper max-width-23"
>
<select
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.defaultProject"
ng-options=
"p.id as p.name for p in ctrl.projects"
ng-change=
"ctrl.userChangedDefaultProject()"
></select>
</div>
<div
ng-if=
"ctrl.loadingProjects"
>
<i
class=
"fa fa-spinner fa-spin"
></i>
<em>
Fetching projects...
…
</em>
</div>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-10"
>
Default Project
</span>
<div
class=
"gf-form-select-wrapper max-width-23"
>
<select
class=
"gf-form-input"
ng-model=
"ctrl.current.jsonData.defaultProject"
ng-options=
"p.id as p.name for p in ctrl.projects"
ng-change=
"ctrl.userChangedDefaultProject()"
></select>
</div>
<div
ng-if=
"ctrl.
projectsError"
class=
"text-error p-l-1
"
>
<i
class=
"fa fa-
warning
"
></i>
{{ctrl.projectsError}}
<div
ng-if=
"ctrl.
loadingProjects
"
>
<i
class=
"fa fa-
spinner fa-spin
"
></i>
<em>
Fetching projects...
…
</em>
</div>
</div>
<div
ng-if=
"ctrl.projectsError"
class=
"text-error p-l-1"
>
<i
class=
"fa fa-warning"
></i>
{{ctrl.projectsError}}
</div>
</div>
\ No newline at end of file
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