cpee-model-management 1.0.16 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ui/resources.html ADDED
@@ -0,0 +1,91 @@
1
+ <!--
2
+ This file is part of CPEE-MODEL-MANAGEMENT.
3
+
4
+ CPEE-MODEL-MANAGEMENT is free software: you can redistribute it and/or
5
+ modify it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or (at your
7
+ option) any later version.
8
+
9
+ CPEE-MODEL-MANAGEMENT is distributed in the hope that it will be useful, but
10
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
+ more details.
13
+
14
+ You should have received a copy of the GNU General Public License along with
15
+ CPEE-MODEL-MANAGEMENT (file LICENSE in the main directory). If not, see
16
+ <http://www.gnu.org/licenses/>.
17
+ -->
18
+
19
+ <!DOCTYPE html>
20
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
21
+ <head>
22
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
23
+ <title>Resources</title>
24
+
25
+ <!-- libs, do not modify. When local than load local libs. -->
26
+ <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
27
+ <script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
28
+ <script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
29
+ <script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
30
+ <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
31
+ <script type="text/javascript" src="/js_libs/util.js"></script>
32
+ <script type="text/javascript" src="/js_libs/printf.js"></script>
33
+ <script type="text/javascript" src="/js_libs/strftime.min.js"></script>
34
+ <script type="text/javascript" src="/js_libs/parsequery.js"></script>
35
+ <script type="text/javascript" src="/js_libs/underscore.min.js"></script>
36
+ <script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
37
+ <script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
38
+ <script type="text/javascript" src="/js_libs/plotly.min.js"></script>
39
+
40
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
41
+
42
+ <script type="text/javascript" src="/js_libs/relaxngui.js"></script>
43
+
44
+ <script type="text/javascript" src="/js_libs/uidash.js"></script>
45
+ <script type="text/javascript" src="/js_libs/custommenu.js"></script>
46
+
47
+ <link rel="stylesheet" href="/js_libs/custommenu.css" type="text/css"/>
48
+ <link rel="stylesheet" href="/js_libs/uidash.css" type="text/css"/>
49
+
50
+ <link rel="stylesheet" href="/global_ui/ui.css" type="text/css"/>
51
+
52
+ <link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
53
+
54
+ <!-- custom stuff, play arround -->
55
+ <link rel="stylesheet" href="css/stats.css" type="text/css"/>
56
+ <link rel="stylesheet" href="css/stats_standalone.css" type="text/css"/>
57
+ <script type="text/javascript" src="js/stats.js"></script>
58
+ </head>
59
+ <body is="x-ui-">
60
+ <p>
61
+ Show statistics about instances per server, and metrics about the health of the environment.
62
+ </p>
63
+ <template id="stats_engine">
64
+ <h1 class="stats_title">Engine: </h1>
65
+ <div class="stats_plot"></div>
66
+ <div class="stats_text">
67
+ <table>
68
+ <tbody>
69
+ <tr>
70
+ <td>Total Instances <strong>Created</strong> / <strong>Finished</strong> / <strong>Abandoned</strong>:</td>
71
+ <td class='total_created'></td>
72
+ <td>/</td>
73
+ <td class='total_finished'></td>
74
+ <td>/</td>
75
+ <td class='total_abandoned'></td>
76
+ </tr>
77
+ <tr>
78
+ <td>Instances Currently <strong>Ready</strong> / <strong>Running</strong> / <strong>Stopped</strong>:</td>
79
+ <td class='current_ready'></td>
80
+ <td>/</td>
81
+ <td class='current_running'></td>
82
+ <td>/</td>
83
+ <td class='current_stopped'></td>
84
+ </tr>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+ </template>
89
+ <div id='resources'></div>
90
+ </body>
91
+ </html>
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.0.16
4
+ version: 1.1.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: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2022-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl
@@ -73,6 +73,7 @@ files:
73
73
  - cpee-model-management.gemspec
74
74
  - lib/cpee-model-management/commit.rb
75
75
  - lib/cpee-model-management/implementation.rb
76
+ - lib/cpee-model-management/implementation.xml
76
77
  - lib/cpee-model-management/moma.xml
77
78
  - lib/cpee-model-management/stages
78
79
  - server/model.xml
@@ -81,9 +82,13 @@ files:
81
82
  - server/testset.xml
82
83
  - tools/cpee-moma
83
84
  - ui/css/design.css
84
- - ui/design.js
85
+ - ui/css/stats.css
86
+ - ui/css/stats_standalone.css
85
87
  - ui/index.html
88
+ - ui/instances.html
86
89
  - ui/js/design.js
90
+ - ui/js/stats.js
91
+ - ui/resources.html
87
92
  homepage: http://cpee.org/
88
93
  licenses:
89
94
  - LGPL-3.0
@@ -103,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
108
  - !ruby/object:Gem::Version
104
109
  version: '0'
105
110
  requirements: []
106
- rubygems_version: 3.1.6
111
+ rubygems_version: 3.3.7
107
112
  signing_key:
108
113
  specification_version: 4
109
114
  summary: "(Lifecycle) manage your process models in a directory or git repo."
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
- });