Skip to content

Commit 9b937d0

Browse files
committed
Copy Base Url
1 parent b58eef0 commit 9b937d0

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/TokensPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ qx.Class.define("osparc.desktop.preferences.pages.TokensPage", {
7777
const formData = e.getData();
7878
const params = {
7979
data: {
80-
"display_name": formData["name"]
80+
"displayName": formData["name"]
8181
}
8282
};
8383
if (formData["expiration"]) {

services/static-webserver/client/source/class/osparc/desktop/preferences/window/ShowAPIKey.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ qx.Class.define("osparc.desktop.preferences.window.ShowAPIKey", {
3030

3131
members: {
3232
__populateTokens: function(key, secret, baseUrl) {
33-
const hBox1 = this.__createEntry(this.tr("<b>Key:</b>"), key);
33+
const hBox1 = this.__createStarredEntry(this.tr("<b>Key:</b>"), key);
3434
this._add(hBox1);
3535

36-
const hBox2 = this.__createEntry(this.tr("<b>Secret:</b>"), secret);
36+
const hBox2 = this.__createStarredEntry(this.tr("<b>Secret:</b>"), secret);
3737
this._add(hBox2);
3838

3939
const hBox3 = this.__createEntry(this.tr("<b>Base url:</b>"), baseUrl);
@@ -42,40 +42,58 @@ qx.Class.define("osparc.desktop.preferences.window.ShowAPIKey", {
4242
const buttonsLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(10)).set({
4343
appearance: "margined-layout"
4444
});
45-
const copyAPIKeyBtn = new qx.ui.form.Button(this.tr("Copy API Key"));
45+
const copyAPIKeyBtn = new qx.ui.form.Button(this.tr("API Key"), "@FontAwesome5Solid/copy/12");
4646
copyAPIKeyBtn.addListener("execute", e => {
4747
if (osparc.utils.Utils.copyTextToClipboard(key)) {
4848
copyAPIKeyBtn.setIcon("@FontAwesome5Solid/check/12");
4949
}
5050
});
5151
buttonsLayout.add(copyAPIKeyBtn, {
52-
width: "50%"
52+
flex: 1
5353
});
54-
const copyAPISecretBtn = new qx.ui.form.Button(this.tr("Copy API Secret"));
54+
const copyAPISecretBtn = new qx.ui.form.Button(this.tr("API Secret"), "@FontAwesome5Solid/copy/12");
5555
copyAPISecretBtn.addListener("execute", e => {
5656
if (osparc.utils.Utils.copyTextToClipboard(secret)) {
5757
copyAPISecretBtn.setIcon("@FontAwesome5Solid/check/12");
5858
}
5959
});
6060
buttonsLayout.add(copyAPISecretBtn, {
61-
width: "50%"
61+
flex: 1
62+
});
63+
const copyBaseUrlBtn = new qx.ui.form.Button(this.tr("Base URL"), "@FontAwesome5Solid/copy/12");
64+
copyBaseUrlBtn.addListener("execute", e => {
65+
if (osparc.utils.Utils.copyTextToClipboard(baseUrl)) {
66+
copyBaseUrlBtn.setIcon("@FontAwesome5Solid/check/12");
67+
}
68+
});
69+
buttonsLayout.add(copyBaseUrlBtn, {
70+
flex: 1
6271
});
6372
this._add(buttonsLayout);
6473
},
6574

75+
__createStarredEntry: function(title, label) {
76+
const hBox = this.__createEntry(title);
77+
if (label) {
78+
// partially hide the key and secret
79+
hBox.getChildren()[1].setValue(label.substring(1, 8) + "****")
80+
}
81+
return hBox;
82+
},
83+
6684
__createEntry: function(title, label) {
6785
const hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(10)).set({
6886
padding: 5
6987
});
7088
const sTitle = new qx.ui.basic.Label(title).set({
7189
rich: true,
72-
width: 40
90+
width: 60
7391
});
7492
hBox.add(sTitle);
7593
const sLabel = new qx.ui.basic.Label();
7694
if (label) {
7795
// partially hide the key and secret
78-
sLabel.setValue(label.substring(1, 8) + "****")
96+
sLabel.setValue(label);
7997
}
8098
hBox.add(sLabel);
8199
return hBox;

0 commit comments

Comments
 (0)