Skip to content

Commit

Permalink
Copy app params
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Apr 19, 2024
1 parent e881a72 commit 17773c2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/views/admin/AdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import IrdomLayout from '@/components/IrdomLayout.vue';
import { scopename } from '@/models/ScopeName';
import { useProfileStore } from '@/store/profile';
import { useToolbar } from '@/store/toolbar';
import { onMounted, ref } from 'vue';
import { onMounted, ref, computed } from 'vue';
import { AuthApi } from '@/api/controllers/auth/AuthApi';
import { MySessionInfo } from '@/api/auth';
import { useToastStore } from '@/store/toast';
Expand Down Expand Up @@ -32,6 +32,11 @@ const copyText = (text: string) => {
});
};
const paramsString = computed(() => {
const scopes_str = profileStore.tokenScopes.join(',');
return `?token=${profileStore.token}&scopes=${scopes_str}&user_id=${profileStore.id}`;
});
onMounted(() => {
if (!profileStore.id) {
AuthApi.getMe([MySessionInfo.SessionScopes]);
Expand Down Expand Up @@ -74,9 +79,16 @@ onMounted(() => {
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
<v-btn prepend-icon="md:refresh" variant="plain" @click:abort="console.log('123')">
<v-btn
prepend-icon="md:refresh"
variant="plain"
@click="AuthApi.getMe([MySessionInfo.SessionScopes])"
>
Обновить сессию
</v-btn>
<v-btn prepend-icon="md:content_copy" variant="plain" @click="copyText(paramsString)">
Cкопировать параметры приложения
</v-btn>
</div>
<h3>Инструменты администратора</h3>
Expand Down

0 comments on commit 17773c2

Please sign in to comment.