generated from hereon-wpi/waltz-webpack-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
61 lines (53 loc) · 1.55 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {BeamtimeDbWidget, kWidgetBeamtimedb} from "widget/beamtimedb";
import {kChannelLog, kTopicError, kUserContext, UserContext} from "@waltz-controls/waltz-user-context-plugin";
import {Application, Controller, WaltzWidget} from "@waltz-controls/middleware";
export const kWidgetMain = 'widget:main';
const dummyUserContext = new UserContext({
ext: {
[kWidgetBeamtimedb]: [
{
id: 'test',
value: 'my query'
}
]
}
});
class Main extends WaltzWidget {
constructor(app) {
super(kWidgetMain, app);
}
get leftPanel() {
return $$('left');
}
get mainView() {
return $$('main');
}
run() {
webix.ui({
cols: [
{
view: 'accordion',
id: 'left',
rows: []
},
{
gravity: 6,
id: 'main',
view: 'tabview',
cells: [{}]
}
]
})
}
}
const app = new Application({name: APPNAME, version: VERSION})
.registerContext(kUserContext, dummyUserContext)
.registerController(application => new class extends Controller {
constructor() {
super('log', application);
this.listen(event => console.error(event), kTopicError, kChannelLog)
}
})
.registerWidget(application => new Main(application))
.registerWidget(application => new BeamtimeDbWidget(application))
.run()