diff --git a/esp/src/src-react/components/Menu.tsx b/esp/src/src-react/components/Menu.tsx index 382df996894..1e34430c628 100644 --- a/esp/src/src-react/components/Menu.tsx +++ b/esp/src/src-react/components/Menu.tsx @@ -162,6 +162,7 @@ const subMenuItems: SubMenuItems = { { headerText: nlsHPCC.Security + " (L)", itemKey: "/topology/security" }, { headerText: nlsHPCC.DESDL + " (L)", itemKey: "/topology/desdl" }, { headerText: nlsHPCC.DaliAdmin, itemKey: "/topology/daliadmin" }, + { headerText: nlsHPCC.Sasha, itemKey: "/topology/sasha" }, ], "operations": [ { headerText: nlsHPCC.Topology + " (L)", itemKey: "/operations" }, diff --git a/esp/src/src-react/components/Sasha.tsx b/esp/src/src-react/components/Sasha.tsx new file mode 100644 index 00000000000..14bc8f3e17c --- /dev/null +++ b/esp/src/src-react/components/Sasha.tsx @@ -0,0 +1,88 @@ +import React, { useState } from "react"; + +interface SashaProps {} + +export const Sasha: React.FunctionComponent = ({ }) => { + const [selectedOption, setSelectedOption] = useState(""); + const [wuid, setWuid] = useState(""); + const [result, setResult] = useState(""); + + const handleOptionChange = (e: React.ChangeEvent) => { + setSelectedOption(e.target.value); + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + // Perform action based on selected option + switch (selectedOption) { + case "getVersion": + // Implement getVersion function call + break; + case "getLastServerMessage": + // Implement getLastServerMessage function call + break; + case "restoreECLWorkUnit": + // Implement restoreECLWorkUnit function call + break; + case "restoreDFUWorkUnit": + // Implement restoreDFUWorkUnit function call + break; + case "archiveECLWorkUnit": + // Implement archiveECLWorkUnit function call + break; + case "archiveDFUWorkUnit": + // Implement archiveDFUWorkUnit function call + break; + case "backupECLWorkUnit": + // Implement backupECLWorkUnit function call + break; + case "backupDFUWorkUnit": + // Implement backupDFUWorkUnit function call + break; + default: + console.log("Invalid option selected"); + } + // Reset form + setSelectedOption(""); + setWuid(""); + setResult(""); + }; + + // Conditional rendering for default value + const defaultValue = result ? null :
No data available
; + + return ( +
+
+ + {["restoreECLWorkUnit", "restoreDFUWorkUnit", "archiveECLWorkUnit", "archiveDFUWorkUnit", "backupECLWorkUnit", "backupDFUWorkUnit"].includes(selectedOption) && ( +
+ + setWuid(e.target.value)} + /> +
+ )} + + {/* Render defaultValue when result is empty */} + {defaultValue} + {/* Render result when available */} + {result &&
Result: {result}
} +
+
+ ); +}; + +export default Sasha; \ No newline at end of file diff --git a/esp/src/src-react/routes.tsx b/esp/src/src-react/routes.tsx index d5e36af6746..ca3f91ad786 100644 --- a/esp/src/src-react/routes.tsx +++ b/esp/src/src-react/routes.tsx @@ -390,6 +390,11 @@ export const routes: RoutesEx = [ }, ] }, + { + path: "/sasha", action: (ctx, params) => import("./components/Sasha").then(_ => { + return <_.Sasha />; + }) + }, ] }, { diff --git a/esp/src/src/nls/hpcc.ts b/esp/src/src/nls/hpcc.ts index c000f4b115e..ad4fafa93c8 100644 --- a/esp/src/src/nls/hpcc.ts +++ b/esp/src/src/nls/hpcc.ts @@ -820,6 +820,7 @@ export = { Sample: "Sample", SampleRequest: "Sample Request", SampleResponse: "Sample Response", + Sasha: "Sasha", Save: "Save", Scope: "Scope", SearchResults: "Search Results",