@processmaker/modeler 1.43.3 → 1.43.4
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.
- package/dist/modeler.common.js +201 -125
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +201 -125
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +3 -3
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/aiMessages/CreateAssetsFailCard.vue +11 -1
- package/src/components/aiMessages/GeneratingAssetsCard.vue +2 -2
- package/src/components/modeler/Modeler.vue +64 -18
- package/src/components/toolbar/ToolBar.vue +1 -0
- package/src/components/topRail/TopRail.vue +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="customAlert mx-auto mt-2">
|
|
3
|
-
<b-alert
|
|
3
|
+
<b-alert
|
|
4
|
+
show
|
|
5
|
+
dismissible
|
|
6
|
+
variant="warning"
|
|
7
|
+
@dismissed="onDismiss()"
|
|
8
|
+
>
|
|
4
9
|
{{ $t("Generation of assets was not able to complete. Try again") }}
|
|
5
10
|
</b-alert>
|
|
6
11
|
</div>
|
|
@@ -11,6 +16,11 @@ export default {
|
|
|
11
16
|
data() {
|
|
12
17
|
return {};
|
|
13
18
|
},
|
|
19
|
+
methods: {
|
|
20
|
+
onDismiss() {
|
|
21
|
+
this.$emit('onDismiss');
|
|
22
|
+
},
|
|
23
|
+
},
|
|
14
24
|
};
|
|
15
25
|
</script>
|
|
16
26
|
<style scoped>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div class="p-0">
|
|
12
12
|
<button
|
|
13
13
|
class="h-100 px-3 cancel-btn btn btn-secondary"
|
|
14
|
-
@click="
|
|
14
|
+
@click="onStop()"
|
|
15
15
|
>
|
|
16
16
|
{{ $t("STOP") }}
|
|
17
17
|
</button>
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
};
|
|
35
35
|
},
|
|
36
36
|
methods: {
|
|
37
|
-
|
|
37
|
+
onStop() {
|
|
38
38
|
this.$emit('stopAssetGeneration');
|
|
39
39
|
},
|
|
40
40
|
},
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
@clearSelection="clearSelection"
|
|
26
26
|
:players="filteredPlayers"
|
|
27
27
|
@action="handleToolbarAction"
|
|
28
|
+
@onGenerateAssets="generateAssets()"
|
|
28
29
|
/>
|
|
29
30
|
<b-row class="modeler h-100">
|
|
30
31
|
<b-tooltip
|
|
@@ -60,23 +61,25 @@
|
|
|
60
61
|
ref="createAssetsCard"
|
|
61
62
|
v-if="isAiGenerated"
|
|
62
63
|
@onGenerateAssets="generateAssets()"
|
|
63
|
-
@closeCreateAssets="
|
|
64
|
+
@closeCreateAssets="isAiGenerated = false"
|
|
64
65
|
/>
|
|
65
66
|
|
|
66
67
|
<GeneratingAssetsCard
|
|
67
68
|
ref="generatingAssetsCard"
|
|
68
|
-
v-if="
|
|
69
|
+
v-if="loadingAI"
|
|
70
|
+
@stopAssetGeneration="onStopAssetGeneration()"
|
|
69
71
|
/>
|
|
70
72
|
|
|
71
73
|
<AssetsCreatedCard
|
|
72
74
|
ref="assetsCreatedCard"
|
|
73
75
|
v-if="assetsCreated"
|
|
74
|
-
@closeAssetsCreated="
|
|
76
|
+
@closeAssetsCreated="assetsCreated = false"
|
|
75
77
|
/>
|
|
76
78
|
|
|
77
79
|
<CreateAssetsFailCard
|
|
78
80
|
ref="createAssetsFailCard"
|
|
79
|
-
v-if="
|
|
81
|
+
v-if="assetFail"
|
|
82
|
+
@onDismiss="assetFail = false"
|
|
80
83
|
/>
|
|
81
84
|
|
|
82
85
|
<InspectorButton
|
|
@@ -166,7 +169,7 @@
|
|
|
166
169
|
/>
|
|
167
170
|
|
|
168
171
|
<RailBottom
|
|
169
|
-
v-if="!
|
|
172
|
+
v-if="!loadingAI"
|
|
170
173
|
:nodeTypes="nodeTypes"
|
|
171
174
|
:paper-manager="paperManager"
|
|
172
175
|
:graph="graph"
|
|
@@ -199,9 +202,7 @@
|
|
|
199
202
|
</template>
|
|
200
203
|
|
|
201
204
|
<script>
|
|
202
|
-
|
|
203
205
|
import Vue from 'vue';
|
|
204
|
-
|
|
205
206
|
import _ from 'lodash';
|
|
206
207
|
import { dia } from 'jointjs';
|
|
207
208
|
import boundaryEventConfig from '../nodes/boundaryEvent';
|
|
@@ -387,11 +388,12 @@ export default {
|
|
|
387
388
|
currentCursorPosition: 0,
|
|
388
389
|
previewPanelWidth: 600,
|
|
389
390
|
isAiGenerated: window.ProcessMaker?.modeler?.isAiGenerated,
|
|
390
|
-
generatingAi: false,
|
|
391
391
|
assetsCreated: false,
|
|
392
|
-
|
|
392
|
+
assetFail: false,
|
|
393
393
|
currentNonce: null,
|
|
394
394
|
promptSessionId: '',
|
|
395
|
+
loadingAI: false,
|
|
396
|
+
cancelledJobs: [],
|
|
395
397
|
flowTypes: [
|
|
396
398
|
'processmaker-modeler-sequence-flow',
|
|
397
399
|
'processmaker-modeler-message-flow',
|
|
@@ -1845,7 +1847,7 @@ export default {
|
|
|
1845
1847
|
|
|
1846
1848
|
let params = {
|
|
1847
1849
|
server: window.location.host,
|
|
1848
|
-
processId:
|
|
1850
|
+
processId: window.ProcessMaker?.modeler?.process?.id,
|
|
1849
1851
|
};
|
|
1850
1852
|
|
|
1851
1853
|
if (this.promptSessionId && this.promptSessionId !== null && this.promptSessionId !== '') {
|
|
@@ -1860,9 +1862,8 @@ export default {
|
|
|
1860
1862
|
this.promptSessionId = (response.data.promptSessionId);
|
|
1861
1863
|
localStorage.promptSessionId = (response.data.promptSessionId);
|
|
1862
1864
|
}).catch((error) => {
|
|
1863
|
-
const errorMsg = error.
|
|
1864
|
-
|
|
1865
|
-
if (error.response.status === 404) {
|
|
1865
|
+
const errorMsg = error.message;
|
|
1866
|
+
if (error === 404) {
|
|
1866
1867
|
this.removePromptSessionForUser();
|
|
1867
1868
|
localStorage.promptSessionId = '';
|
|
1868
1869
|
this.promptSessionId = '';
|
|
@@ -1874,7 +1875,7 @@ export default {
|
|
|
1874
1875
|
generateAssets() {
|
|
1875
1876
|
this.getNonce();
|
|
1876
1877
|
|
|
1877
|
-
|
|
1878
|
+
this.fetchHistory();
|
|
1878
1879
|
|
|
1879
1880
|
const params = {
|
|
1880
1881
|
promptSessionId: this.promptSessionId,
|
|
@@ -1886,17 +1887,56 @@ export default {
|
|
|
1886
1887
|
|
|
1887
1888
|
window.ProcessMaker.apiClient.post(url, params)
|
|
1888
1889
|
.then(() => {
|
|
1890
|
+
// Response
|
|
1889
1891
|
})
|
|
1890
1892
|
.catch((error) => {
|
|
1891
1893
|
const errorMsg = error.response?.data?.message || error.message;
|
|
1892
1894
|
window.ProcessMaker.alert(errorMsg, 'danger');
|
|
1895
|
+
this.assetFail = true;
|
|
1893
1896
|
});
|
|
1894
1897
|
},
|
|
1895
|
-
|
|
1896
|
-
|
|
1898
|
+
subscribeToProgress() {
|
|
1899
|
+
const channel = `ProcessMaker.Models.User.${window.ProcessMaker?.modeler?.process?.user_id}`;
|
|
1900
|
+
const streamProgressEvent = '.ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsProgressEvent';
|
|
1901
|
+
window.Echo.private(channel).listen(
|
|
1902
|
+
streamProgressEvent,
|
|
1903
|
+
(response) => {
|
|
1904
|
+
if (response.data.promptSessionId !== this.promptSessionId) {
|
|
1905
|
+
return;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
if (this.cancelledJobs.some((element) => element === response.data.nonce)) {
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
if (response.data) {
|
|
1913
|
+
if (response.data.progress.status === 'running') {
|
|
1914
|
+
this.loadingAI = true;
|
|
1915
|
+
// Blue color for nodes running
|
|
1916
|
+
} else if (response.data.progress.status === 'error') {
|
|
1917
|
+
this.loadingAI = false;
|
|
1918
|
+
window.ProcessMaker.alert(response.data.message, 'danger');
|
|
1919
|
+
// Stop and show error
|
|
1920
|
+
this.assetFail = true;
|
|
1921
|
+
} else {
|
|
1922
|
+
this.setPromptSessions(response.data.promptSessionId);
|
|
1923
|
+
// Successful generation
|
|
1924
|
+
this.assetsCreated = true;
|
|
1925
|
+
this.fetchHistory();
|
|
1926
|
+
setTimeout(() => {
|
|
1927
|
+
this.loadingAI = false;
|
|
1928
|
+
}, 500);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
},
|
|
1932
|
+
);
|
|
1897
1933
|
},
|
|
1898
|
-
|
|
1899
|
-
this.
|
|
1934
|
+
onStopAssetGeneration() {
|
|
1935
|
+
if (this.currentNonce) {
|
|
1936
|
+
this.cancelledJobs.push(this.currentNonce);
|
|
1937
|
+
localStorage.setItem('cancelledJobs', JSON.stringify(this.cancelledJobs));
|
|
1938
|
+
this.loadingAI = false;
|
|
1939
|
+
}
|
|
1900
1940
|
},
|
|
1901
1941
|
},
|
|
1902
1942
|
created() {
|
|
@@ -2092,8 +2132,14 @@ export default {
|
|
|
2092
2132
|
if (!localStorage.getItem('promptSessions') || localStorage.getItem('promptSessions') === 'null') {
|
|
2093
2133
|
localStorage.setItem('promptSessions', JSON.stringify([]));
|
|
2094
2134
|
}
|
|
2135
|
+
if (!localStorage.getItem('cancelledJobs') || localStorage.getItem('cancelledJobs') === 'null') {
|
|
2136
|
+
this.cancelledJobs = [];
|
|
2137
|
+
} else {
|
|
2138
|
+
this.cancelledJobs = JSON.parse(localStorage.getItem('cancelledJobs'));
|
|
2139
|
+
}
|
|
2095
2140
|
this.promptSessionId = this.getPromptSessionForUser();
|
|
2096
2141
|
this.fetchHistory();
|
|
2142
|
+
this.subscribeToProgress();
|
|
2097
2143
|
},
|
|
2098
2144
|
};
|
|
2099
2145
|
</script>
|