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

Commit c0cf655

Browse files
authored
Merge pull request #498 from FlowzPlatform/SocketFixing
Socket fix on list page
2 parents c5cb976 + 8f3bbd1 commit c0cf655

File tree

4 files changed

+47
-27
lines changed

4 files changed

+47
-27
lines changed

client/src/components/SchemaView.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export default {
227227
sendDataEmail: null,
228228
loadingEmail: true,
229229
currentSchema: null,
230-
dataLoading: true
230+
dataLoading: true,
231+
entriesTotal: 10
231232
}
232233
},
233234
components: {
@@ -282,11 +283,13 @@ export default {
282283
pagination (skip, limit, page) {
283284
this.skip = skip
284285
this.limit = limit
286+
this.entriesTotal = limit
285287
this.pageno = page
286288
this.populateTables()
287289
},
288290
handlepage (skip, limit, size) {
289291
this.limit = size
292+
this.entriesTotal = size
290293
this.skip = 0
291294
this.populateTables()
292295
},
@@ -910,6 +913,7 @@ export default {
910913
$limit: this.limit
911914
}).then(queryresp => {
912915
// console.log('queryresp: ', queryresp)
916+
// this.entriesTotal = queryresp.data.data.length
913917
this.isFlowzLoaded = true
914918
this.dataTotal = queryresp.data.total
915919
if (queryresp.data.data.length > 0) {
@@ -1010,7 +1014,29 @@ export default {
10101014
// console.log('err: ', err)
10111015
// })
10121016
// }, 2000)
1013-
this.init()
1017+
// console.log('Length: ', this.instanceEntries.length)
1018+
// console.log('instanceEntries: ', this.instanceEntries.length, this.entriesTotal)
1019+
if (this.instanceEntries.length < this.entriesTotal) {
1020+
// console.log('Ready to push: ', this.instanceEntries.length)
1021+
// push to table
1022+
let instanceObj = data
1023+
// console.log('instanceObj: ', instanceObj)
1024+
let lastEntryId = data.stageReference[data.stageReference.length - 1].stageRecordId
1025+
// console.log('lastEntryId: ', lastEntryId)
1026+
if (lastEntryId !== undefined) {
1027+
flowzdataModal.get(lastEntryId).then(res => {
1028+
// console.log('Response fdata: ', res)
1029+
instanceObj['data'] = res.data.data
1030+
instanceObj['iid'] = data.id
1031+
this.instanceEntries.push(instanceObj)
1032+
this.dataData.push(instanceObj)
1033+
// console.log('Pushed data: ', this.instanceEntries, this.dataData)
1034+
})
1035+
}
1036+
} else {
1037+
// don't do anything
1038+
}
1039+
// this.init()
10141040
} else if (this.$route.params.stateid === data.stageReference[(data.stageReference.length - 1)].StageName) {
10151041
let inx = _.findIndex(this.instanceEntries, (o) => { return o.id === data.id })
10161042
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

@@ -122,17 +123,21 @@ export default {
122123
return moment(item).fromNow()
123124
},
124125
getDuration (x, y) {
125-
if (x) {
126-
let x1 = moment(x)
127-
let y1 = moment(y)
128-
let milliseconds = y1.diff(x1)
129-
return this.msToTime(milliseconds)
126+
// if (x) {
127+
let x1 = moment(x)
128+
let y1 = moment(y)
129+
let milliseconds = y1.diff(x1)
130+
if (milliseconds < 1000) {
131+
return ((milliseconds / 1000) + 's')
130132
} else {
131-
let x1 = moment(y)
132-
let y1 = moment()
133-
let milliseconds = y1.diff(x1)
134133
return this.msToTime(milliseconds)
135134
}
135+
// } else {
136+
// let x1 = moment(y)
137+
// let y1 = moment()
138+
// let milliseconds = y1.diff(x1)
139+
// return this.msToTime(milliseconds)
140+
// }
136141
},
137142
msToTime (duration) {
138143
// let milliseconds = parseInt((duration % 1000) / 100)
@@ -313,15 +318,5 @@ export default {
313318
border-radius: 50px;
314319
width: 20px;
315320
}
316-
.ivu-table-cell{
317-
padding-left: 0;
318-
padding-right: 0;
319-
}
320-
</style>
321321

322-
<style>
323-
.ivu-table-cell{
324-
padding-left: 0;
325-
padding-right: 0;
326-
}
327322
</style>

client/src/pages/flow/analytics.vue

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

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)