@mixd-id/web-scaffold 0.1.230406365 → 0.1.230406366

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406365",
4
+ "version": "0.1.230406366",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -169,21 +169,14 @@ export default{
169
169
 
170
170
  .button-primary {
171
171
  @apply bg-primary-500 text-white rounded-lg;
172
+ @apply hover:bg-primary-600 focus:border-primary-300;
172
173
  box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
173
174
  border: solid 1px rgb(var(--primary-500));
174
175
  }
175
176
 
176
- .button-primary:focus {
177
- border-color: rgb(var(--primary-600));
178
- }
179
-
180
- .button-primary:hover {
181
- @apply bg-primary-600;
182
- }
183
-
184
177
  .button-primary-disabled,
185
178
  .button-primary-disabled:hover {
186
- @apply bg-primary-300 top-0 left-0 cursor-not-allowed text-opacity-50;
179
+ @apply bg-primary-300 border-primary-300 top-0 left-0 cursor-not-allowed text-opacity-50;
187
180
  @apply top-0 left-0;
188
181
  }
189
182
 
package/src/utils/wss.js CHANGED
@@ -245,6 +245,13 @@ class WSS extends EventEmitter2{
245
245
 
246
246
  if(this._retryCount > 10){
247
247
  socket.close(1002, 'ping timeout')
248
+ if(subscriber){
249
+ subscriber.disconnect()
250
+ console.log('CLOSE SOCKET', token.substring(0, 10) + '...')
251
+ }
252
+ else{
253
+ console.log('CLOSE SOCKET#2', token.substring(0, 10) + '...')
254
+ }
248
255
  }
249
256
  }
250
257
  else{
@@ -112,6 +112,7 @@ export default{
112
112
  this.socket.send(`${this.controller}.open-action`, { uid })
113
113
  .then(_ => {
114
114
  this.action = _.item
115
+ this.config.selectedUid = this.action.uid
115
116
  this.initialAction = JSON.stringify(this.action)
116
117
  })
117
118
  },
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+
9
+ export default{
10
+
11
+ }
12
+
13
+ </script>
14
+
15
+ <style module>
16
+
17
+ .comp{
18
+ @apply p-6;
19
+ }
20
+
21
+ </style>
@@ -59,8 +59,7 @@
59
59
 
60
60
  <UserActionConsole class="flex-1"
61
61
  ref="console"
62
- @test-message="testMessage"
63
- @test-reset="testReset" />
62
+ :controller="controller" />
64
63
 
65
64
  </div>
66
65
 
@@ -85,6 +84,7 @@ import {capitalize} from "../utils/helpers.mjs";
85
84
  import BotEditorActions from "./BotEditor/BotEditorActions.vue";
86
85
  import VirtualGrid from "../components/VirtualGrid.vue";
87
86
  import UserActionConsole from "./UserActionBuilder/UserActionConsole.vue";
87
+ import BotEditorSettings from "./BotEditor/BotEditorSettings.vue";
88
88
 
89
89
 
90
90
  export default{
@@ -93,6 +93,7 @@ export default{
93
93
  UserActionConsole,
94
94
  VirtualGrid,
95
95
  BotEditorActions,
96
+ BotEditorSettings,
96
97
  },
97
98
 
98
99
  inject: [ 'alert', 'confirm', 'socket', 'toast' ],
@@ -140,12 +141,17 @@ export default{
140
141
  data(){
141
142
  return {
142
143
  actions: null,
144
+ user: null,
143
145
  page: '',
144
146
  }
145
147
  },
146
148
 
147
149
  methods: {
148
150
 
151
+ getUser(){
152
+ return this.user
153
+ },
154
+
149
155
  load(){
150
156
 
151
157
  },
@@ -157,6 +163,13 @@ export default{
157
163
  })
158
164
  },
159
165
 
166
+ open(id){
167
+ this.socket.send(`${this.controller}.open`, { id })
168
+ .then(res => {
169
+ this.user = res.user
170
+ })
171
+ },
172
+
160
173
  resize1(w) {
161
174
  if (this.sidebar.width + w >= 200 && this.sidebar.width + w <= 600) {
162
175
  this.sidebar.width += w
@@ -169,14 +182,6 @@ export default{
169
182
  }
170
183
  },
171
184
 
172
- testMessage(){
173
-
174
- },
175
-
176
- testReset(){
177
-
178
- },
179
-
180
185
  },
181
186
 
182
187
  props: {
@@ -186,6 +191,14 @@ export default{
186
191
 
187
192
  controller: String,
188
193
 
194
+ id: String,
195
+
196
+ },
197
+
198
+ provide(){
199
+ return {
200
+ getUser: this.getUser
201
+ }
189
202
  },
190
203
 
191
204
  watch: {
@@ -197,6 +210,13 @@ export default{
197
210
  }
198
211
  },
199
212
 
213
+ id: {
214
+ immediate: true,
215
+ handler(to){
216
+ this.open(to)
217
+ }
218
+ },
219
+
200
220
  page: {
201
221
  immediate: true,
202
222
  handler(to){
@@ -222,7 +242,7 @@ export default{
222
242
  }
223
243
 
224
244
  .resize2 {
225
- @apply h-[3px] cursor-n-resize absolute top-0 right-0 left-0 bg-red-500;
245
+ @apply h-[3px] cursor-n-resize absolute top-0 right-0 left-0 z-50;
226
246
  }
227
247
 
228
248
  </style>
@@ -1,6 +1,14 @@
1
1
  <template>
2
2
  <div class="flex flex-col relative">
3
3
 
4
+ <div class="p-3 flex flex-row items-start gap-3">
5
+ <div class="flex-1">
6
+ <h5>Simulation</h5>
7
+ </div>
8
+ <button type="button" class="text-primary" @click="reset">Reset</button>
9
+ <button type="button" class="text-primary" @click="clear">Clear</button>
10
+ </div>
11
+
4
12
  <div class="flex-1 overflow-y-auto flex flex-col-reverse px-3 gap-2">
5
13
  <div v-for="_message in reversedMessages"
6
14
  class="p-1 bg-text-50 self-start"
@@ -9,14 +17,9 @@
9
17
  </div>
10
18
  </div>
11
19
 
12
- <div class="absolute top-0 right-0 p-3">
13
- <button type="button" class="text-primary" @click="clear">Clear</button>
14
- </div>
15
-
16
- <div class="p-2 flex flex-row gap-2">
20
+ <div class="p-3 flex flex-row gap-2">
17
21
  <Textbox v-model="message.body" class="flex-1" />
18
22
  <Button class="px-4" @click="send">Send</Button>
19
- <Button class="px-3" variant="secondary" @click="reset">Reset</Button>
20
23
  </div>
21
24
  </div>
22
25
  </template>
@@ -25,7 +28,7 @@
25
28
 
26
29
  export default{
27
30
 
28
- emits: [ 'test-message', 'test-reset' ],
31
+ inject: [ 'getUser', 'socket' ],
29
32
 
30
33
  computed: {
31
34
 
@@ -38,7 +41,8 @@ export default{
38
41
  data(){
39
42
  return {
40
43
  message: {},
41
- messages: []
44
+ messages: [],
45
+ context: null,
42
46
  }
43
47
  },
44
48
 
@@ -53,15 +57,31 @@ export default{
53
57
  },
54
58
 
55
59
  reset(){
56
- this.$emit('test-reset')
60
+ this.context = {}
57
61
  },
58
62
 
59
63
  send(){
60
- this.$emit('test-message', this.message)
64
+ this.socket.send(`${this.controller}.test-message`, {
65
+ userId: this.getUser().id,
66
+ message: this.message,
67
+ context: this.context
68
+ })
69
+ .then(res => {
70
+ this.context = res.context ?? this.context
71
+ if(res.message)
72
+ this.messages.push(res.message)
73
+ })
74
+
61
75
  this.messages.push(this.message)
62
76
  this.message = {}
63
77
  },
64
78
 
79
+ },
80
+
81
+ props: {
82
+
83
+ controller: String
84
+
65
85
  }
66
86
 
67
87
  }