diff --git a/electron/app/js/witInspect.js b/electron/app/js/witInspect.js index e8eef3dbe..b7410cec9 100644 --- a/electron/app/js/witInspect.js +++ b/electron/app/js/witInspect.js @@ -64,7 +64,7 @@ function getInspectEnvironment(javaHome, options, httpsProxyUrl, bypassProxyHost } function getImageToolInspectArgs(imageTag, options) { - const args = [ 'inspect', `--image=${imageTag}`, '--format=JSON' ]; + const args = [ 'inspect', `--image=${imageTag}`, '--patches', '--format=JSON' ]; if ('buildEngine' in options && options.buildEngine) { args.push(`--builder=${options['buildEngine']}`); } diff --git a/electron/app/locales/en/webui.json b/electron/app/locales/en/webui.json index def0f9a42..569c8c9f1 100644 --- a/electron/app/locales/en/webui.json +++ b/electron/app/locales/en/webui.json @@ -809,14 +809,25 @@ "wit-inspector-inspect-failed-title": "Inspect Image Failed", "wit-inspector-inspect-failed-error-message":"Unable to inspect image {{imageTag}}: {{error}}.", "wit-inspector-inspect-catch-all-error-message": "Inspect Image failed with an unexpected error: {{error}}", - "wit-inspector-fmw-version-message": "Oracle Fusion Middleware {{version}} installed at {{path}}", - "wit-inspector-fmw-message": "Oracle Fusion Middleware installed at {{path}}", - "wit-inspector-java-version-message": "Java {{version}} installed at {{path}}", - "wit-inspector-java-message": "Java installed at {{path}}", - "wit-inspect-results-fmw-message": "Inspection of image {{imageTag}} found {{javaMessage}} and {{fmwMessage}}.", - "wit-inspect-results-java-message": "Inspection of image {{imageTag}} found {{javaMessage}}.", + "wit-inspect-results-fmw-message": "Inspection of image {{imageTag}} found both Java and Oracle Fusion Middleware installations.", + "wit-inspect-results-java-message": "Inspection of image {{imageTag}} found a Java installation.", "wit-inspector-empty-contents-message": "Inspection of image {{imageTag}} did not find Java or Oracle Fusion Middleware installations", + "inspect-dialog-default-title": "Image Contents", + "inspect-dialog-default-message": "Unknown image contents", + "inspect-dialog-os-section-title": "Operating System:", + "inspect-dialog-os-name-label": "Name:", + "inspect-dialog-os-version-label": "Version:", + "inspect-dialog-java-home-section-title": "Java Development Kit:", + "inspect-dialog-java-home-path-label": "Location:", + "inspect-dialog-java-home-version-label": "Version:", + "inspect-dialog-oracle-home-section-title": "Oracle Fusion Middleware:", + "inspect-dialog-oracle-home-path-label": "Location:", + "inspect-dialog-oracle-home-version-label": "Version:", + "inspect-dialog-opatch-version-label": "OPatch Version:", + "inspect-dialog-oracle-patches-section-title": "Oracle Patches:", + "inspect-dialog-oracle-one-off-patches-label": "Oracle One-Off Patches:", + "wit-creator-image-not-create-message": "The Create New Primary Image option is off so there is nothing to do.", "wit-creator-aborted-error-title": "Create Image Aborted", "wit-creator-invalid-java-home-error-prefix": "Unable to create image due to the Java Home being invalid", @@ -1121,7 +1132,6 @@ "flow-getting-k8s-domain-status-in-progress": "Getting domain {{domain}} status", "flow-checking-operator-version-in-progress": "Checking operator version", - "add-archive-file-title": "Add Archive File", "add-archive-file-replace-message": "This will replace the existing archive, continue?", "add-model-file-title": "Add Model File", diff --git a/webui/src/css/app.css b/webui/src/css/app.css index 13c01f27a..8a9a85a2a 100644 --- a/webui/src/css/app.css +++ b/webui/src/css/app.css @@ -406,6 +406,41 @@ h6:first-child { max-width: 850px; } +.wkt-inspect-grid-container { + display: grid; + grid-column-gap: 1em; + grid-auto-columns: min-content auto; +} + +.wkt-inspect-grid-message { + grid-column-start: 1; + grid-column-end: 3; +} + +.wkt-inspect-grid-title { + font-weight: bold; + margin-top: 0.75em; + grid-column-start: 1; + grid-column-end: 3; +} + +.wkt-inspect-grid-name { + margin-left: 1em; + grid-column-start: 1; + grid-column-end: 1; + white-space: nowrap; +} + +.wkt-inspect-grid-value { + grid-column-start: 2; + grid-column-end: 3; +} + +.wkt-inspect-dialog-content { + max-height: 50vh; + overflow: auto; +} + .wkt-center-text-in-frame { vertical-align: center; text-align: center; diff --git a/webui/src/js/utils/wit-inspector.js b/webui/src/js/utils/wit-inspector.js index 5510342bd..68c88efef 100644 --- a/webui/src/js/utils/wit-inspector.js +++ b/webui/src/js/utils/wit-inspector.js @@ -88,7 +88,12 @@ define(['utils/wit-actions-base', 'models/wkt-project', 'utils/i18n', 'utils/pro this.project.image.setBaseImageContents(inspectResults.contents); const title = i18n.t('wit-inspector-inspect-complete-title'); const message = this.getInspectSuccessMessage(baseImageTag, inspectResults.contents); - await window.api.ipc.invoke('show-info-message', title, message); + const dialogOptions = { + title: title, + message: message, + contents: inspectResults.contents + }; + dialogHelper.openDialog('inspect-dialog', dialogOptions); return Promise.resolve(true); } else { errTitle = i18n.t('wit-inspector-inspect-failed-title'); @@ -137,39 +142,15 @@ define(['utils/wit-actions-base', 'models/wkt-project', 'utils/i18n', 'utils/pro } getInspectSuccessMessage(imageTag, imageContents) { - const hasJdk = 'javaHome' in imageContents; - const jdkPath = imageContents.javaHome; - const jdkVersion = imageContents.javaVersion; - const hasFmw = 'oracleHome' in imageContents; - const fmwPath = imageContents.oracleHome; - const fmwVersion = imageContents.wlsVersion; - - const fmwMessage = this.getMessage('wit-inspector-fmw', hasFmw, fmwPath, fmwVersion); - const javaMessage = this.getMessage('wit-inspector-java', hasJdk, jdkPath, jdkVersion); - - let message; - if (fmwMessage) { - message = i18n.t('wit-inspect-results-fmw-message', - { imageTag: imageTag, javaMessage: javaMessage, fmwMessage: fmwMessage }); - } else if (javaMessage) { - message = i18n.t('wit-inspect-results-java-message', - { imageTag: imageTag, javaMessage: javaMessage }); + let key; + if ('oracleHome' in imageContents) { + key = 'wit-inspect-results-fmw-message'; + } else if ('javaHome' in imageContents) { + key = 'wit-inspect-results-java-message'; } else { - message = i18n.t('wit-inspector-empty-contents-message', { imageTag: imageTag }); - } - return message; - } - - getMessage(i18nPrefix, isInstalled, path, version) { - let message; - if (isInstalled) { - if (version) { - message = i18n.t(`${i18nPrefix}-version-message`, { path: path, version: version }); - } else { - message = i18n.t(`${i18nPrefix}-message`, { path: path }); - } + key = 'wit-inspector-empty-contents-message'; } - return message; + return i18n.t(key, { imageTag: imageTag }); } } diff --git a/webui/src/js/viewModels/app-main.js b/webui/src/js/viewModels/app-main.js index 76a30812d..958097609 100644 --- a/webui/src/js/viewModels/app-main.js +++ b/webui/src/js/viewModels/app-main.js @@ -198,7 +198,7 @@ function(accUtils, ko, i18n, project, wktConsole, dialogHelper, viewHelper, Arra this.collapseArrowClass = ko.computed(() => { return this.navCollapsed() ? 'oj-ux-ico-arrow-right' : 'oj-ux-ico-arrow-left'; - }); + }, this); this.collapseNav = () => { this.navCollapsed(!this.navCollapsed()); diff --git a/webui/src/js/viewModels/domain-design-view.js b/webui/src/js/viewModels/domain-design-view.js index 78b0b9d99..fe4c892a0 100644 --- a/webui/src/js/viewModels/domain-design-view.js +++ b/webui/src/js/viewModels/domain-design-view.js @@ -33,15 +33,15 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, this.isDomainInPV = ko.computed(() => { return this.project.settings.targetDomainLocation.observable() === 'pv'; - }); + }, this); this.isDomainInImage = ko.computed(() => { return this.project.settings.targetDomainLocation.observable() === 'dii'; - }); + }, this); this.isModelInImage = ko.computed(() => { return this.project.settings.targetDomainLocation.observable() === 'mii'; - }); + }, this); // Disable JRF as the domain type since the application does not (yet?) provide the mechanisms required // 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, this.usingAuxImage = ko.computed(() => { return this.isModelInImage() && this.project.image.useAuxImage.value; - }); + }, this); this.hasNoClusters = () => { return this.project.k8sDomain.clusters.value.length === 0; diff --git a/webui/src/js/viewModels/image-code-view.js b/webui/src/js/viewModels/image-code-view.js index 648dafc7b..0d0f3a736 100644 --- a/webui/src/js/viewModels/image-code-view.js +++ b/webui/src/js/viewModels/image-code-view.js @@ -42,12 +42,12 @@ function(accUtils, ko, i18n, project, ImageScriptGenerator, ArrayDataProvider) { this.disablePrimaryImageScript = ko.computed(() => { return !this.project.image.createPrimaryImage.value; - }); + }, this); this.disableAuxiliaryImageScript = ko.computed(() => { return !(this.project.settings.targetDomainLocation.value === 'mii' && this.project.image.useAuxImage.value && this.project.image.createAuxImage.value); - }); + }, this); this.subviews = [ { @@ -69,7 +69,7 @@ function(accUtils, ko, i18n, project, ImageScriptGenerator, ArrayDataProvider) { this.tabsStatus = ko.computed(() => { return this.disablePrimaryImageScript() && this.disableAuxiliaryImageScript() ? 'disabled' : 'enabled'; - }); + }, this); this.codeViewScriptLanguage = ko.observable(ImageScriptGenerator.getDefaultScriptingLanguage()); this.codeViewScriptLanguages = [ diff --git a/webui/src/js/viewModels/image-design-view-impl.js b/webui/src/js/viewModels/image-design-view-impl.js index 38f6a47f8..5150f0d0c 100644 --- a/webui/src/js/viewModels/image-design-view-impl.js +++ b/webui/src/js/viewModels/image-design-view-impl.js @@ -60,7 +60,7 @@ define(['utils/wkt-logger'], this.disableAuxImage = ko.computed(() => { return !(this.targetDomainLocationIsMII() && this.project.image.useAuxImage.value); - }); + }, this); this.mainCreateImageSwitchHelp = ko.computed(() => { if (this.project.image.useAuxImage.value) { @@ -68,7 +68,7 @@ define(['utils/wkt-logger'], } else { return this.labelMapper('create-image-help'); } - }); + }, this); this.mainImageTagHelpMII = () => { let key = 'image-tag-mii-use-help'; @@ -116,7 +116,7 @@ define(['utils/wkt-logger'], break; } return this.labelMapper(key); - }); + }, this); this.auxImageTagHelp = ko.computed(() => { if (this.project.image.createAuxImage.value) { @@ -124,7 +124,7 @@ define(['utils/wkt-logger'], } else { return this.labelMapper('aux-image-tag-use-help'); } - }); + }, this); this.subviews = [ {id: 'fmwImage', name: this.labelMapper('image-tab')}, @@ -144,7 +144,7 @@ define(['utils/wkt-logger'], } else { return this.labelMapper('fmw-title'); } - }); + }, this); this.mainImageRequiresWdt = () => { let result = false; @@ -210,6 +210,16 @@ define(['utils/wkt-logger'], return !this.project.image.baseImageContentsIncludesMiddleware(); }; + this.needsInstallers = ko.computed(function() { + let result = true; + if (this.project.image.useCustomBaseImage.observable()) { + if (this.project.image.baseImageContentsIncludesMiddleware()) { + result = false; + } + } + return result; + }, this); + this.chooseJDK = () => { window.api.ipc.invoke('get-jdk-installer-location') .then(jdkInstaller => { diff --git a/webui/src/js/viewModels/inspect-dialog.js b/webui/src/js/viewModels/inspect-dialog.js new file mode 100644 index 000000000..ad634fb7c --- /dev/null +++ b/webui/src/js/viewModels/inspect-dialog.js @@ -0,0 +1,136 @@ +/** + * @license + * Copyright (c) 2021, Oracle and/or its affiliates. + * Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ +'use strict'; + +define(['accUtils', 'knockout', 'utils/i18n', 'utils/view-helper', 'ojs/ojarraydataprovider', 'ojs/ojknockout', + 'ojs/ojinputtext', 'ojs/ojlabel', 'ojs/ojbutton', 'ojs/ojdialog', 'ojs/ojformlayout' ], +function(accUtils, ko, i18n, viewHelper) { + function InspectDialogModel(config) { + const DIALOG_SELECTOR = '#wktInspectDialog'; + + this.connected = () => { + accUtils.announce('Validation Error dialog loaded.', 'assertive'); + + this.dialogContainer = $(DIALOG_SELECTOR)[0]; + + // open the dialog when the container is ready. + // using oj-dialog initial-visibility="show" causes vertical centering issues. + viewHelper.componentReady(this.dialogContainer).then(() => { + this.dialogContainer.open(); + }); + }; + + this.labelMapper = (labelId, payload) => { + return i18n.t(`inspect-dialog-${labelId}`, payload); + }; + + this.i18n = i18n; + this.config = config; + this.contents = config.contents; + + this.getTitle = () => { + return this.config.title || this.labelMapper('default-title'); + }; + + this.getMessage = () => { + return this.config.message || this.labelMapper('default-message'); + }; + + this.hasOsInfo = () => { + return !!this.contents.os && !!this.contents.os.name && !!this.contents.os.version; + }; + + this.getOsName = () => { + return this.contents.os.name; + }; + + this.getOsVersion = () => { + return this.contents.os.version; + }; + + this.hasJavaHome = () => { + return !!this.contents.javaHome; + }; + + this.getJavaHome = () => { + return this.contents.javaHome; + }; + + this.getJavaVersion = () => { + return this.contents.javaVersion; + }; + + this.hasOracleHome = () => { + return !!this.contents.oracleHome; + }; + + this.getOracleHome = () => { + return this.contents.oracleHome; + }; + + this.getWlsVersion = () => { + return this.contents.wlsVersion; + }; + + this.getOpatchVersion = () => { + return this.contents.opatchVersion; + }; + + this.hasOraclePatches = () => { + return !!this.contents.oraclePatches && this.contents.oraclePatches.length > 0; + }; + + this.patches = { }; + + this.buildPatchesData = () => { + const namedPatches = [ ]; + const oneOffPatches = [ ]; + + if (this.hasOraclePatches()) { + this.contents.oraclePatches.forEach(patch => { + if (patch.description.toLowerCase() === 'one-off') { + oneOffPatches.push({ number: patch.patch }); + } else { + namedPatches.push({ name: patch.description, number: patch.patch }); + } + }); + if (namedPatches.length > 0) { + this.patches['namedPatches'] = namedPatches; + } + if (oneOffPatches.length > 0) { + this.patches['oneOffPatches'] = oneOffPatches; + } + } + }; + + this.hasNamedPatches = () => { + return !!this.patches.namedPatches; + }; + + this.hasOneOffPatches = () => { + return !!this.patches.oneOffPatches; + }; + + this.getNamedPatches = () => { + return this.patches.namedPatches; + }; + + this.getOneOffPatches = () => { + return this.patches.oneOffPatches; + }; + + this.dismissDialog = () => { + const dialog = this.dialogContainer; + if (dialog) { + dialog.close(); + } + }; + + this.buildPatchesData(); + } + + return InspectDialogModel; +}); diff --git a/webui/src/js/viewModels/network-page.js b/webui/src/js/viewModels/network-page.js index 2cb3e778a..3a1f2f095 100644 --- a/webui/src/js/viewModels/network-page.js +++ b/webui/src/js/viewModels/network-page.js @@ -36,11 +36,11 @@ function(accUtils, ko, i18n, project) { this.topMessage = ko.computed(() => { const messageKey = this.connectOk() ? 'proceed' : 'warning'; return this.labelMapper(messageKey); - }); + }, this); this.topClass = ko.computed(() => { return this.connectOk() ? 'wkt-proceed' : 'wkt-warning'; - }); + }, this); this.tryConnect = () => { this.tryMessage(this.labelMapper('trying')); diff --git a/webui/src/js/viewModels/project-settings-page.js b/webui/src/js/viewModels/project-settings-page.js index a5dcffbe0..72e407e24 100644 --- a/webui/src/js/viewModels/project-settings-page.js +++ b/webui/src/js/viewModels/project-settings-page.js @@ -55,7 +55,7 @@ function(accUtils, ko, i18n, project, ArrayDataProvider) { key = 'java-directory-location-with-pv-answer-message'; } return this.labelMapper(key); - }); + }, this); this.requiresOracleHome = () => { return this.project.settings.targetDomainLocation.value !== 'pv'; @@ -103,7 +103,7 @@ function(accUtils, ko, i18n, project, ArrayDataProvider) { key = 'build-tool-type-with-pv-answer-message'; } return this.labelMapper(key); - }); + }, this); this.getBuilderExecutableFilePathLabel = () => { let name = this.getDockerLabelForBuilderType(this.project.settings.builderType.value) || ''; diff --git a/webui/src/js/views/image-design-view.html b/webui/src/js/views/image-design-view.html index a6bfa52e1..c7986f982 100644 --- a/webui/src/js/views/image-design-view.html +++ b/webui/src/js/views/image-design-view.html @@ -138,99 +138,103 @@
-
-
- -
-
- - - - - - - - - -
-
- - -
-
- - - - - - - - - - - - - -
-
-
- -
- -
-
- - - - + +
+
+ +
+
+ + + + + + + + + +
+
- + +
+
+ + + + - - - - -
- - - - - -
- - + + + + + + +
- -
-
+
+
+
+ +
+ +
+
+ + + + + + + + + + + +
+ + + + + +
+ + +
+
+
+
+
+
+
@@ -261,34 +265,36 @@
- -
-
- - - - - - - +
+ +
+
+ + + + + + + + + + - - - - - - -
-
+ + + +
+
+
diff --git a/webui/src/js/views/inspect-dialog.html b/webui/src/js/views/inspect-dialog.html new file mode 100644 index 000000000..4f54f66ed --- /dev/null +++ b/webui/src/js/views/inspect-dialog.html @@ -0,0 +1,68 @@ + + +
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ + +
+ + + + + + +
+ + + +
+
+
+
+
+
+ +
+ + + +
+