cpee 2.1.85 → 2.1.87
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/llm.css +79 -0
- data/cockpit/css/ui.css +11 -2
- data/cockpit/edit.html +6 -4
- data/cockpit/graph.html +5 -3
- data/cockpit/index.html +6 -4
- data/cockpit/js/instance.js +7 -0
- data/cockpit/js/llm.js +185 -0
- data/cockpit/js/llm_alternative.js +90 -0
- data/cockpit/js/ui.js +15 -15
- data/cockpit/js/wfadaptor.js +0 -1
- data/cockpit/llm.html +292 -0
- data/cockpit/llm_alternative.html +294 -0
- data/cockpit/model.html +4 -2
- data/cockpit/only_llm.html +250 -0
- data/cockpit/templates/Subprocess.xml +2 -16
- data/cockpit/templates/Worklist.xml +2 -1
- data/cockpit/themes/base.js +6 -1
- data/cockpit/track.html +5 -3
- data/cpee.gemspec +1 -1
- data/lib/cpee/implementation.rb +1 -2
- data/lib/cpee/implementation_callbacks.rb +69 -60
- data/lib/cpee/implementation_notifications.rb +36 -25
- data/lib/cpee/implementation_properties.rb +84 -30
- data/lib/cpee/statemachine.rb +7 -2
- data/lib/properties.xml +7 -0
- data/server/executionhandlers/ruby/ShiftingTestSimple.xml +100 -0
- data/server/executionhandlers/ruby/connection.rb +2 -1
- data/server/executionhandlers/ruby/dsl_to_dslx.xsl +9 -3
- metadata +9 -7
- data/server/resources/transformation.xml +0 -53
- data/server/routing/end.pid +0 -1
- data/server/routing/forward-events-00.pid +0 -1
- data/server/routing/forward-votes.pid +0 -1
- data/server/routing/persist.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2daaf617d59eef8d41794e44b8b4488db897422baaee84ad06d9fd936923c896
|
4
|
+
data.tar.gz: 075d29fb38465e916b869a0d4602f143e0e31590535d1ec38eac6ffae7eb8b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1d375b2bf0f363d97fa77c2e09dbd3f6d66130d328c77f9b02037b8b0951c93faa36f703a764cb85360af9220095af2836cb618baf0e4d23cd26b40d554eb8
|
7
|
+
data.tar.gz: '019b357616c43dd596200536e46226d0ee4960ada5d34e8a3d185398f9b835e451643182861b0b4cb55c54b828e1a7b69370afb6beb9f577b57631f18505979b'
|
data/cockpit/css/llm.css
ADDED
@@ -0,0 +1,79 @@
|
|
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
|
+
outline: none;
|
51
|
+
min-height: 2.66em;
|
52
|
+
}
|
53
|
+
|
54
|
+
#llmlabel {
|
55
|
+
width: 20%;
|
56
|
+
}
|
57
|
+
|
58
|
+
.single {
|
59
|
+
width: 2.3em;
|
60
|
+
height: 2.3em;
|
61
|
+
}
|
62
|
+
|
63
|
+
.multi {
|
64
|
+
border-top: 0.1em solid var(--x-ui-border-color);
|
65
|
+
display: flex;
|
66
|
+
justify-content: space-evenly;
|
67
|
+
flex-direction: row;
|
68
|
+
padding: 15px;
|
69
|
+
gap: 5px;
|
70
|
+
}
|
71
|
+
|
72
|
+
.llm_button {
|
73
|
+
width: 100%;
|
74
|
+
height: 100%;
|
75
|
+
}
|
76
|
+
|
77
|
+
.llm_button:hover {
|
78
|
+
background-color: var(--wfadaptor-selected);
|
79
|
+
}
|
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
|
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=
|
263
|
-
<div
|
264
|
-
|
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=
|
80
|
-
<div
|
81
|
-
|
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
|
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=
|
264
|
-
<div
|
265
|
-
|
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>
|
data/cockpit/js/instance.js
CHANGED
@@ -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,185 @@
|
|
1
|
+
var last_generated_model = undefined;
|
2
|
+
var last_model_before_generation =undefined;
|
3
|
+
|
4
|
+
function clean_llm_ui(status_id) {
|
5
|
+
status_div = $(`#${status_id}`);
|
6
|
+
status_div.empty();
|
7
|
+
status_div.removeClass('error').removeClass('success');
|
8
|
+
return
|
9
|
+
}
|
10
|
+
|
11
|
+
function add_prompt(prompt_id,content) {
|
12
|
+
let input = $(`#${prompt_id}`);
|
13
|
+
const range = document.createRange();
|
14
|
+
const selection = window.getSelection();
|
15
|
+
range.selectNodeContents(input[0]);
|
16
|
+
selection.removeAllRanges();
|
17
|
+
selection.addRange(range);
|
18
|
+
document.execCommand('insertText', false, content);
|
19
|
+
return ;
|
20
|
+
}
|
21
|
+
|
22
|
+
function call_llm_service(status_id,prompt_id,llm_id) {
|
23
|
+
let input = $(`#${prompt_id}`);
|
24
|
+
let text = input[0].innerText;
|
25
|
+
let myllm = $(`#${llm_id}`).find(":selected").val();
|
26
|
+
if (myllm === undefined){
|
27
|
+
myllm = "gemini-2.0-flash";
|
28
|
+
}
|
29
|
+
const formData = new FormData();
|
30
|
+
const blob1 = new Blob([save['dslx']], { type: "text/xml" });
|
31
|
+
formData.append("rpst_xml", blob1);
|
32
|
+
const blob2 = new Blob([text], { type: "text/plain" });
|
33
|
+
formData.append("user_input", blob2);
|
34
|
+
const blob3 = new Blob([myllm], { type: "text/plain" });
|
35
|
+
formData.append("llm", blob3);
|
36
|
+
|
37
|
+
jQuery.ajax({
|
38
|
+
url: '/llm/',
|
39
|
+
data: formData,
|
40
|
+
cache: false,
|
41
|
+
contentType: false,
|
42
|
+
processData: false,
|
43
|
+
method: 'POST',
|
44
|
+
success: function(data){
|
45
|
+
last_model_before_generation = save['dslx'];
|
46
|
+
last_generated_model = data.output_cpee;
|
47
|
+
set_cpee_model(data.output_cpee,["<!-- Input CPEE-Tree -->\n"+data.input_cpee,"# User Input:\n"+data.user_input,"# Used LLM:\n"+data.used_llm,"%% Input Intermediate\n"+data.input_intermediate,"%% Output Intermediate\n"+data.output_intermediate,"<!-- Output CPEE-Tree -->\n"+data.output_cpee]);
|
48
|
+
set_success(status_id,data.status);
|
49
|
+
},
|
50
|
+
error: function(xhr, status, data) {
|
51
|
+
set_error(status_id,xhr.responseJSON.error);
|
52
|
+
}
|
53
|
+
});
|
54
|
+
|
55
|
+
input.empty();
|
56
|
+
}
|
57
|
+
|
58
|
+
function call_llm_text_service(status_id,prompt_id,llm_id,action) {
|
59
|
+
let myllm = $(`#${llm_id}`).find(":selected").val();
|
60
|
+
if (myllm === undefined){
|
61
|
+
myllm = "gemini-2.0-flash";
|
62
|
+
}
|
63
|
+
const info = save.attributes_raw.info;
|
64
|
+
const formData = new FormData();
|
65
|
+
const first = new Blob([save['dslx']], { type: "text/xml" });
|
66
|
+
formData.append("rpst_xml", first);
|
67
|
+
const second = myllm;
|
68
|
+
formData.append("llm", second);
|
69
|
+
|
70
|
+
jQuery.ajax({
|
71
|
+
url: '/llm/text/llm/',
|
72
|
+
data: formData,
|
73
|
+
cache: false,
|
74
|
+
contentType: false,
|
75
|
+
processData: false,
|
76
|
+
method: 'POST',
|
77
|
+
success: function(data){
|
78
|
+
if (action=="show"){
|
79
|
+
add_prompt(prompt_id,data["output_text"]);
|
80
|
+
} else if (action=="file") {
|
81
|
+
$('#savetext').attr('download', info + '.txt');
|
82
|
+
const encodedText = encodeURIComponent(data["output_text"]);
|
83
|
+
const dataUri = "data:text/plain;charset=utf-8," + encodedText;
|
84
|
+
const link = document.getElementById("savetext");
|
85
|
+
link.href = dataUri;
|
86
|
+
link.click();
|
87
|
+
};
|
88
|
+
last_model_before_generation = save['dslx'];
|
89
|
+
set_success(status_id,data.status);
|
90
|
+
},
|
91
|
+
error: function(xhr, status, data) {
|
92
|
+
set_error(status_id,xhr.responseJSON.error);
|
93
|
+
}
|
94
|
+
});
|
95
|
+
}
|
96
|
+
|
97
|
+
function set_cpee_model(cpee_xml,expositions=[]) {
|
98
|
+
|
99
|
+
const form_data = new FormData();
|
100
|
+
const blob = new Blob([cpee_xml], { type: "text/xml" });
|
101
|
+
form_data.append("dslx", blob);
|
102
|
+
|
103
|
+
for (const x of expositions) {
|
104
|
+
const blobi = new Blob([x], { type: "text/plain" });
|
105
|
+
form_data.append("exposition", blobi);
|
106
|
+
}
|
107
|
+
|
108
|
+
$.ajax({
|
109
|
+
type: "PUT",
|
110
|
+
url: url + "/properties/dslx/",
|
111
|
+
contentType: false,
|
112
|
+
processData: false,
|
113
|
+
data: form_data
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
function set_success(status_id,success_text) {
|
118
|
+
$(`#${status_id}`).text(success_text);
|
119
|
+
$(`#${status_id}`).addClass('success');
|
120
|
+
}
|
121
|
+
|
122
|
+
function set_error(status_id,error_text) {
|
123
|
+
$(`#${status_id}`).text(error_text);
|
124
|
+
$(`#${status_id}`).addClass('error');
|
125
|
+
}
|
126
|
+
|
127
|
+
function load_last_generated_model() {
|
128
|
+
set_cpee_model(last_generated_model === undefined ? save['dslx'] : last_generated_model);
|
129
|
+
}
|
130
|
+
|
131
|
+
function load_last_model_before_generation() {
|
132
|
+
set_cpee_model(last_model_before_generation === undefined ? save['dslx'] : last_model_before_generation);
|
133
|
+
}
|
134
|
+
|
135
|
+
function load_file_content(files) {
|
136
|
+
if (typeof window.FileReader !== 'function') {
|
137
|
+
console.log('FileReader not yet supported');
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
var reader = new FileReader();
|
141
|
+
reader.onload = function(){
|
142
|
+
clean_llm_ui('status');
|
143
|
+
add_prompt('prompt',reader.result);
|
144
|
+
}
|
145
|
+
reader.onerror = function(){ console.log("reader error"); }
|
146
|
+
reader.onabort = function(){ console.log("reader abort"); }
|
147
|
+
reader.readAsText(files[0]);
|
148
|
+
}
|
149
|
+
|
150
|
+
$(document).ready(function() {
|
151
|
+
$(document).on('keydown','#prompt',function(e){
|
152
|
+
clean_llm_ui('status');
|
153
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
154
|
+
call_llm_service('status',this.id,'llms');
|
155
|
+
}
|
156
|
+
});
|
157
|
+
$(document).on('click','#prompt_submit_button',function(e){
|
158
|
+
clean_llm_ui('status');
|
159
|
+
call_llm_service('status','prompt','llms');
|
160
|
+
});
|
161
|
+
$(document).on('click','#generate_itext_button',function(e){
|
162
|
+
clean_llm_ui('status');
|
163
|
+
call_llm_text_service('status','prompt','llms','file');
|
164
|
+
});
|
165
|
+
$(document).on('click','#generate_text_button',function(e){
|
166
|
+
clean_llm_ui('status');
|
167
|
+
call_llm_text_service('status','prompt','llms','show');
|
168
|
+
});
|
169
|
+
$(document).on('click','#prompt_undo_button',function(e){
|
170
|
+
clean_llm_ui('status');
|
171
|
+
load_last_model_before_generation();
|
172
|
+
});
|
173
|
+
$(document).on('click','#prompt_attach_button',function(e){
|
174
|
+
document.getElementById('loadtxt').click();
|
175
|
+
});
|
176
|
+
$("#loadtxt").change(function(e){
|
177
|
+
let files = document.getElementById('loadtxt').files;
|
178
|
+
load_file_content(files);
|
179
|
+
});
|
180
|
+
$(document).on('drop','#prompt',function(e){
|
181
|
+
e.preventDefault();
|
182
|
+
e.stopPropagation();
|
183
|
+
load_file_content(e.originalEvent.dataTransfer.files);
|
184
|
+
});
|
185
|
+
});
|
@@ -0,0 +1,90 @@
|
|
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
|
+
console.log('FileReader not yet supported');
|
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('drop',function(e) {
|
86
|
+
e.preventDefault();
|
87
|
+
e.stopPropagation();
|
88
|
+
load_file_content(e.originalEvent.dataTransfer.files);
|
89
|
+
});
|
90
|
+
});
|
data/cockpit/js/ui.js
CHANGED
@@ -36,38 +36,38 @@ $(document).ready(function() {
|
|
36
36
|
success: function(res){
|
37
37
|
var res_def = config_defaults();
|
38
38
|
if (res['log-url']) { // just leave it out when it is not configured
|
39
|
-
$("body").attr('current-logs',res['log-url']);
|
39
|
+
$("body").attr('current-logs',res['log-url'].replace("%host",window.location.host));
|
40
40
|
}
|
41
41
|
if (res['res-url']) {
|
42
|
-
$("body").attr('current-resources',res['res-url']);
|
42
|
+
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
43
43
|
} else {
|
44
|
-
$("body").attr('current-resources',res_def['res-url']);
|
44
|
+
$("body").attr('current-resources',res_def['res-url'].replace("%host",window.location.host));
|
45
45
|
}
|
46
46
|
if (res['base-url']) {
|
47
|
-
$("body").attr('current-base',res['base-url']);
|
47
|
+
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
48
48
|
} else {
|
49
|
-
$("body").attr('current-base',res_def['base-url']);
|
49
|
+
$("body").attr('current-base',res_def['base-url'].replace("%host",window.location.host));
|
50
50
|
}
|
51
51
|
if (res['save-url']) {
|
52
|
-
$("body").attr('current-save',res['save-url']);
|
52
|
+
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
53
53
|
} else {
|
54
|
-
$("body").attr('current-save',res_def['save-url']);
|
54
|
+
$("body").attr('current-save',res_def['save-url'].replace("%host",window.location.host));
|
55
55
|
}
|
56
56
|
if (res['templates-url']) {
|
57
|
-
$("body").attr('current-templates',res['templates-url']);
|
57
|
+
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
58
58
|
} else {
|
59
|
-
$("body").attr('current-templates',res_def['templates-url']);
|
59
|
+
$("body").attr('current-templates',res_def['templates-url'].replace("%host",window.location.host));
|
60
60
|
}
|
61
|
-
$("input[name=res-url]").val($("body").attr('current-resources'));
|
62
|
-
$("input[name=base-url]").val($("body").attr('current-base'));
|
61
|
+
$("input[name=res-url]").val($("body").attr('current-resources').replace("%host",window.location.host));
|
62
|
+
$("input[name=base-url]").val($("body").attr('current-base').replace("%host",window.location.host));
|
63
63
|
cockpit();
|
64
64
|
},
|
65
65
|
error: function(){
|
66
66
|
var res = config_defaults();
|
67
|
-
$("body").attr('current-resources',res['res-url']);
|
68
|
-
$("body").attr('current-base',res['base-url']);
|
69
|
-
$("body").attr('current-save',res['save-url']);
|
70
|
-
$("body").attr('current-templates',res['templates-url']);
|
67
|
+
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
68
|
+
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
69
|
+
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
70
|
+
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
71
71
|
$("input[name=res-url]").val($("body").attr('current-resources'));
|
72
72
|
$("input[name=base-url]").val($("body").attr('current-base'));
|
73
73
|
cockpit();
|
data/cockpit/js/wfadaptor.js
CHANGED
@@ -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;
|