mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-17 10:14:08 +00:00
build passes Create all missing components (modals, dropdowns, icons, tabs, mail drivers, customer partials), fix all @/scripts/ imports to @v2/, wire up vite entry point and blade template. 382 files, 48883 lines. - 27 settings components: modals (tax, payment, custom field, note, category, role, exchange rate, unit, mail test), dropdowns (6), customization tabs (4), mail driver forms (4) - 22 icon components: 5 utility icons, 4 dashboard icons, 13 editor toolbar icons with typed barrel export - 3 customer components: info, chart placeholder, custom fields single - Fixed usePopper composable, client/format-money import patterns - Zero remaining @/scripts/ imports in scripts-v2/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.2 KiB
Vue
45 lines
1.2 KiB
Vue
<template>
|
|
<div
|
|
v-if="isImpersonating"
|
|
class="fixed top-0 left-0 right-0 z-50 flex items-center justify-center px-4 py-2 text-sm font-medium text-white bg-orange-600"
|
|
>
|
|
<BaseIcon name="ExclamationTriangleIcon" class="w-4 h-4 mr-2" />
|
|
<span>{{ $t('administration.users.impersonating_banner') }}</span>
|
|
<button
|
|
class="ml-4 px-3 py-1 text-xs font-semibold text-orange-600 bg-white rounded hover:bg-orange-50"
|
|
:disabled="isStopping"
|
|
@click="stopImpersonating"
|
|
>
|
|
{{ $t('administration.users.stop_impersonating') }}
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed, ref } from 'vue'
|
|
import * as ls from '@v2/utils/local-storage'
|
|
import { client } from '@v2/api/client'
|
|
import { API } from '@v2/api/endpoints'
|
|
|
|
const isStopping = ref<boolean>(false)
|
|
|
|
const isImpersonating = computed<boolean>(() => {
|
|
return ls.get<string>('admin.impersonating') === 'true'
|
|
})
|
|
|
|
async function stopImpersonating(): Promise<void> {
|
|
isStopping.value = true
|
|
|
|
try {
|
|
await client.post(API.SUPER_ADMIN_STOP_IMPERSONATING)
|
|
} catch {
|
|
// Token already cleaned up in store action
|
|
}
|
|
|
|
ls.remove('admin.impersonating')
|
|
ls.remove('auth.token')
|
|
|
|
window.location.href = '/admin/administration/users'
|
|
}
|
|
</script>
|