Repository: incubator-griffin Updated Branches: refs/heads/master 8c7d7c002 -> c1b90c1a4
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/job/job.component.html ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/job/job.component.html b/ui/angular/src/app/job/job.component.html index f7dab88..9cb5f56 100644 --- a/ui/angular/src/app/job/job.component.html +++ b/ui/angular/src/app/job/job.component.html @@ -17,12 +17,20 @@ specific language governing permissions and limitations under the License. --> <div> - <p> - <a routerLink="/createjob" class="btn btn-primary btn-o btn-wide"> + <div class="btn-group"> + <!-- <a routerLink="/createjob" class="btn btn-primary btn-o btn-wide"> <i class="fa fa-plus"></i> Create Job + </a> --> + <a role="button" routerLink="/createjob/batch" class="btn btn-primary btn-o btn-wide dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <i class="fa fa-plus"></i> + Create Job </a> - </p> + <ul class="dropdown-menu"> + <!-- <li><a class="dropdown-item" routerLink="/createjob/batch">Batch Job</a></li> --> + <!-- <li><a class="dropdown-item" routerLink="/createjob/streaming">Streaming Job</a></li> --> + </ul> + </div> <div id="modelContainer"> <table class="table table-striped reco" [mfData]="results" #mf="mfDataTable" [mfRowsOnPage]="10"> <thead> @@ -30,8 +38,8 @@ under the License. <th st-ratio="15">Job Name</th> <th st-ratio="15">Previous Fire Time</th> <th st-ratio="20">Next Fire Time</th> - <th st-ratio="15">Trigger State</th> - <th st-ratio="5">Cron Expression</th> + <th st-ratio="15">Job State</th> + <!-- <th st-ratio="5">Cron Expression</th> --> <th st-ratio="5">Action</th> <th st-ratio="5">Metric</th> </tr> @@ -57,16 +65,25 @@ under the License. <td [hidden]="row.previousFireTime==-1">{{(row.previousFireTime | date: 'yyyy/MM/dd HH:mm:ss') || 'N/A' }}</td> <td>{{(row.nextFireTime | date: 'yyyy/MM/dd HH:mm:ss') || 'N/A' }}</td> <td> - <span *ngIf='row.triggerState == "NORMAL"' class="normal">{{row.triggerState}} + <span *ngIf='row.jobState.state == "NORMAL"' class="normal">{{row.jobState.state}} </span> - <span *ngIf='row.triggerState != "NORMAL"' class='unnormal'>{{row.triggerState}}</span> + <span *ngIf='row.jobState.state != "NORMAL"' class='unnormal'>{{row.jobState.state}}</span> </td> - <td>{{row.cronExpression}}</td> + <!-- <td>{{row.cronExpression}}</td> --> <td> <a (click)="remove(row)" title="delete" style="text-decoration:none"> <i class="fa fa-trash-o po"></i> </a> + <a routerLink="/job/{{row.jobId}}" title="subscribe"> + <i class="fa fa-eye"></i> + </a> + <a *ngIf="row.action==='START'" (click)="stateMag(row)" title="Start" style="text-decoration:none"> + <i class="fa fa-play"></i> + </a> + <a *ngIf="row.action!=='START'" (click)="stateMag(row)" title="Stop" style="text-decoration:none"> + <i class="fa fa-stop"></i> + </a> </td> <td> http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/job/job.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/job/job.component.ts b/ui/angular/src/app/job/job.component.ts index c5abd4f..3151d3f 100644 --- a/ui/angular/src/app/job/job.component.ts +++ b/ui/angular/src/app/job/job.component.ts @@ -43,6 +43,7 @@ export class JobComponent implements OnInit { targetTable: string; deleteId: string; deleteIndex: number; + action: string; private toasterService: ToasterService; constructor( @@ -98,6 +99,19 @@ export class JobComponent implements OnInit { ); } + stateMag(row){ + let actionUrl = this.serviceService.config.uri.modifyJobs + "/" + row.jobId + "?action=" + row.action.toLowerCase(); + this.http.put(actionUrl, {}).subscribe(data => { + var result = JSON.parse(JSON.stringify(data)); + row.action = (row.action === 'STOP' ? 'START' : 'STOP'); + row.jobState.state = result.jobState.state; + }, + err => { + this.toasterService.pop("error", "Error!", "Failed to manage job state!"); + console.log("Error when manage job state"); + }); + } + showInstances(row) { if (row.showDetail) { row.showDetail = !row.showDetail; @@ -126,6 +140,7 @@ export class JobComponent implements OnInit { let trans = Object.keys(data).map(function(index) { let job = data[index]; job.showDetail = false; + job.action = (job.jobState.toStart === true) ? 'START' : 'STOP'; return job; }); this.results = Object.assign([],trans).reverse(); http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/measure/create-measure/ac/ac.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/measure/create-measure/ac/ac.component.ts b/ui/angular/src/app/measure/create-measure/ac/ac.component.ts index 6bcfcb7..4bb7ddc 100644 --- a/ui/angular/src/app/measure/create-measure/ac/ac.component.ts +++ b/ui/angular/src/app/measure/create-measure/ac/ac.component.ts @@ -135,8 +135,8 @@ export class AcComponent implements OnInit, AfterViewChecked { newMeasure = { name: "", "measure.type": "griffin", - "dq.type": "accuracy", - "process.type": "batch", + "dq.type": "ACCURACY", + "process.type": "BATCH", owner: "", description: "", // "group":[], @@ -199,7 +199,7 @@ export class AcComponent implements OnInit, AfterViewChecked { rules: [ { "dsl.type": "griffin-dsl", - "dq.type": "accuracy", + "dq.type": "ACCURACY", name: "accuracy", rule: "" // "details": { @@ -372,8 +372,8 @@ export class AcComponent implements OnInit, AfterViewChecked { this.newMeasure = { name: this.name, "measure.type": "griffin", - "dq.type": "accuracy", - "process.type": "batch", + "dq.type": "ACCURACY", + "process.type": "BATCH", owner: this.owner, description: this.desc, // "group":this.finalgrp, @@ -435,7 +435,7 @@ export class AcComponent implements OnInit, AfterViewChecked { rules: [ { "dsl.type": "griffin-dsl", - "dq.type": "accuracy", + "dq.type": "ACCURACY", name: "accuracy", rule: "" // "details": { http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/measure/create-measure/pr/pr.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/measure/create-measure/pr/pr.component.ts b/ui/angular/src/app/measure/create-measure/pr/pr.component.ts index f5f0763..b36af39 100644 --- a/ui/angular/src/app/measure/create-measure/pr/pr.component.ts +++ b/ui/angular/src/app/measure/create-measure/pr/pr.component.ts @@ -112,8 +112,8 @@ export class PrComponent implements AfterViewChecked, OnInit { newMeasure = { name: "", "measure.type": "griffin", - "dq.type": "profiling", - "process.type": "batch", + "dq.type": "PROFILING", + "process.type": "BATCH", owner: "", description: "", "rule.description": { @@ -126,7 +126,7 @@ export class PrComponent implements AfterViewChecked, OnInit { connectors: [ { name: "", - type: "hive", + type: "HIVE", version: "1.2", "data.unit": "", "data.time.zone": "", @@ -387,11 +387,11 @@ export class PrComponent implements AfterViewChecked, OnInit { this.newMeasure = { name: this.name, "measure.type": "griffin", - "dq.type": "profiling", + "dq.type": "PROFILING", "rule.description": { details:this.noderule }, - "process.type": "batch", + "process.type": "BATCH", owner: this.owner, description: this.desc, // "group":this.finalgrp, @@ -401,7 +401,7 @@ export class PrComponent implements AfterViewChecked, OnInit { connectors: [ { name: this.srcname, - type: "hive", + type: "HIVE", version: "1.2", "data.unit": this.size, "data.time.zone": this.timezone, @@ -458,7 +458,7 @@ export class PrComponent implements AfterViewChecked, OnInit { var self = this; self.newMeasure["evaluate.rule"].rules.push({ "dsl.type": "griffin-dsl", - "dq.type": "profiling", + "dq.type": "PROFILING", rule: rule, name: grpname, metric: { @@ -471,7 +471,7 @@ export class PrComponent implements AfterViewChecked, OnInit { var self = this; self.newMeasure["evaluate.rule"].rules.push({ "dsl.type": "griffin-dsl", - "dq.type": "profiling", + "dq.type": "PROFILING", rule: rule, name: nullname }); @@ -481,7 +481,7 @@ export class PrComponent implements AfterViewChecked, OnInit { var self = this; self.newMeasure["evaluate.rule"].rules.push({ "dsl.type": "griffin-dsl", - "dq.type": "profiling", + "dq.type": "PROFILING", rule: rule, name: "profiling" }); http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/measure/create-measure/pub/pub.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/measure/create-measure/pub/pub.component.ts b/ui/angular/src/app/measure/create-measure/pub/pub.component.ts index 20f79f7..e103817 100644 --- a/ui/angular/src/app/measure/create-measure/pub/pub.component.ts +++ b/ui/angular/src/app/measure/create-measure/pub/pub.component.ts @@ -61,7 +61,7 @@ export function createPubMeasure(name: string, styleUrls: ["./pub.component.css"] }) export class PubComponent implements AfterViewChecked, OnInit { - newMeasure = createPubMeasure("", "", "","external","accuracy","test"); + newMeasure = createPubMeasure("", "", "","external","ACCURACY","test"); dqTypeOptions =["accuracy"]; createResult: any; private toasterService: ToasterService; @@ -143,12 +143,13 @@ export class PubComponent implements AfterViewChecked, OnInit { save() { var measure2Save ={ name:this.newMeasure.name, - metricName: this.newMeasure.metricName, + "metric.name": this.newMeasure.metricName, "measure.type":this.newMeasure.measureType, description:this.newMeasure.description, - "dq.type":this.newMeasure.dqType, + "dq.type":this.newMeasure.dqType.toUpperCase(), owner:this.newMeasure.owner } + console.log(measure2Save); var addModels = this.serviceService.config.uri.addModels; $("#save").attr("disabled", "true"); this.http.post(addModels, measure2Save).subscribe( http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/measure/measure-detail/measure-detail.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/measure/measure-detail/measure-detail.component.ts b/ui/angular/src/app/measure/measure-detail/measure-detail.component.ts index 56d982a..409c79c 100644 --- a/ui/angular/src/app/measure/measure-detail/measure-detail.component.ts +++ b/ui/angular/src/app/measure/measure-detail/measure-detail.component.ts @@ -84,16 +84,16 @@ export class MeasureDetailComponent implements OnInit { data => { this.ruleData = data; if (this.ruleData["measure.type"] === "external") { - this.ruleData.type = this.ruleData["measure.type"]; - this.ruleData.dqType = this.ruleData["dq.type"]; + this.ruleData.type = this.ruleData["measure.type"].toLowerCase(); + this.ruleData.dqType = this.ruleData["dq.type"].toLowerCase(); } else{ - this.ruleData.type = this.ruleData["dq.type"]; + this.ruleData.type = this.ruleData["dq.type"].toLowerCase(); this.currentrule = this.ruleData["evaluate.rule"].rules; if(this.ruleData["rule.description"]){ this.ruleDes = this.ruleData["rule.description"].details } this.fetchData("source", 0); - if (this.ruleData.type === "accuracy") { + if (this.ruleData.type === "ACCURACY") { this.fetchData("target", 1); } else { this.targetDB = ""; http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/measure/measure.component.html ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/measure/measure.component.html b/ui/angular/src/app/measure/measure.component.html index 5342d63..09991e7 100644 --- a/ui/angular/src/app/measure/measure.component.html +++ b/ui/angular/src/app/measure/measure.component.html @@ -43,7 +43,7 @@ under the License. </tr> <tr *ngFor="let row of mf.data"> <td><a routerLink="/measure/{{row.id}}">{{row.name}}</a></td> - <td>{{row["dq.type"]}}</td> + <td>{{row["dq.type"].toLowerCase()}}</td> <td>{{row.description}}</td> <td> @@ -102,7 +102,7 @@ under the License. Measure Type: </label> <div class="col-md-8 col-lg-8 col-sm-8 " style="color: #fff"> - {{deletedRow["dq.type"]}} + {{deletedRow["dq.type"].toLowerCase()}} </div> </div> <div class="row" *ngIf="sourceTable"> http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/metric/metric.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/metric/metric.component.ts b/ui/angular/src/app/metric/metric.component.ts index ab67797..1fce6c5 100644 --- a/ui/angular/src/app/metric/metric.component.ts +++ b/ui/angular/src/app/metric/metric.component.ts @@ -66,15 +66,15 @@ export class MetricComponent implements OnInit { for (let mesName in this.mesWithJob) { var jobs = this.mesWithJob[mesName]; if ( - jobs.length > 0 && jobs[0].type == "accuracy" - ) { + jobs.length > 0 && jobs[0].type == "ACCURACY" + ) { var node = null; node = new Object(); node.name = mesName; node.dq = 0; node.metrics = []; this.measureOptions.push(mesName); - node.type = "accuracy"; + node.type = "ACCURACY"; for (let i = 0; i < jobs.length; i++) { if (jobs[i].metricValues.length != 0) { var someMetrics = jobs[i].metricValues.slice(0,30); @@ -166,4 +166,4 @@ export class MetricComponent implements OnInit { self.redraw(self.finalData); }, 0); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/service/service.service.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/service/service.service.ts b/ui/angular/src/app/service/service.service.ts index dcbcfaf..1b3f4d4 100644 --- a/ui/angular/src/app/service/service.service.ts +++ b/ui/angular/src/app/service/service.service.ts @@ -21,7 +21,7 @@ import { Injectable } from "@angular/core"; @Injectable() export class ServiceService { constructor() {} - // public BACKEND_SERVER = 'http://10.149.247.90:38080'; + // public BACKEND_SERVER = 'http://10.64.222.80:38080'; // public BACKEND_SERVER = 'http://localhost:8080'; public BACKEND_SERVER = ""; public API_ROOT_PATH = "/api/v1"; @@ -84,6 +84,8 @@ export class ServiceService { //Jobs allJobs: this.BACKEND_SERVER + this.API_ROOT_PATH + "/jobs", addJobs: this.BACKEND_SERVER + this.API_ROOT_PATH + "/jobs", + modifyJobs: this.BACKEND_SERVER + this.API_ROOT_PATH + "/jobs", + getJobById: this.BACKEND_SERVER + this.API_ROOT_PATH + "/jobs/config", getMeasuresByOwner: this.BACKEND_SERVER + this.API_ROOT_PATH + "/measures/owner/", deleteJob: this.BACKEND_SERVER + this.API_ROOT_PATH + "/jobs", http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/sidebar/sidebar.component.html ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/sidebar/sidebar.component.html b/ui/angular/src/app/sidebar/sidebar.component.html index 7bcee99..ab1195b 100644 --- a/ui/angular/src/app/sidebar/sidebar.component.html +++ b/ui/angular/src/app/sidebar/sidebar.component.html @@ -37,7 +37,7 @@ under the License. <!-- <div id="side-bar-metrics" class="row"> --> <div id="side-bar-metrics" class="row y-scrollable"> <div *ngFor="let outerItems of finalData;let parent=index"> - <div class="well"> + <div class="well" *ngIf="outerItems.metrics.length != 0"> <div class="col-sm-4 col-lg-4 col-md-4 "> <h4> <!-- <a routerLink="/metrics/{{outerItems.name}}"> {{outerItems.name}}</a> --> http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/app/sidebar/sidebar.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/sidebar/sidebar.component.ts b/ui/angular/src/app/sidebar/sidebar.component.ts index 3021e30..a902cfa 100644 --- a/ui/angular/src/app/sidebar/sidebar.component.ts +++ b/ui/angular/src/app/sidebar/sidebar.component.ts @@ -39,7 +39,6 @@ export class SidebarComponent implements OnInit { public chartService: ChartService ) {} - // finalData = []; finalData = []; chartOption = new Map(); orgWithMeasure: any; @@ -97,7 +96,7 @@ export class SidebarComponent implements OnInit { getOption(parent, i) { return this.chartOption.get("chart" + parent + "-" + i); } - + checkvalue(job){ return job.metricValues.length === 0; } @@ -114,7 +113,7 @@ export class SidebarComponent implements OnInit { for (let mesName in this.mesWithJob) { var jobs = this.mesWithJob[mesName]; if ( - jobs.length > 0 && jobs[0].type == "accuracy" + jobs.length > 0 && jobs[0].type == "ACCURACY" ) { var jobs = this.mesWithJob[mesName]; var node = null; @@ -122,7 +121,7 @@ export class SidebarComponent implements OnInit { node.name = mesName; node.dq = 0; node.metrics = []; - node.type = "accuracy"; + node.type = "ACCURACY"; for (let i = 0; i < jobs.length; i++) { if (jobs[i].metricValues.length != 0) { var someMetrics = jobs[i].metricValues.slice(0,30); @@ -158,4 +157,4 @@ export class SidebarComponent implements OnInit { ngOnInit() { this.sideBarList(null); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/c1b90c1a/ui/angular/src/styles.css ---------------------------------------------------------------------- diff --git a/ui/angular/src/styles.css b/ui/angular/src/styles.css index 688b4cf..0ce15db 100644 --- a/ui/angular/src/styles.css +++ b/ui/angular/src/styles.css @@ -1076,12 +1076,18 @@ tbody { background-color: #00C853; border-radius: 5px; padding:3px 4px; + display: inline-block; + width: 70px; + text-align: center; } .unnormal{ background-color: #EF5350; border-radius: 5px; padding:3px 4px; + display: inline-block; + width: 70px; + text-align: center; } #timePopup{
