From f9d54f6b451d79a122e9473c80853362bd1e2827 Mon Sep 17 00:00:00 2001 From: "Li, Juan" Date: Wed, 22 Aug 2018 15:57:25 +0800 Subject: [PATCH 1/4] Fix UI bugs: 1. In profiling, when selecting rule on UI, for "Enum detection Top5 count", it generates rule like: { "rule": "source.desc, desc, count(*) AS count GROUP BY source.desc ORDER BY count DESC LIMIT 5", "dsl.type": "griffin-dsl", "dq.type": "PROFILING" } Actually, we need it to be like: { "rule": "source.desc AS desc, count(*) AS count GROUP BY source.desc ORDER BY count DESC LIMIT 5", "dsl.type": "griffin-dsl", "dq.type": "PROFILING", "out": [ { "type": "metric", "name": "desc_group", "flatten": "array" } ] } To flatten the group by metric as an array, and naming it as "${the group column name}_group". Then the metric will be like: {"name":"prof_job","tmst":1534768500000,"value":{"desc_group":[{"desc": "aaa", "count": 3}, {"desc": "bbb", "count": 5}]}} Please notice that there're 2 mistakes in current enum rule, one is the "rule" content, the other one is the lack of "out" field. 2. There's a bug in Dashboard page, when refreshing, it works good, and a metric chart is painted. But after select the measure drop-down box, the chart size is collapsed into a line, which is terrible. 3. In "partition configuration" pages of creating accuracy measure, the item "Time Zone" is blank by default, but in the same page of creating profiling measure, the item "Time Zone" has a default value, which should act the same as the accuracy measure creation page. 4. In "Select Models" page of creating profiling measure, when you select "Regular Expression Detection Count" as a rule for a string column, there will be a text box below, for regular expression. I think the UI is not bad so far. However, it doesn't work in a right way. The rule it generates is like: { "rule": "count(source.desc RLIKE '^[0-9]{4}$') AS `desc_regexcount`", "dsl.type": "griffin-dsl", "dq.type": "PROFILING" } After test, it returns total count of the column, which means the statement "RLIKE" doesn't work. We need to change it like this: { "rule": "count(source.desc) AS `desc_regexcount` WHERE source.desc RLIKE '^[0-9]{4}$'", "dsl.type": "griffin-dsl", "dq.type": "PROFILING" } I've tested the latter, it works. 5. For "Download Miss Sample" page, the item list seems a litte strange, it would be better to list them in a table and hover with a hand pointer rather than a text cursor. Besides, sometimes it's slow for the downloading, I think it's better to tell user to wait after a click. --- ui/angular/package.json | 2 +- .../measure/create-measure/ac/ac.component.ts | 6 ++++-- .../configuration/configuration.component.ts | 2 +- .../create-measure.component.css | 10 ++++++++++ .../measure/create-measure/pr/pr.component.ts | 20 +++++++++++-------- .../detail-metric/detail-metric.component.css | 9 +++++++++ .../detail-metric.component.html | 14 ++++++++++--- .../detail-metric/detail-metric.component.ts | 4 +++- 8 files changed, 51 insertions(+), 16 deletions(-) diff --git a/ui/angular/package.json b/ui/angular/package.json index a7f5f835c..692601466 100644 --- a/ui/angular/package.json +++ b/ui/angular/package.json @@ -32,7 +32,7 @@ "font-awesome": "^4.7.0", "ng2-bootstrap": "1.6.3", "ng2-nouislider": "^1.7.6", - "ngx-echarts": "2.2.0", + "ngx-echarts": "2.3.1", "nouislider": "11.0.3", "rxjs": "5.4.2", "zone.js": "^0.8.14" 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 9492ad8cd..31f89203c 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 @@ -90,7 +90,7 @@ export class AcComponent implements OnInit, AfterViewChecked { currentDBstr: string; srcconfig = { where: "", - timezone: "", + timezone: "UTC(WET,GMT)", num: 1, timetype: "day", needpath: false, @@ -98,7 +98,7 @@ export class AcComponent implements OnInit, AfterViewChecked { }; tgtconfig = { where: "", - timezone: "", + timezone: "UTC(WET,GMT)", num: 1, timetype: "day", needpath: false, @@ -691,6 +691,8 @@ export class AcComponent implements OnInit, AfterViewChecked { }); this.src_size = "1day"; this.tgt_size = "1day"; + this.src_timezone = this.srcconfig.timezone; + this.tgt_timezone = this.tgtconfig.timezone; } ngAfterViewChecked() { diff --git a/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts b/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts index ff86f9903..42fcca2c5 100644 --- a/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts +++ b/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts @@ -48,7 +48,7 @@ export class ConfigurationComponent implements OnInit { selectedType: string; configuration = { where: "", - timezone: "", + timezone: "UTC(WET,GMT)", num: 1, timetype: "day", needpath: false, diff --git a/ui/angular/src/app/measure/create-measure/create-measure.component.css b/ui/angular/src/app/measure/create-measure/create-measure.component.css index ad67a180d..02b1f7bcd 100644 --- a/ui/angular/src/app/measure/create-measure/create-measure.component.css +++ b/ui/angular/src/app/measure/create-measure/create-measure.component.css @@ -121,3 +121,13 @@ div.tree > treenode > div > .node-wrapper > treenodeexpander > .toggle-children- .panel-footer { background-color: #3c3c3c; } + + +a.adisabled { + cursor: not-allowed; + opacity: .65; +} + +a.adisabled:hover { text-decoration: none; } +a.adisabled:focus { text-decoration: none; } +a.adisabled:active { text-decoration: none; } 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 8bb205263..5e994216d 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 @@ -239,10 +239,14 @@ export class PrComponent implements AfterViewChecked, OnInit { "dsl.type": "griffin-dsl", "dq.type": "PROFILING", rule: rule, - name: grpname, - metric: { - "collect.type": "array" - } + "out.dataframe.name": grpname, + "out": [ + { + "type": "metric", + "name": grpname+"_group", + "flatten": "array" + } + ] }); } @@ -251,7 +255,7 @@ export class PrComponent implements AfterViewChecked, OnInit { "dsl.type": "griffin-dsl", "dq.type": "PROFILING", rule: rule, - name: nullname + "out.dataframe.name": nullname }); } @@ -260,7 +264,7 @@ export class PrComponent implements AfterViewChecked, OnInit { "dsl.type": "griffin-dsl", "dq.type": "PROFILING", rule: rule, - name: nullname + "out.dataframe.name": nullname }); } @@ -305,11 +309,11 @@ export class PrComponent implements AfterViewChecked, OnInit { ); case "Regular Expression Detection Count": return ( - `count(source.${col.name} RLIKE '${col.regex}') AS \`${col.name}_regexcount\`` + `count(source.${col.name}) AS \`${col.name}_regexcount\` WHERE source.${col.name} RLIKE '^[0-9]{4}$'` ); case "Enum Detection Top5 Count": return ( - `source.${col.name}, ${col.name}, count(*) AS count GROUP BY source.${col.name} ORDER BY count DESC LIMIT 5` + `source.${col.name} AS ${col.name}, count(*) AS count GROUP BY source.${col.name} ORDER BY count DESC LIMIT 5` ); } } diff --git a/ui/angular/src/app/metric/detail-metric/detail-metric.component.css b/ui/angular/src/app/metric/detail-metric/detail-metric.component.css index ee1b824d9..e45728002 100644 --- a/ui/angular/src/app/metric/detail-metric/detail-metric.component.css +++ b/ui/angular/src/app/metric/detail-metric/detail-metric.component.css @@ -97,3 +97,12 @@ under the License. .clone tfoot { background: transparent; } + +a.adisabled { + cursor: not-allowed; + opacity: .65; +} + +a.adisabled:hover { text-decoration: none; } +a.adisabled:focus { text-decoration: none; } +a.adisabled:active { text-decoration: none; } diff --git a/ui/angular/src/app/metric/detail-metric/detail-metric.component.html b/ui/angular/src/app/metric/detail-metric/detail-metric.component.html index 66c9d8d43..f8247102d 100644 --- a/ui/angular/src/app/metric/detail-metric/detail-metric.component.html +++ b/ui/angular/src/app/metric/detail-metric/detail-metric.component.html @@ -77,16 +77,24 @@
- +
- + +
+
+ + + + diff --git a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts index 929464136..f01ced374 100644 --- a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts +++ b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts @@ -68,7 +68,7 @@ export class DetailMetricComponent implements AfterViewChecked, OnInit { missRecordList = []; public visible = false; public visibleAnimate = false; - + isDownloadClickDisabled = true; ngOnInit() { this.currentJob = this.route.snapshot.paramMap.get("name"); @@ -194,6 +194,7 @@ export class DetailMetricComponent implements AfterViewChecked, OnInit { } downloadSample(row) { + this.isDownloadClickDisabled = !this.isDownloadClickDisabled; let urlDownload = this.serviceService.config.uri.missRecordDownload + "?jobName=" + row.name + "&ts=" + row.tmst; this.http .get(urlDownload, @@ -205,6 +206,7 @@ export class DetailMetricComponent implements AfterViewChecked, OnInit { }; }) .subscribe(res => { + this.isDownloadClickDisabled = !this.isDownloadClickDisabled; console.log('start download:', res); var url = window.URL.createObjectURL(res.data); var a = document.createElement('a'); From d1cac0f520a18c9222d093de406c3d82a81121b5 Mon Sep 17 00:00:00 2001 From: "Li, Juan" Date: Thu, 23 Aug 2018 19:31:29 +0800 Subject: [PATCH 2/4] Further fix UI bugs --- ui/angular/src/app/job/job.component.ts | 1 + .../src/app/measure/create-measure/ac/ac.component.ts | 4 ++-- .../configuration/configuration.component.ts | 2 +- .../pr/confirmModal/confirmModal.component.html | 4 ++-- .../src/app/measure/create-measure/pr/pr.component.ts | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ui/angular/src/app/job/job.component.ts b/ui/angular/src/app/job/job.component.ts index f558de3ae..0a86fe532 100644 --- a/ui/angular/src/app/job/job.component.ts +++ b/ui/angular/src/app/job/job.component.ts @@ -189,6 +189,7 @@ export class JobComponent implements OnInit { let trans = Object.keys(data).map(function (index) { let job = self.swapJson(data[index]); job.showDetail = false; + job.jobState.previousFireTime = job.jobState.previousFireTime < 0?'':job.jobState.previousFireTime; job.action = (job.jobState.toStart === true) ? 'START' : 'STOP'; return job; }); 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 31f89203c..5987d1e3d 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 @@ -90,7 +90,7 @@ export class AcComponent implements OnInit, AfterViewChecked { currentDBstr: string; srcconfig = { where: "", - timezone: "UTC(WET,GMT)", + timezone: "", num: 1, timetype: "day", needpath: false, @@ -98,7 +98,7 @@ export class AcComponent implements OnInit, AfterViewChecked { }; tgtconfig = { where: "", - timezone: "UTC(WET,GMT)", + timezone: "", num: 1, timetype: "day", needpath: false, diff --git a/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts b/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts index 42fcca2c5..ff86f9903 100644 --- a/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts +++ b/ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts @@ -48,7 +48,7 @@ export class ConfigurationComponent implements OnInit { selectedType: string; configuration = { where: "", - timezone: "UTC(WET,GMT)", + timezone: "", num: 1, timetype: "day", needpath: false, diff --git a/ui/angular/src/app/measure/create-measure/pr/confirmModal/confirmModal.component.html b/ui/angular/src/app/measure/create-measure/pr/confirmModal/confirmModal.component.html index 92a3afc26..f0fd015b5 100644 --- a/ui/angular/src/app/measure/create-measure/pr/confirmModal/confirmModal.component.html +++ b/ui/angular/src/app/measure/create-measure/pr/confirmModal/confirmModal.component.html @@ -70,11 +70,11 @@
Basic information
{{step3.size}} -
+
-
+
{{step3.timezone}}
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 5e994216d..9e0ca5bb7 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 @@ -46,13 +46,13 @@ export class ProfilingStep2 { export class ProfilingStep3 { config: object = { where: "", - timezone: "UTC(WET,GMT)", + timezone: "", num: 1, timetype: "day", needpath: false, path: "" }; - timezone: string = "UTC(WET,GMT)"; + timezone: string = ""; where: string = ""; size: string = "1day"; needpath: boolean = false; @@ -178,7 +178,7 @@ export class PrComponent implements AfterViewChecked, OnInit { if (originrule == "Enum Detection Top5 Count") { enmvalue = this.transferRule(originrule, selected); - grpname = `${selected.name}_grp`; + grpname = `${selected.name}_top5count`; this.transenumrule.push(enmvalue); this.pushEnmRule(enmvalue, grpname); @@ -243,7 +243,7 @@ export class PrComponent implements AfterViewChecked, OnInit { "out": [ { "type": "metric", - "name": grpname+"_group", + "name": grpname.split("_")[0]=="id"?"id":grpname, "flatten": "array" } ] From 66b654eb3c7ba8edb0094be7f38ce725ebfcd49e Mon Sep 17 00:00:00 2001 From: "Li, Juan" Date: Fri, 24 Aug 2018 09:49:50 +0800 Subject: [PATCH 3/4] fix bugs --- ui/angular/src/app/measure/create-measure/pr/pr.component.ts | 2 +- .../src/app/metric/detail-metric/detail-metric.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9e0ca5bb7..a1dae5e84 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 @@ -243,7 +243,7 @@ export class PrComponent implements AfterViewChecked, OnInit { "out": [ { "type": "metric", - "name": grpname.split("_")[0]=="id"?"id":grpname, + "name": grpname, "flatten": "array" } ] diff --git a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts index f01ced374..4c707c779 100644 --- a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts +++ b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts @@ -128,7 +128,7 @@ export class DetailMetricComponent implements AfterViewChecked, OnInit { records += record; } delete item.value[key]; - key = key + ' (' + keysplit[0] + ', count)'; + key = key + ' (' + keysplit[0].split("_")[0] + ', count)'; item.value[key] = records; // var sortable = []; // for(let i in item.value[key]){ From e67f2102f8d1921d3b17fb1a47b2d34a6e5dfff6 Mon Sep 17 00:00:00 2001 From: "Li, Juan" Date: Fri, 24 Aug 2018 10:11:48 +0800 Subject: [PATCH 4/4] no message --- .../detail-metric/detail-metric.component.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts index 4c707c779..06a6f844b 100644 --- a/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts +++ b/ui/angular/src/app/metric/detail-metric/detail-metric.component.ts @@ -130,23 +130,6 @@ export class DetailMetricComponent implements AfterViewChecked, OnInit { delete item.value[key]; key = key + ' (' + keysplit[0].split("_")[0] + ', count)'; item.value[key] = records; - // var sortable = []; - // for(let i in item.value[key]){ - // for(let category in item.value[key][i]){ - // if(category != "count"){ - // let name = category + ':' + item.value[key][i][category]; - // sortable.push([name, item.value[key][i].count]); - // sortable.sort(function(a, b) { - // return b[1] - a[1]; - // }); - // } - // } - // } - // for(let i=0;i<5;i++){ - // let grpname = sortable[i][0]; - // item.value[grpname] = sortable[i][1]; - // } - // delete item.value[key]; } } }
No content.
{{mf2.data[i].tmst}} {{mf2.data[i].tmst | + date: 'yyyy/MM/dd HH:mm:ss'}}{{mf2.data[i].tmst}} {{mf2.data[i+1].tmst | + date: 'yyyy/MM/dd HH:mm:ss'}}