@@ -16,7 +16,7 @@ import { useRecTreeStore } from '@/stores/recTreeStore'
1616import { useRoute } from ' vue-router'
1717import SrClearCache from ' @/components/SrClearCache.vue'
1818import { useSysConfigStore } from ' @/stores/sysConfigStore'
19- import { useJwtStore } from ' @/stores/SrJWTStore '
19+ import { useLegacyJwtStore } from ' @/stores/SrLegacyJwtStore '
2020import { useAuthDialogStore } from ' @/stores/authDialogStore'
2121import { useGoogleApiKeyStore } from ' @/stores/googleApiKeyStore'
2222import SrJsonDisplayDialog from ' @/components/SrJsonDisplayDialog.vue'
@@ -30,6 +30,8 @@ import { useTourStore } from '@/stores/tourStore.js'
3030import { useViewportHeight } from ' @/composables/useViewportHeight'
3131import { useSlideruleDefaults } from ' @/stores/defaultsStore'
3232import { createLogger } from ' @/utils/logger'
33+ import { usePrivacyConsentStore } from ' @/stores/privacyConsentStore'
34+ import SrConsentBanner from ' @/components/SrConsentBanner.vue'
3335
3436const logger = createLogger (' App' )
3537
@@ -39,9 +41,10 @@ const toast = useToast()
3941const deviceStore = useDeviceStore ()
4042const tourStore = useTourStore ()
4143const sysConfigStore = useSysConfigStore ()
42- const jwtStore = useJwtStore ()
44+ const legacyJwtStore = useLegacyJwtStore ()
4345const authDialogStore = useAuthDialogStore ()
4446const googleApiKeyStore = useGoogleApiKeyStore ()
47+ const privacyConsentStore = usePrivacyConsentStore ()
4548const route = useRoute ()
4649
4750// Global login dialog state
@@ -66,16 +69,16 @@ const checkUnsupported = () => {
6669}
6770
6871const checkPrivateClusterAuth = () => {
69- const domain = sysConfigStore .getDomain ()
70- const org = sysConfigStore .getOrganization ()
72+ const domain = sysConfigStore .domain
73+ const org = sysConfigStore .cluster
7174
7275 // Skip check for public cluster
7376 if (org === ' sliderule' ) {
7477 return
7578 }
7679
7780 // Check if user has valid credentials for this private cluster
78- const jwt = jwtStore .getCredentials ()
81+ const jwt = legacyJwtStore .getCredentials ()
7982 if (! jwt ) {
8083 toast .add ({
8184 severity: ' warn' ,
@@ -89,10 +92,10 @@ const checkPrivateClusterAuth = () => {
8992}
9093
9194async function fetchOrgInfo(): Promise <void > {
92- const psHost = ` https://ps.${sysConfigStore .getDomain () } `
95+ const psHost = ` https://ps.${sysConfigStore .domain } `
9396 try {
9497 const response = await authenticatedFetch (
95- ` ${psHost }/api/org_num_nodes/${sysConfigStore .getOrganization () }/ ` ,
98+ ` ${psHost }/api/org_num_nodes/${sysConfigStore .cluster }/ ` ,
9699 {
97100 method: ' GET' ,
98101 headers: {
@@ -105,10 +108,10 @@ async function fetchOrgInfo(): Promise<void> {
105108 if (response .ok ) {
106109 const result = await response .json ()
107110 logger .debug (' fetchOrgInfo result' , { result })
108- sysConfigStore .setMinNodes ( result .min_nodes )
109- sysConfigStore .setCurrentNodes ( result .current_nodes )
110- sysConfigStore .setMaxNodes ( result .max_nodes )
111- sysConfigStore .setVersion ( result .version )
111+ sysConfigStore .min_nodes = result .min_nodes
112+ sysConfigStore .current_nodes = result .current_nodes
113+ sysConfigStore .max_nodes = result .max_nodes
114+ sysConfigStore .version = result .version
112115 } else {
113116 logger .error (' Failed to fetch org info' , { status: response .status })
114117 }
@@ -120,8 +123,8 @@ async function fetchOrgInfo(): Promise<void> {
120123}
121124
122125async function handleGlobalLogin(): Promise <void > {
123- const orgName = sysConfigStore .getOrganization ()
124- const psHost = ` https://ps.${sysConfigStore .getDomain () } `
126+ const orgName = sysConfigStore .cluster
127+ const psHost = ` https://ps.${sysConfigStore .domain } `
125128 logger .debug (' handleGlobalLogin' , { username: loginUsername .value , orgName })
126129
127130 const body = JSON .stringify ({
@@ -145,7 +148,7 @@ async function handleGlobalLogin(): Promise<void> {
145148 refreshToken: result .refresh ,
146149 expiration: result .expiration
147150 }
148- jwtStore .setJwt (sysConfigStore .getDomain () , sysConfigStore .getOrganization () , jwt )
151+ legacyJwtStore .setJwt (sysConfigStore .domain , sysConfigStore .cluster , jwt )
149152 await fetchOrgInfo ()
150153 toast .add ({
151154 severity: ' success' ,
@@ -180,7 +183,7 @@ async function handleGlobalLogin(): Promise<void> {
180183}
181184
182185async function resetToPublicCluster() {
183- jwtStore .clearAllJwts ()
186+ legacyJwtStore .clearAllJwts ()
184187 sysConfigStore .$reset ()
185188 loginUsername .value = ' '
186189 loginPassword .value = ' '
@@ -348,6 +351,7 @@ onMounted(async () => {
348351 checkUnsupported ()
349352 checkPrivateClusterAuth ()
350353 tourStore .checkSeen ()
354+ privacyConsentStore .initializeOnStartup ()
351355 await nextTick ()
352356
353357 if (! tourStore .hasSeenIntro ) {
@@ -694,6 +698,7 @@ async function handleLongTourButtonClick() {
694698 <div class =" sliderule-content" >
695699 <RouterView />
696700 </div >
701+ <SrConsentBanner />
697702
698703 <!-- Dialog for displaying version information -->
699704 <Dialog
@@ -834,7 +839,7 @@ async function handleLongTourButtonClick() {
834839 >
835840 <form class =" sr-global-login-form" @submit.prevent =" handleGlobalLogin" >
836841 <p class =" sr-login-org-info" >
837- Logging in to: <strong >{{ sysConfigStore.getOrganization() }}</strong >
842+ Logging in to: <strong >{{ sysConfigStore.cluster }}</strong >
838843 </p >
839844 <div class =" sr-login-field" >
840845 <label for =" global-username" >Username</label >
0 commit comments