submit()

in ui/angular/src/app/job/create-job/batch/batch.component.ts [134:190]


  submit(form) {
    if (!form.valid) {
      this.toasterService.pop("error", "Error!", "Please complete the form!");
      return false;
    }
    this.measureid = this.getMeasureId();
    this.newJob = {
      "job.name": this.jobname,
      "job.type": "batch",
      "measure.id": this.measureid,
      "cron.expression": this.cronExp,
      "cron.time.zone": this.timezone,
      // "cron.time.zone": "GMT+8:00",
      // "predicate.config": {
      // "interval": "1m",
      // "repeat": 2
      // },
      "data.segments": [
        // {
        //   "data.connector.index": "source[0]",
        //   "segment.range": {
        //   "begin": "",
        //   "length": ""
        //   }
        // },
        // {
        //   "data.connector.index": "target[0]",
        //   "segment.range": {
        //   "begin": "",
        //   "length": ""
        //   }
        // }
      ]
    };
    for (let i = 0; i < this.dropdownList.length; i++) {
      var connector = this.dropdownList[i];
      var begin = this.someKeyboard[i][0];
      var length = this.someKeyboard[i][1] - this.someKeyboard[i][0];
      var beginStr = this.getTimeByUnit(begin, connector.size);
      var lengthStr = this.getTimeByUnit(length, connector.size);
      this.newJob["data.segments"].push({
        "data.connector.name": connector.connectorname,
        "as.baseline": true,
        "segment.range": {
          begin: beginStr,
          length: lengthStr
        }
      });
      this.originBegin.push(beginStr);
      this.originLength.push(lengthStr);
    }
    if (this.dropdownList.length == 2) {
      delete this.newJob["data.segments"][1]["as.baseline"];
    }
    this.visible = true;
    setTimeout(() => (this.visibleAnimate = true), 100);
  }