|
48 | 48 | item-title="label" |
49 | 49 | item-value="key" |
50 | 50 | v-model="instanceName" |
| 51 | + :disabled="environments.length <= 1" |
51 | 52 | /> |
52 | 53 | <i> |
53 | 54 | By logging in, you are agreeing to our |
@@ -87,18 +88,28 @@ import { useAuthStore } from "../stores/loginAuth"; |
87 | 88 | import PrivacyPolicy from "../components/PrivacyPolicy.vue"; |
88 | 89 | import config from "../config"; |
89 | 90 |
|
| 91 | +const router = useRouter(); |
| 92 | +const auth = useAuthStore(); |
| 93 | +
|
| 94 | +const availableInstances = import.meta.env.VITE_AVAILABLE_INSTANCES?.split(','); |
| 95 | +const environments = Object.keys(config.environments) |
| 96 | + .filter((key) => { |
| 97 | + if (availableInstances?.length) { |
| 98 | + return availableInstances.includes(key); |
| 99 | + } |
| 100 | + return true; |
| 101 | + }) |
| 102 | + .map((key) => ({ |
| 103 | + key, |
| 104 | + ...config.environments[key], |
| 105 | + })); |
| 106 | +
|
90 | 107 | const userName = ref(""); |
91 | 108 | const tokenString = ref(""); |
92 | 109 | const org = ref(""); |
93 | | -const instanceName = ref(null); |
94 | | -const router = useRouter(); |
95 | | -const auth = useAuthStore(); |
| 110 | +const instanceName = ref(availableInstances?.length > 1 ? null : environments[0]); |
96 | 111 | const authError = ref(false); |
97 | 112 | const showPrivacy = ref(false); |
98 | | -const environments = Object.keys(config.environments).map((key) => ({ |
99 | | - key, |
100 | | - ...config.environments[key], |
101 | | -})); |
102 | 113 |
|
103 | 114 | const submit = async () => { |
104 | 115 | const success = await auth.login( |
|
0 commit comments