Close #96 - Set unique page titles

This commit is contained in:
Bubka 2022-07-07 18:04:04 +02:00
parent cb2de26e93
commit 98bd9ddea5
7 changed files with 61 additions and 12 deletions

2
resources/js/app.js vendored
View File

@ -1,9 +1,9 @@
import Vue from 'vue'
import mixins from './mixins'
import VueStorage from './packages/vue-storage'
import i18n from './langs/i18n'
import router from './routes'
import api from './api'
import i18n from './langs/i18n'
import FontAwesome from './packages/fontawesome'
import Clipboard from './packages/clipboard'
import Notifications from 'vue-notification'

View File

@ -32,11 +32,11 @@
},
{
'name' : this.$t('settings.oauth'),
'view' : 'settings.oauth'
'view' : 'settings.oauth.tokens'
},
{
'name' : this.$t('settings.webauthn'),
'view' : 'settings.webauthn'
'view' : 'settings.webauthn.devices'
},
]
}

View File

@ -45,10 +45,10 @@ const router = new Router({
{ path: '/settings/options', name: 'settings.options', component: SettingsOptions, meta: { requiresAuth: true } },
{ path: '/settings/account', name: 'settings.account', component: SettingsAccount, meta: { requiresAuth: true } },
{ path: '/settings/oauth', name: 'settings.oauth', component: SettingsOAuth, meta: { requiresAuth: true } },
{ path: '/settings/webauthn/:credentialId/edit', name: 'settings.webauthn.editCredential', component: EditCredential, meta: { requiresAuth: true }, props: true },
{ path: '/settings/webauthn', name: 'settings.webauthn', component: SettingsWebAuthn, meta: { requiresAuth: true } },
{ path: '/settings/oauth', name: 'settings.oauth.tokens', component: SettingsOAuth, meta: { requiresAuth: true } },
{ path: '/settings/oauth/pat/create', name: 'settings.oauth.generatePAT', component: GeneratePAT, meta: { requiresAuth: true } },
{ path: '/settings/webauthn/:credentialId/edit', name: 'settings.webauthn.editCredential', component: EditCredential, meta: { requiresAuth: true }, props: true },
{ path: '/settings/webauthn', name: 'settings.webauthn.devices', component: SettingsWebAuthn, meta: { requiresAuth: true } },
{ path: '/login', name: 'login', component: Login, meta: { disabledWithAuthProxy: true } },
{ path: '/register', name: 'register', component: Register, meta: { disabledWithAuthProxy: true } },
@ -67,6 +67,8 @@ let isFirstLoad = true;
router.beforeEach((to, from, next) => {
document.title = router.app.$options.i18n.t('titles.' + to.name)
if( to.name === 'accounts') {
to.params.isFirstLoad = isFirstLoad ? true : false
isFirstLoad = false;

View File

@ -36,14 +36,14 @@
await this.form.patch('/webauthn/credentials/' + this.id + '/name')
if( this.form.errors.any() === false ) {
this.$router.push({name: 'settings.webauthn', params: { toRefresh: true }})
this.$router.push({name: 'settings.webauthn.devices', params: { toRefresh: true }})
}
},
cancelCreation: function() {
this.$router.push({ name: 'settings.webauthn' });
this.$router.push({ name: 'settings.webauthn.devices' });
},
},

View File

@ -34,14 +34,14 @@
const { data } = await this.form.post('/oauth/personal-access-tokens')
if( this.form.errors.any() === false ) {
this.$router.push({ name: 'settings.oauth', params: { accessToken: data.accessToken, token_id: data.token.id } });
this.$router.push({ name: 'settings.oauth.tokens', params: { accessToken: data.accessToken, token_id: data.token.id } });
}
},
cancelGeneration: function() {
this.$router.push({ name: 'settings.oauth' });
this.$router.push({ name: 'settings.oauth.tokens' });
},
},

View File

@ -1,6 +1,6 @@
<template>
<div>
<setting-tabs :activeTab="'settings.webauthn'"></setting-tabs>
<setting-tabs :activeTab="'settings.webauthn.devices'"></setting-tabs>
<div class="options-tabs">
<form-wrapper>
<div v-if="isRemoteUser" class="notification is-warning has-text-centered" v-html="$t('auth.auth_handled_by_proxy')" />

View File

@ -0,0 +1,47 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Titles Language Lines
|--------------------------------------------------------------------------
|
*/
'start' => 'New account',
'capture' => 'Flash QR',
'accounts' => 'Accounts',
'createAccount' => 'Create account',
'importAccounts' => 'Import accounts',
'editAccount' => 'Account edit',
'showQRcode' => 'Account as QR code',
'groups' => 'Groups',
'createGroup' => 'Create group',
'editGroup' => 'Group edit',
'settings' => [
'options' => 'Options',
'account' => 'User account',
'oauth' => [
'tokens' => 'OAuth tokens',
'generatePAT' => 'New personal token',
],
'webauthn' => [
'editCredential' => 'Device edit',
'devices' => 'WebAuthn devices',
],
],
'login' => 'Login',
'register' => 'Register',
'password' => [
'request' => 'Reset password',
'reset' => 'New password',
],
'webauthn' => [
'lost' => 'Account recovery',
'recover' => 'Register a new device',
],
'flooded' => 'Flood',
'genericError' => 'Error',
'404' => 'Item not found',
];