cpee 2.1.84 → 2.1.86

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85f1d2cbf39ac8585ef05774578606c35b1323e31c3d4cc1b0b3de5774c916b1
4
- data.tar.gz: b3d88e28a6346b9a66333242ab42c8a4f06542223847d27c434afea16a830081
3
+ metadata.gz: 8c00da803ffced9cf1afdfc7a81d41e88573b5c33e4d78e5abe6fac61892fc2e
4
+ data.tar.gz: d83c71efdf5b6ebf088af77bf07d0b32d2e0270bdd82441b0c5d86cb48df35f8
5
5
  SHA512:
6
- metadata.gz: a5f78409b8d6b06a1d7d7d77792f3dc7b8d0a09d55acd36e07c4098c4ca7aed9eb73f8048b503a488c98bafcb1b21adf82077e4d306a99048126ba5d728718cc
7
- data.tar.gz: 8d7caeb62b53372f3358c053293fad18fd733ce22dc6172e9011bad084b228fdbc6773fcbdfe6a1ee7dd4f24ff4aa59f3ebb23bc39ae5f6fc698935762d859d5
6
+ metadata.gz: ab4f6f4553e230706b94c1bbc7aa377d6982d70e35172f19d751087ac04af410988baa9078a31ebef3762de6d5c3322f9a06c3db6028da3a4b270654a3608a8d
7
+ data.tar.gz: 680ea935445d3f2d4a3526f1bf438433769e79398328926ec00766706c4491de953e7555147e7a8f0023234a26090b25c164472ce1799caa6f4febbed97d8826
@@ -0,0 +1,76 @@
1
+ #loadtxt {
2
+ display: none;
3
+ }
4
+
5
+ #status {
6
+ padding: 0.2em 0.5em;
7
+ border-top: 0.1em solid var(--x-ui-border-color);
8
+ background-color: var(--x-tab-inactive-color);
9
+ min-height: 1.4em;
10
+ overflow:hidden;
11
+ }
12
+ #status.error {
13
+ background-color: var(--wfadaptor-selected);
14
+ }
15
+ #status.success {
16
+ background-color: var(--wfadaptor-exec-vote);
17
+ }
18
+
19
+ #prompt_container {
20
+ padding: 0.2em 0.5em;
21
+ outline: none;
22
+ min-height: 2.66em;
23
+ display: flex;
24
+ flex-wrap: nowrap;
25
+ }
26
+
27
+ .max {
28
+ max-height: 2.66em;
29
+ }
30
+
31
+ .stand_alone {
32
+ height: 100%;
33
+ }
34
+ #prompt {
35
+ flex: 1 1 auto;
36
+ outline: none;
37
+ min-height: 2.66em;
38
+ overflow-y: scroll;
39
+ }
40
+ #prompt:empty:before {
41
+ font-family: sans-serif;
42
+ white-space: normal;
43
+ content: attr(placeholder);
44
+ display: block;
45
+ }
46
+
47
+ #llm_params {
48
+ flex: 0 0 auto;
49
+ box-sizing: border-box;
50
+ padding: 0.2em 0em 0.2em 0.5em;
51
+ outline: none;
52
+ min-height: 2.66em;
53
+ }
54
+
55
+ .single {
56
+ width: 2.3em;
57
+ height: 2.3em;
58
+ }
59
+
60
+ .multi {
61
+ border-top: 0.1em solid var(--x-ui-border-color);
62
+ display: flex;
63
+ justify-content: space-evenly;
64
+ flex-direction: row;
65
+ padding: 15px;
66
+ gap: 5px;
67
+ }
68
+
69
+ .llm_button {
70
+ width: 100%;
71
+ height: 100%;
72
+ }
73
+
74
+ .llm_button:hover {
75
+ background-color: var(--wfadaptor-selected);
76
+ }
data/cockpit/css/ui.css CHANGED
@@ -27,7 +27,6 @@ body {
27
27
  display: flex;
28
28
  flex-direction: row;
29
29
  }
30
-
31
30
  #graphgrid.striped .graphlast.even {
32
31
  background-color: #e9e9e9;
33
32
  }
@@ -66,7 +65,9 @@ ui-tabbed ui-tabbar ui-behind button {
66
65
  #current-graph[href]:before {
67
66
  content: "|";
68
67
  }
69
-
68
+ #current-index[href]:after {
69
+ content: "|";
70
+ }
70
71
  #parameters ui-content { height: 8.5em; min-height: 2.7em; }
71
72
 
72
73
  #areadataelements, #areaendpoints, #areaattributes {
@@ -183,11 +184,19 @@ span.vote {
183
184
  color: #73d216;
184
185
  }
185
186
 
187
+ #modelling {
188
+ flex: 1 1 auto;
189
+ overflow: scroll;
190
+ }
191
+
186
192
  #graphcolumn {
187
193
  margin: 0;
188
194
  padding: 0;
189
195
  border-right: 1px solid var(--x-ui-border-color);
190
196
  min-width: 9em;
197
+ display: flex;
198
+ flex-direction: column;
199
+ overflow: hidden;
191
200
  }
192
201
  #detailcolumn {
193
202
  padding-left: 1.5em;
data/cockpit/edit.html CHANGED
@@ -226,7 +226,7 @@
226
226
  <ui-tabbed class="hidden" id='parameters'>
227
227
  <ui-tabbar>
228
228
  <ui-tab class="switch" ></ui-tab>
229
- <ui-tab class="" data-tab="dataelements" id="tabdataelements">Data Elements</ui-tab>
229
+ <ui-tab class="" data-tab="dataelements" id="tabdataelements">Data Objects</ui-tab>
230
230
  <ui-tab class="inactive" data-tab="endpoints" id="tabendpoints" >Endpoints</ui-tab>
231
231
  <ui-tab class="inactive" data-tab="attributes" id="tabattributes" >Attributes</ui-tab>
232
232
  <ui-behind ></ui-behind>
@@ -259,9 +259,11 @@
259
259
  </ui-tabbar>
260
260
  <ui-content>
261
261
  <ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
262
- <div id='graphgrid'>
263
- <div class="resource-label" style="display: none"></div>
264
- <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>
262
+ <div id="modelling">
263
+ <div id='graphgrid'>
264
+ <div class="resource-label" style="display: none"></div>
265
+ <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>
266
+ </div>
265
267
  </div>
266
268
  </ui-area>
267
269
  <ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
data/cockpit/graph.html CHANGED
@@ -76,9 +76,11 @@
76
76
  </template>
77
77
  <div id="trackfull">
78
78
  <div id='graphcolumn'>
79
- <div id='graphgrid'>
80
- <div class="resource-label" style="display: none"></div>
81
- <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>
79
+ <div id="modelling">
80
+ <div id='graphgrid'>
81
+ <div class="resource-label" style="display: none"></div>
82
+ <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>
83
+ </div>
82
84
  </div>
83
85
  </div>
84
86
  </div>
data/cockpit/index.html CHANGED
@@ -227,7 +227,7 @@
227
227
  <ui-tabbed class="hidden" id='parameters'>
228
228
  <ui-tabbar>
229
229
  <ui-tab class="switch" ></ui-tab>
230
- <ui-tab class="" data-tab="dataelements" id="tabdataelements">Data Elements</ui-tab>
230
+ <ui-tab class="" data-tab="dataelements" id="tabdataelements">Data Objects</ui-tab>
231
231
  <ui-tab class="inactive" data-tab="endpoints" id="tabendpoints" >Endpoints</ui-tab>
232
232
  <ui-tab class="inactive" data-tab="attributes" id="tabattributes" >Attributes</ui-tab>
233
233
  <ui-behind ></ui-behind>
@@ -260,9 +260,11 @@
260
260
  </ui-tabbar>
261
261
  <ui-content>
262
262
  <ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
263
- <div id='graphgrid'>
264
- <div class="resource-label" style="display: none"></div>
265
- <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>
263
+ <div id="modelling">
264
+ <div id='graphgrid'>
265
+ <div class="resource-label" style="display: none"></div>
266
+ <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>
267
+ </div>
266
268
  </div>
267
269
  </ui-area>
268
270
  <ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
@@ -17,6 +17,7 @@ var save = {};
17
17
  save['endpoints'] = undefined;
18
18
  save['dataelements'] = undefined;
19
19
  save['attributes'] = undefined;
20
+ save['attributes_raw'] = {};
20
21
  var node_state = {};
21
22
 
22
23
  function global_init() {
@@ -387,6 +388,8 @@ function monitor_instance(cin,rep,load,exec) {// {{{
387
388
  $("#current-graph").attr('href','graph.html?monitor=' + url);
388
389
  $("#current-track").show();
389
390
  $("#current-track").attr('href','track.html?monitor=' + url);
391
+ $("#current-index").show();
392
+ $("#current-index").attr('href','index.html?monitor=' + url);
390
393
  var q = $.parseQuerySimple();
391
394
  history.replaceState({}, '', '?' + (graph_position ? "position=" + graph_position + "&" : "") + (graph_highlight ? "highlight=" + graph_highlight + "&" : "") + (graph_theme ? "theme=" + graph_theme + "&" : "") + (q.min || q.min=="" ? "min&" : "") + 'monitor='+url);
392
395
 
@@ -513,6 +516,9 @@ function monitor_instance_values(type,vals) {// {{{
513
516
  }
514
517
  });
515
518
  } else if(type == "attributes") {
519
+ $(" > attributes > *",res).each((k,v)=>{
520
+ save['attributes_raw'][v.nodeName] = v.textContent;
521
+ });
516
522
  if ($(" > attributes > resources",res).length > 0) {
517
523
  save['resources'] = $(" > attributes > resources",res).text();
518
524
  } else {
@@ -836,6 +842,7 @@ function monitor_graph_change(force) { //{{{
836
842
  type: "GET",
837
843
  url: url + "/properties/dslx/",
838
844
  success: function(dslx){
845
+ save['dslx'] = $(dslx.documentElement).serializePrettyXML();
839
846
  if (force || !save['graph'] || (save['graph'] && save['graph'].serializePrettyXML() != $(dslx.documentElement).serializePrettyXML())) {
840
847
  $.ajax({
841
848
  type: "GET",
data/cockpit/js/llm.js ADDED
@@ -0,0 +1,58 @@
1
+ function clean_llm_ui(status_id) {
2
+ status_div = $(`#${status_id}`);
3
+ status_div.empty();
4
+ status_div.removeClass('error').removeClass('success');
5
+ return
6
+ }
7
+
8
+ function call_llm_service(status_id,prompt_id) {
9
+ let input = $(`#${prompt_id}`);
10
+ let text = input[0].innerText;
11
+
12
+ const formData = new FormData();
13
+ const blob1 = new Blob([save['dslx']], { type: "text/xml" });
14
+ formData.append("rpst_xml", blob1);
15
+ const blob2 = new Blob([text], { type: "text/plain" });
16
+ formData.append("user_input", blob2);
17
+ const blob3 = new Blob(['gemini-2.0-flash'], { type: "text/plain" });
18
+ formData.append("llm", blob3);
19
+
20
+ jQuery.ajax({
21
+ url: '/llm/',
22
+ data: formData,
23
+ cache: false,
24
+ contentType: false,
25
+ processData: false,
26
+ method: 'POST',
27
+ success: function(data){
28
+ $.ajax({
29
+ type: "PUT",
30
+ url: url + "/properties/description/",
31
+ contentType: 'text/xml',
32
+ headers: { 'Content-ID': 'description' },
33
+ data: data.output_cpee
34
+ });
35
+ $(`#${status_id}`).text(data.status);
36
+ $(`#${status_id}`).addClass('success');
37
+ },
38
+ error: function(xhr, status, data) {
39
+ $(`#${status_id}`).text(xhr.responseJSON.error);
40
+ $(`#${status_id}`).addClass('error');
41
+ }
42
+ });
43
+
44
+ input.empty();
45
+ }
46
+
47
+ $(document).ready(function() {
48
+ $(document).on('keydown','#prompt',function(e){
49
+ clean_llm_ui('status');
50
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
51
+ call_llm_service('status',this.id);
52
+ }
53
+ });
54
+ $(document).on('click','#prompt_submit_button',function(e){
55
+ clean_llm_ui('status');
56
+ call_llm_service('status','prompt');
57
+ });
58
+ });
@@ -0,0 +1,107 @@
1
+ function clean_llm_ui(status_id) {
2
+ status_div = $(`#${status_id}`);
3
+ status_div.empty();
4
+ status_div.removeClass('error').removeClass('success');
5
+ return
6
+ }
7
+
8
+ function add_prompt(prompt_id,content) {
9
+ let input = $(`#${prompt_id}`);
10
+ const range = document.createRange();
11
+ const selection = window.getSelection();
12
+ range.selectNodeContents(input[0]);
13
+ selection.removeAllRanges();
14
+ selection.addRange(range);
15
+ document.execCommand('insertText', false, content);
16
+ return ;
17
+ }
18
+
19
+ function call_llm_service(status_id,prompt_id) {
20
+ let input = $(`#${prompt_id}`);
21
+ let text = input[0].innerText;
22
+
23
+ const formData = new FormData();
24
+ const blob1 = new Blob([save['dslx']], { type: "text/xml" });
25
+ formData.append("rpst_xml", blob1);
26
+ const blob2 = new Blob([text], { type: "text/plain" });
27
+ formData.append("user_input", blob2);
28
+ const blob3 = new Blob(['gemini-2.0-flash'], { type: "text/plain" });
29
+ formData.append("llm", blob3);
30
+
31
+ jQuery.ajax({
32
+ url: '/llm/',
33
+ data: formData,
34
+ cache: false,
35
+ contentType: false,
36
+ processData: false,
37
+ method: 'POST',
38
+ success: function(data){
39
+ $.ajax({
40
+ type: "PUT",
41
+ url: url + "/properties/description/",
42
+ contentType: 'text/xml',
43
+ headers: { 'Content-ID': 'description' },
44
+ data: data.output_cpee
45
+ });
46
+ $(`#${status_id}`).text(data.status);
47
+ $(`#${status_id}`).addClass('success');
48
+ },
49
+ error: function(xhr, status, data) {
50
+ $(`#${status_id}`).text(xhr.responseJSON.error);
51
+ $(`#${status_id}`).addClass('error');
52
+ }
53
+ });
54
+
55
+ input.empty();
56
+ }
57
+
58
+ function load_file_content(files) {
59
+ if (typeof window.FileReader !== 'function') {
60
+ alert('FileReader not yet supportet');
61
+ return;
62
+ }
63
+ var reader = new FileReader();
64
+ reader.onload = function(){
65
+ clean_llm_ui('status');
66
+ add_prompt('prompt',reader.result);
67
+ }
68
+ reader.onerror = function(){ console.log("reader error"); }
69
+ reader.onabort = function(){ console.log("reader abort"); }
70
+ reader.readAsText(files[0]);
71
+ }
72
+
73
+
74
+ $(document).ready(function() {
75
+ $(document).on('keydown','#prompt',function(e){
76
+ clean_llm_ui('status');
77
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
78
+ call_llm_service('status',this.id);
79
+ }
80
+ });
81
+ $(document).on('click','#prompt_submit_button',function(e) {
82
+ clean_llm_ui('status');
83
+ call_llm_service('status','prompt');
84
+ });
85
+ /*$('#prompt').on('input',function(e) {
86
+ console.log("beforeinput");
87
+ console.log(e);
88
+ if(e.originalEvent.inputType === "insertFromDrop") {
89
+ e.preventDefault();
90
+ e.stopPropagation();
91
+ load_file_content(e.originalEvent.dataTransfer.files);
92
+ }
93
+ });*/
94
+ /*$('#prompt').on('dragover',function(e) {
95
+ e.preventDefault();
96
+ e.stopPropagation();
97
+ });
98
+ $('#prompt').on('dragenter',function(e) {
99
+ e.preventDefault();
100
+ e.stopPropagation();
101
+ });*/
102
+ $('#prompt').on('drop',function(e) {
103
+ e.preventDefault();
104
+ e.stopPropagation();
105
+ load_file_content(e.originalEvent.dataTransfer.files);
106
+ });
107
+ });
@@ -233,7 +233,6 @@ function WfIllustrator(wf_adaptor) { // View {{{
233
233
  '</g>');
234
234
  for(element in self.elements)
235
235
  if(self.elements[element].svg) {
236
- console.log(self.elements[element].svg);
237
236
  var sym = $X('<g xmlns="http://www.w3.org/2000/svg"/>').append(self.elements[element].svg.clone().children()); // append all children to symbol
238
237
  $.each(self.elements[element].svg.attr('class').split(/\s+/), function(index, item) { sym.addClass(item); }); // copy all classes from the root node
239
238
  self.svg.defs[element] = sym;