cpee 2.1.131 → 2.1.133
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/compliance-view.html +313 -0
- data/cockpit/compliance.html +1 -1
- data/cockpit/config.json.example +7 -6
- data/cockpit/css/llm.css +9 -1
- data/cockpit/css/llmmodel.css +3 -0
- data/cockpit/css/ui.css +9 -31
- data/cockpit/edit.html +1 -1
- data/cockpit/graph.html +1 -1
- data/cockpit/index.html +6 -1
- data/cockpit/js/compliance.js +148 -36
- data/cockpit/js/instance.js +15 -5
- data/cockpit/js/parameters.js +41 -9
- data/cockpit/js/ui.js +10 -40
- data/cockpit/llm.html +4 -4
- data/cockpit/llmmodel.html +15 -8
- data/cockpit/model.html +1 -1
- data/cockpit/only_llm.html +5 -5
- data/cockpit/rngs/attributes.rng +2 -2
- data/cockpit/rngs/dataelements.rng +2 -2
- data/cockpit/rngs/documents.rng +8 -0
- data/cockpit/rngs/endpoints.rng +2 -2
- data/cockpit/rngs/requirements.rng +2 -2
- data/cockpit/track.html +1 -1
- data/cpee.gemspec +2 -2
- data/lib/cpee/implementation.rb +3 -1
- data/lib/cpee/implementation_properties.rb +6 -5
- data/lib/cpee/persistence.rb +6 -7
- data/lib/properties/documents.rng +10 -0
- data/lib/properties/properties.rng +2 -0
- data/lib/properties/set-properties.rng +2 -0
- data/lib/properties/set-some-properties.rng +4 -0
- data/lib/properties/set-testset.rng +3 -0
- data/lib/properties/t_documents.rng +7 -0
- data/lib/properties.xml +22 -0
- data/server/executionhandlers/eval/connection.rb +1 -0
- data/server/executionhandlers/eval/execution.rb +2 -0
- data/server/executionhandlers/ruby/connection.rb +2 -1
- data/server/executionhandlers/ruby/controller.rb +4 -8
- data/server/executionhandlers/ruby/execution.rb +2 -0
- data/server/resources/properties.empty +1 -0
- data/server/resources/properties.init +1 -0
- data/server/routing/end.pid +1 -1
- data/server/routing/forward-events-00.pid +1 -1
- data/server/routing/forward-votes.pid +1 -1
- data/server/routing/persist.pid +1 -1
- data/server/routing/persist.rb +2 -1
- data/tools/cpee +1 -1
- metadata +8 -4
- data/lib/cpee/attributes_helper.rb +0 -41
data/cockpit/js/compliance.js
CHANGED
|
@@ -31,12 +31,18 @@ $(document).ready(function() { //{{{
|
|
|
31
31
|
success: function(yaml) {
|
|
32
32
|
$('#comp-verify-current-log').attr('href', url).text(url.split('/').pop()).show();
|
|
33
33
|
displayComplianceMessages(yaml, renderOptions);
|
|
34
|
+
if (typeof renderOptions.onLoaded === 'function') {
|
|
35
|
+
renderOptions.onLoaded({ yaml: yaml, url: url });
|
|
36
|
+
}
|
|
34
37
|
},
|
|
35
38
|
error: function() {
|
|
36
39
|
if (fallback) {
|
|
37
40
|
tryLoad(fallback, null);
|
|
38
41
|
} else {
|
|
39
42
|
$('#comp_log').html('Could not load compliance log.');
|
|
43
|
+
if (typeof renderOptions.onError === 'function') {
|
|
44
|
+
renderOptions.onError('Could not load compliance log.');
|
|
45
|
+
}
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
});
|
|
@@ -45,6 +51,84 @@ $(document).ready(function() { //{{{
|
|
|
45
51
|
tryLoad(currentUrl, baseUrl + uuid + '.current.xes.yaml');
|
|
46
52
|
}
|
|
47
53
|
|
|
54
|
+
function extractLatestLogTimestamp(yamlText) {
|
|
55
|
+
if (typeof yamlText !== 'string' || !yamlText.trim()) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Match ISO timestamps such as 2026-07-28T10:11:12Z or with timezone offsets.
|
|
60
|
+
var matches = yamlText.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})/g);
|
|
61
|
+
if (!matches || matches.length === 0) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var latest = null;
|
|
66
|
+
for (var i = 0; i < matches.length; i++) {
|
|
67
|
+
var ts = Date.parse(matches[i]);
|
|
68
|
+
if (!isNaN(ts) && (latest == null || ts > latest)) {
|
|
69
|
+
latest = ts;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return latest;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isLogOlderThanSeconds(yamlText, seconds) {
|
|
77
|
+
var latestTimestamp = extractLatestLogTimestamp(yamlText);
|
|
78
|
+
if (latestTimestamp == null) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var ageMs = Date.now() - latestTimestamp;
|
|
83
|
+
return ageMs > (seconds * 1000);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function triggerComplianceSubscriber(uuid, onSuccess, onError) {
|
|
87
|
+
getCurrentTestsetXml(
|
|
88
|
+
function(testsetXml) {
|
|
89
|
+
var notification;
|
|
90
|
+
try {
|
|
91
|
+
notification = buildSubscriptionLikeNotification(testsetXml, uuid);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
onError(error.message || 'Failed to build compliance notification payload.');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var formData = new FormData();
|
|
98
|
+
formData.append('notification', JSON.stringify(notification));
|
|
99
|
+
formData.append('type', 'event');
|
|
100
|
+
formData.append('topic', 'description');
|
|
101
|
+
formData.append('event', 'change');
|
|
102
|
+
|
|
103
|
+
$.ajax({
|
|
104
|
+
method: 'POST',
|
|
105
|
+
type: 'POST',
|
|
106
|
+
url: 'https://power.bpm.cit.tum.de/compliance/Subscriber',
|
|
107
|
+
data: formData,
|
|
108
|
+
processData: false,
|
|
109
|
+
contentType: false,
|
|
110
|
+
dataType: 'text',
|
|
111
|
+
success: function(_response, _textStatus, xhr) {
|
|
112
|
+
if (xhr && xhr.status === 200) {
|
|
113
|
+
onSuccess();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var body = xhr && xhr.responseText ? xhr.responseText : 'Compliance verify returned an unexpected response.';
|
|
118
|
+
onError(body);
|
|
119
|
+
},
|
|
120
|
+
error: function(xhr) {
|
|
121
|
+
var body = xhr && xhr.responseText ? xhr.responseText : 'Compliance verify failed.';
|
|
122
|
+
onError(body);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
function(message) {
|
|
127
|
+
onError(message);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
48
132
|
function getCurrentTestsetXml(onSuccess, onError) {
|
|
49
133
|
if (typeof get_testset !== 'function') {
|
|
50
134
|
onError('Could not collect the current testset XML.');
|
|
@@ -154,7 +238,30 @@ $(document).ready(function() { //{{{
|
|
|
154
238
|
return;
|
|
155
239
|
}
|
|
156
240
|
|
|
157
|
-
|
|
241
|
+
$('#comp_log').html('Loading compliance log...');
|
|
242
|
+
|
|
243
|
+
loadComplianceLog(uuid, {
|
|
244
|
+
onLoaded: function(result) {
|
|
245
|
+
if (!result || !result.yaml) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (!isLogOlderThanSeconds(result.yaml, 60)) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
$('#comp_log').html('Last log is older than 60 seconds. Requesting fresh verification...');
|
|
254
|
+
triggerComplianceSubscriber(
|
|
255
|
+
uuid,
|
|
256
|
+
function() {
|
|
257
|
+
loadComplianceLog(uuid);
|
|
258
|
+
},
|
|
259
|
+
function(message) {
|
|
260
|
+
$('#comp_log').html('<pre>' + escapeHtml(message || 'Failed to request fresh verification.') + '</pre>');
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
158
265
|
});
|
|
159
266
|
|
|
160
267
|
$("#semantic_verify").click(function(){
|
|
@@ -383,40 +490,6 @@ function initialize_nl_requirements_tab() { //{{{
|
|
|
383
490
|
do_nl_requirements_save();
|
|
384
491
|
});
|
|
385
492
|
|
|
386
|
-
$(document).on('click', '.nlreq-extract', function() {
|
|
387
|
-
var row = $(this).closest('.nlreq-row');
|
|
388
|
-
var requirementId = row.attr('data-requirement-id');
|
|
389
|
-
var naturalText = row.find('.nlreq-text').val().trim();
|
|
390
|
-
var status = row.find('.nlreq-status');
|
|
391
|
-
var button = $(this);
|
|
392
|
-
|
|
393
|
-
if (!naturalText) {
|
|
394
|
-
status.text('Enter text').removeClass('ok').addClass('error');
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
if (!save['requirements']) {
|
|
398
|
-
status.text('Not ready').removeClass('ok').addClass('error');
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
status.text('Extracting...').removeClass('ok error');
|
|
403
|
-
button.prop('disabled', true);
|
|
404
|
-
|
|
405
|
-
extract_ast_from_natural_language(
|
|
406
|
-
naturalText,
|
|
407
|
-
function(ast) {
|
|
408
|
-
upsert_requirement_ast(requirementId, ast);
|
|
409
|
-
do_nl_requirements_save();
|
|
410
|
-
status.text('Added').removeClass('error').addClass('ok');
|
|
411
|
-
button.prop('disabled', false);
|
|
412
|
-
},
|
|
413
|
-
function(message) {
|
|
414
|
-
status.text(message || 'Failed').removeClass('ok').addClass('error');
|
|
415
|
-
button.prop('disabled', false);
|
|
416
|
-
}
|
|
417
|
-
);
|
|
418
|
-
});
|
|
419
|
-
|
|
420
493
|
if ($('#dat_nlrequirements .nlreq-row').length === 0) {
|
|
421
494
|
add_nl_requirement_row();
|
|
422
495
|
}
|
|
@@ -444,9 +517,45 @@ function add_nl_requirement_row(requirementId, textValue) { //{{{
|
|
|
444
517
|
.val(textValue || '')
|
|
445
518
|
);
|
|
446
519
|
row.append('<span class="nlreq-status"></span>');
|
|
520
|
+
row.find('.nlreq-extract').on('click', function() {
|
|
521
|
+
extract_single_nl_requirement(row);
|
|
522
|
+
});
|
|
447
523
|
$('#dat_nlrequirements').append(row);
|
|
448
524
|
} //}}}
|
|
449
525
|
|
|
526
|
+
function extract_single_nl_requirement(row) { //{{{
|
|
527
|
+
var requirementId = row.attr('data-requirement-id');
|
|
528
|
+
var naturalText = row.find('.nlreq-text').val().trim();
|
|
529
|
+
var status = row.find('.nlreq-status');
|
|
530
|
+
var button = row.find('.nlreq-extract');
|
|
531
|
+
|
|
532
|
+
if (!naturalText) {
|
|
533
|
+
status.text('Enter text').removeClass('ok').addClass('error');
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (!save['requirements']) {
|
|
537
|
+
status.text('Not ready').removeClass('ok').addClass('error');
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
status.text('Extracting...').removeClass('ok error');
|
|
542
|
+
button.prop('disabled', true);
|
|
543
|
+
|
|
544
|
+
extract_ast_from_natural_language(
|
|
545
|
+
naturalText,
|
|
546
|
+
function(ast) {
|
|
547
|
+
upsert_requirement_ast(requirementId, ast);
|
|
548
|
+
do_nl_requirements_save();
|
|
549
|
+
status.text('Added').removeClass('error').addClass('ok');
|
|
550
|
+
button.prop('disabled', false);
|
|
551
|
+
},
|
|
552
|
+
function(message) {
|
|
553
|
+
status.text(message || 'Failed').removeClass('ok').addClass('error');
|
|
554
|
+
button.prop('disabled', false);
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
} //}}}
|
|
558
|
+
|
|
450
559
|
function sync_nl_rows_to_requirement_keys(requirementsObject, pruneMissing) { //{{{
|
|
451
560
|
if (!requirementsObject || typeof requirementsObject !== 'object') {
|
|
452
561
|
return;
|
|
@@ -822,7 +931,10 @@ function renderResolutionStrategies(result) { //{{{
|
|
|
822
931
|
html += '<div class="indent">Repair Action: ' + escapeHtml(changeDescription) + '</div>';
|
|
823
932
|
html += '<div class="indent">Risk: ' + escapeHtml(riskValue) + '</div>';
|
|
824
933
|
|
|
825
|
-
|
|
934
|
+
if (
|
|
935
|
+
(status === 'success' || status === 'warning') &&
|
|
936
|
+
pstXml
|
|
937
|
+
) {
|
|
826
938
|
html += '<div class="indent">PST: ' + buildPstDownloadLink(pstXml, requirementId, i) + '</div>';
|
|
827
939
|
} else {
|
|
828
940
|
html += '<div class="indent error">Error</div>';
|
data/cockpit/js/instance.js
CHANGED
|
@@ -16,6 +16,7 @@ var model_loaded = new Event("model:loaded", {"bubbles":true, "cancelable":false
|
|
|
16
16
|
var save = {};
|
|
17
17
|
save['endpoints'] = undefined;
|
|
18
18
|
save['dataelements'] = undefined;
|
|
19
|
+
save['documents'] = undefined;
|
|
19
20
|
save['attributes'] = undefined;
|
|
20
21
|
save['attributes_raw'] = {};
|
|
21
22
|
var node_state = {};
|
|
@@ -60,6 +61,8 @@ var sub_more = 'topic' + '=' + 'activity' + '&' +// {{{
|
|
|
60
61
|
'events' + '=' + 'change' + '&' +
|
|
61
62
|
'topic' + '=' + 'dataelements' + '&' +
|
|
62
63
|
'events' + '=' + 'change' + '&' +
|
|
64
|
+
'topic' + '=' + 'documents' + '&' +
|
|
65
|
+
'events' + '=' + 'change' + '&' +
|
|
63
66
|
'topic' + '=' + 'endpoints' + '&' +
|
|
64
67
|
'events' + '=' + 'change' + '&' +
|
|
65
68
|
'topic' + '=' + 'attributes' + '&' +
|
|
@@ -82,6 +85,8 @@ var sub_less = 'topic' + '=' + 'activity' + '&' +// {{{
|
|
|
82
85
|
'events' + '=' + 'change' + '&' +
|
|
83
86
|
'topic' + '=' + 'dataelements' + '&' +
|
|
84
87
|
'events' + '=' + 'change' + '&' +
|
|
88
|
+
'topic' + '=' + 'documents' + '&' +
|
|
89
|
+
'events' + '=' + 'change' + '&' +
|
|
85
90
|
'topic' + '=' + 'endpoints' + '&' +
|
|
86
91
|
'events' + '=' + 'change' + '&' +
|
|
87
92
|
'topic' + '=' + 'attributes' + '&' +
|
|
@@ -162,7 +167,7 @@ function cockpit() { //{{{
|
|
|
162
167
|
e.stopImmediatePropagation();
|
|
163
168
|
});
|
|
164
169
|
document.addEventListener('uidash:activate_tab', function (e) {
|
|
165
|
-
if (
|
|
170
|
+
if (e.detail.active == 'details') {
|
|
166
171
|
if (save['graph_adaptor']) {
|
|
167
172
|
var svgid = manifestation.selected();
|
|
168
173
|
var marks = manifestation.marked();
|
|
@@ -357,6 +362,9 @@ async function sse() { //{{{
|
|
|
357
362
|
case 'dataelements':
|
|
358
363
|
monitor_instance_values("dataelements",data.content.values);
|
|
359
364
|
break;
|
|
365
|
+
case 'documents':
|
|
366
|
+
monitor_instance_values("documents",data.content.values);
|
|
367
|
+
break;
|
|
360
368
|
case 'description':
|
|
361
369
|
monitor_instance_dsl();
|
|
362
370
|
monitor_graph_change(false);
|
|
@@ -407,6 +415,7 @@ async function sse() { //{{{
|
|
|
407
415
|
await monitor_instance_values("endpoints"); // we cant render before we know specialized endpoint symbols
|
|
408
416
|
await monitor_instance_values("attributes"); // attributes first, to catch the <resources> attribute which overrides current-resources
|
|
409
417
|
monitor_instance_values("dataelements");
|
|
418
|
+
monitor_instance_values("documents");
|
|
410
419
|
monitor_instance_dsl();
|
|
411
420
|
monitor_graph_change(false);
|
|
412
421
|
monitor_instance_state();
|
|
@@ -423,7 +432,7 @@ function monitor_instance(cin,rep,load,exec) {// {{{
|
|
|
423
432
|
$("input[name=instance-url]").val($("body").attr('current-instance'));
|
|
424
433
|
$("input[name=res-url]").val($("body").attr('current-resources'));
|
|
425
434
|
|
|
426
|
-
$('#parameters ui-content ui-area > button').attr('disabled','disabled');
|
|
435
|
+
$('#parameters ui-content ui-area > button, ui-tabbed.parameters ui-content ui-area > button').attr('disabled','disabled');
|
|
427
436
|
$('#dat_details').empty();
|
|
428
437
|
|
|
429
438
|
$('#modifiers > div').remove();
|
|
@@ -625,7 +634,7 @@ function adaptor_init(url,theme,dslx) { //{{{
|
|
|
625
634
|
// while inside and svgs are reloaded, do nothing here
|
|
626
635
|
suspended_redrawing = true;
|
|
627
636
|
save['graph_theme'] = theme;
|
|
628
|
-
save['graph_adaptor'] = new WfAdaptor($('body').data('
|
|
637
|
+
save['graph_adaptor'] = new WfAdaptor($('body').data('base-themes') + '/' + theme + '/theme.js',function(graphrealization){
|
|
629
638
|
graphrealization.illustrator.get_symbol = (target) => { //{{{
|
|
630
639
|
if (save['endpoints_cache'][target]) {
|
|
631
640
|
return save['endpoints_cache'][target].symbol;
|
|
@@ -908,10 +917,10 @@ function monitor_instance_state_change(notification) { //{{{
|
|
|
908
917
|
}
|
|
909
918
|
|
|
910
919
|
if (notification != "ready" && notification != "stopped" && notification != "running") {
|
|
911
|
-
$('#parameters ui-content ui-area > button').attr('disabled','disabled');
|
|
920
|
+
$('#parameters ui-content ui-area > button, ui-tabbed.parameters ui-content ui-area > button').attr('disabled','disabled');
|
|
912
921
|
$('#state_any').hide();
|
|
913
922
|
} else {
|
|
914
|
-
$('#parameters ui-content ui-area > button').removeAttr('disabled');
|
|
923
|
+
$('#parameters ui-content ui-area > button, ui-tabbed.parameters ui-content ui-area > button').removeAttr('disabled');
|
|
915
924
|
$('#state_any').show();
|
|
916
925
|
}
|
|
917
926
|
|
|
@@ -1142,6 +1151,7 @@ async function set_testset(testset,exec) {// {{{
|
|
|
1142
1151
|
tset.append($("testset > executionhandler",testset));
|
|
1143
1152
|
tset.append($("testset > positions",testset));
|
|
1144
1153
|
tset.append($("testset > dataelements",testset));
|
|
1154
|
+
tset.append($("testset > documents",testset));
|
|
1145
1155
|
tset.append($("testset > endpoints",testset));
|
|
1146
1156
|
tset.append($("testset > attributes",testset));
|
|
1147
1157
|
tset.append($("testset > description",testset));
|
data/cockpit/js/parameters.js
CHANGED
|
@@ -2,6 +2,7 @@ var parameters_changed = new Event("parameters:changed", {"bubbles":true, "cance
|
|
|
2
2
|
var attributes_changed = new Event("attributes:changed", {"bubbles":true, "cancelable":false});
|
|
3
3
|
var endpoints_changed = new Event("endpoints:changed", {"bubbles":true, "cancelable":false});
|
|
4
4
|
var dataelements_changed = new Event("dataelements:changed", {"bubbles":true, "cancelable":false});
|
|
5
|
+
var documents_changed = new Event("documents:changed", {"bubbles":true, "cancelable":false});
|
|
5
6
|
|
|
6
7
|
$(document).ready(function() {
|
|
7
8
|
// hook up dataelements with relaxngui //{{{
|
|
@@ -31,33 +32,42 @@ $(document).ready(function() {
|
|
|
31
32
|
save['attributes'] = new RelaxNGui(rng,$('#dat_attributes'));
|
|
32
33
|
}
|
|
33
34
|
}); //}}}
|
|
35
|
+
// hook up documents with relaxngui //{{{
|
|
36
|
+
$.ajax({
|
|
37
|
+
type: "GET",
|
|
38
|
+
dataType: "xml",
|
|
39
|
+
url: "rngs/documents.rng",
|
|
40
|
+
success: function(rng){
|
|
41
|
+
save['documents'] = new RelaxNGui(rng,$('#dat_documents'));
|
|
42
|
+
}
|
|
43
|
+
}); //}}}
|
|
34
44
|
|
|
35
45
|
// new entry //{{{
|
|
36
|
-
$('#parameters ui-content ui-area > button').click(function(event){
|
|
37
|
-
var but = $(document).find('#parameters ui-content ui-area:not(.inactive) > div button');
|
|
46
|
+
$('#parameters ui-content ui-area > button, ui-tabbed.parameters ui-content ui-area > button').click(function(event){
|
|
47
|
+
var but = $(document).find('#parameters ui-content ui-area:not(.inactive) > div button.relaxngui_control, ui-tabbed.parameters ui-content ui-area:not(.inactive) > div button.relaxngui_control');
|
|
38
48
|
but.click();
|
|
39
|
-
var inp = $(document).find('#parameters ui-content ui-area:not(.inactive) > div input');
|
|
49
|
+
var inp = $(document).find('#parameters ui-content ui-area:not(.inactive) > div input, ui-tabbed.parameters ui-content ui-area:not(.inactive) > div input');
|
|
40
50
|
$(inp[inp.length-2]).focus();
|
|
41
|
-
var are = $(document).find('#parameters ui-content ui-area:not(.inactive) > div');
|
|
42
|
-
var tab = $(document).find('#parameters ui-content ui-area:not(.inactive) > div > div');
|
|
51
|
+
var are = $(document).find('#parameters ui-content ui-area:not(.inactive) > div, ui-tabbed.parameters ui-content ui-area:not(.inactive) > div');
|
|
52
|
+
var tab = $(document).find('#parameters ui-content ui-area:not(.inactive) > div > div, ui-tabbed.parameters ui-content ui-area:not(.inactive) > div > div');
|
|
43
53
|
are.animate({ scrollTop: tab.height() }, "slow");
|
|
44
54
|
}); //}}}
|
|
45
55
|
|
|
46
56
|
var timer;
|
|
47
57
|
// when input in one of the inputs, save
|
|
48
|
-
$(document).on('input','#dat_dataelements input, #dat_endpoints input, #dat_attributes input',function(event){
|
|
58
|
+
$(document).on('input','#dat_dataelements input, #dat_endpoints input, #dat_attributes input, #dat_documents input',function(event){
|
|
49
59
|
clearTimeout(timer);
|
|
50
60
|
timer = setTimeout(function(){ do_parameters_save(event); }, 5000);
|
|
51
61
|
});
|
|
52
|
-
$(document).on('relaxngui_remove', '#dat_dataelements, #dat_endpoints, #dat_attributes', function(event){
|
|
62
|
+
$(document).on('relaxngui_remove', '#dat_dataelements, #dat_endpoints, #dat_attributes, #dat_documents', function(event){
|
|
53
63
|
clearTimeout(timer);
|
|
54
64
|
do_parameters_save(event);
|
|
55
65
|
});
|
|
56
|
-
$(document).on('relaxngui_move', '#dat_dataelements, #dat_endpoints, #dat_attributes', function(event){
|
|
66
|
+
$(document).on('relaxngui_move', '#dat_dataelements, #dat_endpoints, #dat_attributes, #dat_documents', function(event){
|
|
57
67
|
clearTimeout(timer);
|
|
58
68
|
do_parameters_save(event);
|
|
59
69
|
});
|
|
60
|
-
$(document).on('relaxngui_change', '#dat_dataelements, #dat_endpoints, #dat_attributes', function(event){
|
|
70
|
+
$(document).on('relaxngui_change', '#dat_dataelements, #dat_endpoints, #dat_attributes, #dat_documents', function(event){
|
|
61
71
|
clearTimeout(timer);
|
|
62
72
|
do_parameters_save(event);
|
|
63
73
|
});
|
|
@@ -86,3 +96,25 @@ function do_parameters_save_part(visid,send) { //{{{
|
|
|
86
96
|
data: send
|
|
87
97
|
});
|
|
88
98
|
} //}}}
|
|
99
|
+
|
|
100
|
+
function do_parameters_save_document(id,file,content) { //{{{
|
|
101
|
+
let name = $('input#' + id).parent().find('input.relaxngui_cell').first().get_val();
|
|
102
|
+
if (!name) {
|
|
103
|
+
return '';
|
|
104
|
+
} else {
|
|
105
|
+
// todo store in dstore
|
|
106
|
+
let surl = $.path_join($('body').attr('current-document-store'),save.attributes_raw.uuid,name);
|
|
107
|
+
|
|
108
|
+
$.ajax({
|
|
109
|
+
type: "PUT",
|
|
110
|
+
url: surl,
|
|
111
|
+
contentType: (file.type == "" ? "application/octet-stream" : file.type),
|
|
112
|
+
headers: {
|
|
113
|
+
'Content-ID': 'file'
|
|
114
|
+
},
|
|
115
|
+
data: content.result
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return surl;
|
|
119
|
+
}
|
|
120
|
+
} //}}}
|
data/cockpit/js/ui.js
CHANGED
|
@@ -2,13 +2,11 @@ function config_defaults(){
|
|
|
2
2
|
var default_values = {};
|
|
3
3
|
// logs is missing, so that the button is not shown, when there is no info
|
|
4
4
|
if (location.protocol.match(/^file/)) {
|
|
5
|
-
default_values['res-url'] = 'http://localhost:' + $('body').data('res-port');
|
|
6
5
|
default_values['base-url'] = 'http://localhost:' + $('body').data('base-port');
|
|
7
|
-
|
|
6
|
+
} else if (location.port == '') {
|
|
7
|
+
default_values['base-url'] = $.path_join(location.protocol + "//", location.hostname, location.pathname, $('body').data('base-engine'));
|
|
8
8
|
} else {
|
|
9
|
-
default_values['res-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('res-port');
|
|
10
9
|
default_values['base-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('base-port');
|
|
11
|
-
default_values['save-url'] = location.protocol + "//" + location.hostname + ":" + $('body').data('base-port') + '/design';
|
|
12
10
|
}
|
|
13
11
|
default_values['templates-url'] = 'templates/';
|
|
14
12
|
return default_values;
|
|
@@ -35,45 +33,17 @@ $(document).ready(function() {
|
|
|
35
33
|
url: "config.json",
|
|
36
34
|
success: function(res){
|
|
37
35
|
var res_def = config_defaults();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
|
46
|
-
} else {
|
|
47
|
-
$("body").attr('current-resources',res_def['res-url'].replace("%host",window.location.host));
|
|
48
|
-
}
|
|
49
|
-
if (res['base-url']) {
|
|
50
|
-
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
|
51
|
-
} else {
|
|
52
|
-
$("body").attr('current-base',res_def['base-url'].replace("%host",window.location.host));
|
|
53
|
-
}
|
|
54
|
-
if (res['save-url']) {
|
|
55
|
-
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
|
56
|
-
} else {
|
|
57
|
-
$("body").attr('current-save',res_def['save-url'].replace("%host",window.location.host));
|
|
58
|
-
}
|
|
59
|
-
if (res['templates-url']) {
|
|
60
|
-
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
|
61
|
-
} else {
|
|
62
|
-
$("body").attr('current-templates',res_def['templates-url'].replace("%host",window.location.host));
|
|
63
|
-
}
|
|
64
|
-
$("input[name=res-url]").val($("body").attr('current-resources').replace("%host",window.location.host));
|
|
65
|
-
$("input[name=base-url]").val($("body").attr('current-base').replace("%host",window.location.host));
|
|
36
|
+
$("body").attr('current-base',(res['base-url'] || res_def['base-url']).replace("%host",window.location.host));
|
|
37
|
+
$("body").attr('current-templates',(res['templates-url'] || res_def['templates-url']).replace("%host",window.location.host));
|
|
38
|
+
$.each(res, function(key, value){ // just leave it out when it is not configured
|
|
39
|
+
if (key != 'base-url' && key != 'templates-url') {
|
|
40
|
+
$("body").attr('current-' + key.replace(/-url$/,''), value.replace("%host",window.location.host));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
66
43
|
cockpit();
|
|
67
44
|
},
|
|
68
45
|
error: function(){
|
|
69
|
-
|
|
70
|
-
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
|
71
|
-
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
|
72
|
-
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
|
73
|
-
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
|
74
|
-
$("input[name=res-url]").val($("body").attr('current-resources'));
|
|
75
|
-
$("input[name=base-url]").val($("body").attr('current-base'));
|
|
76
|
-
cockpit();
|
|
46
|
+
alert('fix your config.json');
|
|
77
47
|
}
|
|
78
48
|
});
|
|
79
49
|
}
|
data/cockpit/llm.html
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
71
71
|
<style></style>
|
|
72
72
|
</head>
|
|
73
|
-
<body data-base-port="8298" data-
|
|
73
|
+
<body data-base-port="8298" data-base-engine="engine/" data-base-themes="themes" is="x-ui-">
|
|
74
74
|
<div id='disclaimer' class='hidden'> <!--{{{-->
|
|
75
75
|
<h1>Disclaimer</h1>
|
|
76
76
|
|
|
@@ -289,9 +289,9 @@
|
|
|
289
289
|
<option value="noendpoints" selected="selected">Generate/Adapt from Scratch</option>
|
|
290
290
|
<option value="endpoints">Generate/Adapt with Endpoint Knowledge</option>
|
|
291
291
|
</select>
|
|
292
|
-
<button id='prompt_submit_button' title="CTRL-ENTER to Submit" class="llm_button small"
|
|
293
|
-
<button id='prompt_reset_button' title="Reset Context" class="llm_button small"
|
|
294
|
-
<button id='prompt_prop_button' title="Properties" class="llm_button small"
|
|
292
|
+
<button id='prompt_submit_button' title="CTRL-ENTER to Submit" class="llm_button small"><i class="uidash-icon uidash-icon-send"></i></button>
|
|
293
|
+
<button id='prompt_reset_button' title="Reset Context" class="llm_button small"><i class="uidash-icon uidash-icon-reset"></i></button>
|
|
294
|
+
<button id='prompt_prop_button' title="Properties" class="llm_button small"><i class="uidash-icon uidash-icon-properties"></i></button>
|
|
295
295
|
<select name="llms" id="llms" class='active hidden'>
|
|
296
296
|
<option value="gemini-3.1-flash-lite" selected="selected">gemini 3.1 Flash Lite</option>
|
|
297
297
|
<option value="gemini-3.1-flash">gemini 3.1 Flash</option>
|
data/cockpit/llmmodel.html
CHANGED
|
@@ -62,16 +62,18 @@
|
|
|
62
62
|
<script type="text/javascript" src="js/modifiers.js"></script>
|
|
63
63
|
<script type="text/javascript" src="themes/base.js"></script>
|
|
64
64
|
|
|
65
|
-
<script type="text/javascript" src="js/llm.js"></script>
|
|
66
|
-
<link rel="stylesheet" href="css/llm.css" type="text/css"/>
|
|
67
|
-
|
|
68
65
|
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
69
66
|
<link rel="stylesheet" href="css/extended_columns-label.css" type="text/css"/>
|
|
70
67
|
<link rel="stylesheet" href="css/extended_columns-svg.css" type="text/css" data-include-export="true"/>
|
|
71
68
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
69
|
+
|
|
70
|
+
<script type="text/javascript" src="js/llm.js"></script>
|
|
71
|
+
<link rel="stylesheet" href="css/llm.css" type="text/css"/>
|
|
72
|
+
<link rel="stylesheet" href="css/llmmodel.css" type="text/css"/>
|
|
73
|
+
|
|
72
74
|
<style></style>
|
|
73
75
|
</head>
|
|
74
|
-
<body data-base-port="8298" data-
|
|
76
|
+
<body data-base-port="8298" data-base-engine="engine/" data-base-themes="themes" is="x-ui-">
|
|
75
77
|
<div class='hidden' id='relaxngworker'></div>
|
|
76
78
|
|
|
77
79
|
<div class='menu' id='templates'></div>
|
|
@@ -105,10 +107,11 @@
|
|
|
105
107
|
</table>
|
|
106
108
|
</div> <!--}}}-->
|
|
107
109
|
|
|
108
|
-
<ui-tabbed id="instance">
|
|
110
|
+
<ui-tabbed id="instance" class="parameters">
|
|
109
111
|
<ui-tabbar>
|
|
110
112
|
<ui-tab class="switch" ></ui-tab>
|
|
111
113
|
<ui-tab class="inactive hidden" data-tab="instance" id="tabinstance" >Model</ui-tab>
|
|
114
|
+
<ui-tab class="inactive hidden" data-tab="documents" id="tabdocuments">Documents</ui-tab>
|
|
112
115
|
<ui-behind ><a style='display:none' target='_blank' id='current-instance'></a><a style='display:none' target='_blank' id='current-instance-properties'>P</a><a style='display:none' target='_blank' id='current-instance-subscriptions'>S</a><a style='display:none' target='_blank' id='current-instance-callbacks'>C</a></ui-behind>
|
|
113
116
|
<ui-last ><a class="logo" href=".."></a></ui-last>
|
|
114
117
|
</ui-tabbar>
|
|
@@ -149,6 +152,10 @@
|
|
|
149
152
|
</div>
|
|
150
153
|
</div>
|
|
151
154
|
</ui-area> <!--}}}-->
|
|
155
|
+
<ui-area data-belongs-to-tab="documents" id="areadocuments" class="inactive"> <!--{{{-->
|
|
156
|
+
<button title='add entry'><span>New</span></button>
|
|
157
|
+
<div id="dat_documents"></div>
|
|
158
|
+
</ui-area> <!--}}}-->
|
|
152
159
|
</ui-content>
|
|
153
160
|
</ui-tabbed>
|
|
154
161
|
|
|
@@ -189,9 +196,9 @@
|
|
|
189
196
|
<option value="noendpoints">Generate/Adapt from Scratch</option>
|
|
190
197
|
<option value="endpoints">Generate/Adapt with Endpoint Knowledge</option>
|
|
191
198
|
</select>
|
|
192
|
-
<button id='prompt_submit_button' title="CTRL-ENTER to Submit" class="llm_button small"
|
|
193
|
-
<button id='prompt_reset_button' title="Reset Context" class="llm_button small"
|
|
194
|
-
<button id='prompt_prop_button' title="Properties" class="llm_button small"
|
|
199
|
+
<button id='prompt_submit_button' title="CTRL-ENTER to Submit" class="llm_button small"><i class="uidash-icon uidash-icon-send"></i></button>
|
|
200
|
+
<button id='prompt_reset_button' title="Reset Context" class="llm_button small"><i class="uidash-icon uidash-icon-reset"></i></button>
|
|
201
|
+
<button id='prompt_prop_button' title="Properties" class="llm_button small"><i class="uidash-icon uidash-icon-properties"></i></button>
|
|
195
202
|
<select name="llms" id="llms" class='active hidden'>
|
|
196
203
|
<option value="gemini-3.1-flash-lite" selected="selected">gemini 3.1 Flash Lite</option>
|
|
197
204
|
<option value="gemini-3.1-flash">gemini 3.1 Flash</option>
|
data/cockpit/model.html
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
70
70
|
<style></style>
|
|
71
71
|
</head>
|
|
72
|
-
<body data-base-port="8298" data-
|
|
72
|
+
<body data-base-port="8298" data-base-engine="engine/" data-base-themes="themes" is="x-ui-">
|
|
73
73
|
<div id='disclaimer' class='hidden'> <!--{{{-->
|
|
74
74
|
<h1>Disclaimer</h1>
|
|
75
75
|
|
data/cockpit/only_llm.html
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
71
71
|
<style></style>
|
|
72
72
|
</head>
|
|
73
|
-
<body data-base-port="8298" data-
|
|
73
|
+
<body data-base-port="8298" data-base-engine="engine/" data-base-themes="themes" is="x-ui-">
|
|
74
74
|
<div id='disclaimer' class='hidden'> <!--{{{-->
|
|
75
75
|
<h1>Disclaimer</h1>
|
|
76
76
|
|
|
@@ -243,10 +243,10 @@
|
|
|
243
243
|
</div>
|
|
244
244
|
<div><input id="loadtxt" accept=".txt" type="file"/></div>
|
|
245
245
|
<div id='prompt_submit_container' class="multi">
|
|
246
|
-
<button id='prompt_undo_button' class='llm_button' title='undo (reset to state before your last submit)'
|
|
247
|
-
<button id='prompt_reset_button' title="Reset Context" class="llm_button"
|
|
248
|
-
<button id='prompt_attach_button' class='llm_button' title='load text from (txt) file'
|
|
249
|
-
<button id='prompt_submit_button' class=
|
|
246
|
+
<button id='prompt_undo_button' class='llm_button' title='undo (reset to state before your last submit)'><i class="uidash-icon uidash-icon-back"></i></button>
|
|
247
|
+
<button id='prompt_reset_button' title="Reset Context" class="llm_button"><i class="uidash-icon uidash-icon-reset"></i></button>
|
|
248
|
+
<button id='prompt_attach_button' class='llm_button' title='load text from (txt) file'><i class="uidash-icon uidash-icon-attach"></i></button>
|
|
249
|
+
<button id='prompt_submit_button' title="CTRL-ENTER to Submit" class="llm_button"><i class="uidash-icon uidash-icon-send"></i></button>
|
|
250
250
|
</div>
|
|
251
251
|
</ui-area>
|
|
252
252
|
<ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
|
data/cockpit/rngs/attributes.rng
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<element rngui:version="1.2" name="attributes" ns="http://cpee.org/ns/properties/2.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
|
|
2
2
|
<zeroOrMore rngui:label="Create Attributes">
|
|
3
|
-
<element rngui:label='
|
|
4
|
-
<anyName/>
|
|
3
|
+
<element rngui:label='Name'>
|
|
4
|
+
<anyName rngui:unique="true"/>
|
|
5
5
|
<data type="string" rngui:label="value"/>
|
|
6
6
|
</element>
|
|
7
7
|
</zeroOrMore>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<element rngui:version="1.2" name="dataelements" ns="http://cpee.org/ns/properties/2.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
|
|
2
2
|
<zeroOrMore rngui:label="Create Data Element">
|
|
3
|
-
<element rngui:label='
|
|
4
|
-
<anyName/>
|
|
3
|
+
<element rngui:label='Name'>
|
|
4
|
+
<anyName rngui:unique="true"/>
|
|
5
5
|
<data type="string" rngui:label="value"/>
|
|
6
6
|
</element>
|
|
7
7
|
</zeroOrMore>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<element rngui:version="1.2" name="documents" ns="http://cpee.org/ns/properties/2.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
|
|
2
|
+
<zeroOrMore rngui:label="Create Document">
|
|
3
|
+
<element rngui:label='Name'>
|
|
4
|
+
<anyName rngui:unique="true"/>
|
|
5
|
+
<data type="string" rngui:label="Value" rngui:filehandler="do_parameters_save_document(id,file,content)"/>
|
|
6
|
+
</element>
|
|
7
|
+
</zeroOrMore>
|
|
8
|
+
</element>
|
data/cockpit/rngs/endpoints.rng
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<element rngui:version="1.2" name="endpoints" ns="http://cpee.org/ns/properties/2.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
|
|
2
2
|
<zeroOrMore rngui:label="Create Endpoint">
|
|
3
|
-
<element rngui:label='
|
|
4
|
-
<anyName/>
|
|
3
|
+
<element rngui:label='Name'>
|
|
4
|
+
<anyName rngui:unique="true"/>
|
|
5
5
|
<data type="string" rngui:label="value"/>
|
|
6
6
|
</element>
|
|
7
7
|
</zeroOrMore>
|