Skip to content

Commit 4fbde62

Browse files
committed
[webgui] adjust generic openui5 panel
1 parent 66b6206 commit 4fbde62

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

ui5/panel/Controller.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
sap.ui.define([
2-
'sap/ui/core/mvc/Controller',
3-
'sap/ui/model/json/JSONModel'
4-
], function (Controller, JSONModel) {
2+
'sap/ui/core/mvc/Controller'
3+
], function (Controller) {
54
"use strict";
65

76
return Controller.extend("rootui5.panel.Controller", {
@@ -13,18 +12,16 @@ sap.ui.define([
1312

1413

1514
onInit: function() {
16-
var data = this.getView().getViewData();
15+
let data = this.getView().getViewData();
1716

18-
if (data && data.handle) {
19-
this.websocket = data.handle;
17+
this.websocket = data?.handle;
18+
if (this.websocket) {
2019
this.websocket.setReceiver(this); // redirect websocket handling on controller itself
2120
this.websocket.send("PANEL_READY"); // confirm panel creation, only then GUI can send commands
2221
}
2322

2423
// TODO: use more specific API between Canvas and Panel
25-
if (data && data.masterPanel) {
26-
this.masterPanel = data.masterPanel;
27-
}
24+
this.masterPanel = data?.masterPanel;
2825

2926
if (typeof this.onPanelInit == "function")
3027
this.onPanelInit();

ui5/panel/panel.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<!DOCTYPE html>
33
<html lang="en">
44
<head>
5-
<meta charset="UTF-8">
5+
<meta charset="utf-8">
66
<title>ROOT7 web panel</title>
7-
<script type="text/javascript" src="jsrootsys/scripts/JSRoot.core.js"></script>
87
</head>
98

109
<style>
@@ -22,19 +21,17 @@
2221

2322
<body>
2423
<div id="PanelDiv">
25-
loading scripts...
2624
</div>
2725
</body>
2826

29-
<script type='text/javascript'>
27+
<script type='module'>
3028

31-
JSROOT.connectWebWindow({
32-
prereq_logdiv: "PanelDiv",
33-
// openui5src: "jsroot",
34-
// openui5src: "https://openui5.hana.ondemand.com/1.98.0/",
35-
// openui5libs: "sap.ui.core, sap.ui.layout, sap.m",
29+
import { connectWebWindow } from '/jsrootsys/modules/webwindow.mjs';
30+
import { source_dir } from '/jsrootsys/modules/core.mjs';
31+
32+
connectWebWindow({
3633
first_recv: "SHOWPANEL:",
37-
prereq2: "openui5" // components which can be loaded during connection establishing
34+
ui5: true // components which can be loaded during connection establishing
3835
}).then(handle => {
3936

4037
if (!handle || !sap) return false;
@@ -46,8 +43,8 @@
4643
let p = viewName.indexOf(".");
4744
if ((p > 1) && (p < viewName.length - 1)) {
4845
let tgtpath = "/currentdir/";
49-
let pp = JSROOT.source_dir.indexOf("/jsrootsys/");
50-
if (pp > 0) tgtpath = JSROOT.source_dir.slice(0,pp) + "/currentdir/";
46+
let pp = source_dir.indexOf("/jsrootsys/");
47+
if (pp > 0) tgtpath = source_dir.slice(0, pp) + tgtpath;
5148
let _paths = {};
5249
_paths[viewName.slice(0,p)] = tgtpath;
5350
console.log('Register module path', viewName.slice(0,p), ' as ', tgtpath);

0 commit comments

Comments
 (0)