mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-26 13:14:04 +00:00
Hardcode API type to Postgres to test Postgres quick start
This commit is contained in:
@@ -86,7 +86,7 @@ function isAccountNewerThanThresholdInMs(createdAt: string, threshold: number) {
|
|||||||
|
|
||||||
function updateUserContext(newContext: Partial<UserContext>): void {
|
function updateUserContext(newContext: Partial<UserContext>): void {
|
||||||
if (newContext.databaseAccount) {
|
if (newContext.databaseAccount) {
|
||||||
newContext.apiType = apiType(newContext.databaseAccount);
|
newContext.apiType = "Postgres";
|
||||||
|
|
||||||
const isNewAccount = isAccountNewerThanThresholdInMs(
|
const isNewAccount = isAccountNewerThanThresholdInMs(
|
||||||
newContext.databaseAccount?.systemData?.createdAt || "",
|
newContext.databaseAccount?.systemData?.createdAt || "",
|
||||||
@@ -107,34 +107,30 @@ function updateUserContext(newContext: Partial<UserContext>): void {
|
|||||||
Object.assign(userContext, newContext);
|
Object.assign(userContext, newContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiType(account: DatabaseAccount | undefined): ApiType {
|
// function apiType(account: DatabaseAccount | undefined): ApiType {
|
||||||
if (!account) {
|
// if (!account) {
|
||||||
return "SQL";
|
// return "SQL";
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (features.enablePGQuickstart) {
|
// const capabilities = account.properties?.capabilities;
|
||||||
return "Postgres";
|
// if (capabilities) {
|
||||||
}
|
// if (capabilities.find((c) => c.name === "EnableCassandra")) {
|
||||||
|
// return "Cassandra";
|
||||||
const capabilities = account.properties?.capabilities;
|
// }
|
||||||
if (capabilities) {
|
// if (capabilities.find((c) => c.name === "EnableGremlin")) {
|
||||||
if (capabilities.find((c) => c.name === "EnableCassandra")) {
|
// return "Gremlin";
|
||||||
return "Cassandra";
|
// }
|
||||||
}
|
// if (capabilities.find((c) => c.name === "EnableMongo")) {
|
||||||
if (capabilities.find((c) => c.name === "EnableGremlin")) {
|
// return "Mongo";
|
||||||
return "Gremlin";
|
// }
|
||||||
}
|
// if (capabilities.find((c) => c.name === "EnableTable")) {
|
||||||
if (capabilities.find((c) => c.name === "EnableMongo")) {
|
// return "Tables";
|
||||||
return "Mongo";
|
// }
|
||||||
}
|
// }
|
||||||
if (capabilities.find((c) => c.name === "EnableTable")) {
|
// if (account.kind === "MongoDB" || account.kind === "Parse") {
|
||||||
return "Tables";
|
// return "Mongo";
|
||||||
}
|
// }
|
||||||
}
|
// return "SQL";
|
||||||
if (account.kind === "MongoDB" || account.kind === "Parse") {
|
// }
|
||||||
return "Mongo";
|
|
||||||
}
|
|
||||||
return "SQL";
|
|
||||||
}
|
|
||||||
|
|
||||||
export { userContext, updateUserContext };
|
export { userContext, updateUserContext };
|
||||||
|
|||||||
Reference in New Issue
Block a user