🎨 Enhance authentication UI with provider-specific status indicators and dynamic connection checks
This commit is contained in:
@@ -21,7 +21,16 @@
|
||||
<p>
|
||||
Manage authentication for Challonge, Discord, and other platforms
|
||||
</p>
|
||||
<span v-if="isKeyStored" class="badge">Active</span>
|
||||
<div v-if="hasAnyAuth" class="auth-indicators">
|
||||
<div v-if="hasChallongeAuth" class="provider-indicator" title="Challonge Connected">
|
||||
🏆
|
||||
<span class="status-dot connected"></span>
|
||||
</div>
|
||||
<div v-if="hasDiscordAuth" class="provider-indicator" title="Discord Connected">
|
||||
🎮
|
||||
<span class="status-dot connected"></span>
|
||||
</div>
|
||||
</div>
|
||||
</router-link>
|
||||
|
||||
<router-link to="/gamemaster" class="tool-card">
|
||||
@@ -65,11 +74,31 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import ProfessorPokeball from '../components/shared/ProfessorPokeball.vue';
|
||||
import { useChallongeApiKey } from '../composables/useChallongeApiKey.js';
|
||||
import { useChallongeOAuth } from '../composables/useChallongeOAuth.js';
|
||||
import { useDiscordOAuth } from '../composables/useDiscordOAuth.js';
|
||||
|
||||
// Get API key status for badge display
|
||||
// Get auth status for all providers
|
||||
const { isKeyStored } = useChallongeApiKey();
|
||||
const challongeOAuth = useChallongeOAuth();
|
||||
const discordOAuth = useDiscordOAuth();
|
||||
|
||||
// Check if any Challonge auth method is active
|
||||
const hasChallongeAuth = computed(() => {
|
||||
return isKeyStored.value || challongeOAuth.isAuthenticated.value;
|
||||
});
|
||||
|
||||
// Check if Discord is connected
|
||||
const hasDiscordAuth = computed(() => {
|
||||
return discordOAuth.hasDiscordAuth.value;
|
||||
});
|
||||
|
||||
// Show indicators if any auth is active
|
||||
const hasAnyAuth = computed(() => {
|
||||
return hasChallongeAuth.value || hasDiscordAuth.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -196,6 +225,53 @@ h1 {
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.auth-indicators {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.provider-indicator {
|
||||
position: relative;
|
||||
font-size: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 8px;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
right: -2px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid white;
|
||||
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.status-dot.connected {
|
||||
background: #10b981;
|
||||
box-shadow: 0 0 6px #10b981;
|
||||
animation: pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
background: #f0f0f0;
|
||||
padding: 15px;
|
||||
|
||||
Reference in New Issue
Block a user