cpee 2.1.6 → 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37a2b6910315c8913216a368e40556013da8a33e5887adb75729a52ead89daba
4
- data.tar.gz: 93b34b46c2e9db0586ce251a51e388f668b128cf497cb1ba95920cbe5424e09b
3
+ metadata.gz: 9723d9a647c3d39f739c125cbc6112254172a59b61c24d498c1ec4d53f9a6998
4
+ data.tar.gz: 8945918c7a22d82a7936f1f76a322734f233e7ab701fa670f9a182ccbcd5c80b
5
5
  SHA512:
6
- metadata.gz: f6ed4c4157ebb113589f14c1ab020c4199b30b3e673547b48522cf7cc901a4cbfb70b3ffeb7c21f942df2e151d474a5f7662f64ed1fff4ac60005424e403e83f
7
- data.tar.gz: 87d605938e321c920c969aaf525e6fb7213e9eeef18ef99884175e5d75d14e25f793f1953d55b79dccce61e8270c5d222061c9d10c75fc18d4af9df3726df23d
6
+ metadata.gz: 7d7cb7f744225804de94c56b348c22e61cc2501aba291bddadcef2c1ae725f5280eeb9700065467d3b9289ec2fd15c3200708d557e3b94ffd03b190abd72c492
7
+ data.tar.gz: 731e6e16864401821398d2274c230512abca96af46f74ff0c665bc90a4a9db00141972f52084ce4b84c076532507ca4f9e0bee8635a2913bf4533d4f5a2b56fb
data/cockpit/css/ui.css CHANGED
@@ -149,11 +149,11 @@ ui-tabbed ui-tabbar ui-behind button {
149
149
  #areainstance div.section:nth-child(2) button { white-space: normal; width: 6em; height: 5.7em; vertical-align: middle; margin: 0; padding: 0; }
150
150
 
151
151
  #areainstance div.section:nth-child(3) { overflow-y: scroll; }
152
- #areainstance div.section:nth-child(3) strong { margin:0; padding:0; white-space: normal; font-size: 1em; }
153
- #areainstance div.section:nth-child(3) > div:not(:first-child) { padding-top: 0.5em; }
154
- #areainstance div.section:nth-child(3) > div { padding-bottom: 0.2em; }
152
+ #areainstance div.section:nth-child(3) strong { margin:0; padding:0; white-space: normal; font-size: 0.7em; }
153
+ #areainstance div.section:nth-child(3) > div:not(:first-child) { padding-top: 0.2em; }
154
+ #areainstance div.section:nth-child(3) > div { padding-bottom: 0em; }
155
155
  #areainstance div.section:nth-child(3) select { margin-left: 1em; }
156
- #areainstance div.section:nth-child(3) div.additional { margin-left: 1em; }
156
+ #areainstance div.section:nth-child(3) div.additional { margin: 0 1em; font-size: 0.9em; }
157
157
 
158
158
  #areaexecution input { padding: 0; margin:0; }
159
159
  #areaexecution table.x-ui-compact { width: 100%; }
data/cockpit/edit.html CHANGED
@@ -54,6 +54,7 @@
54
54
  <script type="text/javascript" src="js/details.js"></script>
55
55
  <script type="text/javascript" src="js/parameters.js"></script>
56
56
  <script type="text/javascript" src="js/edit.js"></script>
57
+ <script type="text/javascript" src="js/modifiers.js"></script>
57
58
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
58
59
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
59
60
  <style>
@@ -166,7 +167,7 @@
166
167
  <template id="item">
167
168
  <div>
168
169
  <div class='title'><strong></strong></div>
169
- <div class='select'><select/></div>
170
+ <div class='select'><select></select></div>
170
171
  <div class='additional'></div>
171
172
  </div>
172
173
  </template>
data/cockpit/graph.html CHANGED
@@ -54,6 +54,7 @@
54
54
  <script type="text/javascript" src="js/instance.js"></script>
55
55
  <script type="text/javascript" src="js/details.js"></script>
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
+ <script type="text/javascript" src="js/modifiers.js"></script>
57
58
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
58
59
  </head>
59
60
  <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
data/cockpit/index.html CHANGED
@@ -53,6 +53,7 @@
53
53
  <script type="text/javascript" src="js/instance.js"></script>
54
54
  <script type="text/javascript" src="js/details.js"></script>
55
55
  <script type="text/javascript" src="js/parameters.js"></script>
56
+ <script type="text/javascript" src="js/modifiers.js"></script>
56
57
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
57
58
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
58
59
  <style>
@@ -167,7 +168,7 @@
167
168
  <template id="item">
168
169
  <div>
169
170
  <div class='title'><strong></strong></div>
170
- <div class='select'><select/></div>
171
+ <div class='select'><select></select></div>
171
172
  <div class='additional'></div>
172
173
  </div>
173
174
  </template>
data/cockpit/js/edit.js CHANGED
@@ -4,6 +4,13 @@ document.addEventListener('graph:changed', function (e) {
4
4
  document.addEventListener('parameters:changed', function (e) {
5
5
  $("button[name=save]").prop("disabled",false);
6
6
  }, false);
7
+ document.addEventListener('modifiers:changed', function (e) {
8
+ $("button[name=save]").prop("disabled",false);
9
+ }, false);
10
+
11
+ function leading_zeros(dt) {
12
+ return (dt < 10 ? '0' : '') + dt;
13
+ }
7
14
 
8
15
  $(document).ready(function() {
9
16
  $("button[name=save]").click(function(){
@@ -19,7 +26,7 @@ $(document).ready(function() {
19
26
  $("button[name=save]").prop("disabled",true);
20
27
  $("#lastsavedline").removeClass('hidden');
21
28
  var dt = new Date();
22
- var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds();
29
+ var time = leading_zeros(dt.getHours()) + ":" + leading_zeros(dt.getMinutes()) + ":" + leading_zeros(dt.getSeconds());
23
30
  $("#lastsaved").text(time);
24
31
  },
25
32
  error: function() {
@@ -30,6 +30,7 @@ function global_init() {
30
30
  save['instance_pos'] = [];
31
31
  save['modifiers'] = {};
32
32
  save['modifiers_active'] = {};
33
+ save['modifiers_additional'] = {};
33
34
  node_state = {};
34
35
  }
35
36
 
@@ -446,7 +447,7 @@ function monitor_instance_values(val) {// {{{
446
447
  });
447
448
  } else if(val == "attributes") {
448
449
  if ($('#modifiers > div').length == 0) {
449
- modifiers_display().then(modifiers_select);
450
+ modifiers_display().then(function(){ modifiers_select(); });
450
451
  } else {
451
452
  modifiers_select();
452
453
  }
@@ -1371,113 +1372,6 @@ function append_to_log(what,type,message) {//{{{
1371
1372
  }
1372
1373
  }//}}}
1373
1374
 
1374
- async function modifiers_display() {
1375
- let promises = [];
1376
- let rep = $('body').attr('current-resources');
1377
- $('#modifiers > div').remove();
1378
-
1379
- promises.push(
1380
- $.ajax({
1381
- url: rep + 'modifiers/'
1382
- }).then(async function(res) {
1383
- let ipromises = [];
1384
- $('resource',res).each(function(_,r) {
1385
- ipromises.push(
1386
- $.ajax({
1387
- url: rep + 'modifiers/' + $(r).text()
1388
- }).then(async function(ses){
1389
- let clone = document.importNode(document.querySelector('#modifiers template').content,true);
1390
- let t = $(r).text();
1391
- $('> div',clone).attr('data-resource',t);
1392
- $('div.title *',clone).text(decodeURIComponent(t));
1393
-
1394
- let cpromises = [];
1395
- $('resource',ses).each(function(_,s) {
1396
- let opt = $('<option/>');
1397
- opt.text(decodeURIComponent($(s).text()));
1398
- $('div.select select',clone).append(opt);
1399
-
1400
- cpromises.push(
1401
- $.ajax({
1402
- url: rep + 'modifiers/' + $(r).text() + '/' + $(s).text() + '/condition.json'
1403
- }).then(function(tes){
1404
- save['modifiers'][$(r).text() + '/' + $(s).text()] = tes;
1405
- })
1406
- );
1407
-
1408
- });
1409
- $(clone).insertBefore($('#modifiers template'));
1410
-
1411
- await Promise.all(cpromises);
1412
- })
1413
- );
1414
- });
1415
- await Promise.all(ipromises);
1416
- })
1417
- );
1418
- await Promise.all(promises);
1419
- }
1420
-
1421
- function modifiers_select(e) {
1422
- let atts = {}
1423
- let attr = save['attributes'].save();
1424
- $('> attributes > *',attr).each(function(_,s){
1425
- atts[s.nodeName] = $(s).text();
1426
- });
1427
- $('#modifiers div[data-resource]').each(function(_,r){
1428
- $('select option',r).each(function(_,s){
1429
- let where = $(r).attr('data-resource') + '/' + encodeURIComponent($(s).text());
1430
- let cond = save['modifiers'][where];
1431
- let success = true;
1432
- for (x in cond) {
1433
- if (cond[x] != atts[x]) { success = false; }
1434
- }
1435
- if (success) {
1436
- save['modifiers_active'][$(r).attr('data-resource')] = $(s).text();
1437
- $('select',r).val($(s).text());
1438
- }
1439
- });
1440
- });
1441
- }
1442
-
1443
- function modifiers_update_patch(url,now) {
1444
- $.ajax({
1445
- url: url + '/' + now + '/patch.xml',
1446
- success: function(res) {
1447
- set_testset(res,false);
1448
- }
1449
- });
1450
- }
1451
- function modifiers_update_unpatch(url,last,now) {
1452
- $.ajax({
1453
- url: url + '/' + last + '/unpatch.xml',
1454
- success: function(res) {
1455
- set_testset(res,false).then(function() {
1456
- modifiers_update_patch(url,now);
1457
- });
1458
- },
1459
- error: function() {
1460
- modifiers_update_patch(url,now);
1461
- }
1462
- });
1463
- }
1464
-
1465
- function modifiers_update(e) {
1466
- // when change path
1467
- // unpach from what changed
1468
- // show ui
1469
- let rep = $('body').attr('current-resources');
1470
- let top = $(e.target).parents('div[data-resource]').attr('data-resource');
1471
- let last = save['modifiers_active'][top];
1472
- let now = $(e.target).val();
1473
-
1474
- if (last) {
1475
- modifiers_update_unpatch(rep + 'modifiers/' + top,last,now);
1476
- } else {
1477
- modifiers_update_patch(rep + 'modifiers/' + top,now);
1478
- }
1479
- }
1480
-
1481
1375
  function report_failure(){}
1482
1376
 
1483
1377
  function ui_pos(e,bl) {
@@ -0,0 +1,188 @@
1
+ var modifiers_changed = new Event("modifiers:changed", {"bubbles":true, "cancelable":false});
2
+
3
+ $(document).ready(function() {
4
+ var timer;
5
+
6
+ $(document).on('input','#modifiers div.additional input, #modifiers div.additional textarea, #modifiers div.additional [contenteditable]',function(e){
7
+ clearTimeout(timer);
8
+ timer = setTimeout(function(){ do_main_save(e.target) }, 5000);
9
+ });
10
+ $(document).on('change','#modifiers div.additional select',function(e){
11
+ clearTimeout(timer);
12
+ do_main_save(e.target);
13
+ });
14
+ $(document).on('blur','#modifiers div.additional input, #modifiers div.additional textarea, #modifiers div.additional [contenteditable]',function(e){
15
+ clearTimeout(timer);
16
+ do_main_save(e.target);
17
+ });
18
+ $(document).on('keypress','#modifiers div.additional input',function(e){
19
+ if (e.keyCode == 13) {
20
+ clearTimeout(timer);
21
+ do_main_save(e.target);
22
+ }
23
+ });
24
+ $(document).on('keypress','#modifiers div.additional [contenteditable]',function(e){
25
+ if (e.keyCode == 13) {
26
+ document.execCommand('insertText', false, '\n');
27
+ return false;
28
+ }
29
+ });
30
+ $(document).on('relaxngui_remove', '#modifiers div.additional', function(e){
31
+ clearTimeout(timer);
32
+ do_main_save(e.target);
33
+ });
34
+ $(document).on('relaxngui_move', '#modifiers div.additional', function(e){
35
+ clearTimeout(timer);
36
+ do_main_save(e.target);
37
+ });
38
+ });
39
+
40
+ function do_main_save(target) {
41
+ let div = $(target).parents('div[data-resource]');
42
+ let top = div.attr('data-resource');
43
+ let doc = save['modifiers_additional'][top].save();
44
+ let rep = $('body').attr('current-resources');
45
+ let now = encodeURIComponent($('div.select select',div).val());
46
+
47
+ var tset = $X('<testset xmlns="http://cpee.org/ns/properties/2.0"/>');
48
+ tset.append(doc.documentElement);
49
+
50
+ set_testset(tset,false);
51
+ document.dispatchEvent(modifiers_changed);
52
+ }
53
+
54
+ async function modifiers_display() {
55
+ let promises = [];
56
+ let rep = $('body').attr('current-resources');
57
+ $('#modifiers > div').remove();
58
+
59
+ promises.push(
60
+ $.ajax({
61
+ url: rep + 'modifiers/'
62
+ }).then(async function(res) {
63
+ let ipromises = [];
64
+ $('resource',res).each(function(_,r) {
65
+ ipromises.push(
66
+ $.ajax({
67
+ url: rep + 'modifiers/' + $(r).text()
68
+ }).then(async function(ses){
69
+ let clone = document.importNode(document.querySelector('#modifiers template').content,true);
70
+ let t = $(r).text();
71
+ $('> div',clone).attr('data-resource',t);
72
+ $('div.title *',clone).text(decodeURIComponent(t));
73
+
74
+ let cpromises = [];
75
+ $('resource',ses).each(function(_,s) {
76
+ let opt = $('<option/>');
77
+ opt.text(decodeURIComponent($(s).text()));
78
+ $('div.select select',clone).append(opt);
79
+
80
+ cpromises.push(
81
+ $.ajax({
82
+ url: rep + 'modifiers/' + $(r).text() + '/' + $(s).text() + '/condition.json'
83
+ }).then(function(tes){
84
+ save['modifiers'][$(r).text() + '/' + $(s).text()] = tes;
85
+ })
86
+ );
87
+
88
+ });
89
+ $(clone).insertBefore($('#modifiers template'));
90
+
91
+ await Promise.all(cpromises);
92
+ })
93
+ );
94
+ });
95
+ await Promise.all(ipromises);
96
+ })
97
+ );
98
+ await Promise.all(promises);
99
+ }
100
+
101
+ function modifiers_display_ui(url,top,it,notchanged) {
102
+ if (notchanged) {
103
+ if (save['modifiers_additional'][top]) {
104
+ let attr = save['attributes'].save();
105
+ save['modifiers_additional'][top].content(attr);
106
+ }
107
+ } else {
108
+ $('#modifiers div[data-resource]').each(function(_,r){
109
+ if ($(r).attr('data-resource') == top) {
110
+ $('div.additional',r).empty();
111
+ }
112
+ });
113
+ $.ajax({
114
+ url: url + top + '/' + it + '/ui.rng',
115
+ success: function(rng) {
116
+ $('#modifiers div[data-resource]').each(function(_,r){
117
+ if ($(r).attr('data-resource') == top) {
118
+ save['modifiers_additional'][top] = new RelaxNGui(rng, $('div.additional',r));
119
+ let attr = save['attributes'].save();
120
+ save['modifiers_additional'][top].content(attr);
121
+ }
122
+ });
123
+ }
124
+ });
125
+ }
126
+ }
127
+
128
+ function modifiers_select() {
129
+ let atts = {}
130
+ let attr = save['attributes'].save();
131
+ let rep = $('body').attr('current-resources');
132
+ $('> attributes > *',attr).each(function(_,s){
133
+ atts[s.nodeName] = $(s).text();
134
+ });
135
+ $('#modifiers div[data-resource]').each(function(_,r){
136
+ $('select option',r).each(function(_,s){
137
+ let where = $(r).attr('data-resource') + '/' + encodeURIComponent($(s).text());
138
+ let cond = save['modifiers'][where];
139
+ let success = true;
140
+ for (x in cond) {
141
+ if (cond[x] != atts[x]) { success = false; }
142
+ }
143
+ if (success) {
144
+ let top = $(r).attr('data-resource');
145
+ let it = encodeURIComponent($(s).text());
146
+ $('select',r).val($(s).text());
147
+ modifiers_display_ui(rep + 'modifiers/',top,it,save['modifiers_active'][top] == it);
148
+ save['modifiers_active'][top] = it;
149
+ }
150
+ });
151
+ });
152
+ }
153
+
154
+ function modifiers_update_patch(url,top,now) {
155
+ $.ajax({
156
+ url: url + top + '/' + now + '/patch.xml',
157
+ success: function(res) {
158
+ set_testset(res,false);
159
+ document.dispatchEvent(modifiers_changed);
160
+ }
161
+ });
162
+ }
163
+ function modifiers_update_unpatch(url,top,last,now) {
164
+ $.ajax({
165
+ url: url + top + '/' + last + '/unpatch.xml',
166
+ success: function(res) {
167
+ set_testset(res,false).then(function() {
168
+ modifiers_update_patch(url,top,now);
169
+ });
170
+ },
171
+ error: function() {
172
+ modifiers_update_patch(url,top,now);
173
+ }
174
+ });
175
+ }
176
+
177
+ function modifiers_update(e) {
178
+ let rep = $('body').attr('current-resources');
179
+ let top = $(e.target).parents('div[data-resource]').attr('data-resource');
180
+ let last = save['modifiers_active'][top];
181
+ let now = $(e.target).val();
182
+
183
+ if (last) {
184
+ modifiers_update_unpatch(rep + 'modifiers/',top,last,now);
185
+ } else {
186
+ modifiers_update_patch(rep + 'modifiers/',top,now);
187
+ }
188
+ }
data/cockpit/model.html CHANGED
@@ -54,6 +54,7 @@
54
54
  <script type="text/javascript" src="js/details.js"></script>
55
55
  <script type="text/javascript" src="js/parameters.js"></script>
56
56
  <script type="text/javascript" src="js/model.js"></script>
57
+ <script type="text/javascript" src="js/modifiers.js"></script>
57
58
  <script type="text/javascript" src="js/edit.js"></script>
58
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
59
60
  <link rel="stylesheet" href="css/model.css" type="text/css"/>
data/cockpit/track.html CHANGED
@@ -55,6 +55,7 @@
55
55
  <script type="text/javascript" src="js/details.js"></script>
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
57
  <script type="text/javascript" src="js/track.js"></script>
58
+ <script type="text/javascript" src="js/modifiers.js"></script>
58
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
59
60
  <link rel="stylesheet" href="css/track.css" type="text/css"/>
60
61
  </head>
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.1.6"
3
+ s.version = "2.1.7"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2021-06-17 00:00:00.000000000 Z
13
+ date: 2021-06-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -139,6 +139,7 @@ files:
139
139
  - cockpit/js/edit.js
140
140
  - cockpit/js/instance.js
141
141
  - cockpit/js/model.js
142
+ - cockpit/js/modifiers.js
142
143
  - cockpit/js/parameters.js
143
144
  - cockpit/js/replay.js
144
145
  - cockpit/js/track.js