Просмотр исходного кода

fix(cloudwatch): fixed broken cloudwatch edit page, #6697

Torkel Ödegaard 9 лет назад
Родитель
Сommit
c3920bfba1

+ 2 - 1
public/app/features/plugins/ds_edit_ctrl.ts

@@ -13,7 +13,8 @@ var defaults = {
   type: 'graphite',
   url: '',
   access: 'proxy',
-  jsonData: {}
+  jsonData: {},
+  encryptedFields: []
 };
 
 var datasourceCreated = false;

+ 1 - 0
public/app/plugins/datasource/cloudwatch/config_ctrl.ts

@@ -12,6 +12,7 @@ export class CloudWatchConfigCtrl {
 
   /** @ngInject */
   constructor($scope) {
+    debugger;
     this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';
     this.current.jsonData.authType = this.current.jsonData.authType || 'credentials';
 

+ 8 - 10
public/app/plugins/datasource/cloudwatch/partials/config.html

@@ -13,24 +13,21 @@
       Credentials profile name, as specified in ~/.aws/credentials, leave blank for default
     </info-popover>
   </div>
+
   <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "keys"'>
     <label class="gf-form-label width-13">Access key </label>
     <label class="gf-form-label width-13" ng-show="ctrl.accessKeyExist">Configured</label>
-    <a class="gf-form-button btn btn-danger btn-small" type="submit" ng-click="ctrl.resetAccessKey()" ng-show="ctrl.accessKeyExist">Reset</a>
-    <input type="text"
-      class="gf-form-input max-width-18"
-      ng-hide="ctrl.accessKeyExist"
-      ng-model='ctrl.current.secureJsonData.accessKey'></input>
+    <a class="btn btn-secondary gf-form-btn" type="submit" ng-click="ctrl.resetAccessKey()" ng-show="ctrl.accessKeyExist">Reset</a>
+    <input type="text" class="gf-form-input max-width-18" ng-hide="ctrl.accessKeyExist" ng-model='ctrl.current.secureJsonData.accessKey'></input>
   </div>
+
   <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "keys"'>
     <label class="gf-form-label width-13">Secret key</label>
     <label class="gf-form-label width-13" ng-show="ctrl.secretKeyExist">Configured</label>
-    <a class="btn btn-danger gf-form-button btn-small" type="submit" ng-click="ctrl.resetSecretKey()" ng-show="ctrl.secretKeyExist">Reset</a>
-    <input type="text"
-      class="gf-form-input max-width-18"
-      ng-hide="ctrl.secretKeyExist"
-      ng-model='ctrl.current.secureJsonData.secretKey'></input>
+    <a class="btn btn-secondary gf-form-btn" type="submit" ng-click="ctrl.resetSecretKey()" ng-show="ctrl.secretKeyExist">Reset</a>
+    <input type="text" class="gf-form-input max-width-18" ng-hide="ctrl.secretKeyExist" ng-model='ctrl.current.secureJsonData.secretKey'></input>
   </div>
+
   <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "arn"'>
     <label class="gf-form-label width-13">Assume Role ARN</label>
     <input type="text" class="gf-form-input max-width-18" ng-model='ctrl.current.jsonData.assumeRoleArn' placeholder="arn:aws:iam:*"></input>
@@ -38,6 +35,7 @@
       ARN of Assume Role
     </info-popover>
   </div>
+
   <div class="gf-form">
     <label class="gf-form-label width-13">Default Region</label>
     <div class="gf-form-select-wrapper max-width-18 gf-form-select-wrapper--has-help-icon">