Merge pull request 'Add button to copy current token' (!130) from 6098_lilium_token_copy into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #130
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Javier Segarra 2024-01-02 09:21:30 +00:00
commit 1b5fd42b96
1 changed files with 12 additions and 1 deletions

View File

@ -81,6 +81,10 @@ function logout() {
session.destroy(); session.destroy();
router.push('/login'); router.push('/login');
} }
function copyUserToken(){
navigator.clipboard.writeText(session.getToken());
}
</script> </script>
<template> <template>
@ -122,7 +126,8 @@ function logout() {
<div class="text-subtitle1 q-mt-md"> <div class="text-subtitle1 q-mt-md">
<strong>{{ user.nickname }}</strong> <strong>{{ user.nickname }}</strong>
</div> </div>
<div class="text-subtitle3 text-grey-7 q-mb-xs">@{{ user.name }}</div> <div class="text-subtitle3 text-grey-7 q-mb-xs copyUserToken" @click="copyUserToken()" >@{{ user.name }}
</div>
<QBtn <QBtn
id="logout" id="logout"
@ -143,4 +148,10 @@ function logout() {
.panel { .panel {
width: 150px; width: 150px;
} }
.copyUserToken {
&:hover{
cursor: alias;
}
}
</style> </style>