cpee-model-management 1.0.17 → 1.0.18
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 +1 -1
- metadata +1 -2
- data/ui/design.js +0 -239
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0f20ba70c3f8b275794d93cc37318ea2c9a2f6cac142b97955b7df37bf19c78
|
4
|
+
data.tar.gz: 727d1d7684b81ce572a09fb6afa63365e74c7f9d40d231fb8495d7797f3f2057
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d765472f0d8e08bbc6a43e2e6fb779065ee86606cd5030ff82a9e69134f29a01afcad618c81d089a66d06b893f6f64133555ef578ed2a9e9c1504faedd8f65f
|
7
|
+
data.tar.gz: 522152b30e278e976ae047cd4a355f40f73e19d8abf7ddb809e1385bd39007e9f6b1904b3f98d8334dd031f1d1fb30af4952581978128219f521741c401669f4
|
@@ -358,7 +358,7 @@ module CPEE
|
|
358
358
|
Dir.mkdir(fname)
|
359
359
|
FileUtils.touch(File.join(fname,'.gitignore'))
|
360
360
|
|
361
|
-
attrs =
|
361
|
+
attrs = {}
|
362
362
|
attrs['creator'] = creator
|
363
363
|
attrs['author'] = creator
|
364
364
|
File.write(fname + '.attrs',JSON::pretty_generate(attrs))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-model-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -81,7 +81,6 @@ files:
|
|
81
81
|
- server/testset.xml
|
82
82
|
- tools/cpee-moma
|
83
83
|
- ui/css/design.css
|
84
|
-
- ui/design.js
|
85
84
|
- ui/index.html
|
86
85
|
- ui/js/design.js
|
87
86
|
homepage: http://cpee.org/
|
data/ui/design.js
DELETED
@@ -1,239 +0,0 @@
|
|
1
|
-
var gstage;
|
2
|
-
var gdir;
|
3
|
-
|
4
|
-
function move_it(name,todir) {
|
5
|
-
$.ajax({
|
6
|
-
type: "PUT",
|
7
|
-
url: "server/" + gdir + name,
|
8
|
-
data: { dir: todir }
|
9
|
-
});
|
10
|
-
}
|
11
|
-
function shift_it(name,to) {
|
12
|
-
$.ajax({
|
13
|
-
type: "PUT",
|
14
|
-
url: "server/" + gdir + name,
|
15
|
-
data: { stage: to }
|
16
|
-
});
|
17
|
-
}
|
18
|
-
function rename_it(name) {
|
19
|
-
var newname;
|
20
|
-
if (newname = prompt('New name please!',name.replace(/\.xml$/,'').replace(/\.dir$/,''))) {
|
21
|
-
$.ajax({
|
22
|
-
type: "PUT",
|
23
|
-
url: "server/" + gdir + name,
|
24
|
-
data: { new: newname }
|
25
|
-
});
|
26
|
-
}
|
27
|
-
}
|
28
|
-
function duplicate_it(name) {
|
29
|
-
var newname;
|
30
|
-
if (newname = prompt('New name please!',name.replace(/\.xml$/,'').replace(/\.dir$/,''))) {
|
31
|
-
$.ajax({
|
32
|
-
type: "POST",
|
33
|
-
url: "server/" + gdir,
|
34
|
-
data: { new: newname, old: name }
|
35
|
-
});
|
36
|
-
}
|
37
|
-
}
|
38
|
-
function delete_it(name) {
|
39
|
-
if (confirm('Are you really, really, REALLY sure!')) {
|
40
|
-
$.ajax({
|
41
|
-
type: "DELETE",
|
42
|
-
url: "server/" + gdir + name
|
43
|
-
});
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
function es_init(gdir,gstage) {
|
48
|
-
var es = new EventSource('server/');
|
49
|
-
es.onopen = function() {
|
50
|
-
console.log('es open');
|
51
|
-
};
|
52
|
-
es.onmessage = function(e) {
|
53
|
-
paint(gdir,gstage);
|
54
|
-
};
|
55
|
-
es.onerror = function() {
|
56
|
-
console.log('es error');
|
57
|
-
// es_init();
|
58
|
-
};
|
59
|
-
}
|
60
|
-
|
61
|
-
function paint(gdir,gstage) {
|
62
|
-
$('#models tbody').empty();
|
63
|
-
if (gdir && gdir != '') {
|
64
|
-
var clone = document.importNode(document.querySelector('#up').content,true);
|
65
|
-
$('[data-class=name] a',clone).text('..');
|
66
|
-
$('[data-class=name] a',clone).attr('href',window.location.pathname + '?stage=' + gstage + '&dir=');
|
67
|
-
$('#models tbody').append(clone);
|
68
|
-
}
|
69
|
-
$.ajax({
|
70
|
-
type: "GET",
|
71
|
-
url: "server/" + gdir,
|
72
|
-
data: { stage: gstage },
|
73
|
-
success: function(res) {
|
74
|
-
$(res).each(function(k,data) {
|
75
|
-
if (data.type == 'dir') {
|
76
|
-
var clone = document.importNode(document.querySelector('#folder').content,true);
|
77
|
-
$('[data-class=name] a',clone).text(data['name'].replace(/\.dir$/,''));
|
78
|
-
$('[data-class=name]',clone).attr('data-full-name',data['name']);
|
79
|
-
$('[data-class=name] a',clone).attr('href',window.location.pathname + '?stage=' + gstage + '&dir=' + data['name']);
|
80
|
-
} else {
|
81
|
-
var clone = document.importNode(document.querySelector('#model').content,true);
|
82
|
-
$('[data-class=name] a',clone).text(data['name']);
|
83
|
-
$('[data-class=name]',clone).attr('data-full-name',data['name']);
|
84
|
-
$('[data-class=name] a',clone).attr('href','server/' + gdir + data['name'] + '/open?stage=' + gstage);
|
85
|
-
$('[data-class=force] a',clone).attr('href','server/' + gdir + data['name'] + '/open-new?stage=' + gstage);
|
86
|
-
$('[data-class=raw] a',clone).attr('href','server/' + gdir + data['name']);
|
87
|
-
|
88
|
-
$('[data-class=guarded] abbr',clone).attr('title',data['guarded'] || '');
|
89
|
-
$('[data-class=guarded] abbr',clone).text((data['guarded'] || '').match(/none/i) ? '' : (data['guarded'] || '').charAt(0).toUpperCase());
|
90
|
-
$('[data-class=resource]',clone).text(data['guarded_id'] || '');
|
91
|
-
}
|
92
|
-
$('[data-class=author]',clone).text(data['author']);
|
93
|
-
$('[data-class=date]',clone).text(new Date(data['date']).strftime('%Y-%m-%d, %H:%M:%S'));
|
94
|
-
$('#models tbody').append(clone);
|
95
|
-
});
|
96
|
-
}
|
97
|
-
});
|
98
|
-
}
|
99
|
-
|
100
|
-
function change_it(gdir,gstage) {
|
101
|
-
window.location.href = window.location.pathname + '?stage=' + gstage + '&dir=' + gdir;
|
102
|
-
}
|
103
|
-
|
104
|
-
$(document).ready(function() {
|
105
|
-
const queryString = window.location.search;
|
106
|
-
const urlParams = new URLSearchParams(queryString);
|
107
|
-
|
108
|
-
gstage = urlParams.get('stage') || 'draft';
|
109
|
-
gdir = urlParams.get('dir') ? (urlParams.get('dir') + '/').replace(/\/+/,'/') : '';
|
110
|
-
|
111
|
-
es_init(gdir,gstage);
|
112
|
-
|
113
|
-
var shifts = []
|
114
|
-
$.ajax({
|
115
|
-
type: "GET",
|
116
|
-
url: "server/",
|
117
|
-
data: { stages: 'stages' },
|
118
|
-
success: (r) => {
|
119
|
-
shifts = shifts.concat(r);
|
120
|
-
shifts = shifts.filter(item => item !== gstage);
|
121
|
-
}
|
122
|
-
});
|
123
|
-
|
124
|
-
$('input[name=stage]').val(gstage);
|
125
|
-
$('input[name=dir]').val(gdir);
|
126
|
-
$('ui-behind span').text(gstage);
|
127
|
-
$('ui-behind span').click((e) => {
|
128
|
-
if (shifts.length > 0) {
|
129
|
-
var menu = {};
|
130
|
-
menu['Change to'] = [];
|
131
|
-
shifts.forEach(ele => {
|
132
|
-
menu['Change to'].push(
|
133
|
-
{
|
134
|
-
'label': ele,
|
135
|
-
'function_call': change_it,
|
136
|
-
'text_icon': '➔',
|
137
|
-
'type': undefined,
|
138
|
-
'class': 'capitalized',
|
139
|
-
'params': [gdir,ele]
|
140
|
-
}
|
141
|
-
);
|
142
|
-
});
|
143
|
-
new CustomMenu(e).contextmenu(menu);
|
144
|
-
}
|
145
|
-
});
|
146
|
-
|
147
|
-
var dragged;
|
148
|
-
$('#models').on('drag','td[data-class=model]',false);
|
149
|
-
$('#models').on('dragstart','td[data-class=model]',(e) => {
|
150
|
-
dragged = $(e.currentTarget).parents('tr').find('td[data-class=name]').text();
|
151
|
-
});
|
152
|
-
$('#models').on('dragover','td[data-class=folder]',false);
|
153
|
-
$('#models').on('drop','td[data-class=folder]',(e) => {
|
154
|
-
e.preventDefault();
|
155
|
-
e.stopPropagation();
|
156
|
-
if (dragged) {
|
157
|
-
var todir = $(e.currentTarget).parents('tr').find('td[data-class=name]').text();
|
158
|
-
todir = todir.replace(/\./g,'');
|
159
|
-
if (todir != '') {
|
160
|
-
todir += '.dir';
|
161
|
-
}
|
162
|
-
move_it(dragged,todir);
|
163
|
-
dragged = undefined;
|
164
|
-
}
|
165
|
-
});
|
166
|
-
$('#models').on('click','td[data-class=ops]',(e) => {
|
167
|
-
var menu = {};
|
168
|
-
var name = $(e.currentTarget).parents('tr').find('td[data-class=name]').attr('data-full-name');
|
169
|
-
menu['Operations'] = [
|
170
|
-
{
|
171
|
-
'label': 'Delete',
|
172
|
-
'function_call': delete_it,
|
173
|
-
'text_icon': '❌',
|
174
|
-
'type': undefined,
|
175
|
-
'params': [name]
|
176
|
-
},
|
177
|
-
{
|
178
|
-
'label': 'Rename',
|
179
|
-
'function_call': rename_it,
|
180
|
-
'type': undefined,
|
181
|
-
'text_icon': '📛',
|
182
|
-
'params': [name]
|
183
|
-
}
|
184
|
-
];
|
185
|
-
if (name.match(/\.xml$/)) {
|
186
|
-
menu['Operations'].unshift(
|
187
|
-
{
|
188
|
-
'label': 'Duplicate',
|
189
|
-
'function_call': duplicate_it,
|
190
|
-
'text_icon': '➕',
|
191
|
-
'type': undefined,
|
192
|
-
'params': [name]
|
193
|
-
}
|
194
|
-
);
|
195
|
-
}
|
196
|
-
if (shifts.length > 0) {
|
197
|
-
menu['Shifting'] = [];
|
198
|
-
shifts.forEach(ele => {
|
199
|
-
menu['Shifting'].push(
|
200
|
-
{
|
201
|
-
'label': 'Shift to ' + ele,
|
202
|
-
'function_call': shift_it,
|
203
|
-
'text_icon': '➔',
|
204
|
-
'type': undefined,
|
205
|
-
'params': [name,ele]
|
206
|
-
}
|
207
|
-
);
|
208
|
-
});
|
209
|
-
}
|
210
|
-
new CustomMenu(e).contextmenu(menu);
|
211
|
-
});
|
212
|
-
|
213
|
-
history.pushState({}, document.title, window.location.pathname + '?stage=' + gstage + '&dir=' + gdir);
|
214
|
-
paint(gdir,gstage);
|
215
|
-
|
216
|
-
$('#newmod').on('submit',(e) => {
|
217
|
-
$.ajax({
|
218
|
-
type: "POST",
|
219
|
-
url: "server/" + gdir,
|
220
|
-
data: { stage: gstage, new: $("#newmod input[name=new]").val() },
|
221
|
-
success: (r) => {
|
222
|
-
uidash_activate_tab($('ui-tab').first());
|
223
|
-
}
|
224
|
-
});
|
225
|
-
return false;
|
226
|
-
});
|
227
|
-
|
228
|
-
$('#newdir').on('submit',(e) => {
|
229
|
-
$.ajax({
|
230
|
-
type: "POST",
|
231
|
-
url: "server/",
|
232
|
-
data: { dir: $("#newdir input[name=newdir]").val() },
|
233
|
-
success: (r) => {
|
234
|
-
uidash_activate_tab($('ui-tab').first());
|
235
|
-
}
|
236
|
-
});
|
237
|
-
return false;
|
238
|
-
});
|
239
|
-
});
|