2
0
Fork 0

fix: expose settings for app node title, type

This commit is contained in:
Lance Edgar 2024-08-20 22:15:11 -05:00
parent d15ac46184
commit 1b4aaacc10
5 changed files with 32 additions and 9 deletions

View file

@ -6,11 +6,30 @@
<h3 class="block is-size-3">Basics</h3> <h3 class="block is-size-3">Basics</h3>
<div class="block" style="padding-left: 2rem; width: 50%;"> <div class="block" style="padding-left: 2rem; width: 50%;">
<b-field label="App Title"> <b-field grouped>
<b-input name="${app.appname}.app_title"
v-model="simpleSettings['${app.appname}.app_title']" <b-field label="App Title">
@input="settingsNeedSaved = true"> <b-input name="${app.appname}.app_title"
</b-input> v-model="simpleSettings['${app.appname}.app_title']"
@input="settingsNeedSaved = true">
</b-input>
</b-field>
<b-field label="Node Type">
## TODO: should be a dropdown, app handler defines choices
<b-input name="${app.appname}.node_type"
v-model="simpleSettings['${app.appname}.node_type']"
@input="settingsNeedSaved = true">
</b-input>
</b-field>
<b-field label="Node Title">
<b-input name="${app.appname}.node_title"
v-model="simpleSettings['${app.appname}.node_title']"
@input="settingsNeedSaved = true">
</b-input>
</b-field>
</b-field> </b-field>
<b-field> <b-field>

View file

@ -16,6 +16,9 @@
<b-field horizontal label="App Title"> <b-field horizontal label="App Title">
<span>${app.get_title()}</span> <span>${app.get_title()}</span>
</b-field> </b-field>
<b-field horizontal label="Node Title">
<span>${app.get_node_title()}</span>
</b-field>
<b-field horizontal label="Production Mode"> <b-field horizontal label="Production Mode">
<span>${config.production()}</span> <span>${config.production()}</span>
</b-field> </b-field>

View file

@ -1,6 +1,6 @@
## -*- coding: utf-8; -*- ## -*- coding: utf-8; -*-
<%def name="global_title()">${app.get_title()}</%def> <%def name="global_title()">${app.get_node_title()}</%def>
<%def name="extra_styles()"></%def> <%def name="extra_styles()"></%def>

View file

@ -53,15 +53,14 @@
<b-button @click="purgeSettingsShowDialog = false"> <b-button @click="purgeSettingsShowDialog = false">
Cancel Cancel
</b-button> </b-button>
${h.form(request.current_route_url())} ${h.form(request.current_route_url(), **{'@submit': 'purgingSettings = true'})}
${h.csrf_token(request)} ${h.csrf_token(request)}
${h.hidden('remove_settings', 'true')} ${h.hidden('remove_settings', 'true')}
<b-button type="is-danger" <b-button type="is-danger"
native-type="submit" native-type="submit"
:disabled="purgingSettings" :disabled="purgingSettings"
icon-pack="fas" icon-pack="fas"
icon-left="trash" icon-left="trash">
@click="purgingSettings = true">
{{ purgingSettings ? "Working, please wait..." : "Remove All Settings for ${config_title}" }} {{ purgingSettings ? "Working, please wait..." : "Remove All Settings for ${config_title}" }}
</b-button> </b-button>
${h.end_form()} ${h.end_form()}

View file

@ -99,6 +99,8 @@ class AppInfoView(MasterView):
# basics # basics
{'name': f'{self.app.appname}.app_title'}, {'name': f'{self.app.appname}.app_title'},
{'name': f'{self.app.appname}.node_type'},
{'name': f'{self.app.appname}.node_title'},
{'name': f'{self.app.appname}.production', {'name': f'{self.app.appname}.production',
'type': bool}, 'type': bool},