Skip to content

Commit fc964e1

Browse files
Merge pull request #61 from oracle/inspect-details
Inspect details
2 parents 9b3b111 + 6bad975 commit fc964e1

File tree

13 files changed

+419
-173
lines changed

13 files changed

+419
-173
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: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,25 @@
809809
"wit-inspector-inspect-failed-title": "Inspect Image Failed",
810810
"wit-inspector-inspect-failed-error-message":"Unable to inspect image {{imageTag}}: {{error}}.",
811811
"wit-inspector-inspect-catch-all-error-message": "Inspect Image failed with an unexpected error: {{error}}",
812-
"wit-inspector-fmw-version-message": "Oracle Fusion Middleware {{version}} installed at {{path}}",
813-
"wit-inspector-fmw-message": "Oracle Fusion Middleware installed at {{path}}",
814-
"wit-inspector-java-version-message": "Java {{version}} installed at {{path}}",
815-
"wit-inspector-java-message": "Java installed at {{path}}",
816-
"wit-inspect-results-fmw-message": "Inspection of image {{imageTag}} found {{javaMessage}} and {{fmwMessage}}.",
817-
"wit-inspect-results-java-message": "Inspection of image {{imageTag}} found {{javaMessage}}.",
812+
"wit-inspect-results-fmw-message": "Inspection of image {{imageTag}} found both Java and Oracle Fusion Middleware installations.",
813+
"wit-inspect-results-java-message": "Inspection of image {{imageTag}} found a Java installation.",
818814
"wit-inspector-empty-contents-message": "Inspection of image {{imageTag}} did not find Java or Oracle Fusion Middleware installations",
819815

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

1124-
11251135
"add-archive-file-title": "Add Archive File",
11261136
"add-archive-file-replace-message": "This will replace the existing archive, continue?",
11271137
"add-model-file-title": "Add Model File",

webui/src/css/app.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,41 @@ h6:first-child {
406406
max-width: 850px;
407407
}
408408

409+
.wkt-inspect-grid-container {
410+
display: grid;
411+
grid-column-gap: 1em;
412+
grid-auto-columns: min-content auto;
413+
}
414+
415+
.wkt-inspect-grid-message {
416+
grid-column-start: 1;
417+
grid-column-end: 3;
418+
}
419+
420+
.wkt-inspect-grid-title {
421+
font-weight: bold;
422+
margin-top: 0.75em;
423+
grid-column-start: 1;
424+
grid-column-end: 3;
425+
}
426+
427+
.wkt-inspect-grid-name {
428+
margin-left: 1em;
429+
grid-column-start: 1;
430+
grid-column-end: 1;
431+
white-space: nowrap;
432+
}
433+
434+
.wkt-inspect-grid-value {
435+
grid-column-start: 2;
436+
grid-column-end: 3;
437+
}
438+
439+
.wkt-inspect-dialog-content {
440+
max-height: 50vh;
441+
overflow: auto;
442+
}
443+
409444
.wkt-center-text-in-frame {
410445
vertical-align: center;
411446
text-align: center;

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

Lines changed: 13 additions & 32 deletions
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');
@@ -137,39 +142,15 @@ define(['utils/wit-actions-base', 'models/wkt-project', 'utils/i18n', 'utils/pro
137142
}
138143

139144
getInspectSuccessMessage(imageTag, imageContents) {
140-
const hasJdk = 'javaHome' in imageContents;
141-
const jdkPath = imageContents.javaHome;
142-
const jdkVersion = imageContents.javaVersion;
143-
const hasFmw = 'oracleHome' in imageContents;
144-
const fmwPath = imageContents.oracleHome;
145-
const fmwVersion = imageContents.wlsVersion;
146-
147-
const fmwMessage = this.getMessage('wit-inspector-fmw', hasFmw, fmwPath, fmwVersion);
148-
const javaMessage = this.getMessage('wit-inspector-java', hasJdk, jdkPath, jdkVersion);
149-
150-
let message;
151-
if (fmwMessage) {
152-
message = i18n.t('wit-inspect-results-fmw-message',
153-
{ imageTag: imageTag, javaMessage: javaMessage, fmwMessage: fmwMessage });
154-
} else if (javaMessage) {
155-
message = i18n.t('wit-inspect-results-java-message',
156-
{ imageTag: imageTag, javaMessage: javaMessage });
145+
let key;
146+
if ('oracleHome' in imageContents) {
147+
key = 'wit-inspect-results-fmw-message';
148+
} else if ('javaHome' in imageContents) {
149+
key = 'wit-inspect-results-java-message';
157150
} else {
158-
message = i18n.t('wit-inspector-empty-contents-message', { imageTag: imageTag });
159-
}
160-
return message;
161-
}
162-
163-
getMessage(i18nPrefix, isInstalled, path, version) {
164-
let message;
165-
if (isInstalled) {
166-
if (version) {
167-
message = i18n.t(`${i18nPrefix}-version-message`, { path: path, version: version });
168-
} else {
169-
message = i18n.t(`${i18nPrefix}-message`, { path: path });
170-
}
151+
key = 'wit-inspector-empty-contents-message';
171152
}
172-
return message;
153+
return i18n.t(key, { imageTag: imageTag });
173154
}
174155
}
175156

webui/src/js/viewModels/app-main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function(accUtils, ko, i18n, project, wktConsole, dialogHelper, viewHelper, Arra
198198

199199
this.collapseArrowClass = ko.computed(() => {
200200
return this.navCollapsed() ? 'oj-ux-ico-arrow-right' : 'oj-ux-ico-arrow-left';
201-
});
201+
}, this);
202202

203203
this.collapseNav = () => {
204204
this.navCollapsed(!this.navCollapsed());

webui/src/js/viewModels/domain-design-view.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider,
3333

3434
this.isDomainInPV = ko.computed(() => {
3535
return this.project.settings.targetDomainLocation.observable() === 'pv';
36-
});
36+
}, this);
3737

3838
this.isDomainInImage = ko.computed(() => {
3939
return this.project.settings.targetDomainLocation.observable() === 'dii';
40-
});
40+
}, this);
4141

4242
this.isModelInImage = ko.computed(() => {
4343
return this.project.settings.targetDomainLocation.observable() === 'mii';
44-
});
44+
}, this);
4545

4646
// Disable JRF as the domain type since the application does not (yet?) provide the mechanisms required
4747
// to specify the JRF schemas or the database connectivity and credential information needed to run RCU.
@@ -70,7 +70,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider,
7070

7171
this.usingAuxImage = ko.computed(() => {
7272
return this.isModelInImage() && this.project.image.useAuxImage.value;
73-
});
73+
}, this);
7474

7575
this.hasNoClusters = () => {
7676
return this.project.k8sDomain.clusters.value.length === 0;

webui/src/js/viewModels/image-code-view.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ function(accUtils, ko, i18n, project, ImageScriptGenerator, ArrayDataProvider) {
4242

4343
this.disablePrimaryImageScript = ko.computed(() => {
4444
return !this.project.image.createPrimaryImage.value;
45-
});
45+
}, this);
4646

4747
this.disableAuxiliaryImageScript = ko.computed(() => {
4848
return !(this.project.settings.targetDomainLocation.value === 'mii' &&
4949
this.project.image.useAuxImage.value && this.project.image.createAuxImage.value);
50-
});
50+
}, this);
5151

5252
this.subviews = [
5353
{
@@ -69,7 +69,7 @@ function(accUtils, ko, i18n, project, ImageScriptGenerator, ArrayDataProvider) {
6969

7070
this.tabsStatus = ko.computed(() => {
7171
return this.disablePrimaryImageScript() && this.disableAuxiliaryImageScript() ? 'disabled' : 'enabled';
72-
});
72+
}, this);
7373

7474
this.codeViewScriptLanguage = ko.observable(ImageScriptGenerator.getDefaultScriptingLanguage());
7575
this.codeViewScriptLanguages = [

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ define(['utils/wkt-logger'],
6060

6161
this.disableAuxImage = ko.computed(() => {
6262
return !(this.targetDomainLocationIsMII() && this.project.image.useAuxImage.value);
63-
});
63+
}, this);
6464

6565
this.mainCreateImageSwitchHelp = ko.computed(() => {
6666
if (this.project.image.useAuxImage.value) {
6767
return this.labelMapper('create-image-aux-help');
6868
} else {
6969
return this.labelMapper('create-image-help');
7070
}
71-
});
71+
}, this);
7272

7373
this.mainImageTagHelpMII = () => {
7474
let key = 'image-tag-mii-use-help';
@@ -116,15 +116,15 @@ define(['utils/wkt-logger'],
116116
break;
117117
}
118118
return this.labelMapper(key);
119-
});
119+
}, this);
120120

121121
this.auxImageTagHelp = ko.computed(() => {
122122
if (this.project.image.createAuxImage.value) {
123123
return this.labelMapper('aux-image-tag-create-help');
124124
} else {
125125
return this.labelMapper('aux-image-tag-use-help');
126126
}
127-
});
127+
}, this);
128128

129129
this.subviews = [
130130
{id: 'fmwImage', name: this.labelMapper('image-tab')},
@@ -144,7 +144,7 @@ define(['utils/wkt-logger'],
144144
} else {
145145
return this.labelMapper('fmw-title');
146146
}
147-
});
147+
}, this);
148148

149149
this.mainImageRequiresWdt = () => {
150150
let result = false;
@@ -210,6 +210,16 @@ define(['utils/wkt-logger'],
210210
return !this.project.image.baseImageContentsIncludesMiddleware();
211211
};
212212

213+
this.needsInstallers = ko.computed(function() {
214+
let result = true;
215+
if (this.project.image.useCustomBaseImage.observable()) {
216+
if (this.project.image.baseImageContentsIncludesMiddleware()) {
217+
result = false;
218+
}
219+
}
220+
return result;
221+
}, this);
222+
213223
this.chooseJDK = () => {
214224
window.api.ipc.invoke('get-jdk-installer-location')
215225
.then(jdkInstaller => {

0 commit comments

Comments
 (0)