Skip to content

Commit bcde0db

Browse files
committed
Release 2.3.0
1 parent 0f7abb5 commit bcde0db

File tree

1,540 files changed

+438802
-229379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,540 files changed

+438802
-229379
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ The WebLogic Remote Console provides an alternative WebLogic Server administrati
1919
## Get Started
2020
You can install the WebLogic Remote Console as a desktop or browser application, depending on your usecases although the desktop application is recommended. Both versions are available to download from [https://github.com/oracle/weblogic-remote-console/releases](https://github.com/oracle/weblogic-remote-console/releases).
2121

22+
Review the system requirements at [Get Started](https://oracle.github.io/weblogic-remote-console/setup/)
23+
2224
You should also download and install the WebLogic Remote Console extension for your WebLogic Server domain. The extension provides additional functionality that is not available with the console alone. Although installing the extension is optional, we recommend that you install it to get the optimum functionality from the WebLogic Remote Console.
2325

24-
Documentation for the WebLogic Remote Console is available at [https://oracle.github.io/weblogic-remote-console/](https://oracle.github.io/weblogic-remote-console/setup/). It provides instructions for installing and configuring the WebLogic Remote Console.
26+
Documentation for the WebLogic Remote Console is [available here](https://oracle.github.io/weblogic-remote-console/setup/).
2527

2628
To build the WebLogic Remote Console from source, see the [Developer Guide](https://oracle.github.io/weblogic-remote-console/develop/build-source/).
2729

THIRD_PARTY_LICENSES.txt

Lines changed: 6789 additions & 3164 deletions
Large diffs are not rendered by default.

assembly/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Copyright 2020, 2021, Oracle and/or its affiliates.
2+
<!-- Copyright 2020, 2022, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
44
<project xmlns="http://maven.apache.org/POM/4.0.0"
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>console-backend</artifactId>
1111
<groupId>com.oracle.weblogic</groupId>
12-
<version>2.2.0</version>
12+
<version>2.3.0</version>
1313
</parent>
1414

1515
<packaging>pom</packaging>

build-console-with-docker.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ set -e
1111
make
1212
"
1313

14-
rm -rf runnable installer/target
15-
mkdir -p runnable installer/target
14+
rm -rf runnable installer/target frontend/web
15+
mkdir -p runnable installer/target frontend/web
1616
docker cp $DOCKER_ID:/build/runnable/. runnable
1717
docker cp $DOCKER_ID:/build/installer/target/. installer/target
18+
docker cp $DOCKER_ID:/build/frontend/web/. frontend/web

build-tools/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Copyright 2020, 2021, Oracle Corporation and/or its affiliates. All rights reserved.
2+
<!-- Copyright 2020, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -->
44
<project>
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>com.oracle.weblogic.console-backend</groupId>
88
<artifactId>build-tools</artifactId>
9-
<version>2.2.0</version>
9+
<version>2.3.0</version>
1010
<name>Build Tools</name>
1111

1212
<properties>

electron/main.js

Lines changed: 118 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,28 @@ const { autoUpdater } = require('electron-updater');
1212
autoUpdater.autoDownload = false;
1313
const prompt = require('electron-prompt');
1414
var path = require('path');
15+
var another_me = null;
1516
const instDir = path.dirname(app.getPath('exe'));
1617
const canCheckForUpdates = !instDir.startsWith('/opt/');
1718

1819
const { homepage, productName, version, copyright } = require(`${instDir}/package.json`);
1920

21+
const fileExtensions = ['yml', 'yaml', 'json', 'props', 'properties'];
22+
2023
const fs = require('fs');
2124
var checkPid = 0;
2225
var newVersion = version;
2326
var cbePort = 0;
2427
var window;
2528
var projects;
2629
var current_project;
30+
var tablePrefs = {};
2731
var width = 1600;
2832
var height = 1000;
2933
var started = false;
3034
var stdinOption = false;
3135
var showPort = false;
36+
var useTokenNotCookie = false;
3237
var quiet = false;
3338
var lines = [ ];
3439
var origConsoleLog;
@@ -168,6 +173,12 @@ function getFilteredProviders(providers) {
168173
filteredProvider.models = providers[i].models;
169174
}
170175

176+
// Filter out the references to a property list
177+
// associated with model provider type.
178+
if (providers[i].type === 'model' && providers[i].properties) {
179+
filteredProvider.properties = providers[i].properties;
180+
}
181+
171182
filteredProviders.push(filteredProvider);
172183
}
173184
return filteredProviders;
@@ -528,6 +539,49 @@ function makeMenu() {
528539
Menu.setApplicationMenu((Menu.buildFromTemplate(template)));
529540
}
530541

542+
// On Mac OS, the "Finder" prevents starting the Remote Console when it
543+
// has already been started, even if it was only started for use by WKT UI.
544+
// This is different than Windows and Linux where the passive Remote Console
545+
// instance started for WKT UI is not seen as an instance of the Remote
546+
// Console. Given the limitations of the Mac OS user interface, it will be
547+
// impossible to do as well as Windows and Linux, where the user can launch as
548+
// many copies of the Remote Console as they choose. Instead, we will allow the
549+
// user to have, at most, two Remote Consoles, the passive one used by WKT UI
550+
// and an active one that is actually a Remote Console that they can use.
551+
//
552+
// We will be able to make this work on the Mac by recognizing that the user
553+
// has clicked on the Remote Console and interpreting that as the desire to
554+
// have a real one, not the passive one.
555+
//
556+
// Electron on Mac OS does give an "activate" notification when the user clicks.
557+
// Therefore, if there is no Remote Console running when we get the
558+
// notification, we start one. There are three ways to know that there is
559+
// already a Remote Console running:
560+
// 1. We are a Remote Console ourselves. This is indicated by the "window"
561+
// variable, which is where the remote console is displayed and is set by the
562+
// "ready" notification, which comes before any "activate" notification.
563+
// 2. We've already started one ourselves and it is still running.
564+
// 3. If a Remote Console was started *prior* to launching WKT UI and the user
565+
// clicked on our process, neither of the above conditions is true, but
566+
// we also don't want to launch another because that is not consistent with
567+
// the user's click.
568+
// We can tell that this has occurred by using the "single instance lock".
569+
// On Mac OS, we grab the lock whenever we create the window (the lock is
570+
// automatically released on process exit). Therefore, if nobody is holding
571+
// the lock, then we are free to start a new process to start a window and
572+
// grab the lock. Since we are testing the lock before creating the new
573+
// process, there is a timing window where if a user clicks really quickly,
574+
// we will try to create more than necessary and they will die right away.
575+
// This will actually be the behavior the user would expect since, on the
576+
// Mac, only a single active instance is allowed.
577+
// Technically, we could live without #2 since #3 will cover it, but it feels
578+
// like checking a variable is nice and light weight.
579+
app.on('activate', () => {
580+
if (!window && !another_me && app.requestSingleInstanceLock()) {
581+
app.releaseSingleInstanceLock();
582+
start_another_me();
583+
}
584+
});
531585

532586
if (canCheckForUpdates && !app.commandLine.hasSwitch("headless")) {
533587
autoUpdater.checkForUpdates().then(result => {
@@ -547,7 +601,8 @@ function writeAutoPrefs() {
547601
width: width,
548602
height: height,
549603
projects: getMaskedProjects(["password"]),
550-
location: process.env.APPIMAGE ? process.env.APPIMAGE : app.getPath('exe')
604+
location: process.env.APPIMAGE ? process.env.APPIMAGE : app.getPath('exe'),
605+
tablePrefs: tablePrefs
551606
};
552607
fs.writeFileSync(`${app.getPath('userData')}/auto-prefs.json`, JSON.stringify(prefs, null, 4));
553608
}
@@ -564,6 +619,9 @@ function readAutoPrefs() {
564619
projects = props["projects"]
565620
else
566621
projects = [ ];
622+
623+
if (props["tablePrefs"]) tablePrefs = props["tablePrefs"];
624+
567625
for (let i = 0; i < projects.length; i++)
568626
if (projects[i].current)
569627
current_project = projects[i];
@@ -592,7 +650,10 @@ function processOptions() {
592650
if (props["server.port"])
593651
cbePort = props["server.port"];
594652
}
595-
checkPid = app.commandLine.getSwitchValue("check-pid");
653+
if (app.commandLine.hasSwitch("check-ppid"))
654+
checkPid = process.ppid;
655+
else
656+
checkPid = app.commandLine.getSwitchValue("check-pid");
596657
if (checkPid != 0) {
597658
setInterval(doCheckPid, 5000);
598659
}
@@ -609,7 +670,11 @@ function processOptions() {
609670
process.exit();
610671
});
611672
}
612-
showPort = app.commandLine.hasSwitch("showPort");
673+
// Windows folds case in arguments it seems
674+
showPort = app.commandLine.hasSwitch("showPort") ||
675+
app.commandLine.hasSwitch("showport");
676+
useTokenNotCookie = app.commandLine.hasSwitch("useTokenNotCookie") ||
677+
app.commandLine.hasSwitch("usetokennotcookie");
613678
quiet = app.commandLine.hasSwitch("quiet");
614679
}
615680

@@ -657,16 +722,20 @@ function start_cbe() {
657722

658723
var instDir = path.dirname(app.getPath("exe"));
659724
let filename = `${app.getPath("userData")}/config.json`;
660-
const cbe = spawn(instDir + "/customjre/bin/java", [
725+
let spawnArgs = [
661726
`-Dserver.port=${cbePort}`,
662727
"-jar",
663728
`${instDir}/backend/console.jar`,
664729
"--showPort",
665730
"--stdin",
666731
"--properties",
667732
filename,
668-
]);
669-
733+
];
734+
if (useTokenNotCookie) {
735+
spawnArgs.push('--useTokenNotCookie');
736+
}
737+
const cbe = spawn(instDir + "/customjre/bin/java", spawnArgs);
738+
670739
let readlineStderr = readline.createInterface({
671740
input: cbe.stderr,
672741
});
@@ -708,14 +777,24 @@ function start_cbe() {
708777
});
709778
}
710779

711-
function readWDTModelFile(filepath) {
780+
function readContentFile(filepath) {
712781
return {
713782
file: filepath,
714783
fileContents: fs.readFileSync(filepath, 'utf8'),
715-
mediaType: (filepath.endsWith(".json") ? "application/json" : (filepath.endsWith(".props") ? "text/plain" : "application/yaml"))
784+
mediaType: (filepath.endsWith(".json") ? "application/json" : "application/x-yaml")
716785
};
717786
}
718787

788+
function start_another_me() {
789+
const { execFile } = require("child_process");
790+
791+
another_me = execFile(`${instDir}/WebLogic Remote Console`, () =>
792+
{
793+
another_me = null;
794+
}
795+
);
796+
}
797+
719798
function writeFileAsync(filepath, fileContents) {
720799
return new Promise((resolve, reject) => {
721800
fs.writeFile(
@@ -744,7 +823,7 @@ function createFileReadingResponse(filepath) {
744823
const response = {};
745824
if (fs.existsSync(filepath)) {
746825
try {
747-
const results = readWDTModelFile(filepath);
826+
const results = readContentFile(filepath);
748827
response["file"] = results.file;
749828
response["fileContents"] = results.fileContents;
750829
response["mediaType"] = results.mediaType;
@@ -779,7 +858,7 @@ ipcMain.handle('file-creating', async (event, arg) => {
779858
const dialogParams = {
780859
defaultPath: arg.filepath,
781860
properties: ['createDirectory'],
782-
filters: { name: 'Supported Formats', extensions: ['yml', 'yaml', 'json']}
861+
filters: { name: 'Supported Formats', extensions: fileExtensions }
783862
};
784863
return dialog.showSaveDialog(window, dialogParams)
785864
.then(result => {
@@ -815,7 +894,7 @@ ipcMain.handle('file-reading', async (event, arg) => {
815894
const dialogParams = {
816895
defaultPath: arg.filepath,
817896
properties: ['openFile'],
818-
filters: { name: 'Supported Formats', extensions: ['yml', 'yaml', 'json', 'props']}
897+
filters: { name: 'Supported Formats', extensions: fileExtensions }
819898
};
820899
return dialog.showOpenDialog(window, dialogParams)
821900
.then(dialogReturnValue => {
@@ -836,8 +915,25 @@ ipcMain.handle('file-reading', async (event, arg) => {
836915
});
837916
});
838917

918+
ipcMain.handle("table-customizing", async (event, arg) => {
919+
const currentEntry = tablePrefs[arg.page];
920+
921+
if (currentEntry !== arg.fileContents) {
922+
tablePrefs[arg.page] = arg.fileContents;
923+
writeAutoPrefs();
924+
return Promise.resolve();
925+
}
926+
});
927+
928+
ipcMain.handle("table-prefs-reading", async () => {
929+
return Promise.resolve(tablePrefs);
930+
});
931+
839932
ipcMain.handle('file-writing', async (event, arg) => {
840933
if (arg.filepath && arg.fileContents) {
934+
if (path.dirname(arg.filepath) === '.') {
935+
arg.filepath = path.join(__dirname, arg.filepath)
936+
}
841937
return writeFileAsync(arg.filepath, arg.fileContents);
842938
}
843939
else {
@@ -1013,12 +1109,21 @@ app.whenReady()
10131109
.then(() => {
10141110
processOptions();
10151111
if (!app.commandLine.hasSwitch("headless")) {
1112+
// As described earlier, the Mac will only support one running
1113+
// Remote Console (with a head)
1114+
if (process.platform === 'darwin') {
1115+
if (!app.requestSingleInstanceLock()) {
1116+
process.exit();
1117+
process.kill(process.pid, 9);
1118+
}
1119+
}
10161120
/**
10171121
* Creates a new instance of the ``BrowserWindow`` class, using the specified parameter values.
10181122
* @param {string} title
10191123
* @param {number} width
10201124
* @param {number} height
10211125
* @returns {BrowserWindow}
1126+
show: app.commandLine.hasSwitch("headless") ? false : true,
10221127
* @private
10231128
*/
10241129
function createBrowserWindow(title, width, height) {
@@ -1084,7 +1189,9 @@ app.whenReady()
10841189
process.exit();
10851190
process.kill(process.pid, 9);
10861191
}
1192+
10871193
window = createBrowserWindow("Initializing...", width, height);
1194+
10881195
window.webContents.session.clearCache();
10891196
window.on('resize', () => {
10901197
width = window.getSize()[0];

0 commit comments

Comments
 (0)