2017-07-07 09:13:53 -05:00
|
|
|
## -*- coding: utf-8; -*-
|
2017-07-14 21:23:40 -05:00
|
|
|
<%inherit file="/master/index.mako" />
|
2017-07-07 09:13:53 -05:00
|
|
|
|
2017-12-02 17:08:17 -06:00
|
|
|
<%def name="grid_tools()">
|
2019-10-09 11:19:48 -05:00
|
|
|
${parent.grid_tools()}
|
2020-03-02 18:11:13 -06:00
|
|
|
|
|
|
|
## Refresh Results
|
|
|
|
% if master.results_refreshable and master.has_perm('refresh'):
|
2023-02-03 12:05:17 -06:00
|
|
|
<b-button type="is-primary"
|
|
|
|
:disabled="refreshResultsButtonDisabled"
|
|
|
|
icon-pack="fas"
|
2024-04-28 18:49:11 -05:00
|
|
|
icon-left="redo"
|
2023-02-03 12:05:17 -06:00
|
|
|
@click="refreshResults()">
|
|
|
|
{{ refreshResultsButtonText }}
|
|
|
|
</b-button>
|
|
|
|
${h.form(url('{}.refresh_results'.format(route_prefix)), ref='refreshResultsForm')}
|
|
|
|
${h.csrf_token(request)}
|
|
|
|
${h.end_form()}
|
2020-03-02 18:11:13 -06:00
|
|
|
% endif
|
|
|
|
|
|
|
|
## Execute Results
|
|
|
|
% if master.results_executable and master.has_perm('execute_multiple'):
|
2023-02-03 12:05:17 -06:00
|
|
|
<b-button type="is-primary"
|
|
|
|
@click="executeResults()"
|
|
|
|
icon-pack="fas"
|
|
|
|
icon-left="arrow-circle-right"
|
|
|
|
:disabled="!total">
|
|
|
|
Execute Results
|
|
|
|
</b-button>
|
|
|
|
|
|
|
|
<b-modal has-modal-card
|
|
|
|
:active.sync="showExecutionOptions">
|
|
|
|
<div class="modal-card">
|
|
|
|
|
|
|
|
<header class="modal-card-head">
|
|
|
|
<p class="modal-card-title">Execution Options</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<section class="modal-card-body">
|
|
|
|
<p>
|
|
|
|
Please be advised, you are about to execute {{ total }} batches!
|
|
|
|
</p>
|
|
|
|
<br />
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<div class="form">
|
2024-08-20 13:46:40 -05:00
|
|
|
${execute_form.render_vue_tag(ref='executeResultsForm')}
|
2023-02-03 12:05:17 -06:00
|
|
|
</div>
|
2019-06-16 15:50:40 -05:00
|
|
|
</div>
|
2023-02-03 12:05:17 -06:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button @click="showExecutionOptions = false">
|
|
|
|
Cancel
|
|
|
|
</b-button>
|
|
|
|
<once-button type="is-primary"
|
|
|
|
@click="submitExecuteResults()"
|
|
|
|
icon-left="arrow-circle-right"
|
|
|
|
:text="'Execute ' + total + ' Batches'">
|
|
|
|
</once-button>
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</b-modal>
|
2019-06-16 15:50:40 -05:00
|
|
|
% endif
|
|
|
|
</%def>
|
|
|
|
|
2024-08-19 21:30:58 -05:00
|
|
|
<%def name="render_vue_templates()">
|
|
|
|
${parent.render_vue_templates()}
|
|
|
|
% if master.results_executable and master.has_perm('execute_multiple'):
|
2024-08-20 13:46:40 -05:00
|
|
|
${execute_form.render_vue_template(form_kwargs={'ref': 'actualExecuteForm'}, buttons=False)}
|
2024-08-19 21:30:58 -05:00
|
|
|
% endif
|
|
|
|
</%def>
|
|
|
|
|
|
|
|
<%def name="modify_vue_vars()">
|
|
|
|
${parent.modify_vue_vars()}
|
2021-02-09 12:19:26 -06:00
|
|
|
% if master.results_refreshable and master.has_perm('refresh'):
|
2024-08-19 21:30:58 -05:00
|
|
|
<script>
|
2019-06-16 15:50:40 -05:00
|
|
|
|
2020-09-28 13:23:01 -05:00
|
|
|
TailboneGridData.refreshResultsButtonText = "Refresh Results"
|
|
|
|
TailboneGridData.refreshResultsButtonDisabled = false
|
|
|
|
|
|
|
|
TailboneGrid.methods.refreshResults = function() {
|
|
|
|
this.refreshResultsButtonDisabled = true
|
|
|
|
this.refreshResultsButtonText = "Working, please wait..."
|
|
|
|
this.$refs.refreshResultsForm.submit()
|
|
|
|
}
|
|
|
|
|
2021-02-09 12:19:26 -06:00
|
|
|
</script>
|
|
|
|
% endif
|
|
|
|
% if master.results_executable and master.has_perm('execute_multiple'):
|
2024-08-19 21:30:58 -05:00
|
|
|
<script>
|
2021-02-09 12:19:26 -06:00
|
|
|
|
2024-08-19 09:53:10 -05:00
|
|
|
${execute_form.vue_component}.methods.submit = function() {
|
2020-08-23 11:23:22 -05:00
|
|
|
this.$refs.actualExecuteForm.submit()
|
2019-06-16 15:50:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
TailboneGridData.hasExecutionOptions = ${json.dumps(master.has_execution_options(batch))|n}
|
|
|
|
TailboneGridData.showExecutionOptions = false
|
|
|
|
|
|
|
|
TailboneGrid.methods.executeResults = function() {
|
|
|
|
|
|
|
|
// this should never happen since we disable the button when there are no results
|
|
|
|
if (!this.total) {
|
|
|
|
alert("There are no batch results to execute.")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.hasExecutionOptions) {
|
|
|
|
// show execution options modal, user can submit form from there
|
|
|
|
this.showExecutionOptions = true
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// no execution options, but this still warrants a basic confirmation
|
|
|
|
if (confirm("Are you sure you wish to execute all " + this.total.toLocaleString('en') + " batches?")) {
|
|
|
|
alert('TODO: ok then you asked for it')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TailboneGrid.methods.submitExecuteResults = function() {
|
|
|
|
this.$refs.executeResultsForm.submit()
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
2017-12-02 17:08:17 -06:00
|
|
|
% endif
|
|
|
|
</%def>
|
|
|
|
|
2024-08-19 21:30:58 -05:00
|
|
|
<%def name="make_vue_components()">
|
|
|
|
${parent.make_vue_components()}
|
2020-03-02 18:11:13 -06:00
|
|
|
% if master.results_executable and master.has_perm('execute_multiple'):
|
2024-08-20 13:46:40 -05:00
|
|
|
${execute_form.render_vue_finalize()}
|
2019-08-03 16:57:13 -05:00
|
|
|
% endif
|
|
|
|
</%def>
|