Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit ad30caa

Browse files
author
Faizan Saiyed
committed
Socket fix on list page
1 parent 9406eee commit ad30caa

File tree

4 files changed

+50
-28
lines changed

4 files changed

+50
-28
lines changed

client/src/components/SchemaView.vue

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ export default {
234234
sendDataEmail: null,
235235
loadingEmail: true,
236236
currentSchema: null,
237-
dataLoading: true
237+
dataLoading: true,
238+
entriesTotal: 10
238239
}
239240
},
240241
components: {
@@ -289,11 +290,13 @@ export default {
289290
pagination (skip, limit, page) {
290291
this.skip = skip
291292
this.limit = limit
293+
this.entriesTotal = limit
292294
this.pageno = page
293295
this.populateTables()
294296
},
295297
handlepage (skip, limit, size) {
296298
this.limit = size
299+
this.entriesTotal = size
297300
this.skip = 0
298301
this.populateTables()
299302
},
@@ -917,7 +920,8 @@ export default {
917920
$skip: this.skip,
918921
$limit: this.limit
919922
}).then(queryresp => {
920-
// console.log('queryresp: ', queryresp)
923+
console.log('queryresp: ', queryresp)
924+
// this.entriesTotal = queryresp.data.data.length
921925
this.isFlowzLoaded = true
922926
this.dataTotal = queryresp.data.total
923927
if (queryresp.data.data.length > 0) {
@@ -992,8 +996,10 @@ export default {
992996
feathers: {
993997
'finstance': {
994998
created (data) {
999+
console.log('Data: ', data)
9951000
},
9961001
updated (data) {
1002+
console.log('Schema view Data: ', data)
9971003
if (this.$store.state.role === 1) {
9981004
if (data.currentStatus === this.$route.params.stateid) {
9991005
// // data = data.data
@@ -1018,7 +1024,29 @@ export default {
10181024
// console.log('err: ', err)
10191025
// })
10201026
// }, 2000)
1021-
this.init()
1027+
// console.log('Length: ', this.instanceEntries.length)
1028+
console.log('instanceEntries: ', this.instanceEntries.length, this.entriesTotal)
1029+
if (this.instanceEntries.length < this.entriesTotal) {
1030+
console.log('Ready to push: ', this.instanceEntries.length)
1031+
// push to table
1032+
let instanceObj = data
1033+
// console.log('instanceObj: ', instanceObj)
1034+
let lastEntryId = data.stageReference[data.stageReference.length - 1].stageRecordId
1035+
console.log('lastEntryId: ', lastEntryId)
1036+
if (lastEntryId !== undefined) {
1037+
flowzdataModal.get(lastEntryId).then(res => {
1038+
console.log('Response fdata: ', res)
1039+
instanceObj['data'] = res.data.data
1040+
instanceObj['iid'] = data.id
1041+
this.instanceEntries.push(instanceObj)
1042+
this.dataData.push(instanceObj)
1043+
console.log('Pushed data: ', this.instanceEntries, this.dataData)
1044+
})
1045+
}
1046+
} else {
1047+
// don't do anything
1048+
}
1049+
// this.init()
10221050
} else if (this.$route.params.stateid === data.stageReference[(data.stageReference.length - 1)].StageName) {
10231051
let inx = _.findIndex(this.instanceEntries, (o) => { return o.id === data.id })
10241052
this.instanceEntries.splice(inx, 1)

client/src/components/cellRender.vue

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
<span v-if="item.obj != null && item.isCompletedTask == true" title="Duration" style="display: block;">
3232
<i class="fa fa-clock-o fa-fw"></i>
33+
<!-- <span>{{item.obj.createdAt}} : {{ item.obj.completedAt}}</span> -->
3334
<small>{{ getDuration(item.obj.createdAt, item.obj.completedAt) }}</small>
3435
</span>
3536

@@ -123,17 +124,21 @@ export default {
123124
return moment(item).fromNow()
124125
},
125126
getDuration (x, y) {
126-
if (x) {
127-
let x1 = moment(x)
128-
let y1 = moment(y)
129-
let milliseconds = y1.diff(x1)
130-
return this.msToTime(milliseconds)
127+
// if (x) {
128+
let x1 = moment(x)
129+
let y1 = moment(y)
130+
let milliseconds = y1.diff(x1)
131+
if (milliseconds < 1000) {
132+
return ((milliseconds / 1000) + 's')
131133
} else {
132-
let x1 = moment(y)
133-
let y1 = moment()
134-
let milliseconds = y1.diff(x1)
135134
return this.msToTime(milliseconds)
136135
}
136+
// } else {
137+
// let x1 = moment(y)
138+
// let y1 = moment()
139+
// let milliseconds = y1.diff(x1)
140+
// return this.msToTime(milliseconds)
141+
// }
137142
},
138143
msToTime (duration) {
139144
// let milliseconds = parseInt((duration % 1000) / 100)
@@ -314,15 +319,5 @@ export default {
314319
border-radius: 50px;
315320
width: 20px;
316321
}
317-
.ivu-table-cell{
318-
padding-left: 0;
319-
padding-right: 0;
320-
}
321-
</style>
322322
323-
<style>
324-
.ivu-table-cell{
325-
padding-left: 0;
326-
padding-right: 0;
327-
}
328323
</style>

client/src/pages/flow/analytics.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,12 @@ export default {
801801
.notfirst {
802802
display: none
803803
}
804-
805-
806804
</style>
807805
<style>
806+
.ivu-table-cell{
807+
padding-left: 0 !important;
808+
padding-right: 0 !important;
809+
}
808810
.ivu-modal-body{
809811
max-height: 550px !important;
810812
overflow-y: auto !important;
@@ -848,11 +850,6 @@ export default {
848850
padding-left: 10px;
849851
}
850852
851-
.ivu-table-cell{
852-
padding-left: 0 !important;
853-
padding-right: 0 !important;
854-
}
855-
856853
.searchQueries{
857854
margin: 5px 0;
858855
}

client/src/pages/user/SchemaList.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,4 +708,6 @@
708708
overflow: hidden !important;
709709
text-overflow: ellipsis !important;
710710
}
711+
712+
711713
</style>

0 commit comments

Comments
 (0)