Fix upgrade execution logic/UI per oruga

This commit is contained in:
Lance Edgar 2024-04-28 20:12:06 -05:00
parent 72f48fa963
commit 9ee6521d6a
2 changed files with 19 additions and 5 deletions

View file

@ -19,9 +19,15 @@
${parent.render_this_page()}
% if expose_websockets and master.has_perm('execute'):
<b-modal :active.sync="upgradeExecuting"
full-screen
:can-cancel="false">
<${b}-modal full-screen
% if request.use_oruga:
v-model:active="upgradeExecuting"
:cancelable="false"
% else:
:active.sync="upgradeExecuting"
:can-cancel="false"
% endif
>
<div class="card">
<div class="card-content">
@ -32,6 +38,10 @@
Upgrading ${system_title} (please wait) ...
{{ executeUpgradeComplete ? "DONE!" : "" }}
</p>
% if request.use_oruga:
<progress class="progress is-large"
style="width: 400px;" />
% else:
<b-progress size="is-large"
style="width: 400px;"
## :value="80"
@ -39,6 +49,7 @@
## format="percent"
>
</b-progress>
% endif
</div>
<div class="level-right">
<div class="level-item">
@ -65,7 +76,7 @@
</div>
</div>
</b-modal>
</${b}-modal>
% endif
% if master.has_perm('execute'):

View file

@ -2060,7 +2060,10 @@ class MasterView(View):
# caller must explicitly request websocket behavior; otherwise
# we will assume traditional behavior for progress
ws = self.request.is_xhr and self.request.json_body.get('ws')
ws = False
if ((self.request.is_xhr or self.request.content_type == 'application/json')
and self.request.json_body.get('ws')):
ws = True
# make our progress tracker
progress = self.make_execute_progress(obj, ws=ws)