Skip to content

Commit

Permalink
Merge pull request #17 from jhnnsrs/with_next
Browse files Browse the repository at this point in the history
With next
  • Loading branch information
jhnnsrs committed Jan 5, 2024
2 parents 81c8ad4 + f26533e commit dbbcb1d
Show file tree
Hide file tree
Showing 57 changed files with 5,969 additions and 16 deletions.
13 changes: 13 additions & 0 deletions graphql/kluster/fragments/dask_cluster.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fragment DaskCluster on DaskCluster {
id
name
dashboardLink
}


fragment ListDaskCluster on DaskCluster {
id
name
dashboardLink
startTime
}
9 changes: 9 additions & 0 deletions graphql/kluster/mutations/dask_cluster.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation StopDaskCluster($id: ID!){
stopDaskCluster(id: $id)
}

mutation CreateNewCluster($name: String!){
createDaskCluster(input: {name: $name}){
...DaskCluster
}
}
5 changes: 5 additions & 0 deletions graphql/kluster/queries/dask_cluster.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query ListCluster {
daskClusters {
...ListDaskCluster
}
}
2 changes: 2 additions & 0 deletions graphql/mikro/fragments/model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fragment DetailModel on Model {
id
name
}
data
kind
}

Expand All @@ -15,5 +16,6 @@ fragment ListModel on Model {
id
name
}
data
kind
}
20 changes: 20 additions & 0 deletions kluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
overwrite: true
schema: "http://localhost:9010/graphql"
documents: "graphql/kluster/**/*.graphql"
generates:
src/kluster/api/fragments.ts:
plugins:
- "fragment-matcher"
src/kluster/api/graphql.ts:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
config:
withHooks: true
reactApolloVersion: 3
arrayInputCoercion: false

src/kluster/graphql.schema.json:
plugins:
- "introspection"
2 changes: 1 addition & 1 deletion mikro.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overwrite: true
schema: "http://localhost:8080/graphql"
schema: "http://localhost:8030/graphql"
documents: "graphql/mikro/**/*.graphql"
generates:
src/mikro/api/fragments.ts:
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"mikro": "graphql-codegen --config mikro.yml",
"mikro_next": "graphql-codegen --config mikro_next.yml",
"herre": "graphql-codegen --config herre.yml",
"kluster": "graphql-codegen --config kluster.yml",
"lok": "graphql-codegen --config lok.yml",
"dockbuild": "vite build && docker build -t jhnnsrs/orkestrator:release .",
"paperbuild": "vite build && docker build -t jhnnsrs/orkestrator:paper .",
Expand All @@ -31,6 +32,8 @@
"@jhnnsrs/datalayer": "0.0.7",
"@jhnnsrs/fakts": "^0.0.17",
"@jhnnsrs/herre": "0.0.11",
"@jhnnsrs/kluster": "^0.0.1",
"@jhnnsrs/omero-ark": "^0.0.1",
"@popperjs/core": "^2.11.5",
"@radix-ui/react-dialog": "^1.0.4",
"@react-spring/web": "^9.5.2",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orkestrator"
version = "0.0.4"
version = "0.0.7"
description = "your arkitekt frontend"
authors = ["you"]
license = ""
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "orkestrator",
"version": "0.0.6"
"version": "0.0.7"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 6 additions & 0 deletions src/app/AppProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { DatalayerProvider } from "@jhnnsrs/datalayer";
import { FaktsProvider } from "@jhnnsrs/fakts";
import { HerreProvider, windowRedirect } from "@jhnnsrs/herre";
import { KlusterProvider } from "@jhnnsrs/kluster";
import { OmeroArkProvider } from "@jhnnsrs/omero-ark";
import React from "react";
import { FlussProvider } from "../fluss/fluss-provider";
import { LokProvider } from "../lok/LokProvider";
Expand Down Expand Up @@ -38,11 +40,15 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
<LokProvider>
<DatalayerProvider>
<FlussProvider>
<KlusterProvider>
<PortProvider>
<MikroNextProvider>
<OmeroArkProvider>
<MikroProvider>{children}</MikroProvider>
</OmeroArkProvider>
</MikroNextProvider>
</PortProvider>
</KlusterProvider>
</FlussProvider>
</DatalayerProvider>
</LokProvider>
Expand Down
14 changes: 14 additions & 0 deletions src/app/AutoConfiguration.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { WellKnownDiscovery } from "@jhnnsrs/fakts";
import { KlusterGuard } from "@jhnnsrs/kluster";
import { OmeroArkGuard } from "@jhnnsrs/omero-ark";
import { ToastContainer, ToastContentProps, toast } from "react-toastify";
import { DatalayerAutoConfigure } from "../bridges/DatalayerAutoConfigure";
import { FlussAutoConfigure } from "../bridges/FlussAutoConfigure";
import { KlusterAutoConfigure } from "../bridges/KlusterAutoConfigure";
import { KlusterWard } from "../bridges/KlusterWard";
import { LokAutoConfigure } from "../bridges/LokAutoConfigure";
import { MikroAutoConfigure } from "../bridges/MikroAutoConfigure";
import { MikroNextAutoConfigure } from "../bridges/MikroNextAutoConfigure";
import { MikroNextWard } from "../bridges/MikroNextWard";
import { MikroWard } from "../bridges/MikroWard";
import { OmeroArkAutoConfigure } from "../bridges/OmeroArkAutoConfigure";
import { OmeroArkWard } from "../bridges/OmeroArkWard";
import { PortAutoConfigure } from "../bridges/PortAutoConfigure";
import { RekuestAutoConfigure } from "../bridges/RekuestAutoConfigure";
import { RekuestWard } from "../bridges/RekuestWard";
Expand Down Expand Up @@ -138,10 +144,18 @@ export const AutoConfiguration = () => {
<PortAutoConfigure />
<DatalayerAutoConfigure />
<LokAutoConfigure />
<OmeroArkAutoConfigure/>
<KlusterAutoConfigure/>
<FlussAutoConfigure />
<ConfirmModal />

<FlussWard />
<KlusterGuard fallback={<></>}>
<KlusterWard/>
</KlusterGuard>
<OmeroArkGuard fallback={<></>}>
<OmeroArkWard/>
</OmeroArkGuard>
<MikroNextWard />
<ToastContainer
position="bottom-right"
Expand Down
25 changes: 25 additions & 0 deletions src/bridges/KlusterAutoConfigure.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useFakts } from "@jhnnsrs/fakts";
import { useHerre } from "@jhnnsrs/herre";
import { useKluster } from "@jhnnsrs/kluster";
import React, { useEffect } from "react";
import result from "../omero-ark/api/fragments";

export const KlusterAutoConfigure: React.FC<{}> = (props) => {
const { configure } = useKluster();
const { token } = useHerre();
const { fakts } = useFakts();

useEffect(() => {
if (token && fakts.kluster) {
configure({
secure: fakts.kluster.secure,
wsEndpointUrl: fakts.kluster.ws_endpoint_url,
endpointUrl: fakts.kluster.endpoint_url,
possibleTypes: result.possibleTypes,
retrieveToken: () => token,
});
}
}, [token, fakts]);

return <> </>;
};
36 changes: 36 additions & 0 deletions src/bridges/KlusterWard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { gql } from "@apollo/client";
import { useKluster } from "@jhnnsrs/kluster";
import { useEffect } from "react";
import { useWidgetRegistry } from "../rekuest/widgets/widget-context";

export const KlusterWard: React.FC<{
key?: string;
fallback?: React.ReactNode;
}> = ({ key, fallback }) => {
const { client } = useKluster();
const { registry } = useWidgetRegistry();

useEffect(() => {
if (client && registry) {
const runFunc = (options: { query: string; variables: any }) => {
let document = gql(options.query);
return client
.query({
query: document,
variables: options.variables,
})
.then((result: any) => {
console.log(result.data);
return result.data;
});
};

registry?.registerWard(key || "kluster", {
search: runFunc,
hook: (x) => () => <div>Hallo</div>
});
}
}, [client, registry]);

return <></>;
};
25 changes: 25 additions & 0 deletions src/bridges/OmeroArkAutoConfigure.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useFakts } from "@jhnnsrs/fakts";
import { useHerre } from "@jhnnsrs/herre";
import { useOmeroArk } from "@jhnnsrs/omero-ark";
import React, { useEffect } from "react";
import result from "../omero-ark/api/fragments";

export const OmeroArkAutoConfigure: React.FC<{}> = (props) => {
const { configure } = useOmeroArk();
const { token } = useHerre();
const { fakts } = useFakts();

useEffect(() => {
if (token && fakts.omero_ark) {
configure({
secure: fakts.omero_ark.secure,
wsEndpointUrl: fakts.omero_ark.ws_endpoint_url,
endpointUrl: fakts.omero_ark.endpoint_url,
possibleTypes: result.possibleTypes,
retrieveToken: () => token,
});
}
}, [token, fakts]);

return <> </>;
};
36 changes: 36 additions & 0 deletions src/bridges/OmeroArkWard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { gql } from "@apollo/client";
import { useOmeroArk } from "@jhnnsrs/omero-ark";
import { useEffect } from "react";
import { useWidgetRegistry } from "../rekuest/widgets/widget-context";

export const OmeroArkWard: React.FC<{
key?: string;
fallback?: React.ReactNode;
}> = ({ key, fallback }) => {
const { client } = useOmeroArk();
const { registry } = useWidgetRegistry();

useEffect(() => {
if (client) {
const runFunc = (options: { query: string; variables: any }) => {
let document = gql(options.query);
return client
.query({
query: document,
variables: options.variables,
})
.then((result: any) => {
console.log(result.data);
return result.data;
});
};

registry?.registerWard(key || "omero-ark", {
search: runFunc,
hook: (x) => () => <div>Hallo</div>
});
}
}, [client, registry]);

return <></>;
};
Loading

0 comments on commit dbbcb1d

Please sign in to comment.