浏览代码

stackdriver: display error message if project name is not present in jwt file

Erik Sundell 7 年之前
父节点
当前提交
835f1d788e
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      public/app/plugins/datasource/stackdriver/config_ctrl.ts

+ 4 - 0
public/app/plugins/datasource/stackdriver/config_ctrl.ts

@@ -45,6 +45,10 @@ export class StackdriverConfigCtrl {
       this.validationErrors.push('Client Email field missing in JWT file.');
     }
 
+    if (!jwt.project_id || jwt.project_id.length === 0) {
+      this.validationErrors.push('Project Id field missing in JWT file.');
+    }
+
     if (this.validationErrors.length === 0) {
       this.inputDataValid = true;
       return true;