settings UI: add Site Base URL + Alert Webhook URL/format fields

The webhook + site_base_url settings existed in the backend but the Email
Settings page had no inputs (hardcoded fields), and the settings composable's
reactive map didn't include the keys so they never loaded. Add the three inputs
(site base URL, webhook URL, webhook format select) and register the keys.
This commit is contained in:
cproudlock
2026-07-22 12:55:50 -04:00
parent 38c7ec347b
commit 824863a95a
2 changed files with 47 additions and 0 deletions

View File

@@ -108,6 +108,9 @@ export function useSystemSettings() {
smtp_from_address: '',
smtp_from_name: 'ShopDB',
alert_recipients: '',
site_base_url: '',
alert_webhook_url: '',
alert_webhook_format: 'teams',
// Audit
audit_retention_days: 90,
// Floor map blueprint (per-facility)

View File

@@ -137,6 +137,50 @@
</label>
</div>
<div class="setting-row full-width">
<label>
<span>Site Base URL</span>
<input
type="text"
v-model="settings.site_base_url"
placeholder="https://tsgwp00525.wjs.geaerospace.net/ops"
@blur="saveSetting('site_base_url', settings.site_base_url)"
:disabled="saving"
>
<small class="input-hint">Public URL of this site; used to build links in emails</small>
</label>
</div>
<div class="setting-row full-width">
<label>
<span>Alert Webhook URL</span>
<input
type="text"
v-model="settings.alert_webhook_url"
placeholder="https://... (Microsoft Teams Incoming Webhook or Workflow)"
@blur="saveSetting('alert_webhook_url', settings.alert_webhook_url)"
:disabled="saving"
>
<small class="input-hint">Alerts also POST here (Teams, etc.). Blank = email only.</small>
</label>
</div>
<div class="setting-row full-width">
<label>
<span>Alert Webhook Format</span>
<select
v-model="settings.alert_webhook_format"
@change="saveSetting('alert_webhook_format', settings.alert_webhook_format)"
:disabled="saving"
>
<option value="teams">Teams - Incoming Webhook (MessageCard)</option>
<option value="adaptivecard">Teams - Workflow (Adaptive Card)</option>
<option value="json">Generic JSON</option>
</select>
<small class="input-hint">Payload format for the webhook above</small>
</label>
</div>
<div class="status-indicator">
<span class="status-dot" :class="smtpStatus"></span>
<span>{{ smtpMessage }}</span>