Skip to content

Commit 3f4c602

Browse files
committed
Merge branch 'release/1.8'
2 parents e847b70 + 0c405c9 commit 3f4c602

42 files changed

Lines changed: 2523 additions & 867 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

echoes-gui/echoes-gui-client.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
"script": "/usr/bin/java",
6060
"args": [
6161
"-jar",
62-
"bin/echoes-gui-consumer-quality-assurance-${echoes.gui.consumer.quality.assurance.version}-shaded.jar",
63-
"--quality-config",
64-
"${echoes.quality.config.file}"
62+
"bin/echoes-gui-consumer-quality-assurance-${echoes.gui.consumer.quality.assurance.version}-shaded.jar"
6563
],
6664
"env": {
6765
},

echoes-gui/echoes-gui-client/app/quality/quality.controller.detail.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,41 @@
3636
id: vm._id
3737
}).then(function (_data) {
3838
$log.info(_data);
39-
4039
vm.data = _data.data;
4140
}).catch(function (_data) {
4241
$log.info(_data);
4342
//$window.location.href = "/404.html";
4443
});
4544
}
4645

46+
vm.saveTextAsFile = function (filename) {
47+
if (!vm.data.qualityConfig) {
48+
console.error('Console.save: No data')
49+
return;
50+
}
51+
52+
if (!filename) filename = 'quality.conf'
53+
54+
var blob = new Blob([vm.data.qualityConfig], {type: 'application/json'}),
55+
e = document.createEvent('MouseEvents'),
56+
a = document.createElement('a')
57+
// FOR IE:
58+
59+
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
60+
window.navigator.msSaveOrOpenBlob(blob, filename);
61+
} else {
62+
var e = document.createEvent('MouseEvents'),
63+
a = document.createElement('a');
64+
65+
a.download = filename;
66+
a.href = window.URL.createObjectURL(blob);
67+
a.dataset.downloadurl = ['text/plain', a.download, a.href].join(':');
68+
e.initEvent('click', true, false, window,
69+
0, 0, 0, 0, 0, false, false, false, false, 0, null);
70+
a.dispatchEvent(e);
71+
}
72+
}
73+
4774
$interval(function () {
4875
run();
4976
}, 10000);

echoes-gui/echoes-gui-client/app/quality/quality.detail.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ <h2>{{vm.title}}</h2>
2828
<td>user</td>
2929
<td>{{vm.profile.nickname}}</td>
3030
</tr>
31+
<tr ng-show="vm.data.qualityConfig">
32+
<td>quality config</td>
33+
<td><a ng-click="vm.saveTextAsFile('quality.' + vm.data._id + '.conf')">download config</a></td>
34+
</tr>
3135
<tr ng-show="vm.data">
3236
<td>dataset-size</td>
3337
<td>{{vm.data.datasetSize}}</td>

echoes-gui/echoes-gui-client/app/recollect/recollect.controller.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
});
6363
}
6464

65+
66+
6567
function ngTableParams(data, count) {
6668
return new NgTableParams({
6769
page: vm.page,
@@ -211,20 +213,34 @@
211213
$scope.model.dataset = data._id;
212214
$scope.model.type = data.format;
213215

216+
$scope.level = ["OFF", "WARNING","ERROR", "INFO"]
217+
218+
$http({
219+
method: 'GET',
220+
url: '/rest/api/quality/config-default.json'
221+
}).then(function successCallback(response) {
222+
$scope.config = response.data;
223+
console.log("config", response.data);
224+
}, function errorCallback(response) {
225+
console.log(response);
226+
});
227+
214228
$scope.submitForm = function (isValid) {
215229
if (isValid) {
216230
var data = {
217231
'contentType': $scope.model.type,
218232
"uuid": $scope.model.dataset,
219-
'user': vm.profile.sub
233+
'user': vm.profile.sub,
234+
'quality': angular.toJson($scope.config)
220235
};
221236

222-
$log.info(data);
237+
$log.info("createQuality", data);
223238

224239
restApi.createQuality({
225240
user: vm.profile.sub,
226241
format: $scope.model.type,
227242
dataset: $scope.model.dataset,
243+
quality: angular.toJson($scope.config)
228244
}).then(function (_data) {
229245
$log.info(_data);
230246
ngDialog.close();

echoes-gui/echoes-gui-client/app/recollect/recollect.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,35 @@ <h3 class="modal-title text-center">Quality assurance</h3>
203203
<label>Content-Type</label>
204204
{{model.type}}
205205
</div>
206+
<div class="form-group">
207+
<label>Quality Config</label>
208+
</div>
209+
<div class="accordion col-lg-12 form-group" id="accordion">
210+
<div class="card" ng-repeat="(key, value) in config">
211+
<div class="card-header" id="heading{{$index}}">
212+
<h2 class="mb-0">
213+
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapse{{$index}}" aria-expanded="true" aria-controls="collapse{{$index}}">
214+
{{key}}
215+
</button>
216+
</h2>
217+
</div>
218+
<div id="collapse{{$index}}" class="collapse" aria-labelledby="heading{{$index}}" data-parent="#accordion">
219+
<div class="card-body">
220+
<table class="table">
221+
<tr ng-repeat="(key2, value2) in value">
222+
<td><strong>{{ key2 }}</strong></td>
223+
<td>
224+
<select class="form-control" ng-model="model" ng-options="l for l in level" data-ng-init="model = value2.level" ng-change="update(key,key2,model)">
225+
<option></option>
226+
</select>
227+
</td>
228+
</tr>
229+
</table>
230+
</div>
231+
</div>
232+
</div>
233+
</div>
234+
206235
<button type="submit" class="btn btn-primary">Submit</button>
207236
</form>
208237
</div>

echoes-gui/echoes-gui-client/app/services/restApiService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
break;
5151
case "createQuality":
5252
data = this.fillDataInObjectByList(data, _params, [
53-
'dataset', 'format', 'user'
53+
'dataset', 'format', 'user', 'quality'
5454
]);
5555
data.url = this.getApiBaseUrl() + 'quality/create';
5656
break;

echoes-gui/echoes-gui-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>echoes-gui-client</artifactId>
13-
<version>0.0.4</version>
13+
<version>0.0.5</version>
1414
<packaging>pom</packaging>
1515

1616
<build>

echoes-gui/echoes-gui-client/server.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ app.post('/rest/api/quality/create', function (req, res, next) {
181181
var formData = {
182182
dataset: req.body.dataset,
183183
format: req.body.format,
184-
user: req.body.user
184+
user: req.body.user,
185+
quality: req.body.quality
185186
}
186187

187188
request({
@@ -235,6 +236,18 @@ app.get('/rest/api/quality/user/:user/id/:id/download-report', function (req, re
235236
});
236237
});
237238

239+
app.get('/rest/api/quality/config-default.json', function (req, res, next) {
240+
var r = request({
241+
method: "GET",
242+
url: `http://${process.env.API_HOSTNAME}:${process.env.API_PORT}/rest/quality/config-default.json`
243+
});
244+
r.pipe(res);
245+
246+
r.on('response', function (resp) {
247+
console.log(req.method, util.format('%s', resp && resp.statusCode), req.url);
248+
});
249+
});
250+
238251
app.get('/rest/api/quality/user/:user/id/:id/:filename/download', function (req, res, next) {
239252
var headers = {
240253
'Content-Type': 'application/json',

echoes-gui/echoes-gui-consumer/echoes-gui-consumer-publish/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<artifactId>echoes-gui-consumer-publish</artifactId>
1313

1414
<name>echoes-gui-consumer-publish</name>
15-
<version>0.0.4</version>
15+
<version>0.0.5</version>
1616

1717
<properties>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -79,7 +79,7 @@
7979
<dependency>
8080
<groupId>org.csuc</groupId>
8181
<artifactId>quality</artifactId>
82-
<version>0.0.2</version>
82+
<version>0.0.3</version>
8383
</dependency>
8484
</dependencies>
8585

echoes-gui/echoes-gui-consumer/echoes-gui-consumer-quality-assurance/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<artifactId>echoes-gui-consumer-quality-assurance</artifactId>
1313

1414
<name>echoes-gui-consumer-quality-assurance</name>
15-
<version>0.0.4</version>
15+
<version>0.0.5</version>
1616

1717
<properties>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -84,7 +84,7 @@
8484
<dependency>
8585
<groupId>org.csuc</groupId>
8686
<artifactId>quality</artifactId>
87-
<version>0.0.2</version>
87+
<version>0.0.3</version>
8888
</dependency>
8989
</dependencies>
9090

0 commit comments

Comments
 (0)