@@ -147,46 +147,64 @@ function formatTimeouts(item) {
147147 return tt
148148}
149149
150+ let isOps = false
151+
152+
150153async function newRound (maxNodes , timeout2 , timeout3 , timeoutR ) {
154+ if (isUpdating || isOps) {
155+ return
156+ }
151157 const roundSettings = {
152158 maxNodes: maxNodes,
153159 timeout2: timeout2,
154160 timeout3: timeout3,
155161 timeoutR: timeoutR
156162 }
163+ isOps = true
157164 roundsStore .add (roundSettings)
158165 .then (() => {
159166 updateDataGrid ()
160167 })
161168 .catch ((error ) => {
162169 alertStore .error (error)
163170 })
171+ .finally (() => isOps = false )
164172}
165173
166174async function cancelRound (id ) {
175+ if (isUpdating || isOps) {
176+ return
177+ }
178+ isOps = true
167179 roundsStore .cancel (id)
168180 .then (() => {
169181 updateDataGrid ()
170182 })
171183 .catch ((error ) => {
172184 alertStore .error (error)
173185 })
186+ .finally (() => isOps = false )
174187}
175188
176189async function nextRoundStep (id ) {
190+ if (isUpdating || isOps) {
191+ return
192+ }
193+ isOps = true
177194 roundsStore .next (id)
178195 .then (() => {
179196 updateDataGrid ()
180197 })
181198 .catch ((error ) => {
182199 alertStore .error (error)
183200 })
201+ .finally (() => isOps = false )
184202}
185203
186204let isUpdating = false
187205
188206const updateDataGrid = async () => {
189- if (isUpdating) {
207+ if (isUpdating || isOps ) {
190208 return
191209 }
192210
@@ -257,7 +275,7 @@ function showCancel(item) {
257275 < hr class = " hr" / >
258276
259277 < div class = " link-crt" >
260- < a class = " link" @click= " newRound(authStore.max_nodes, authStore.timeout2, authStore.timeout3, authStore.timeoutR)" >
278+ < a class = " link" @click= " newRound(authStore.max_nodes, authStore.timeout2, authStore.timeout3, authStore.timeoutR)" : disabled = " isUpdating || isOps " >
261279 < font- awesome- icon size= " 1x" icon= " fa-solid fa-plus" class = " link" / >
262280 New round
263281 < / a>
@@ -311,7 +329,7 @@ function showCancel(item) {
311329 < / template>
312330
313331 < template v- slot: [` item.actionNext` ]= " { item }" >
314- < button @click= " nextRoundStep(item['id'])" class = " anti-btn" v- if = " showProceed(item)" >
332+ < button @click= " nextRoundStep(item['id'])" class = " anti-btn" v- if = " showProceed(item)" : disabled = " isUpdating || isOps " >
315333 < font- awesome- icon size= " 1x" : icon= " 'fa-solid ' + item['nextStatus'].actionIcon" class = " anti-btn" / >
316334 < / button>
317335 < v- tooltip v- if = " showProceed(item)"
@@ -320,7 +338,7 @@ function showCancel(item) {
320338 < / template>
321339
322340 < template v- slot: [` item.actionCancel` ]= " { item }" >
323- < button @click= " cancelRound(item['id'])" class = " anti-btn" v- if = " showCancel(item)" >
341+ < button @click= " cancelRound(item['id'])" class = " anti-btn" v- if = " showCancel(item)" : disabled = " isUpdating || isOps " >
324342 < font- awesome- icon size= " 1x" : icon= " 'fa-solid ' + item['cancelStatus'].actionIcon" class = " anti-btn" / >
325343 < v- tooltip v- if = " showCancel(item)"
326344 activator= " parent"
0 commit comments