Expose some settings for Trainwreck DB rotation

This commit is contained in:
Lance Edgar 2023-01-02 13:12:01 -06:00
parent d21826c70d
commit 9f763b46eb
2 changed files with 44 additions and 0 deletions

View file

@ -3,13 +3,44 @@
<%def name="form_content()"> <%def name="form_content()">
<h3 class="block is-size-3">Rotation</h3>
<div class="block" style="padding-left: 2rem;">
<b-field message="There is only one Trainwreck DB, unless rotation is used.">
<b-checkbox name="trainwreck.use_rotation"
v-model="simpleSettings['trainwreck.use_rotation']"
native-value="true"
@input="settingsNeedSaved = true">
Rotate Databases
</b-checkbox>
</b-field>
<b-field grouped>
<b-field label="Current Years"
message="How many years (max) to keep in &quot;current&quot; DB. Default is 2 if not set.">
<b-input name="trainwreck.current_years"
v-model="simpleSettings['trainwreck.current_years']"
@input="settingsNeedSaved = true">
</b-input>
</b-field>
</b-field>
</div>
<h3 class="block is-size-3">Hidden Databases</h3> <h3 class="block is-size-3">Hidden Databases</h3>
<div class="block" style="padding-left: 2rem;"> <div class="block" style="padding-left: 2rem;">
<p class="block">
The selected DBs will be hidden from the DB picker when viewing
Trainwreck data.
</p>
% for key, engine in six.iteritems(trainwreck_engines): % for key, engine in six.iteritems(trainwreck_engines):
<b-field> <b-field>
<b-checkbox name="hidedb_${key}" <b-checkbox name="hidedb_${key}"
v-model="hiddenDatabases['${key}']" v-model="hiddenDatabases['${key}']"
native-value="true" native-value="true"
% if key == 'default':
disabled
% endif
@input="settingsNeedSaved = true"> @input="settingsNeedSaved = true">
${key} ${key}
</b-checkbox> </b-checkbox>

View file

@ -384,6 +384,19 @@ class TransactionView(MasterView):
'engines_data': engines_data, 'engines_data': engines_data,
}) })
def configure_get_simple_settings(self):
return [
# rotation
{'section': 'trainwreck',
'option': 'use_rotation',
'type': bool},
{'section': 'trainwreck',
'option': 'current_years',
'type': int},
]
def configure_get_context(self): def configure_get_context(self):
context = super(TransactionView, self).configure_get_context() context = super(TransactionView, self).configure_get_context()