cpee 2.1.53 → 2.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cockpit/css/{resources.css → resources-label.css} +0 -7
- data/cockpit/css/resources-svg.css +20 -0
- data/cockpit/css/ui.css +0 -4
- data/cockpit/edit.html +2 -1
- data/cockpit/graph.html +4 -0
- data/cockpit/index.html +3 -2
- data/cockpit/js/instance.js +117 -136
- data/cockpit/js/wfadaptor.js +0 -27
- data/cockpit/model.html +2 -0
- data/cockpit/themes/compact/theme.js +38 -32
- data/cockpit/themes/control/theme.js +76 -20
- data/cockpit/themes/dataflow/theme.js +45 -39
- data/cockpit/themes/default/theme.js +38 -33
- data/cockpit/themes/extended/theme.js +38 -33
- data/cockpit/themes/felix/theme.js +38 -33
- data/cockpit/themes/model/theme.js +14 -13
- data/cockpit/themes/packed/theme.js +38 -32
- data/cockpit/themes/preset/theme.js +38 -33
- data/cockpit/track.html +4 -0
- data/cpee.gemspec +1 -1
- data/server/routing/end.pid +1 -0
- data/server/routing/forward-events-00.pid +1 -0
- data/server/routing/forward-votes.pid +1 -0
- data/server/routing/persist.pid +1 -0
- metadata +8 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b18fb6a90f4eecc274718f826b2eb26594170285bccbe81799b01d62893f7a7
|
|
4
|
+
data.tar.gz: '0990fbfc1a1e7f3dc0874fa53f0d8eae1a9a86e05fc8c3a0b4a8decc4f3cb6c9'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a163fa0d363e66371e948d7c307d0bde0eab957ce9479b19aa7c80c90d5b0e731187b4e5f831faa4a36451f3741182dba5c14fd2b9dc9ac6ff3d1dba0e57691
|
|
7
|
+
data.tar.gz: 897ea95574747419d64820adafb97cac14bfd24493e725f8e6e9a106d46317f280df0a478650a718bcdefd2bb435d4f68cb75f0aa3941d36827afe4929d4c195
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
svg rect.border {
|
|
2
|
+
fill: var(--wfadaptor-border);
|
|
3
|
+
}
|
|
4
|
+
svg .resource-point.read {
|
|
5
|
+
fill: green;
|
|
6
|
+
}
|
|
7
|
+
svg .resource-point.write {
|
|
8
|
+
fill: orange;
|
|
9
|
+
}
|
|
10
|
+
svg .resource-point.both {
|
|
11
|
+
fill: blue;
|
|
12
|
+
}
|
|
13
|
+
svg line.resource-line {
|
|
14
|
+
stroke: red;
|
|
15
|
+
stroke-opacity: 0.1;
|
|
16
|
+
}
|
|
17
|
+
svg line.resource-line:hover {
|
|
18
|
+
stroke: red;
|
|
19
|
+
stroke-opacity: 0.2;
|
|
20
|
+
}
|
data/cockpit/css/ui.css
CHANGED
|
@@ -41,10 +41,6 @@ body {
|
|
|
41
41
|
#graphgrid.striped .graphlabel, #graphgrid.striped .graphempty {
|
|
42
42
|
border-left: 1pt solid var(--wfadaptor-border);
|
|
43
43
|
}
|
|
44
|
-
#graphgrid.striped #resources rect.border {
|
|
45
|
-
width: 0.8pt;
|
|
46
|
-
fill: var(--wfadaptor-border);
|
|
47
|
-
}
|
|
48
44
|
#graphgrid.striped .graphlabel.even, #graphgrid.striped .graphempty.even, #graphgrid.striped .graphlast.even {
|
|
49
45
|
background-color: #e9e9e9;
|
|
50
46
|
}
|
data/cockpit/edit.html
CHANGED
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
<script type="text/javascript" src="js/modifiers.js"></script>
|
|
58
58
|
<script type="text/javascript" src="js/resources.js"></script>
|
|
59
59
|
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
60
|
-
<link rel="stylesheet" href="css/resources.css" type="text/css"/>
|
|
60
|
+
<link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
|
|
61
|
+
<link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
|
|
61
62
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
62
63
|
<style>
|
|
63
64
|
/* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
|
data/cockpit/graph.html
CHANGED
|
@@ -55,7 +55,10 @@
|
|
|
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/modifiers.js"></script>
|
|
58
|
+
<script type="text/javascript" src="js/resources.js"></script>
|
|
58
59
|
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
60
|
+
<link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
|
|
61
|
+
<link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
|
|
59
62
|
<link rel="stylesheet" href="css/graph.css" type="text/css"/>
|
|
60
63
|
</head>
|
|
61
64
|
<body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
<div id="trackfull">
|
|
64
67
|
<div id='graphcolumn'>
|
|
65
68
|
<div id='graphgrid'>
|
|
69
|
+
<div class="resource-label" style="display: none"></div>
|
|
66
70
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
|
|
67
71
|
</div>
|
|
68
72
|
</div>
|
data/cockpit/index.html
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
<!-- modelling ui -->
|
|
48
48
|
<script type="text/javascript" src="js/wfadaptor.js"></script>
|
|
49
|
-
<link rel="stylesheet" href="css/wfadaptor.css" type="text/css"/>
|
|
49
|
+
<link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
|
|
50
50
|
|
|
51
51
|
<!-- custom stuff, play arround -->
|
|
52
52
|
<script type="text/javascript" src="js/ui.js"></script>
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
<script type="text/javascript" src="js/modifiers.js"></script>
|
|
57
57
|
<script type="text/javascript" src="js/resources.js"></script>
|
|
58
58
|
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
59
|
-
<link rel="stylesheet" href="css/resources.css" type="text/css"/>
|
|
59
|
+
<link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
|
|
60
|
+
<link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
|
|
60
61
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
61
62
|
<style>
|
|
62
63
|
/* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
|
data/cockpit/js/instance.js
CHANGED
|
@@ -505,10 +505,12 @@ function monitor_instance_values(type,vals) {// {{{
|
|
|
505
505
|
} else {
|
|
506
506
|
save['modeltype'] = undefined;
|
|
507
507
|
}
|
|
508
|
-
if ($('#modifiers
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
508
|
+
if ($('#modifiers').length > 0) {
|
|
509
|
+
if ($('#modifiers > div').length == 0) {
|
|
510
|
+
modifiers_display().then(function(){ modifiers_select(); });
|
|
511
|
+
} else {
|
|
512
|
+
modifiers_select();
|
|
513
|
+
}
|
|
512
514
|
}
|
|
513
515
|
var text = $(" > attributes > info",res).text() + " (" + url.replace(/\/$/,'').split(/[\\/]/).pop() + ")";
|
|
514
516
|
$('#title').text(text);
|
|
@@ -566,39 +568,35 @@ function adaptor_init(url,theme,dslx) { //{{{
|
|
|
566
568
|
}
|
|
567
569
|
|
|
568
570
|
$('#graphgrid .graphlabel, #graphgrid .graphempty, #resources, #graphgrid .graphlast').remove();
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
var thidden = [];
|
|
571
|
+
let tcolumns = [];
|
|
572
|
+
let tcolumntype = {};
|
|
573
|
+
let tcolumncount = {}
|
|
573
574
|
|
|
574
|
-
var tsvgs = {};
|
|
575
575
|
const mapPoints = new Map();
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
const tcolumnsvgs = {};
|
|
577
|
+
const iconsize = 10;
|
|
578
|
+
const space = 5;
|
|
578
579
|
|
|
579
580
|
_.each(labels,function(val){
|
|
580
581
|
if (val.label != "") {
|
|
581
|
-
tlabels[val.row] = [];
|
|
582
582
|
_.each(val.label,function(col) {
|
|
583
583
|
if (!tcolumns.includes(col.column)) {
|
|
584
584
|
tcolumns.push(col.column);
|
|
585
585
|
tcolumncount[col.column] = 0;
|
|
586
|
+
tcolumnsvgs[col.column] = {};
|
|
586
587
|
}
|
|
587
|
-
if (
|
|
588
|
-
|
|
588
|
+
if (tcolumntype[col.column] == undefined && col.type != undefined) {
|
|
589
|
+
tcolumntype[col.column] = col.type;
|
|
589
590
|
}
|
|
590
591
|
if (col.value != undefined) {
|
|
592
|
+
let pos = dimensions.height_shift/2 + dimensions.height * (val.row - 1) + (dimensions.height / 2);
|
|
593
|
+
let firstpos = dimensions.height_shift/2 + (dimensions.height / 2);
|
|
591
594
|
|
|
592
|
-
// Start Peilei
|
|
593
595
|
if (col.type == "resource") {
|
|
594
|
-
let str = '';
|
|
595
596
|
for (const [k, v] of Object.entries(col.value)) {
|
|
596
|
-
var p = {};
|
|
597
|
-
p.row = val.row;
|
|
598
|
-
p.AR = v;
|
|
599
|
-
p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
|
|
597
|
+
var p = { AR: v };
|
|
600
598
|
if (!mapPoints.has(k)) {
|
|
601
|
-
p.y0 = p.y0 == undefined ?
|
|
599
|
+
p.y0 = p.y0 == undefined ? pos : p.y0;
|
|
602
600
|
p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax;
|
|
603
601
|
} else {
|
|
604
602
|
p.y0 = mapPoints.get(k).y0;
|
|
@@ -606,70 +604,52 @@ function adaptor_init(url,theme,dslx) { //{{{
|
|
|
606
604
|
}
|
|
607
605
|
mapPoints.set(k, p);
|
|
608
606
|
}
|
|
609
|
-
var cx = iconshift*2;
|
|
610
|
-
str += '<g xmlns="http://www.w3.org/2000/svg">';
|
|
611
607
|
|
|
608
|
+
let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
|
|
609
|
+
|
|
610
|
+
var cx = space;
|
|
612
611
|
for (const [k, p] of mapPoints) {
|
|
613
|
-
let firstAssignFlag =
|
|
614
|
-
p.
|
|
612
|
+
let firstAssignFlag = false;
|
|
613
|
+
p.x = cx;
|
|
615
614
|
|
|
616
615
|
// Including Triangle
|
|
617
616
|
if (k in col.value) { // Define points for a triangle pointing to the right
|
|
617
|
+
let inner;
|
|
618
|
+
|
|
618
619
|
if (p.AR == "Read") {
|
|
619
|
-
|
|
620
|
-
if (
|
|
621
|
-
firstAssignFlag = 1;
|
|
622
|
-
}
|
|
620
|
+
inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
|
|
621
|
+
if (pos == p.y0) { firstAssignFlag = true; }
|
|
623
622
|
} else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
|
|
624
|
-
|
|
623
|
+
inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
|
|
625
624
|
} else if (p.AR == "AssignRead") {
|
|
626
|
-
|
|
627
|
-
str += '<circle xmlns="http://www.w3.org/2000/svg" cx="' + cx + '" cy="' + p.yc + '" r="5" fill="blue" class="resource-point">';
|
|
625
|
+
inner = $X('<circle xmlns="http://www.w3.org/2000/svg" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
|
|
628
626
|
}
|
|
629
627
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
|
|
634
|
-
}
|
|
628
|
+
// extend the bars
|
|
629
|
+
if (pos > p.ymax) {
|
|
630
|
+
p.ymax = pos;
|
|
635
631
|
}
|
|
636
632
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
if (p.AR == "Read" || p.AR == "Assign") {
|
|
641
|
-
str += '</polygon>';
|
|
642
|
-
} else if (p.AR == "AssignRead") {
|
|
643
|
-
str += '</circle>';
|
|
644
|
-
}
|
|
633
|
+
inner.append($X('<text xmlns="http://www.w3.org/2000/svg">' + k + '</text>'));
|
|
634
|
+
tsvg.append(inner);
|
|
645
635
|
}
|
|
646
636
|
|
|
647
|
-
if (firstAssignFlag
|
|
637
|
+
if (firstAssignFlag) {
|
|
648
638
|
// Additional logic and construction of another polygon for orange triangle pointing left
|
|
649
|
-
p.y0 -= (
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
cx += iconsize;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
for (const [k, p] of mapPoints) {
|
|
656
|
-
if(k in col.value) {
|
|
657
|
-
if (dimensions.height_shift/2+dimensions.height*val.row != p.y0) {
|
|
658
|
-
p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
|
|
659
|
-
if(dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax) {
|
|
660
|
-
p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
639
|
+
p.y0 -= (val.row-1) * dimensions.height;
|
|
640
|
+
tsvg.append($X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write">' + '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text></polygon>'));
|
|
663
641
|
}
|
|
642
|
+
cx += iconsize + space;
|
|
664
643
|
}
|
|
665
|
-
str += '</g>';
|
|
666
644
|
|
|
667
|
-
|
|
645
|
+
tcolumnsvgs[col.column][val.row] = tsvg;
|
|
646
|
+
} else {
|
|
647
|
+
tsvg = $X('<text x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg">' + col.value + '</text>');
|
|
648
|
+
tcolumnsvgs[col.column][val.row] = tsvg;
|
|
668
649
|
}
|
|
669
650
|
|
|
670
651
|
tcolumncount[col.column] += 1;
|
|
671
652
|
}
|
|
672
|
-
tlabels[val.row][tcolumns.indexOf(col.column)] = { label: col.value, type: val.tname, id: val.element_id };
|
|
673
653
|
});
|
|
674
654
|
}
|
|
675
655
|
});
|
|
@@ -679,48 +659,47 @@ function adaptor_init(url,theme,dslx) { //{{{
|
|
|
679
659
|
'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
|
|
680
660
|
});
|
|
681
661
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
662
|
+
tcolumns.forEach(h => {
|
|
663
|
+
if (Object.keys(tcolumnsvgs[h]).length > 0) {
|
|
664
|
+
const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
|
|
665
|
+
const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
|
|
666
|
+
const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
|
|
667
|
+
let xwidth = 0;
|
|
668
|
+
svgcolumn.append(svgback);
|
|
669
|
+
svgcolumn.append(svgfront);
|
|
670
|
+
svgcolumn.css('grid-row', '1/span ' + (max.row + 2))
|
|
671
|
+
svgcolumn.css('grid-column', tcolumns.indexOf(tcolumns.first) + 2);
|
|
672
|
+
svgcolumn.attr('height', $('#graphcanvas').attr('height'));
|
|
673
|
+
$('#graphgrid').append(svgcolumn);
|
|
674
|
+
|
|
675
|
+
for (var i = 0; i < max.row; i++) {
|
|
676
|
+
let node = svgfront.append($(tcolumnsvgs[h][i+1]));
|
|
677
|
+
if (xwidth < node[0].getBBox().width) { xwidth = node[0].getBBox().width; }
|
|
678
|
+
}
|
|
679
|
+
xwidth = xwidth + 2 * space;
|
|
680
|
+
if (striped == true) {
|
|
681
|
+
for (var i = 0; i < max.row; i++) {
|
|
682
|
+
svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" width="' + (xwidth + 1) + '" height="' + dimensions.height + '"></rect>'));
|
|
683
|
+
svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="border" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" height="' + dimensions.height + '" width="1"></rect>'));
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (tcolumntype[h] == "resource") {
|
|
687
|
+
for (const [k, p] of mapPoints) {
|
|
688
|
+
svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + p.ymax + '" class="resource-line" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
|
|
695
689
|
}
|
|
696
690
|
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
var j = tcolumns.length;
|
|
700
|
-
var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px"> </div>');
|
|
701
|
-
$('#graphgrid').append(ele);
|
|
702
|
-
}
|
|
703
691
|
|
|
704
|
-
|
|
705
|
-
let dataflow = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
|
|
706
|
-
dataflow.css('grid-row', '1/span ' + (max.row + 2));
|
|
707
|
-
dataflow.css('grid-column', tcolumns.indexOf(thidden.first) + 2);
|
|
708
|
-
dataflow.attr('height', $('#graphcanvas').attr('height'));
|
|
709
|
-
dataflow.attr('width', mapPoints.size * iconsize + iconshift * 2);
|
|
692
|
+
$('.resource-label').hide(); // Speech Bubble hide by default
|
|
710
693
|
|
|
711
|
-
|
|
712
|
-
dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + 5.2) + '" width="' + (mapPoints.size * iconsize + iconshift * 2) + '" height="' + dimensions.height + '"></rect>'));
|
|
713
|
-
dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="border" x="0" y="' + (dimensions.height * i + 5.2) + '" height="' + dimensions.height + '"></rect>'));
|
|
714
|
-
}
|
|
715
|
-
for (const [k, p] of mapPoints) {
|
|
716
|
-
dataflow.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + p.x0 + '" y1="' + p.y0 + '" x2="' + p.xc + '" y2="' + p.ymax + '" class="resource-line" stroke-opacity="0.1" stroke="orange" stroke-width="10" marker-end="url(#arrowhead)"><text>' + k + '</text></line>'));
|
|
717
|
-
}
|
|
718
|
-
for (var i = 0; i < max.row; i++) {
|
|
719
|
-
dataflow.append($(tsvgs[i+1]));
|
|
694
|
+
svgcolumn.attr('width', xwidth);
|
|
720
695
|
}
|
|
721
|
-
|
|
696
|
+
});
|
|
722
697
|
|
|
723
|
-
|
|
698
|
+
// Add the last stripe
|
|
699
|
+
var j = tcolumns.length;
|
|
700
|
+
for (var i = 0; i < max.row; i++) {
|
|
701
|
+
var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px"> </div>');
|
|
702
|
+
$('#graphgrid').append(ele);
|
|
724
703
|
}
|
|
725
704
|
};
|
|
726
705
|
graphrealization.set_svg_container($('#graphcanvas'));
|
|
@@ -1122,48 +1101,50 @@ function save_svgfile() {// {{{
|
|
|
1122
1101
|
var url = $('body').attr('current-instance');
|
|
1123
1102
|
|
|
1124
1103
|
var gc = $('#graphcanvas').clone();
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
$(
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
for (k in varreps) {
|
|
1142
|
-
cst = cst.replace(new RegExp(k,'g'),varreps[k]);
|
|
1143
|
-
}
|
|
1144
|
-
loc.each(function(k,loco) {
|
|
1145
|
-
var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
|
|
1146
|
-
$(loco).attr('style',cst + sty);
|
|
1147
|
-
});
|
|
1104
|
+
var start = parseInt(gc.attr('width'));
|
|
1105
|
+
$('#graphgrid > svg:not(#graphcanvas)').each( (i,ele) => {
|
|
1106
|
+
const gr = $X('<g transform="translate(' + start + ')" xmlns="http://www.w3.org/2000/svg"></g>');
|
|
1107
|
+
start = start + parseInt(ele.getAttribute('width'));
|
|
1108
|
+
$('g',ele).each((j,g) => {
|
|
1109
|
+
gr.append($(g).clone());
|
|
1110
|
+
});
|
|
1111
|
+
gc.append(gr);
|
|
1112
|
+
});
|
|
1113
|
+
var varreps = {};
|
|
1114
|
+
$(window.document.styleSheets).each(function(i,x){
|
|
1115
|
+
if (x && x.href && x.ownerNode.attributes.getNamedItem('data-include-export')) {
|
|
1116
|
+
$(x.cssRules).each(function(j,y){
|
|
1117
|
+
if (y.selectorText == ":root") {
|
|
1118
|
+
$(y.style).each(function(k,z) {
|
|
1119
|
+
varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
|
|
1148
1120
|
});
|
|
1149
|
-
var loc = $(gc).find('text.super');
|
|
1150
|
-
loc.attr('style',loc.attr('style') + ' display: none');
|
|
1151
|
-
var loc = $(gc).find('.stripe');
|
|
1152
|
-
loc.attr('style',loc.attr('style') + ' display: none');
|
|
1153
1121
|
}
|
|
1122
|
+
var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
|
|
1123
|
+
var cst = y.style.cssText;
|
|
1124
|
+
for (k in varreps) {
|
|
1125
|
+
cst = cst.replace(new RegExp(k,'g'),varreps[k]);
|
|
1126
|
+
}
|
|
1127
|
+
loc.each(function(k,loco) {
|
|
1128
|
+
var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
|
|
1129
|
+
$(loco).attr('style',cst + sty);
|
|
1130
|
+
console.log(loco);
|
|
1131
|
+
});
|
|
1154
1132
|
});
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
url: url + "/properties/attributes/info/",
|
|
1158
|
-
success: function(res){
|
|
1159
|
-
$('#savesvgfile').attr('download',res + '.svg');
|
|
1160
|
-
$('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializeXML()));
|
|
1161
|
-
document.getElementById('savesvgfile').click();
|
|
1162
|
-
},
|
|
1163
|
-
error: report_failure
|
|
1164
|
-
});
|
|
1133
|
+
var loc = $(gc).find('text.super');
|
|
1134
|
+
loc.attr('style',loc.attr('style') + ' display: none; ');
|
|
1165
1135
|
}
|
|
1166
1136
|
});
|
|
1137
|
+
gc.attr('width',start+1);
|
|
1138
|
+
$.ajax({
|
|
1139
|
+
type: "GET",
|
|
1140
|
+
url: url + "/properties/attributes/info/",
|
|
1141
|
+
success: function(res){
|
|
1142
|
+
$('#savesvgfile').attr('download',res + '.svg');
|
|
1143
|
+
$('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializePrettyXML()));
|
|
1144
|
+
document.getElementById('savesvgfile').click();
|
|
1145
|
+
},
|
|
1146
|
+
error: report_failure
|
|
1147
|
+
});
|
|
1167
1148
|
}// }}}
|
|
1168
1149
|
async function set_testset(testset,exec) {// {{{
|
|
1169
1150
|
var url = $('body').attr('current-instance');
|
data/cockpit/js/wfadaptor.js
CHANGED
|
@@ -228,24 +228,6 @@ function WfIllustrator(wf_adaptor) { // View {{{
|
|
|
228
228
|
return g;
|
|
229
229
|
} // }}}
|
|
230
230
|
|
|
231
|
-
var draw_label = this.draw.draw_label = function (tname, id, label, row, col, group) { // {{{
|
|
232
|
-
var g = $X('<text class="label" transform="translate(' + String(col*self.width-self.width_shift) + ',' + String(row*self.height+20-(self.height-self.height_shift)) + ')" xmlns="http://www.w3.org/2000/svg"></text>');
|
|
233
|
-
var spli = $(label.split(/\n/));
|
|
234
|
-
spli.each(function(k,v) {
|
|
235
|
-
var tspan = $X('<tspan x="0" dy="' + (spli.length > 1 ? '-7' : '0') + '" xmlns="http://www.w3.org/2000/svg"></tspan>');
|
|
236
|
-
if (k == 0) {
|
|
237
|
-
tspan.text(v);
|
|
238
|
-
} else {
|
|
239
|
-
tspan.text(v);
|
|
240
|
-
tspan.attr('dy','15');
|
|
241
|
-
tspan.attr('dx','15');
|
|
242
|
-
}
|
|
243
|
-
g.append(tspan);
|
|
244
|
-
});
|
|
245
|
-
if(group) { group.find('g.element[element-id=' + id + ']').append(g); }
|
|
246
|
-
else {self.svg.container.append(g);}
|
|
247
|
-
return g;
|
|
248
|
-
} // }}}
|
|
249
231
|
var draw_symbol = this.draw.draw_symbol = function (sname, id, title, row, col, group, addition) { // {{{
|
|
250
232
|
if(self.elements[sname] == undefined || self.elements[sname].svg == undefined) sname = 'unknown';
|
|
251
233
|
if (addition) {
|
|
@@ -380,15 +362,6 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
|
|
|
380
362
|
} else {
|
|
381
363
|
adaptor.draw_labels(graph.max,[],{ 'height': illustrator.height, 'height_shift': illustrator.height_shift },false);
|
|
382
364
|
}
|
|
383
|
-
if (illustrator.compact == false) {
|
|
384
|
-
if (labels.length > 0) {
|
|
385
|
-
_.each(labels,function(a,key) {
|
|
386
|
-
if (a.label && a.label[0] && a.label[0].column == 'Label' && a.label[0].value) {
|
|
387
|
-
illustrator.draw.draw_label(a.tname, a.element_id, a.label[0].value, a.row, graph.max.col + 1, graph.svg);
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
365
|
} //}}}
|
|
393
366
|
|
|
394
367
|
// Generic Functions {{{
|
data/cockpit/model.html
CHANGED
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
<script type="text/javascript" src="js/edit.js"></script>
|
|
59
59
|
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
60
60
|
<link rel="stylesheet" href="css/model.css" type="text/css"/>
|
|
61
|
+
<link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
|
|
62
|
+
<link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
|
|
61
63
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
62
64
|
<style>
|
|
63
65
|
/* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
|
|
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
63
63
|
//{{{ Render the details from rng (right hand side of graph tab)
|
|
64
64
|
this.update_details = function(svgid){
|
|
65
65
|
var tab = $('#dat_details');
|
|
66
|
-
var focus_ele = $(':focus',tab);
|
|
67
|
-
var focus_path = focus_ele.attr('data-relaxngui-path');
|
|
68
|
-
var focus_pos = focus_ele.prop('selectionStart');
|
|
69
66
|
var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
|
|
70
|
-
tab.empty();
|
|
71
67
|
if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
|
|
72
68
|
save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
|
|
73
69
|
var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
|
|
@@ -78,20 +74,16 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
78
74
|
if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
|
|
79
75
|
$(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
|
|
80
76
|
}
|
|
81
|
-
save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
|
|
82
77
|
var nn = $X($(node).serializeXML());
|
|
83
78
|
nn.removeAttr('svg-id');
|
|
84
79
|
nn.removeAttr('svg-type');
|
|
85
80
|
nn.removeAttr('svg-subtype');
|
|
86
81
|
nn.removeAttr('svg-label');
|
|
82
|
+
|
|
83
|
+
tab.empty();
|
|
84
|
+
save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
|
|
87
85
|
save['details'].content(nn);
|
|
88
|
-
|
|
89
|
-
var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
|
|
90
|
-
ele.focus();
|
|
91
|
-
if (ele.setSelectionRange) {
|
|
92
|
-
ele.setSelectionRange(focus_pos,focus_pos);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
86
|
+
|
|
95
87
|
format_visual_forms();
|
|
96
88
|
}
|
|
97
89
|
}; //}}}
|
|
@@ -211,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
211
203
|
$(nodes).each(function(key,str) {
|
|
212
204
|
nodes[key] = $X(str);
|
|
213
205
|
});
|
|
206
|
+
let svgids = [];
|
|
214
207
|
$(nodes).each(function(key,node){
|
|
215
|
-
|
|
208
|
+
svgids.push($(node).attr('svg-id'));
|
|
209
|
+
});
|
|
210
|
+
svgids.sort((a,b) => {
|
|
211
|
+
if (a > b) { return -1; }
|
|
212
|
+
else if (a < b) { return 1; }
|
|
213
|
+
else { return 0; }
|
|
214
|
+
});
|
|
215
|
+
svgids.forEach(svgid => {
|
|
216
|
+
var target = self.adaptor.description.get_node_by_svg_id(svgid);
|
|
216
217
|
del_ui_pos(target)
|
|
217
218
|
self.adaptor.description.remove(null,target);
|
|
218
219
|
localStorage.removeItem('marked');
|
|
@@ -1233,28 +1234,33 @@ function WFAdaptorManifestation(adaptor) {
|
|
|
1233
1234
|
return 'vertical';
|
|
1234
1235
|
},
|
|
1235
1236
|
'resolve_symbol': function(node) {
|
|
1237
|
+
let alist = []
|
|
1236
1238
|
let plist = []
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1239
|
+
|
|
1240
|
+
var regassi = /data\.([a-zA-Z_]+)\s*(=[^=]|\+\=|\-\=|\*\=|\/\=|<<|>>)/g; // we do not have to check for >/< version of stuff as only conditions are in attributes, and conditions can not contain assignments
|
|
1241
|
+
var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
|
|
1242
|
+
$ ('call > parameters > arguments > *, call > code > *, loop[condition], alternative[condition]',node).each(function(i,n) {
|
|
1243
|
+
let item;
|
|
1244
|
+
if (n.hasAttribute('condition')) {
|
|
1245
|
+
item = n.getAttribute('condition');
|
|
1246
|
+
} else {
|
|
1247
|
+
item = n.textContent;
|
|
1248
|
+
}
|
|
1249
|
+
if (n.parentNode.nodeName == 'arguments' && item.charAt(0) != '!' ) { return }
|
|
1250
|
+
|
|
1251
|
+
let indices = [];
|
|
1252
|
+
|
|
1253
|
+
for (const match of item.matchAll(regassi)) {
|
|
1254
|
+
indices.push(match.index);
|
|
1255
|
+
alist.push(match[1]);
|
|
1256
|
+
}
|
|
1257
|
+
for (const match of item.matchAll(reg_not_assi)) {
|
|
1258
|
+
const arg1 = match[1];
|
|
1259
|
+
if (indices.includes(match.index)) { continue; }
|
|
1260
|
+
if (!alist.includes(arg1)) { plist.push(arg1); }
|
|
1255
1261
|
}
|
|
1256
1262
|
})
|
|
1257
|
-
if (
|
|
1263
|
+
if (plist.length > 0) { return 'start_event'; }
|
|
1258
1264
|
},
|
|
1259
1265
|
'closing_symbol': 'end',
|
|
1260
1266
|
'col_shift': function(node) {
|