Skip to content

Bind node states to GUI elements #2153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 210 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
5acf405
retrieve connection state
sanderegg Jan 25, 2021
bfbb571
missing string
sanderegg Jan 25, 2021
8eb3540
renamed method
sanderegg Jan 25, 2021
8e4ceb0
compute runnable states and io states
sanderegg Jan 25, 2021
5a13d37
refactoring the tests
sanderegg Jan 25, 2021
def28b4
properly check force_restart when running a whole computation
sanderegg Jan 25, 2021
4a724ee
more refactoring
sanderegg Jan 25, 2021
2d8bee2
better refactoring
sanderegg Jan 25, 2021
79d9969
changed return object to pipeline details. getting there
sanderegg Jan 25, 2021
cf9a132
need to compute the complete dag from the tasks when getting the state
sanderegg Jan 26, 2021
2b9c54b
testing partial pipeline works
sanderegg Jan 26, 2021
7c45384
linter
sanderegg Jan 26, 2021
187b9c7
fixed testing abort pipeline
sanderegg Jan 26, 2021
17697ca
fixes test for update and deletion of computations
sanderegg Jan 26, 2021
e6b9eae
updated schema
sanderegg Jan 26, 2021
6f274d2
moved pydantic models to models-library
sanderegg Jan 26, 2021
353dc94
moved ComputationTask model to models-library
sanderegg Jan 26, 2021
3e91f9f
use pydantic models
sanderegg Jan 26, 2021
80eb140
typo
sanderegg Jan 26, 2021
4868c1d
modified project json schema
sanderegg Jan 26, 2021
3eeae91
bugfix: issue webserver wrongly retrieves templates running state, cr…
sanderegg Jan 26, 2021
4ad6c9d
refactoring
sanderegg Jan 26, 2021
2fb975d
refactoring more
sanderegg Jan 26, 2021
c8e824f
renamed get_pipeline_state to get_computation_task
sanderegg Jan 26, 2021
ebc5090
coming along
sanderegg Jan 26, 2021
cbb90a4
improve logging formatting
sanderegg Jan 26, 2021
9c3bf42
fixed syntax
sanderegg Jan 26, 2021
7294bb4
fill model
sanderegg Jan 26, 2021
940c878
gather calls
sanderegg Jan 26, 2021
bb82406
linter
sanderegg Jan 26, 2021
f4597ed
do normal validation as nested types are not constructed with construct
sanderegg Jan 26, 2021
f37d240
correctly retrieve computationTasks
sanderegg Jan 26, 2021
8e9ce02
this one is still dict
sanderegg Jan 26, 2021
5c86c48
fix fixture
sanderegg Jan 27, 2021
d70228b
add base example for model
sanderegg Jan 27, 2021
aa0e964
added tests for empty thumbnail
sanderegg Jan 27, 2021
dbdd3fc
do not assign state if the node is missing from the project
sanderegg Jan 27, 2021
ab8aa3f
invalid call to function to set states
sanderegg Jan 27, 2021
2021877
fixes unit test accessing director-v2
sanderegg Jan 27, 2021
fe6b9f1
removed thumbnail as str
sanderegg Jan 27, 2021
318c851
API schema is not expecting the same as DB schema, thumbnail is a string
sanderegg Jan 27, 2021
5d4ea64
added iostate and runnable state in Project model
sanderegg Jan 27, 2021
7a812e0
updated OAS
sanderegg Jan 27, 2021
e0e1b95
refactoring
sanderegg Jan 27, 2021
64f9b89
try fixing downgrading the projects table
sanderegg Jan 29, 2021
c9379bf
sorting
sanderegg Jan 29, 2021
e944e3a
use direct SQL
sanderegg Jan 29, 2021
874bc0e
re-created specs
sanderegg Feb 1, 2021
614fdb6
updated specs after rebase
sanderegg Feb 3, 2021
1cdbce1
bad merge
sanderegg Feb 3, 2021
099e695
fixed invalid SQL call
sanderegg Feb 3, 2021
15a6444
linter
sanderegg Feb 3, 2021
73917ec
remove unused code
sanderegg Feb 4, 2021
bd847d2
fix node hashes after import
sanderegg Feb 4, 2021
70409c8
use orjson instead of json
sanderegg Feb 4, 2021
1d85201
pin pip-tools version to 5.4.0
sanderegg Feb 4, 2021
a4a9a73
added orjson to models-library
sanderegg Feb 4, 2021
e567d89
orjson does not set the space between the fields
sanderegg Feb 4, 2021
b930721
adjust workbench to orjson not having spaces
sanderegg Feb 4, 2021
57f6017
improving how test comparison is done
sanderegg Feb 4, 2021
48bf949
comment
sanderegg Feb 4, 2021
cad7429
@GitHK: This eTag in the imported project is wrong. it is the old one…
sanderegg Feb 4, 2021
16fe23e
moved ProjectAtDB to the models_library
sanderegg Feb 4, 2021
0a8618b
typo
sanderegg Feb 4, 2021
3ef0139
fix model to use python snake case
sanderegg Feb 4, 2021
4311fb3
fixing import
sanderegg Feb 4, 2021
48247af
fixed generation of the payload
sanderegg Feb 4, 2021
400c8f0
@pcrespov bonus: sidecar says which mode it uses in the logo
sanderegg Feb 4, 2021
9919628
final fix to the migration so that it works correctly
sanderegg Feb 4, 2021
ab5ad4f
reverted orjson
sanderegg Feb 5, 2021
b90c0ab
correct run_hash based on old_hash
sanderegg Feb 5, 2021
87daf86
fix the project eTags
sanderegg Feb 5, 2021
c408cbb
skip eTag from comparison
sanderegg Feb 5, 2021
334f460
do not check runnableState?
sanderegg Feb 5, 2021
cdbacbb
@GitHK review: remove inner fct
sanderegg Feb 15, 2021
b8b131d
bad merge
sanderegg Feb 15, 2021
750df6d
@pcrespov review: use Field(...) instead of ...
sanderegg Feb 15, 2021
53f3097
@pcrespov review: add a test to check values in enums are the same
sanderegg Feb 15, 2021
606d1e3
fix test to check if types are the same
sanderegg Feb 15, 2021
579193f
change state to object
sanderegg Feb 15, 2021
2d210b2
fix some typos
sanderegg Feb 15, 2021
0ed1aba
fix some of the schema exports
sanderegg Feb 16, 2021
cfcc323
updated project json schema
sanderegg Feb 16, 2021
a1bd14f
updated project json
sanderegg Feb 16, 2021
a31f623
moved node states
sanderegg Feb 16, 2021
af9a248
make dependencies a set of unique node uuids
sanderegg Feb 16, 2021
7442e68
updated API
sanderegg Feb 16, 2021
e525472
the dependencies are a set
sanderegg Feb 16, 2021
c34eaff
create a set of node ids
sanderegg Feb 16, 2021
5ae8855
changed state definition
sanderegg Feb 16, 2021
2aabcf9
returned dependencies are a set
sanderegg Feb 16, 2021
2335362
new pylint issue?
sanderegg Feb 16, 2021
acc032c
migration of workbench according to new state object
sanderegg Feb 16, 2021
294d607
fixed updating of node state
sanderegg Feb 16, 2021
e828bb3
state object contains all the different node status
sanderegg Feb 16, 2021
b058dfb
exclude current status from node states
sanderegg Feb 16, 2021
31fa7c9
check if values are set
sanderegg Feb 16, 2021
e001ddc
ensure we have a dictionary if no value was set before
sanderegg Feb 16, 2021
9a7d643
remove the runtime states from the imported project
sanderegg Feb 16, 2021
ee872fc
added some more logs
sanderegg Feb 16, 2021
e0f8f69
fixed ETag reading
sanderegg Feb 16, 2021
20e0492
export only set payloda
sanderegg Feb 16, 2021
ddacf8a
fixed aiohttp mockup for director-v2
sanderegg Feb 16, 2021
cb10a2b
runnableState disappeared from the project
sanderegg Feb 16, 2021
fc00561
NodeStatus props renaming
odeimaiz Feb 17, 2021
3c67b2e
warning-yellow and busy-orange color added
odeimaiz Feb 17, 2021
72ca155
border bound to running status
odeimaiz Feb 17, 2021
e690767
osparc.utils.StatusUI created
odeimaiz Feb 17, 2021
80e1566
Update NodeUI.js
odeimaiz Feb 17, 2021
3daad8b
more to StatusUI
odeimaiz Feb 17, 2021
176ed2e
more to StatusUI
odeimaiz Feb 17, 2021
f2833cf
NodeStatusUI text color bound to state
odeimaiz Feb 17, 2021
2e44f56
"in" and "out" on NodeUI bound to "dependencies" and "modified"
odeimaiz Feb 17, 2021
8180d64
Edges with colors
odeimaiz Feb 17, 2021
c29659a
Merge branch 'master' into sanderegg-retrieve_more_states
odeimaiz Feb 18, 2021
091ee3b
Merge branch 'sanderegg-retrieve_more_states' of https://github.com/o…
odeimaiz Feb 18, 2021
5fd6821
bad merge
odeimaiz Feb 18, 2021
a00ad25
Listen to nodeUpdated state
odeimaiz Feb 18, 2021
ec00adc
Update WorkbenchView.js
odeimaiz Feb 18, 2021
475a1b9
init props
odeimaiz Feb 18, 2021
63bb9f3
Merge branch 'master' into sanderegg-retrieve_more_states
odeimaiz Feb 18, 2021
80d6fe0
Only show Thumbnail in Medium if not default thumbnail
odeimaiz Feb 18, 2021
e47edc4
Don't paint borders
odeimaiz Feb 18, 2021
a724dc6
Update StudyEditor.js
odeimaiz Feb 18, 2021
f8f1dde
reuse updateStudy from StudyModel
odeimaiz Feb 18, 2021
2666571
Update Workbench.js
odeimaiz Feb 18, 2021
7b8b5f7
Update Node.js
odeimaiz Feb 18, 2021
de6e26c
Update Workbench.js
odeimaiz Feb 18, 2021
aadae34
update node states after put
odeimaiz Feb 18, 2021
d8033c5
update node states after put II
odeimaiz Feb 18, 2021
cdf15fe
Confirmation Window refactoring
odeimaiz Feb 18, 2021
df316fc
forceRestart
odeimaiz Feb 18, 2021
3ac67b6
Update Node.js
odeimaiz Feb 18, 2021
5c95d1e
refactoring
odeimaiz Feb 18, 2021
1aab024
colors for interactive status
odeimaiz Feb 18, 2021
11d528f
Update NodeStatusUI.js
odeimaiz Feb 18, 2021
195328c
refactoring
odeimaiz Feb 18, 2021
4028581
Update NodeStatusUI.js
odeimaiz Feb 19, 2021
20286ef
Update jupyters.js
odeimaiz Feb 19, 2021
76f01a7
Update NodeStatusUI.js
odeimaiz Feb 19, 2021
48d761f
Update StudyBrowser.js
odeimaiz Feb 22, 2021
edec650
Interpretation: Set Modified to true if it has Dependencies
odeimaiz Feb 22, 2021
0936e51
minor
odeimaiz Feb 22, 2021
5186ed1
minor
odeimaiz Feb 22, 2021
78a1f59
renaming
odeimaiz Feb 22, 2021
a3cf3b1
empty logger added to NodeView
odeimaiz Feb 22, 2021
ac09bb4
Logger refactoring
odeimaiz Feb 22, 2021
fc3f89c
Refactoring
odeimaiz Feb 22, 2021
a2cdc44
getLogger is __getStudyLogger
odeimaiz Feb 22, 2021
6c75b6e
iframe or spacer
odeimaiz Feb 22, 2021
aaae436
Logger in Node and NodeView
odeimaiz Feb 22, 2021
0317383
Merge branch 'master' into sanderegg-retrieve_more_states
odeimaiz Feb 22, 2021
edda720
aesthetics
odeimaiz Feb 22, 2021
8bfa667
StartStopButtons has Study as prop
odeimaiz Feb 22, 2021
056cf53
Update StartStopButtons.js
odeimaiz Feb 22, 2021
63a9ee4
cleanup
odeimaiz Feb 22, 2021
a83fe8e
node-level logger out. @mguidon, blame @KZzizzle
odeimaiz Feb 23, 2021
e9ccc24
minor fix
odeimaiz Feb 23, 2021
9c58270
added annotations
sanderegg Feb 23, 2021
1d6c2e2
minor
odeimaiz Feb 23, 2021
2b02912
refactoring BreadcrumbNavigation
odeimaiz Feb 23, 2021
375425e
suffix star if modified
odeimaiz Feb 23, 2021
0c43b20
dependencies -> enabled
odeimaiz Feb 23, 2021
43234f4
return the states of all computational nodes
sanderegg Feb 23, 2021
212c56d
grayout text, but button still enabled
odeimaiz Feb 23, 2021
28ed27c
improved tooltip
odeimaiz Feb 23, 2021
d745b9e
add function to get nodes depending on another
sanderegg Feb 23, 2021
6f3d953
create test for checking new function
sanderegg Feb 23, 2021
154b593
notification of depending nodes
sanderegg Feb 23, 2021
69ee303
check if node is ready
odeimaiz Feb 23, 2021
4f8b7ae
Merge branch 'reset_modified_state' of https://github.com/sanderegg/o…
odeimaiz Feb 23, 2021
a1124f0
also return the current state of the node as was designed
sanderegg Feb 23, 2021
1d5ce4a
Merge branch 'reset_modified_state' of https://github.com/sanderegg/o…
odeimaiz Feb 23, 2021
8ed7510
fix import
sanderegg Feb 23, 2021
c182ad4
fix import
sanderegg Feb 23, 2021
6d3d055
Merge branch 'reset_modified_state' of https://github.com/sanderegg/o…
odeimaiz Feb 23, 2021
a28c4c4
startPipeline expects the partialPipeline arg
odeimaiz Feb 23, 2021
b11a1f5
Update SlideShowView.js
odeimaiz Feb 23, 2021
1136f64
Update SlideShowView.js
odeimaiz Feb 23, 2021
240d136
Save every 3 seconds
odeimaiz Feb 23, 2021
b2954e9
minor
odeimaiz Feb 23, 2021
1a3e85f
added icon with color to NodePorts in NodeView
odeimaiz Feb 23, 2021
4770208
Update NodePorts.js
odeimaiz Feb 23, 2021
6e25236
Update NodePorts.js
odeimaiz Feb 23, 2021
543e2d0
NodeStatusUI in NodeView toolbar
odeimaiz Feb 23, 2021
6bd00ce
Update BaseNodeView.js
odeimaiz Feb 23, 2021
479683f
fix
odeimaiz Feb 23, 2021
83b6d8d
added annotations
sanderegg Feb 23, 2021
40d4544
return the states of all computational nodes
sanderegg Feb 23, 2021
b8a86f8
add function to get nodes depending on another
sanderegg Feb 23, 2021
0e74941
create test for checking new function
sanderegg Feb 23, 2021
64bc2ef
notification of depending nodes
sanderegg Feb 23, 2021
12ba46c
also return the current state of the node as was designed
sanderegg Feb 23, 2021
2d6af7b
fix import
sanderegg Feb 23, 2021
528a6f1
fix import
sanderegg Feb 23, 2021
fc7686f
use the correct comp_tasks when giving back states
sanderegg Feb 23, 2021
664dfc3
fix remaining director-v2 tests
sanderegg Feb 23, 2021
29f9c04
ensure state is set to published when a node is published for execution
sanderegg Feb 23, 2021
af3f6a9
correctly check when a pipeline is not yet started
sanderegg Feb 23, 2021
ed34535
test expected states when running normally or forcing
sanderegg Feb 23, 2021
6e20066
use project state to initialize comp_tasks
sanderegg Feb 24, 2021
a96aa05
correctly convert to DB type of state type
sanderegg Feb 24, 2021
b28969d
Merge branch 'reset_modified_state' of https://github.com/sanderegg/o…
odeimaiz Feb 24, 2021
c006a64
modified can be null
odeimaiz Feb 24, 2021
0a66f0a
modified can be null
odeimaiz Feb 24, 2021
cf65a42
hasOutputs prop added to NodeStatus
odeimaiz Feb 24, 2021
d93f5f9
Update Node.js
odeimaiz Feb 24, 2021
579d024
modified null if there are no outputs
odeimaiz Feb 24, 2021
a427dc2
Merge branch 'master' into sanderegg-retrieve_more_states
odeimaiz Feb 24, 2021
5204c11
Merge branch 'master' into sanderegg-retrieve_more_states
odeimaiz Feb 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
__pane2: null,
__title: null,
__serviceInfoLayout: null,
__nodeStatusUI: null,
__header: null,
_mainView: null,
__inputsView: null,
Expand All @@ -66,8 +67,9 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
_settingsLayout: null,
_mapperLayout: null,
_iFrameLayout: null,
_loggerLayout: null,
__buttonContainer: null,
__filesButton: null,
__outFilesButton: null,

populateLayout: function() {
this.__cleanLayout();
Expand All @@ -77,6 +79,8 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
this.__addOutputPortsUIs();
this._addSettings();
this._addIFrame();
// this._addLogger();

this._addButtons();
},

Expand Down Expand Up @@ -193,6 +197,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
this._settingsLayout = this.self().createSettingsGroupBox(this.tr("Settings"));
this._mapperLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
this._iFrameLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox());
this._loggerLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox());

return mainView;
},
Expand Down Expand Up @@ -237,8 +242,14 @@ qx.Class.define("osparc.component.node.BaseNodeView", {

header.addSpacer();

// just a placeholder until the node is set
const nodeStatusUI = this.__nodeStatusUI = new qx.ui.core.Widget();
header.add(nodeStatusUI);

header.addSpacer();

const buttonsPart = this.__buttonContainer = new qx.ui.toolbar.Part();
const filesBtn = this.__filesButton = new qx.ui.toolbar.Button(this.tr("Output Files"), "@FontAwesome5Solid/folder-open/14");
const filesBtn = this.__outFilesButton = new qx.ui.toolbar.Button(this.tr("Output Files"), "@FontAwesome5Solid/folder-open/14");
osparc.utils.Utils.setIdToWidget(filesBtn, "nodeViewFilesBtn");
filesBtn.addListener("execute", () => this.__openNodeDataManager(), this);
buttonsPart.add(filesBtn);
Expand Down Expand Up @@ -334,7 +345,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
retrieveBtn.setEnabled(Boolean(this.getNode().getServiceUrl()));
this.__buttonContainer.add(retrieveBtn);
}
this.__buttonContainer.add(this.__filesButton);
this.__buttonContainer.add(this.__outFilesButton);
this.__header.add(this.__buttonContainer);
},

Expand All @@ -346,6 +357,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
const othersStatus2 = isSettingsGroupShowable && !maximize ? "visible" : "excluded";
this._settingsLayout.setVisibility(othersStatus2);
this._mapperLayout.setVisibility(othersStatus);
this._loggerLayout.setVisibility(othersStatus);
this.__header.setVisibility(othersStatus);
},

Expand Down Expand Up @@ -475,13 +487,27 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
throw new Error("Abstract method called!");
},

_addLogger: function() {
return;
},

/**
* @abstract
*/
_openEditAccessLevel: function() {
throw new Error("Abstract method called!");
},

__createNodeStatusUI: function(node) {
const nodeStatusUI = new osparc.ui.basic.NodeStatusUI(node).set({
backgroundColor: "material-button-background"
});
nodeStatusUI.getChildControl("label").set({
font: "text-16"
});
return nodeStatusUI;
},

/**
* @param node {osparc.data.model.Node} node
*/
Expand All @@ -498,6 +524,13 @@ qx.Class.define("osparc.component.node.BaseNodeView", {
const infoButton = this.__getInfoButton();
this.__serviceInfoLayout.add(infoButton);
}

const idx = this.__header.indexOf(this.__nodeStatusUI);
if (idx > -1) {
this.__header.remove(this.__nodeStatusUI);
}
this.__nodeStatusUI = this.__createNodeStatusUI(node);
this.__header.addAt(this.__nodeStatusUI, idx);
}
}
});
63 changes: 42 additions & 21 deletions services/web/client/source/class/osparc/component/node/NodeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,34 +100,55 @@ qx.Class.define("osparc.component.node.NodeView", {

const loadingPage = this.getNode().getLoadingPage();
const iFrame = this.getNode().getIFrame();
if (loadingPage === null && iFrame === null) {
return;
}
[
loadingPage,
iFrame
].forEach(widget => {
if (widget) {
widget.addListener("maximize", e => {
this._maximizeIFrame(true);
}, this);
widget.addListener("restore", e => {
this._maximizeIFrame(false);
}, this);
this._maximizeIFrame(widget.hasState("maximized"));
}
});
this.__iFrameChanged();

iFrame.addListener("load", () => {
if (loadingPage && iFrame) {
[
loadingPage,
iFrame
].forEach(widget => {
if (widget) {
widget.addListener("maximize", e => {
this._maximizeIFrame(true);
}, this);
widget.addListener("restore", e => {
this._maximizeIFrame(false);
}, this);
this._maximizeIFrame(widget.hasState("maximized"));
}
});
this.__iFrameChanged();
});

iFrame.addListener("load", () => {
this.__iFrameChanged();
});
} else {
// This will keep what comes after at the bottom
this._iFrameLayout.add(new qx.ui.core.Spacer(), {
flex: 1
});
}

this._addToMainView(this._iFrameLayout, {
flex: 1
});
},

_addLogger: function() {
this._loggerLayout.removeAll();

const loggerView = this.__loggerView = this.getNode().getLogger().set({
maxHeight: 250
});
loggerView.getChildControl("pin-node").exclude();
const loggerPanel = new osparc.desktop.PanelView(this.tr("Logger"), loggerView).set({
collapsed: true,
backgroundColor: "background-main-lighter"
});
osparc.utils.Utils.setIdToWidget(loggerPanel.getTitleLabel(), "nodeLoggerTitleLabel");
this._loggerLayout.add(loggerPanel);

this._addToMainView(this._loggerLayout);
},

_openEditAccessLevel: function() {
const settingsEditorLayout = osparc.component.node.BaseNodeView.createSettingsGroupBox(this.tr("Settings"));
const propsFormEditor = this.getNode().getPropsFormEditor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ qx.Class.define("osparc.component.widget.CollapsibleView", {
}
case "title": {
const header = this.getChildControl("header");
control = new qx.ui.basic.Atom(this.getTitle());
control = new qx.ui.basic.Label(this.getTitle());
header.addAt(control, 1);
// Attach handler
this.__attachToggler(control);
break;
}
case "icon": {
const header = this.getChildControl("header");
control = new qx.ui.basic.Image();
header.addAt(control, 2);
break;
}
}
return control || this.base(arguments, id);
},
Expand Down Expand Up @@ -187,12 +193,16 @@ qx.Class.define("osparc.component.widget.CollapsibleView", {
}
},

_applyCaretSize: function(size) {
this.getChildControl("caret").setSource(this.__getCaretId(this.getCollapsed()));
},

_applyTitle: function(title) {
this.getChildControl("title").setLabel(title);
this.getChildControl("title").setValue(title);
},

_applyCaretSize: function(size) {
this.getChildControl("caret").setSource(this.__getCaretId(this.getCollapsed()));
_applyIcon: function(icon) {
this.getChildControl("icon").setSource(icon);
},

__getCaretId: function(collapsed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,30 @@ qx.Class.define("osparc.component.widget.NodePorts", {

this.base(arguments, node.getLabel());

this.getTitleBar().set({
height: 30
});
node.bind("label", this, "title");

node.getStatus().bind("modified", this.getChildControl("icon"), "source", {
converter: modified => {
if (modified === null) {
return osparc.utils.StatusUI.getIconSource();
}
return osparc.utils.StatusUI.getIconSource(modified === true ? "modified" : "up-to-date");
}
}, this);
node.getStatus().bind("modified", this.getChildControl("icon"), "textColor", {
converter: modified => {
if (modified === null) {
return osparc.utils.StatusUI.getColor();
}
return osparc.utils.StatusUI.getColor(modified === true ? "modified" : "up-to-date");
}
}, this);
node.getStatus().bind("modified", this.getChildControl("icon"), "toolTipText", {
converter: modified => modified === true ? this.tr("Out of date") : ""
}, this);
},

properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Here is a little example of how to use the widget.
*
* <pre class='javascript'>
* let tableModel = this.__logModel = new osparc.component.widget.logger.RemoteTableModel();
* let tableModel = this.__logModel = new osparc.component.widget.logger.LoggerTable();
* tableModel.setColumns(["Origin", "Message"], ["whoRich", "whatRich"]);
* let custom = {
* tableColumnModel : function(obj) {
Expand All @@ -42,14 +42,19 @@
* @asset(demobrowser/backend/remote_table.php)
*/

qx.Class.define("osparc.component.widget.logger.RemoteTableModel", {

qx.Class.define("osparc.component.widget.logger.LoggerTable", {
extend : qx.ui.table.model.Remote,

construct : function() {
this.base(arguments);

this.setColumns(["Origin", "Message"], ["whoRich", "msgRich"]);
this.setColumns([
"Origin",
"Message"
], [
"whoRich",
"msgRich"
]);

this.__rawData = [];
},
Expand All @@ -60,15 +65,11 @@ qx.Class.define("osparc.component.widget.logger.RemoteTableModel", {
check : "Number",
init: -1
},

filterString: {
nullable: true,
check : "String",
init: ""
},
caseSensitive: {
nullable: false,
check : "Boolean",
init: false
}
},

Expand All @@ -85,8 +86,8 @@ qx.Class.define("osparc.component.widget.logger.RemoteTableModel", {
addRows: function(newRows) {
for (let i=0; i<newRows.length; i++) {
const newRow = newRows[i];
newRow["whoRich"] = osparc.component.widget.logger.RemoteTableModel.addColorTag(newRow.label, newRow.nodeColor);
newRow["msgRich"] = osparc.component.widget.logger.RemoteTableModel.addColorTag(newRow.msg, newRow.msgColor);
newRow["whoRich"] = osparc.component.widget.logger.LoggerTable.addColorTag(newRow.label, newRow.nodeColor);
newRow["msgRich"] = osparc.component.widget.logger.LoggerTable.addColorTag(newRow.msg, newRow.msgColor);
this.__rawData.push(newRow);
}
},
Expand All @@ -100,7 +101,7 @@ qx.Class.define("osparc.component.widget.logger.RemoteTableModel", {
const row = this.__rawData[i];
if (row.nodeId === nodeId) {
row.label = newLabel;
row["whoRich"] = osparc.component.widget.logger.RemoteTableModel.addColorTag(row.label, row.nodeColor);
row["whoRich"] = osparc.component.widget.logger.LoggerTable.addColorTag(row.label, row.nodeColor);
}
}
},
Expand Down Expand Up @@ -143,13 +144,9 @@ qx.Class.define("osparc.component.widget.logger.RemoteTableModel", {
if (searchString === null || searchString === "") {
return true;
}
if (searchString && !this.isCaseSensitive()) {
searchString = searchString.toUpperCase();
}
if (msg !== null && msg !== undefined) {
if (!this.isCaseSensitive()) {
msg = msg.toUpperCase();
}
searchString = searchString.toUpperCase();
if (msg) {
msg = msg.toUpperCase();
return msg.includes(searchString);
}
return false;
Expand Down
Loading