cpee-model-management 1.1.3 β 1.2.0
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/cpee-model-management.gemspec +1 -1
- data/lib/cpee-model-management/implementation.rb +73 -42
- data/lib/cpee-model-management/implementation.xml +15 -15
- data/server/redis.rdb +0 -0
- data/tools/cpee-moma +8 -8
- data/ui/css/moma.css +114 -0
- data/ui/index.html +21 -35
- data/ui/instances.html +1 -1
- data/ui/instances_view.html +1 -1
- data/ui/js/moma.js +379 -0
- data/ui/js/stats.js +1 -0
- metadata +6 -5
- data/ui/css/design.css +0 -67
- data/ui/js/design.js +0 -245
data/ui/index.html
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
21
21
|
<head>
|
22
22
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
23
|
-
<title>Process Hub</title>
|
23
|
+
<title data-orig="Process Hub">Process Hub</title>
|
24
24
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
25
25
|
|
26
26
|
<!-- libs, do not modify. When local than load local libs. -->
|
@@ -53,9 +53,9 @@
|
|
53
53
|
<link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
|
54
54
|
|
55
55
|
<!-- custom stuff, play arround -->
|
56
|
-
<link rel="stylesheet" href="css/
|
56
|
+
<link rel="stylesheet" href="css/moma.css" type="text/css"/>
|
57
57
|
<link rel="stylesheet" href="css/stats.css" type="text/css"/>
|
58
|
-
<script type="text/javascript" src="js/
|
58
|
+
<script type="text/javascript" src="js/moma.js"></script>
|
59
59
|
<script type="text/javascript" src="js/stats.js"></script>
|
60
60
|
</head>
|
61
61
|
<body is="x-ui-">
|
@@ -73,10 +73,13 @@
|
|
73
73
|
</ui-tabbar>
|
74
74
|
<ui-content class="noselect">
|
75
75
|
<ui-area data-belongs-to-tab="models">
|
76
|
-
<
|
76
|
+
<div class="fixed">
|
77
|
+
<div class="text">Your Models are saved/versioned in <a target='_blank' href='https://git-scm.com/'>GIT</a>. So fret not. Just send an email to <a href="mail:helpdesk@cpee.org">helpdesk@cpee.org</a> if you are lost. Click on <strong>Icons</strong> of directory entries, to mark them. Then change to a different directory and move/copy them there. And as always: <a target='_blank' href='https://www.youtube.com/watch?v=kkxj5xVLyj0&feature=youtu.be&t=56'>get dressed for success</a>.</div>
|
78
|
+
<div class="breadcrumb"><span class="crumb" onclick="">β Home</span></div>
|
79
|
+
</div>
|
77
80
|
<table id="models" class='ui-table'>
|
78
81
|
<thead>
|
79
|
-
<th
|
82
|
+
<th data-class='special' class='invisible' title='click for operations'>π§</th>
|
80
83
|
<th>Name</th>
|
81
84
|
<th><abbr title='force new instance'>F</abbr></th>
|
82
85
|
<th><abbr title='link to model source'>M</abbr></th>
|
@@ -86,22 +89,9 @@
|
|
86
89
|
<th>Changed At</th>
|
87
90
|
<th><abbr title='Operations'>Op</abbr></th>
|
88
91
|
</thead>
|
89
|
-
<template id="up">
|
90
|
-
<tr>
|
91
|
-
<td data-class='folder' class="noselect">π</td>
|
92
|
-
<td data-class='name' data-full-name=''><a href=''></a></td>
|
93
|
-
<td></td>
|
94
|
-
<td></td>
|
95
|
-
<td></td>
|
96
|
-
<td></td>
|
97
|
-
<td></td>
|
98
|
-
<td data-class='date'></td>
|
99
|
-
<td data-class=''></td>
|
100
|
-
</tr>
|
101
|
-
</template>
|
102
92
|
<template id="folder">
|
103
93
|
<tr>
|
104
|
-
<td data-class='folder' class="noselect">π</td>
|
94
|
+
<td data-class='folder' class="noselect" title='click to mark'>π</td>
|
105
95
|
<td data-class='name' data-full-name=''><a href=''></a></td>
|
106
96
|
<td></td>
|
107
97
|
<td></td>
|
@@ -109,12 +99,12 @@
|
|
109
99
|
<td></td>
|
110
100
|
<td></td>
|
111
101
|
<td data-class='date'></td>
|
112
|
-
<td data-class='ops' class="noselect"><span
|
102
|
+
<td data-class='ops' class="noselect" title='click for operations'><span>π§</span></td>
|
113
103
|
</tr>
|
114
104
|
</template>
|
115
105
|
<template id="model">
|
116
106
|
<tr>
|
117
|
-
<td data-class='model' class="noselect"
|
107
|
+
<td data-class='model' class="noselect" title='click to mark'>π</td>
|
118
108
|
<td data-class='name' data-full-name=''><a target='_blank' href=''></a></td>
|
119
109
|
<td data-class='force'>[<a target='_blank' href='' title='force new instance'>F</a>]</td>
|
120
110
|
<td data-class='raw'>[<a target='_blank' href='' title='link to model source'>M</a>]</td>
|
@@ -122,7 +112,7 @@
|
|
122
112
|
<td data-class='guarded'><abbr title=''></abbr></td>
|
123
113
|
<td data-class='resource'></td>
|
124
114
|
<td data-class='date'></td>
|
125
|
-
<td data-class='ops' class="noselect"><span
|
115
|
+
<td data-class='ops' class="noselect" title='click for operations'><span>π§</span></td>
|
126
116
|
</tr>
|
127
117
|
</template>
|
128
118
|
<tbody>
|
@@ -130,18 +120,17 @@
|
|
130
120
|
</table>
|
131
121
|
</ui-area>
|
132
122
|
<ui-area data-belongs-to-tab="newmodel" class="inactive">
|
133
|
-
<
|
123
|
+
<div class="text">
|
134
124
|
Create an empty model. Beware, if a model of the same name already
|
135
125
|
exists in one of the categories (e.g. draft, development,
|
136
126
|
production, archive) it can not be created. To protect you from
|
137
127
|
getting confused and shooting yourself in the foot in your little
|
138
128
|
modelling world we allow only unique names. Better safe than sorry.
|
139
|
-
</
|
129
|
+
</div>
|
130
|
+
<div class="breadcrumb"><span class="crumb" onclick="">β Home</span></div>
|
140
131
|
<form id="newmod">
|
141
|
-
<input type="hidden" name="stage" value=""/>
|
142
|
-
<input type="hidden" name="dir" value=""/>
|
143
132
|
<p>
|
144
|
-
<input type="text" name="new" required pattern="^[a-zA-Z0-9âÀüΓΓΓ _
|
133
|
+
<input type="text" name="new" required pattern="^[a-zA-Z0-9âÀüΓΓΓ _\-]+" placeholder="Filename (no extension necessary). Only use characters, spaces, underlines and dashes."/>
|
145
134
|
</p>
|
146
135
|
<p>
|
147
136
|
<button>New Model</button>
|
@@ -149,17 +138,14 @@
|
|
149
138
|
</form>
|
150
139
|
</ui-area>
|
151
140
|
<ui-area data-belongs-to-tab="newdir" class="inactive">
|
152
|
-
<
|
141
|
+
<div class="text">
|
153
142
|
Create an empty directory. Beware, if a directory of the same name
|
154
|
-
already exists
|
155
|
-
|
156
|
-
|
157
|
-
modelling world we allow only unique names. Better safe than sorry.
|
158
|
-
</p>
|
143
|
+
already exists it can not be created.
|
144
|
+
</div>
|
145
|
+
<div class="breadcrumb"><span class="crumb" onclick="">β Home</span></div>
|
159
146
|
<form id="newdir">
|
160
|
-
<input type="hidden" name="stage" value=""/>
|
161
147
|
<p>
|
162
|
-
<input type="text" name="newdir" required pattern="^[a-zA-Z0-9âÀüΓΓΓ _
|
148
|
+
<input type="text" name="newdir" required pattern="^[a-zA-Z0-9âÀüΓΓΓ _\-]+" placeholder="Directory name. Only use characters, spaces, underlines and dashes."/>
|
163
149
|
</p>
|
164
150
|
<p>
|
165
151
|
<button>New Directory</button>
|
data/ui/instances.html
CHANGED
@@ -53,7 +53,7 @@
|
|
53
53
|
<link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
|
54
54
|
|
55
55
|
<!-- custom stuff, play arround -->
|
56
|
-
<link rel="stylesheet" href="css/
|
56
|
+
<link rel="stylesheet" href="css/moma.css" type="text/css"/>
|
57
57
|
<link rel="stylesheet" href="css/stats.css" type="text/css"/>
|
58
58
|
<link rel="stylesheet" href="css/stats_standalone.css" type="text/css"/>
|
59
59
|
<script type="text/javascript" src="js/stats.js"></script>
|
data/ui/instances_view.html
CHANGED
@@ -53,7 +53,7 @@
|
|
53
53
|
<link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
|
54
54
|
|
55
55
|
<!-- custom stuff, play arround -->
|
56
|
-
<link rel="stylesheet" href="css/
|
56
|
+
<link rel="stylesheet" href="css/moma.css" type="text/css"/>
|
57
57
|
<link rel="stylesheet" href="css/stats.css" type="text/css"/>
|
58
58
|
<link rel="stylesheet" href="css/stats_standalone.css" type="text/css"/>
|
59
59
|
<script type="text/javascript" src="js/stats.js"></script>
|
data/ui/js/moma.js
ADDED
@@ -0,0 +1,379 @@
|
|
1
|
+
let gstage;
|
2
|
+
var gdir;
|
3
|
+
var selections = [];
|
4
|
+
var updating = false;
|
5
|
+
var updating_counter = 0;
|
6
|
+
var fingerprint = "";
|
7
|
+
|
8
|
+
function copy_all() {
|
9
|
+
selections.forEach((name) => {
|
10
|
+
$.ajax({
|
11
|
+
type: "PUT",
|
12
|
+
url: "server/" + name,
|
13
|
+
data: { dupdir: gdir }
|
14
|
+
});
|
15
|
+
});
|
16
|
+
unmark_all();
|
17
|
+
}
|
18
|
+
function move_all() {
|
19
|
+
selections.forEach((name) => {
|
20
|
+
$.ajax({
|
21
|
+
type: "PUT",
|
22
|
+
url: "server/" + name,
|
23
|
+
data: { movedir: gdir }
|
24
|
+
});
|
25
|
+
});
|
26
|
+
unmark_all();
|
27
|
+
}
|
28
|
+
function delete_all() {
|
29
|
+
if (confirm('Are you really, really, REALLY sure!')) {
|
30
|
+
selections.forEach((name) => {
|
31
|
+
$.ajax({
|
32
|
+
type: "DELETE",
|
33
|
+
url: "server/" + name
|
34
|
+
});
|
35
|
+
});
|
36
|
+
unmark_all();
|
37
|
+
}
|
38
|
+
}
|
39
|
+
function unmark_all() {
|
40
|
+
selections = [];
|
41
|
+
$('[data-class=special]').attr('class','invisible');
|
42
|
+
$('td.selected').removeClass('selected');
|
43
|
+
}
|
44
|
+
function shift_all(to) {
|
45
|
+
selections.forEach((name) => {
|
46
|
+
$.ajax({
|
47
|
+
type: "PUT",
|
48
|
+
url: "server/" + name,
|
49
|
+
data: { stage: to }
|
50
|
+
});
|
51
|
+
});
|
52
|
+
unmark_all();
|
53
|
+
}
|
54
|
+
|
55
|
+
function move_it(name,todir) {
|
56
|
+
$.ajax({
|
57
|
+
type: "PUT",
|
58
|
+
url: "server/" + gdir + name,
|
59
|
+
data: { movedir: todir }
|
60
|
+
});
|
61
|
+
}
|
62
|
+
function shift_it(name,to) {
|
63
|
+
$.ajax({
|
64
|
+
type: "PUT",
|
65
|
+
url: "server/" + gdir + name,
|
66
|
+
data: { stage: to }
|
67
|
+
});
|
68
|
+
}
|
69
|
+
function rename_it(name) {
|
70
|
+
var newname;
|
71
|
+
if (newname = prompt('New name please!',name.replace(/\.xml$/,'').replace(/\.dir$/,''))) {
|
72
|
+
$.ajax({
|
73
|
+
type: "PUT",
|
74
|
+
url: "server/" + gdir + name,
|
75
|
+
data: { new: newname }
|
76
|
+
});
|
77
|
+
}
|
78
|
+
}
|
79
|
+
function duplicate_it(name) {
|
80
|
+
var newname;
|
81
|
+
if (newname = prompt('New name please!',name.replace(/\.xml$/,'').replace(/\.dir$/,''))) {
|
82
|
+
$.ajax({
|
83
|
+
type: "PUT",
|
84
|
+
url: "server/" + gdir + name,
|
85
|
+
data: { dupdir: gdir }
|
86
|
+
});
|
87
|
+
}
|
88
|
+
}
|
89
|
+
function delete_it(name) {
|
90
|
+
if (confirm('Are you really, really, REALLY sure!')) {
|
91
|
+
$.ajax({
|
92
|
+
type: "DELETE",
|
93
|
+
url: "server/" + gdir + name
|
94
|
+
});
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
function moma_init() {
|
99
|
+
var es = new EventSource('server/management/');
|
100
|
+
es.onopen = function() {
|
101
|
+
console.log('design open');
|
102
|
+
};
|
103
|
+
es.onmessage = function(e) {
|
104
|
+
paint(gdir,gstage);
|
105
|
+
};
|
106
|
+
es.onerror = function() {
|
107
|
+
console.log('design error');
|
108
|
+
setTimeout(function(){ if (es.readyState == 2) { moma_init() } }, 5000);
|
109
|
+
};
|
110
|
+
}
|
111
|
+
|
112
|
+
function possibly_paint() {
|
113
|
+
if (updating_counter > 0 && updating != true) {
|
114
|
+
updating_counter = 0;
|
115
|
+
paint(gdir,gstage);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
function paint(pdir,gstage,statesave=true) {
|
120
|
+
if (updating == true) { updating_counter += 1; return };
|
121
|
+
updating = true;
|
122
|
+
gdir = (pdir + '/').replaceAll(/\/+/g,'/').replace(/^\/*/,'');
|
123
|
+
|
124
|
+
$('div.breadcrumb .added').remove();
|
125
|
+
|
126
|
+
document.title = $('html head title').attr('data-orig') + (gdir == '' ? '' : ' - ' + gdir.replace(/\.dir|\.xml/g,''));
|
127
|
+
if (statesave) {
|
128
|
+
history.pushState({gstage: gstage, gdir: gdir}, '', window.location.pathname + '?stage=' + gstage + '&dir=' + gdir);
|
129
|
+
}
|
130
|
+
$('div.breadcrumb span.crumb').attr('onclick','paint("","' + gstage + '")');
|
131
|
+
|
132
|
+
let adddir = '';
|
133
|
+
let node;
|
134
|
+
gdir.split('/').filter((ele) => ele != '').forEach((ele,i) => {
|
135
|
+
adddir += ele + '/';
|
136
|
+
node = $('div.breadcrumb').append('<span class="separator added">/</span><span class="crumb added" onclick="paint(\'' + adddir + '\',\'' + gstage + '\')">' + ele.replace('.dir','') + '</span>');
|
137
|
+
});
|
138
|
+
|
139
|
+
$.ajax({
|
140
|
+
type: "GET",
|
141
|
+
url: "server/" + gdir,
|
142
|
+
data: { stage: gstage },
|
143
|
+
success: function(res,status,request) {
|
144
|
+
let fp = request.getResponseHeader('cpee-moma-fingerprint');
|
145
|
+
if (fp != fingerprint) {
|
146
|
+
$('#models tbody').empty();
|
147
|
+
fingerprint = fp;
|
148
|
+
let tempcont = $();
|
149
|
+
$(res).each(function(k,data) {
|
150
|
+
if (data.type == 'dir') {
|
151
|
+
let dp = gdir + data['name'] + '/';
|
152
|
+
var clone = document.importNode(document.querySelector('#folder').content,true);
|
153
|
+
$('[data-class=folder]',clone).attr('data-path',dp);
|
154
|
+
if (selections.includes(dp)) { $('[data-class=folder]',clone).toggleClass('selected'); }
|
155
|
+
$('[data-class=name] a',clone).text(data['name'].replace(/\.dir$/,''));
|
156
|
+
$('[data-class=name]',clone).attr('data-full-name',data['name']);
|
157
|
+
$('[data-class=name] a',clone).attr('href','javascript:paint("' + gdir + '/' + data['name'] + '","' + gstage + '")');
|
158
|
+
} else {
|
159
|
+
let dp = gdir + data['name'];
|
160
|
+
var clone = document.importNode(document.querySelector('#model').content,true);
|
161
|
+
$('[data-class=model]',clone).attr('data-path',dp);
|
162
|
+
if (selections.includes(dp)) { $('[data-class=model]',clone).toggleClass('selected'); }
|
163
|
+
$('[data-class=name] a',clone).text(data['name']);
|
164
|
+
$('[data-class=name]',clone).attr('data-full-name',data['name']);
|
165
|
+
$('[data-class=name] a',clone).attr('href','server/' + gdir + data['name'] + '/open?stage=' + gstage);
|
166
|
+
$('[data-class=force] a',clone).attr('href','server/' + gdir + data['name'] + '/open-new?stage=' + gstage);
|
167
|
+
$('[data-class=raw] a',clone).attr('href','server/' + gdir + data['name']);
|
168
|
+
|
169
|
+
$('[data-class=guarded] abbr',clone).attr('title',data['guarded'] || '');
|
170
|
+
$('[data-class=guarded] abbr',clone).text((data['guarded'] || '').match(/none/i) ? '' : (data['guarded'] || '').charAt(0).toUpperCase());
|
171
|
+
$('[data-class=resource]',clone).text(data['guarded_id'] || '');
|
172
|
+
|
173
|
+
if (data['guarded']) {
|
174
|
+
$('[data-class=guarded] abbr',clone).attr('title',data['guarded']);
|
175
|
+
$('[data-class=guarded] abbr',clone).text(data['guarded'].match(/none/i) ? '' : data['guarded'].charAt(0).toUpperCase());
|
176
|
+
$('[data-class=resource]',clone).text(data['guarded_what']);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
$('[data-class=author]',clone).text(data['author']);
|
180
|
+
$('[data-class=date]',clone).text(new Date(data['date']).strftime('%Y-%m-%d, %H:%M:%S'));
|
181
|
+
tempcont.push(clone);
|
182
|
+
});
|
183
|
+
$('#models tbody').append(tempcont);
|
184
|
+
}
|
185
|
+
updating = false;
|
186
|
+
}
|
187
|
+
});
|
188
|
+
}
|
189
|
+
|
190
|
+
function change_it(gdir,gstage) {
|
191
|
+
window.location.href = window.location.pathname + '?stage=' + gstage + '&dir=' + gdir;
|
192
|
+
}
|
193
|
+
|
194
|
+
$(document).ready(function() {
|
195
|
+
const queryString = window.location.search;
|
196
|
+
const urlParams = new URLSearchParams(queryString);
|
197
|
+
|
198
|
+
gstage = urlParams.get('stage') || 'draft';
|
199
|
+
gdir = urlParams.get('dir') ? (urlParams.get('dir') + '/').replaceAll(/\/+/g,'/') : '';
|
200
|
+
|
201
|
+
moma_init();
|
202
|
+
|
203
|
+
var shifts = []
|
204
|
+
$.ajax({
|
205
|
+
type: "GET",
|
206
|
+
url: "server/",
|
207
|
+
data: { stages: 'stages' },
|
208
|
+
success: (r) => {
|
209
|
+
shifts = shifts.concat(r);
|
210
|
+
shifts = shifts.filter(item => item !== gstage);
|
211
|
+
}
|
212
|
+
});
|
213
|
+
|
214
|
+
window.onpopstate = function(e){
|
215
|
+
let d = e.state || { gstage: 'draft', 'gdir': '' };
|
216
|
+
paint(d.gdir,d.gstage,false);
|
217
|
+
};
|
218
|
+
|
219
|
+
$('ui-behind span').text(gstage);
|
220
|
+
$('ui-behind span').click((e) => {
|
221
|
+
if (shifts.length > 0) {
|
222
|
+
var menu = {};
|
223
|
+
menu['Change to'] = [];
|
224
|
+
shifts.forEach(ele => {
|
225
|
+
menu['Change to'].push(
|
226
|
+
{
|
227
|
+
'label': ele,
|
228
|
+
'function_call': change_it,
|
229
|
+
'text_icon': 'β',
|
230
|
+
'type': undefined,
|
231
|
+
'class': 'capitalized',
|
232
|
+
'params': [gdir,ele]
|
233
|
+
}
|
234
|
+
);
|
235
|
+
});
|
236
|
+
new CustomMenu(e).contextmenu(menu);
|
237
|
+
}
|
238
|
+
});
|
239
|
+
|
240
|
+
$('#models').on('click','[data-class=model]',(e) => {
|
241
|
+
const tar = $(e.currentTarget);
|
242
|
+
tar.toggleClass('selected');
|
243
|
+
if (tar.hasClass('selected')) {
|
244
|
+
selections.push(tar.attr('data-path'));
|
245
|
+
} else {
|
246
|
+
selections = selections.filter(item => item !== tar.attr('data-path'));
|
247
|
+
}
|
248
|
+
if (selections.length > 0) {
|
249
|
+
$('[data-class=special]').attr('class','');
|
250
|
+
} else {
|
251
|
+
$('[data-class=special]').attr('class','invisible');
|
252
|
+
}
|
253
|
+
});
|
254
|
+
$('#models').on('click','th[data-class=special]',(e) => {
|
255
|
+
var menu = {};
|
256
|
+
var name = $(e.currentTarget).parents('tr').find('td[data-class=name]').attr('data-full-name');
|
257
|
+
menu['Operations'] = [
|
258
|
+
{
|
259
|
+
'label': 'Move all marked entries to the current directory',
|
260
|
+
'function_call': move_all,
|
261
|
+
'text_icon': 'β¨',
|
262
|
+
'type': undefined,
|
263
|
+
'params': []
|
264
|
+
},
|
265
|
+
{
|
266
|
+
'label': 'Copy all marked entries to the current directory',
|
267
|
+
'function_call': copy_all,
|
268
|
+
'text_icon': 'β¨',
|
269
|
+
'type': undefined,
|
270
|
+
'params': []
|
271
|
+
},
|
272
|
+
{
|
273
|
+
'label': 'Delete all marked entries',
|
274
|
+
'function_call': delete_all,
|
275
|
+
'text_icon': 'β',
|
276
|
+
'type': undefined,
|
277
|
+
'params': []
|
278
|
+
},
|
279
|
+
{
|
280
|
+
'label': 'Unmarked all marked entries',
|
281
|
+
'function_call': unmark_all,
|
282
|
+
'type': undefined,
|
283
|
+
'text_icon': 'π₯',
|
284
|
+
'params': []
|
285
|
+
}
|
286
|
+
];
|
287
|
+
if (shifts.length > 0) {
|
288
|
+
menu['Shifting'] = [];
|
289
|
+
shifts.forEach(ele => {
|
290
|
+
menu['Shifting'].push(
|
291
|
+
{
|
292
|
+
'label': 'Shift all marked entries to ' + ele,
|
293
|
+
'function_call': shift_all,
|
294
|
+
'text_icon': 'β',
|
295
|
+
'type': undefined,
|
296
|
+
'params': [ele]
|
297
|
+
}
|
298
|
+
);
|
299
|
+
});
|
300
|
+
}
|
301
|
+
new CustomMenu(e).contextmenu(menu);
|
302
|
+
});
|
303
|
+
|
304
|
+
$('#models').on('click','td[data-class=ops]',(e) => {
|
305
|
+
var menu = {};
|
306
|
+
var name = $(e.currentTarget).parents('tr').find('td[data-class=name]').attr('data-full-name');
|
307
|
+
var is_model = $(e.currentTarget).parents('tr').find('td[data-class=model]').length > 0 ? true : false;
|
308
|
+
menu['Operations'] = [
|
309
|
+
{
|
310
|
+
'label': 'Delete',
|
311
|
+
'function_call': delete_it,
|
312
|
+
'text_icon': 'β',
|
313
|
+
'type': undefined,
|
314
|
+
'params': [name]
|
315
|
+
},
|
316
|
+
{
|
317
|
+
'label': 'Rename',
|
318
|
+
'function_call': rename_it,
|
319
|
+
'type': undefined,
|
320
|
+
'text_icon': 'π',
|
321
|
+
'params': [name]
|
322
|
+
}
|
323
|
+
];
|
324
|
+
if (name.match(/\.xml$/)) {
|
325
|
+
menu['Operations'].unshift(
|
326
|
+
{
|
327
|
+
'label': 'Duplicate',
|
328
|
+
'function_call': duplicate_it,
|
329
|
+
'text_icon': 'β',
|
330
|
+
'type': undefined,
|
331
|
+
'params': [name]
|
332
|
+
}
|
333
|
+
);
|
334
|
+
}
|
335
|
+
if (shifts.length > 0 && is_model) {
|
336
|
+
menu['Shifting'] = [];
|
337
|
+
shifts.forEach(ele => {
|
338
|
+
menu['Shifting'].push(
|
339
|
+
{
|
340
|
+
'label': 'Shift to ' + ele,
|
341
|
+
'function_call': shift_it,
|
342
|
+
'text_icon': 'β',
|
343
|
+
'type': undefined,
|
344
|
+
'params': [name,ele]
|
345
|
+
}
|
346
|
+
);
|
347
|
+
});
|
348
|
+
}
|
349
|
+
new CustomMenu(e).contextmenu(menu);
|
350
|
+
});
|
351
|
+
|
352
|
+
paint(gdir,gstage);
|
353
|
+
|
354
|
+
$('#newmod').on('submit',(e) => {
|
355
|
+
$.ajax({
|
356
|
+
type: "POST",
|
357
|
+
url: "server/" + gdir,
|
358
|
+
data: { stage: gstage, new: $("#newmod input[name=new]").val() },
|
359
|
+
success: (r) => {
|
360
|
+
uidash_activate_tab($('ui-tab').first());
|
361
|
+
}
|
362
|
+
});
|
363
|
+
return false;
|
364
|
+
});
|
365
|
+
|
366
|
+
$('#newdir').on('submit',(e) => {
|
367
|
+
$.ajax({
|
368
|
+
type: "POST",
|
369
|
+
url: "server/" + gdir,
|
370
|
+
data: { dir: $("#newdir input[name=newdir]").val() },
|
371
|
+
success: (r) => {
|
372
|
+
uidash_activate_tab($('ui-tab').first());
|
373
|
+
}
|
374
|
+
});
|
375
|
+
return false;
|
376
|
+
});
|
377
|
+
|
378
|
+
setInterval(possibly_paint,1000);
|
379
|
+
});
|
data/ui/js/stats.js
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-model-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: tools
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riddl
|
@@ -79,16 +79,17 @@ files:
|
|
79
79
|
- server/model.xml
|
80
80
|
- server/moma
|
81
81
|
- server/moma.conf
|
82
|
+
- server/redis.rdb
|
82
83
|
- server/testset.xml
|
83
84
|
- tools/cpee-moma
|
84
|
-
- ui/css/
|
85
|
+
- ui/css/moma.css
|
85
86
|
- ui/css/stats.css
|
86
87
|
- ui/css/stats_standalone.css
|
87
88
|
- ui/favicon.ico
|
88
89
|
- ui/index.html
|
89
90
|
- ui/instances.html
|
90
91
|
- ui/instances_view.html
|
91
|
-
- ui/js/
|
92
|
+
- ui/js/moma.js
|
92
93
|
- ui/js/stats.js
|
93
94
|
- ui/resources.html
|
94
95
|
homepage: http://cpee.org/
|
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
111
|
- !ruby/object:Gem::Version
|
111
112
|
version: '0'
|
112
113
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.4.10
|
114
115
|
signing_key:
|
115
116
|
specification_version: 4
|
116
117
|
summary: "(Lifecycle) manage your process models in a directory or git repo."
|
data/ui/css/design.css
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
td {
|
2
|
-
padding-right: 1em;
|
3
|
-
}
|
4
|
-
|
5
|
-
td[data-class=model] {
|
6
|
-
font-size: 1.7em;
|
7
|
-
}
|
8
|
-
td[data-class=folder] {
|
9
|
-
font-size: 1.7em;
|
10
|
-
}
|
11
|
-
td[data-class=ops] {
|
12
|
-
cursor: pointer;
|
13
|
-
}
|
14
|
-
|
15
|
-
td[draggable] {
|
16
|
-
cursor: move;
|
17
|
-
}
|
18
|
-
|
19
|
-
form input {
|
20
|
-
width: 45em !important;
|
21
|
-
}
|
22
|
-
|
23
|
-
ui-behind {
|
24
|
-
text-transform: capitalize;
|
25
|
-
font-weight: bold;
|
26
|
-
color: #d0d0d0;
|
27
|
-
}
|
28
|
-
|
29
|
-
ui-area > *:first-child {
|
30
|
-
padding-top: 0;
|
31
|
-
margin-top: 0;
|
32
|
-
}
|
33
|
-
|
34
|
-
ui-behind span {
|
35
|
-
cursor: pointer;
|
36
|
-
}
|
37
|
-
|
38
|
-
[is="x-ui-"] table.ui-table {
|
39
|
-
border-collapse: collapse;
|
40
|
-
}
|
41
|
-
[is="x-ui-"] table.ui-table thead th {
|
42
|
-
font-weight: bold;
|
43
|
-
text-align: left;
|
44
|
-
padding: 0.3em 0.5em;
|
45
|
-
}
|
46
|
-
[is="x-ui-"] table.ui-table tbody td {
|
47
|
-
padding: 0.1em 0.5em;
|
48
|
-
}
|
49
|
-
[is="x-ui-"] table.ui-table tbody tr:nth-child(odd) td {
|
50
|
-
background-color: var(--x-ui-content-light-background);
|
51
|
-
}
|
52
|
-
[is="x-ui-"] table.ui-table tbody tr:hover td {
|
53
|
-
background-color: var(--x-ui-content-hover-background);
|
54
|
-
}
|
55
|
-
|
56
|
-
[is="x-ui-"] table.ui-table tbody tr:nth-child(odd) td[data-class=ops] {
|
57
|
-
background-color: #d0d0d0;
|
58
|
-
}
|
59
|
-
[is="x-ui-"] table.ui-table tbody tr:hover td[data-class=ops] {
|
60
|
-
background-color: #99cee6b0;
|
61
|
-
}
|
62
|
-
|
63
|
-
[is="x-ui-"] ui-rest > ui-content > ui-area { padding: 1em; }
|
64
|
-
|
65
|
-
tr.contextmenuitem .capitalized {
|
66
|
-
text-transform: capitalize;
|
67
|
-
}
|