Skip to content

Commit 50b6d98

Browse files
committed
initial checkin for layout help
1 parent 197fd3c commit 50b6d98

File tree

7 files changed

+385
-114
lines changed

7 files changed

+385
-114
lines changed

electron/app/js/witInspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function getInspectEnvironment(javaHome, options, httpsProxyUrl, bypassProxyHost
6464
}
6565

6666
function getImageToolInspectArgs(imageTag, options) {
67-
const args = [ 'inspect', `--image=${imageTag}`, '--format=JSON' ];
67+
const args = [ 'inspect', `--image=${imageTag}`, '--patches', '--format=JSON' ];
6868
if ('buildEngine' in options && options.buildEngine) {
6969
args.push(`--builder=${options['buildEngine']}`);
7070
}

electron/app/locales/en/webui.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,21 @@
817817
"wit-inspect-results-java-message": "Inspection of image {{imageTag}} found {{javaMessage}}.",
818818
"wit-inspector-empty-contents-message": "Inspection of image {{imageTag}} did not find Java or Oracle Fusion Middleware installations",
819819

820+
"inspect-dialog-default-title": "Image Contents",
821+
"inspect-dialog-default-message": "Unknown image contents",
822+
"inspect-dialog-os-section-title": "Operating System:",
823+
"inspect-dialog-os-name-label": "Name:",
824+
"inspect-dialog-os-version-label": "Version:",
825+
"inspect-dialog-java-home-section-title": "Java Development Kit:",
826+
"inspect-dialog-java-home-path-label": "Location:",
827+
"inspect-dialog-java-home-version-label": "Version:",
828+
"inspect-dialog-oracle-home-section-title": "Oracle Fusion Middleware:",
829+
"inspect-dialog-oracle-home-path-label": "Location:",
830+
"inspect-dialog-oracle-home-version-label": "Version:",
831+
"inspect-dialog-opatch-version-label": "OPatch Version:",
832+
"inspect-dialog-oracle-patches-section-title": "Oracle Patches Found:",
833+
"inspect-dialog-oracle-one-off-patches-label": "One-Off Patches:",
834+
820835
"wit-creator-image-not-create-message": "The Create New Primary Image option is off so there is nothing to do.",
821836
"wit-creator-aborted-error-title": "Create Image Aborted",
822837
"wit-creator-invalid-java-home-error-prefix": "Unable to create image due to the Java Home being invalid",
@@ -1121,7 +1136,6 @@
11211136
"flow-getting-k8s-domain-status-in-progress": "Getting domain {{domain}} status",
11221137
"flow-checking-operator-version-in-progress": "Checking operator version",
11231138

1124-
11251139
"add-archive-file-title": "Add Archive File",
11261140
"add-archive-file-replace-message": "This will replace the existing archive, continue?",
11271141
"add-model-file-title": "Add Model File",

webui/src/js/utils/wit-inspector.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ define(['utils/wit-actions-base', 'models/wkt-project', 'utils/i18n', 'utils/pro
8888
this.project.image.setBaseImageContents(inspectResults.contents);
8989
const title = i18n.t('wit-inspector-inspect-complete-title');
9090
const message = this.getInspectSuccessMessage(baseImageTag, inspectResults.contents);
91-
await window.api.ipc.invoke('show-info-message', title, message);
91+
const dialogOptions = {
92+
title: title,
93+
message: message,
94+
contents: inspectResults.contents
95+
};
96+
dialogHelper.openDialog('inspect-dialog', dialogOptions);
9297
return Promise.resolve(true);
9398
} else {
9499
errTitle = i18n.t('wit-inspector-inspect-failed-title');

webui/src/js/viewModels/image-design-view-impl.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ define(['utils/wkt-logger'],
210210
return !this.project.image.baseImageContentsIncludesMiddleware();
211211
};
212212

213+
this.needsInstallers = () => {
214+
215+
};
216+
213217
this.chooseJDK = () => {
214218
window.api.ipc.invoke('get-jdk-installer-location')
215219
.then(jdkInstaller => {
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/**
2+
* @license
3+
* Copyright (c) 2021, Oracle and/or its affiliates.
4+
* Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
*/
6+
'use strict';
7+
8+
define(['accUtils', 'knockout', 'utils/i18n', 'utils/view-helper', 'ojs/ojarraydataprovider', 'ojs/ojknockout',
9+
'ojs/ojinputtext', 'ojs/ojlabel', 'ojs/ojbutton', 'ojs/ojdialog', 'ojs/ojformlayout' ],
10+
function(accUtils, ko, i18n, viewHelper) {
11+
function InspectDialogModel(config) {
12+
const DIALOG_SELECTOR = '#wktInspectDialog';
13+
14+
this.connected = () => {
15+
accUtils.announce('Validation Error dialog loaded.', 'assertive');
16+
17+
this.dialogContainer = $(DIALOG_SELECTOR)[0];
18+
19+
// open the dialog when the container is ready.
20+
// using oj-dialog initial-visibility="show" causes vertical centering issues.
21+
viewHelper.componentReady(this.dialogContainer).then(() => {
22+
this.dialogContainer.open();
23+
});
24+
};
25+
26+
this.labelMapper = (labelId, payload) => {
27+
return i18n.t(`inspect-dialog-${labelId}`, payload);
28+
};
29+
30+
this.i18n = i18n;
31+
this.config = config;
32+
this.contents = config.contents;
33+
34+
this.getTitle = () => {
35+
return this.config.title || this.labelMapper('default-title');
36+
};
37+
38+
this.getMessage = () => {
39+
return this.config.message || this.labelMapper('default-message');
40+
};
41+
42+
this.hasOsInfo = () => {
43+
return !!this.contents.os && !!this.contents.os.name && !!this.contents.os.version;
44+
};
45+
46+
this.getOsName = () => {
47+
return this.contents.os.name;
48+
};
49+
50+
this.getOsVersion = () => {
51+
return this.contents.os.version;
52+
};
53+
54+
this.hasJavaHome = () => {
55+
return !!this.contents.javaHome;
56+
};
57+
58+
this.getJavaHome = () => {
59+
return this.contents.javaHome;
60+
};
61+
62+
this.getJavaVersion = () => {
63+
return this.contents.javaVersion;
64+
};
65+
66+
this.hasOracleHome = () => {
67+
return !!this.contents.oracleHome;
68+
};
69+
70+
this.getOracleHome = () => {
71+
return this.contents.oracleHome;
72+
};
73+
74+
this.getWlsVersion = () => {
75+
return this.contents.wlsVersion;
76+
};
77+
78+
this.getOpatchVersion = () => {
79+
return this.contents.opatchVersion;
80+
};
81+
82+
this.hasOraclePatches = () => {
83+
return !!this.contents.oraclePatches && this.contents.oraclePatches.length > 0;
84+
};
85+
86+
this.patches = { };
87+
88+
this.buildPatchesData = () => {
89+
const namedPatches = [ ];
90+
const oneOffPatches = [ ];
91+
92+
if (this.hasOraclePatches()) {
93+
this.contents.oraclePatches.forEach(patch => {
94+
if (patch.description.toLowerCase() === 'one-off') {
95+
oneOffPatches.push({ number: patch.patch });
96+
} else {
97+
namedPatches.push({ name: patch.description, number: patch.patch });
98+
}
99+
});
100+
if (namedPatches.length > 0) {
101+
this.patches['namedPatches'] = namedPatches;
102+
}
103+
if (oneOffPatches.length > 0) {
104+
this.patches['oneOffPatches'] = oneOffPatches;
105+
}
106+
}
107+
};
108+
109+
this.hasNamedPatches = () => {
110+
return !!this.patches.namedPatches;
111+
};
112+
113+
this.hasOneOffPatches = () => {
114+
return !!this.patches.oneOffPatches;
115+
};
116+
117+
this.getNamedPatches = () => {
118+
return this.patches.namedPatches;
119+
};
120+
121+
this.getOneOffPatches = () => {
122+
return this.patches.oneOffPatches;
123+
};
124+
125+
this.dismissDialog = () => {
126+
const dialog = this.dialogContainer;
127+
if (dialog) {
128+
dialog.close();
129+
}
130+
};
131+
132+
this.buildPatchesData();
133+
}
134+
135+
return InspectDialogModel;
136+
});

0 commit comments

Comments
 (0)