Skip to content

Commit d01a263

Browse files
authored
Clusters: Requests and Fixes (ITISFoundation#2959)
1 parent 7f144ef commit d01a263

File tree

13 files changed

+283
-314
lines changed

13 files changed

+283
-314
lines changed

services/web/client/source/class/osparc/auth/LoginPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ qx.Class.define("osparc.auth.LoginPage", {
6969
const image = new osparc.ui.basic.LogoWPlatform();
7070
image.setSize({
7171
width: 250,
72-
height: 150
72+
height: osparc.utils.Utils.isProduct("s4l") ? 100 : 150
7373
});
7474
image.setFont("text-18");
7575
return image;

services/web/client/source/class/osparc/auth/ui/LoginView.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ qx.Class.define("osparc.auth.ui.LoginView", {
7676
this.add(pass);
7777
this.__form.add(pass, "", null, "password", null);
7878

79-
const loginBtn = this.__loginBtn = new osparc.ui.form.FetchButton(this.tr("Sign in"));
80-
loginBtn.addListener("execute", () => {
81-
this.__login();
82-
}, this);
79+
const loginBtn = this.__loginBtn = new osparc.ui.form.FetchButton(this.tr("Sign in")).set({
80+
center: true,
81+
appearance: "strong-button"
82+
});
83+
loginBtn.addListener("execute", () => this.__login(), this);
8384
osparc.utils.Utils.setIdToWidget(loginBtn, "loginSubmitBtn");
8485
this.add(loginBtn);
8586

@@ -106,9 +107,7 @@ qx.Class.define("osparc.auth.ui.LoginView", {
106107
}, this);
107108
osparc.utils.Utils.setIdToWidget(registerBtn, "loginCreateAccountBtn");
108109

109-
const forgotBtn = this.createLinkButton(this.tr("Forgot Password?"), () => {
110-
this.fireEvent("toReset");
111-
}, this);
110+
const forgotBtn = this.createLinkButton(this.tr("Forgot Password?"), () => this.fireEvent("toReset"), this);
112111
osparc.utils.Utils.setIdToWidget(forgotBtn, "loginForgotPasswordBtn");
113112

114113
[registerBtn, forgotBtn].forEach(btn => {

services/web/client/source/class/osparc/component/cluster/ClusterDetails.js

Lines changed: 0 additions & 206 deletions
This file was deleted.

services/web/client/source/class/osparc/component/cluster/ClusterMiniView.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,13 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
2121
construct: function() {
2222
this.base(arguments);
2323

24-
this._setLayout(new qx.ui.layout.VBox().set({
25-
alignY: "middle"
26-
}));
27-
2824
const grid = new qx.ui.layout.Grid(2, 2);
29-
const miniGrid = this.__miniGrid = new qx.ui.container.Composite(grid).set({
30-
minWidth: 1
31-
});
32-
this._add(miniGrid);
25+
this._setLayout(grid);
3326

3427
this.__listenToClusterDetails();
3528

3629
this.set({
30+
allowGrowY: false,
3731
cursor: "pointer"
3832
});
3933
this.addListener("tap", () => osparc.utils.Clusters.popUpClustersDetails(this.__clusterId), this);
@@ -60,8 +54,6 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
6054

6155
members: {
6256
__clusterId: null,
63-
__clusterDetailsLayout: null,
64-
__miniGrid: null,
6557
__hint: null,
6658

6759
setClusterId: function(clusterId) {
@@ -91,8 +83,7 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
9183
},
9284

9385
__showBulb: function(failed) {
94-
const miniGrid = this.__miniGrid;
95-
miniGrid.removeAll();
86+
this._removeAll();
9687

9788
const clusterStatusImage = new qx.ui.basic.Image().set({
9889
source: "@FontAwesome5Solid/lightbulb/16",
@@ -101,7 +92,7 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
10192
paddingLeft: 3,
10293
textColor: failed ? "failed-red" : "ready-green"
10394
});
104-
miniGrid.add(clusterStatusImage, {
95+
this._add(clusterStatusImage, {
10596
row: 0,
10697
column: 0
10798
});
@@ -113,8 +104,7 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
113104
},
114105

115106
__updateWorkersDetails: function(clusterDetails) {
116-
const miniGrid = this.__miniGrid;
117-
miniGrid.removeAll();
107+
this._removeAll();
118108

119109
const workers = clusterDetails.scheduler.workers;
120110
if (Object.keys(workers).length === 0) {
@@ -126,20 +116,23 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
126116
const resources = {
127117
cpu: {
128118
metric: "cpu",
119+
usedResource: "CPU",
129120
resource: "CPU",
130121
icon: "@FontAwesome5Solid/microchip/10",
131122
available: 0,
132123
used: 0
133124
},
134125
ram: {
135126
metric: "memory",
127+
usedResource: "RAM",
136128
resource: "RAM",
137129
icon: "@MaterialIcons/memory/10",
138130
available: 0,
139131
used: 0
140132
},
141133
gpu: {
142134
metric: "gpu",
135+
usedResource: "GPU",
143136
resource: "GPU",
144137
icon: "@FontAwesome5Solid/server/10",
145138
available: 0,
@@ -155,14 +148,13 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
155148
},
156149

157150
__updateMiniView: function(resources) {
158-
const miniGrid = this.__miniGrid;
159151
Object.keys(resources).forEach((resourceKey, idx) => {
160152
const resourceInfo = resources[resourceKey];
161153
if (resourceInfo.available === 0) {
162154
return;
163155
}
164156
const icon = new qx.ui.basic.Image(resourceInfo.icon);
165-
miniGrid.add(icon, {
157+
this._add(icon, {
166158
row: idx,
167159
column: 0
168160
});
@@ -174,7 +166,7 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
174166
progressBar.getChildControl("progress").set({
175167
backgroundColor: "visual-blue"
176168
});
177-
miniGrid.add(progressBar, {
169+
this._add(progressBar, {
178170
row: idx,
179171
column: 1
180172
});
@@ -189,9 +181,7 @@ qx.Class.define("osparc.component.cluster.ClusterMiniView", {
189181
return;
190182
}
191183
text += resourceInfo.resource + ": ";
192-
if (resourceKey === "cpu") {
193-
text += osparc.utils.Utils.toTwoDecimals(resourceInfo.used*resourceInfo.available/100) + " / " + resourceInfo.available;
194-
} else if (resourceKey === "ram") {
184+
if (resourceKey === "ram") {
195185
text += osparc.utils.Utils.bytesToGB(resourceInfo.used) + "GB / " + osparc.utils.Utils.bytesToGB(resourceInfo.available) + "GB";
196186
} else {
197187
text += resourceInfo.used + " / " + resourceInfo.available;

0 commit comments

Comments
 (0)