Skip to content
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

adding CSP changes to grafana integration #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
14 changes: 14 additions & 0 deletions dist/partials/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ <h5>Wavefront Settings</h5>
</div>
</div>

<div class="gf-form-inline">
<div class="gf-form">
<span class="gf-form-label width-10">CSP API Token</span>
</div>
<div class="gf-form max-width-24">
<i class="gf-form-label max-width-22 text-center" ng-show="ctrl.cspApiTokenExists">Configured</i>
<a class="btn btn-secondary gf-form-btn" style="flex-grow:1" type="submit" ng-click="ctrl.resetCspApiToken()" ng-show="ctrl.cspApiTokenExists">Reset</a>
<input type="text" class="gf-form-input max-width-24" ng-hide="ctrl.cspApiTokenExists" ng-model="ctrl.current.jsonData.cspAPIToken"/>
<info-popover mode="right-absolute" ng-hide="ctrl.cspApiTokenExists">
Paste your CSP API token here. You can find and manage your tokens on your profile page in the Wavefront app

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this throughout:

Paste your VMware Cloud services API token here. You can find and manage your API tokens on your profile page in the Wavefront app.

</info-popover>
</div>
</div>

<div class="gf-form-inline">
<div class="gf-form">
<span class="gf-form-label width-10">Timeout (seconds)</span>
Expand Down
2 changes: 2 additions & 0 deletions dist/plugin/configCtrl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export declare class WavefrontConfigCtrl {
static templateUrl: string;
current: any;
wavefrontTokenExists: boolean;
cspApiTokenExists: boolean;
constructor();
resetWavefrontToken(): void;
resetCspApiToken(): void;
}
6 changes: 6 additions & 0 deletions dist/plugin/configCtrl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/configCtrl.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 52 additions & 1 deletion dist/plugin/datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/datasource.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"author": "",
"license": "ISC",
"dependencies": {
"@types/angular": "^1.6.2",
"@types/lodash": "^4.14.50",
"@types/angular": "^1.6.56",
"@types/jquery": "^2.0.41",
"typescript": "^2.1.5"
},
"devDependencies": {
"@types/lodash": "^4.14.112",
"tslint": "^4.3.1"
}
}
29 changes: 29 additions & 0 deletions src/partials/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,35 @@ <h5>Wavefront Settings</h5>
</div>
</div>

<div class="gf-form-inline">
<div class="gf-form">
<span class="gf-form-label width-10">CSP OAuth Token</span>
</div>
<div class="gf-form max-width-24">
<i class="gf-form-label max-width-22 text-center" ng-show="ctrl.cspOAuthExists">Configured</i>
<a class="btn btn-secondary gf-form-btn" style="flex-grow:1" type="submit" ng-click="ctrl.resetCspOAuth()" ng-show="ctrl.cspOAuthExists">Reset</a>
<input type="text" class="gf-form-input max-width-24" ng-hide="ctrl.cspOAuthExists" ng-model="ctrl.current.jsonData.cspOAuthClientId"/>
<input type="text" class="gf-form-input max-width-24" ng-hide="ctrl.cspOAuthExists" ng-model="ctrl.current.jsonData.cspOAuthClientSecret"/>
<info-popover mode="right-absolute" ng-hide="ctrl.cspOAuthExists">
Paste your CSP OAuth token here. You can find and manage your tokens on your profile page in the Wavefront app
</info-popover>
</div>
</div>
qqq
<div class="gf-form-inline">
<div class="gf-form">
<span class="gf-form-label width-10">CSP API Token</span>
</div>
<div class="gf-form max-width-24">
<i class="gf-form-label max-width-22 text-center" ng-show="ctrl.cspApiTokenExists">Configured</i>
<a class="btn btn-secondary gf-form-btn" style="flex-grow:1" type="submit" ng-click="ctrl.resetCspApiToken()" ng-show="ctrl.cspApiTokenExists">Reset</a>
<input type="text" class="gf-form-input max-width-24" ng-hide="ctrl.cspApiTokenExists" ng-model="ctrl.current.jsonData.cspAPIToken"/>
<info-popover mode="right-absolute" ng-hide="ctrl.cspApiTokenExists">
Paste your CSP API token here. You can find and manage your tokens on your profile page in the Wavefront app
</info-popover>
</div>
</div>

<div class="gf-form-inline">
<div class="gf-form">
<span class="gf-form-label width-10">Timeout (seconds)</span>
Expand Down
15 changes: 15 additions & 0 deletions src/plugin/configCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,28 @@ export class WavefrontConfigCtrl {

public current: any;
public wavefrontTokenExists = false;
public cspApiTokenExists = false;
public cspOAuthExists = false;

constructor() {
this.wavefrontTokenExists = (this.current.jsonData.wavefrontToken != null && this.current.jsonData.wavefrontToken !== "");
this.cspApiTokenExists = (this.current.jsonData.cspAPIToken != null && this.current.jsonData.cspAPIToken !== "");
this.cspOAuthExists = (this.current.jsonData.cspOAuthClientId != null && this.current.jsonData.cspOAuthClientSecret !== "");
}

public resetWavefrontToken() {
this.current.jsonData.wavefrontToken = "";
this.wavefrontTokenExists = false;
}

public resetCspApiToken() {
this.current.jsonData.cspAPIToken = "";
this.cspApiTokenExists = false;
}

public resetCspOAuth() {
this.current.jsonData.cspOAuthClientId = "";
this.current.jsonData.cspOAuthClientSecret = "";
this.cspOAuthExists = false;
}
}
Loading