Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI to Upload Pax for Offline Zowe Install #30

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Copyright Contributors to the Zowe Project.
*/

import { app, BrowserWindow, dialog, ipcMain } from 'electron';
import { app, BrowserWindow, ipcMain, dialog } from 'electron';
import MenuBuilder from './menu';
import { HomeActions } from "../actions/HomeActions";
import { ConnectionActions } from "../actions/ConnectionActions";
Expand Down Expand Up @@ -54,6 +54,12 @@ const createWindow = (): void => {
return res;
});

ipcMain.handle('upload-pax', async (event) => {
return await dialog.showOpenDialog({ properties: ['openFile'], filters: [
{ name: 'pax', extensions: ['pax'] },
] });
});

ipcMain.handle('get-installation-history', (event) => {
const res: IResponse = HomeActions.findPreviousInstallations();
return res;
Expand Down
15 changes: 14 additions & 1 deletion src/renderer/components/stages/installation/Installation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Installation = () => {
const setupSchema = schema.properties.zowe.properties.setup.properties.dataset;
const [setupYaml, setSetupYaml] = useState(yaml.zowe.setup.dataset);
const [showProgress, toggleProgress] = useState(false);
const [paxPath, setPaxPath] = useState("No pax file selected.");
const [installationProgress, setInstallationProgress] = useState({
uploadYaml: false,
download: false,
Expand Down Expand Up @@ -110,11 +111,23 @@ const Installation = () => {

return (
<ContainerCard title="Installation" description="Provide installation details">
<Typography id="position-2" sx={{ mb: 1, whiteSpace: 'pre-wrap' }} color="text.secondary">
<Typography id="position-2" sx={{ mb: 1, whiteSpace: 'pre-wrap' }} color="text.secondary">
{`Ready to download Zowe ${version} and deploy it to the ${installationArgs.installationDir}

Then we will install MVS data sets, please provide HLQ below`}
</Typography>
<Button sx={{boxShadow: 'none', mr: '12px'}} type="submit" variant="text" onClick={e => {
window.electron.ipcRenderer.uploadPax().then((res: any) => {
if(res.filePaths && res.filePaths[0] != undefined){
setPaxPath(res.filePaths[0]);
} else {
setPaxPath("No pax file selected.");
}
});
}}>Upload PAX</Button>
<Typography id="position-2" sx={{ mb: 1, whiteSpace: 'pre-wrap' }} color="text.secondary">
{`${paxPath}`}
</Typography>
<Box sx={{ padding: '24px 0'}} ref={inputRef} onClick={handleInputFocus}>
<JsonForm schema={setupSchema} initialdata={setupYaml} onChange={editHLQ}/>
</Box>
Expand Down
Loading