diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index a916e60..2533f2f 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,4 +1,5 @@ backoffice.configuration.kubernetes.api.kubeconfig=/Users/antoine/.kube/config.kubeconfig +backoffice.configuration.kubernetes.api.context=admin@kubernetes #backoffice.configuration.kubernetes.api.url=https://kubernetes.localdomain:6443 #backoffice.configuration.kubernetes.api.ca-cert=/Users/antoine/Documents/virtualization/kubeadm/ca.crt diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html index 6905ae6..ad05682 100644 --- a/src/main/resources/public/index.html +++ b/src/main/resources/public/index.html @@ -18,6 +18,7 @@ + diff --git a/src/main/resources/public/src/InputWithDebounce.js b/src/main/resources/public/src/InputWithDebounce.js new file mode 100644 index 0000000..e0dd172 --- /dev/null +++ b/src/main/resources/public/src/InputWithDebounce.js @@ -0,0 +1,20 @@ +function InputWithDebounce({value, setValue, debounce = 500}) { + const [directValue, setDirectValue] = React.useState(value); + + React.useEffect(() => { + const timeoutId = setTimeout(() => { + setValue(directValue) + }, debounce); + return () => clearTimeout(timeoutId); + }, [directValue, debounce]); + + return ( + { + setDirectValue(event.target.value); + }} + /> + ) +} diff --git a/src/main/resources/public/src/NodesComponent.js b/src/main/resources/public/src/NodesComponent.js index 38450cb..2db022b 100644 --- a/src/main/resources/public/src/NodesComponent.js +++ b/src/main/resources/public/src/NodesComponent.js @@ -9,6 +9,10 @@ function Nodes({criteria}) { .then(value => setNodes(value)); }, []); + React.useEffect(() => { + console.log(criteria); + }, [criteria]); + return (
nodes
diff --git a/src/main/resources/public/src/RootBody.js b/src/main/resources/public/src/RootBody.js index 252a1b0..455a1ed 100644 --- a/src/main/resources/public/src/RootBody.js +++ b/src/main/resources/public/src/RootBody.js @@ -1,20 +1,13 @@ 'use strict'; -function FilterInput({onChange}) { - return ( - - ) -} - function RootBody() { const [criteria, setCriteria] = React.useState("") return (
- setCriteria(e.target.value)}/> +
+
); }