mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 19:01:28 +00:00
Compare commits
3 Commits
solution22
...
postgres_q
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af5fd699f9 | ||
|
|
d78610cd33 | ||
|
|
bc99ca372b |
@@ -185,7 +185,7 @@ export default class Explorer {
|
|||||||
useNotebook.getState().setNotebookBasePath(userContext.features.notebookBasePath);
|
useNotebook.getState().setNotebookBasePath(userContext.features.notebookBasePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userContext.features.enablePGQuickstart || userContext.apiType !== "Postgres") {
|
if (userContext.apiType !== "Postgres") {
|
||||||
this.refreshExplorer();
|
this.refreshExplorer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
|
|||||||
const buttons = useCommandBar((state) => state.contextButtons);
|
const buttons = useCommandBar((state) => state.contextButtons);
|
||||||
const backgroundColor = StyleConstants.BaseLight;
|
const backgroundColor = StyleConstants.BaseLight;
|
||||||
|
|
||||||
if (userContext.features.enablePGQuickstart && userContext.apiType === "Postgres") {
|
if (userContext.apiType === "Postgres") {
|
||||||
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container);
|
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container);
|
||||||
return (
|
return (
|
||||||
<div className="commandBarContainer">
|
<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
|
<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
|
instructions on the right to enter your password
|
||||||
</Text>
|
</Text>
|
||||||
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "60%" }} />
|
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "80%" }} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem
|
<PivotItem
|
||||||
|
|||||||
@@ -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