mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 10:51:30 +00:00
Compare commits
3 Commits
switch_to_
...
postgres_q
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af5fd699f9 | ||
|
|
d78610cd33 | ||
|
|
bc99ca372b |
@@ -185,7 +185,7 @@ export default class Explorer {
|
||||
useNotebook.getState().setNotebookBasePath(userContext.features.notebookBasePath);
|
||||
}
|
||||
|
||||
if (!userContext.features.enablePGQuickstart || userContext.apiType !== "Postgres") {
|
||||
if (userContext.apiType !== "Postgres") {
|
||||
this.refreshExplorer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
|
||||
const buttons = useCommandBar((state) => state.contextButtons);
|
||||
const backgroundColor = StyleConstants.BaseLight;
|
||||
|
||||
if (userContext.features.enablePGQuickstart && userContext.apiType === "Postgres") {
|
||||
if (userContext.apiType === "Postgres") {
|
||||
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container);
|
||||
return (
|
||||
<div className="commandBarContainer">
|
||||
|
||||
@@ -119,7 +119,7 @@ WHERE user_id = 3861633;`;
|
||||
<br /> Before you can interact with your data using PGShell, you will need to login - please follow
|
||||
instructions on the right to enter your password
|
||||
</Text>
|
||||
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "60%" }} />
|
||||
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "80%" }} />
|
||||
</Stack>
|
||||
</PivotItem>
|
||||
<PivotItem
|
||||
|
||||
@@ -86,7 +86,7 @@ function isAccountNewerThanThresholdInMs(createdAt: string, threshold: number) {
|
||||
|
||||
function updateUserContext(newContext: Partial<UserContext>): void {
|
||||
if (newContext.databaseAccount) {
|
||||
newContext.apiType = apiType(newContext.databaseAccount);
|
||||
newContext.apiType = "Postgres";
|
||||
|
||||
const isNewAccount = isAccountNewerThanThresholdInMs(
|
||||
newContext.databaseAccount?.systemData?.createdAt || "",
|
||||
@@ -107,34 +107,30 @@ function updateUserContext(newContext: Partial<UserContext>): void {
|
||||
Object.assign(userContext, newContext);
|
||||
}
|
||||
|
||||
function apiType(account: DatabaseAccount | undefined): ApiType {
|
||||
if (!account) {
|
||||
return "SQL";
|
||||
}
|
||||
// function apiType(account: DatabaseAccount | undefined): ApiType {
|
||||
// if (!account) {
|
||||
// return "SQL";
|
||||
// }
|
||||
|
||||
if (features.enablePGQuickstart) {
|
||||
return "Postgres";
|
||||
}
|
||||
|
||||
const capabilities = account.properties?.capabilities;
|
||||
if (capabilities) {
|
||||
if (capabilities.find((c) => c.name === "EnableCassandra")) {
|
||||
return "Cassandra";
|
||||
}
|
||||
if (capabilities.find((c) => c.name === "EnableGremlin")) {
|
||||
return "Gremlin";
|
||||
}
|
||||
if (capabilities.find((c) => c.name === "EnableMongo")) {
|
||||
return "Mongo";
|
||||
}
|
||||
if (capabilities.find((c) => c.name === "EnableTable")) {
|
||||
return "Tables";
|
||||
}
|
||||
}
|
||||
if (account.kind === "MongoDB" || account.kind === "Parse") {
|
||||
return "Mongo";
|
||||
}
|
||||
return "SQL";
|
||||
}
|
||||
// const capabilities = account.properties?.capabilities;
|
||||
// if (capabilities) {
|
||||
// if (capabilities.find((c) => c.name === "EnableCassandra")) {
|
||||
// return "Cassandra";
|
||||
// }
|
||||
// if (capabilities.find((c) => c.name === "EnableGremlin")) {
|
||||
// return "Gremlin";
|
||||
// }
|
||||
// if (capabilities.find((c) => c.name === "EnableMongo")) {
|
||||
// return "Mongo";
|
||||
// }
|
||||
// if (capabilities.find((c) => c.name === "EnableTable")) {
|
||||
// return "Tables";
|
||||
// }
|
||||
// }
|
||||
// if (account.kind === "MongoDB" || account.kind === "Parse") {
|
||||
// return "Mongo";
|
||||
// }
|
||||
// return "SQL";
|
||||
// }
|
||||
|
||||
export { userContext, updateUserContext };
|
||||
|
||||
Reference in New Issue
Block a user