Refresh nav on auth changes and show session info

This commit is contained in:
2026-04-06 17:20:47 +02:00
parent a0da39b697
commit 76d8180f41
5 changed files with 58 additions and 9 deletions
+2 -1
View File
@@ -173,8 +173,9 @@ export function loginPageData(store) {
return;
}
const status = error?.cause?.status || error?.status;
const isPendingValidation = !store.session?.hasValidated;
this.verifyState.error =
status === 403
status === 403 || isPendingValidation
? 'Failed to verify connection. Please verify the application key in Tryton first.'
: (error?.message || this.verifyState.error || 'Failed to verify connection.');
});
+18
View File
@@ -27,6 +27,17 @@ export function renderSettingsPage() {
<label class="form-label">Database name</label>
<input class="form-control" type="text" x-model="form.database" required />
</div>
<div>
<label class="form-label">User login</label>
<input class="form-control" type="text" :value="userLogin" readonly />
</div>
<div>
<label class="form-label">Application key</label>
<input class="form-control font-monospace" type="text" :value="maskedApplicationKey" readonly />
<div class="form-text">
Only the first 16 characters are shown for identification.
</div>
</div>
<button class="btn btn-primary align-self-start" type="submit">Save settings</button>
</form>
</div>
@@ -57,6 +68,13 @@ export function settingsPageData(store) {
baseUrl: store.config.baseUrl || '',
database: store.config.database || '',
},
get userLogin() {
return store.session?.userLogin || '';
},
get maskedApplicationKey() {
const key = store.session?.applicationKey || '';
return key ? `${key.slice(0, 16)}...` : '';
},
save() {
store.setConfig({
baseUrl: this.form.baseUrl.trim(),