Skip to content

Commit f91f52d

Browse files
authored
Merge branch 'master' into fix/computationals-in-appmode
2 parents 9d6849d + 1c829d7 commit f91f52d

File tree

18 files changed

+128
-6
lines changed

18 files changed

+128
-6
lines changed

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver/functions/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import logging
2+
3+
from models_library.api_schemas_webserver import WEBSERVER_RPC_NAMESPACE
4+
from models_library.rabbitmq_basic_types import RPCMethodName
5+
from pydantic import TypeAdapter
6+
7+
from .....logging_utils import log_decorator
8+
from .....rabbitmq import RabbitMQRPCClient
9+
10+
_logger = logging.getLogger(__name__)
11+
12+
13+
@log_decorator(_logger, level=logging.DEBUG)
14+
async def ping(
15+
rabbitmq_rpc_client: RabbitMQRPCClient,
16+
) -> str:
17+
result = await rabbitmq_rpc_client.request(
18+
WEBSERVER_RPC_NAMESPACE,
19+
TypeAdapter(RPCMethodName).validate_python("ping"),
20+
)
21+
assert isinstance(result, str) # nosec
22+
return result

services/api-server/src/simcore_service_api_server/api/root.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .routes import credits as _credits
77
from .routes import (
88
files,
9+
functions,
910
health,
1011
licensed_items,
1112
meta,
@@ -44,6 +45,7 @@ def create_router(settings: ApplicationSettings):
4445
router.include_router(
4546
licensed_items.router, tags=["licensed-items"], prefix="/licensed-items"
4647
)
48+
router.include_router(functions.router, tags=["functions"], prefix="/functions")
4749

4850
# NOTE: multiple-files upload is currently disabled
4951
# Web form to upload files at http://localhost:8000/v0/upload-form-view
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from typing import Annotated
2+
3+
from fastapi import APIRouter, Depends
4+
5+
from ...services_rpc.wb_api_server import WbApiRpcClient
6+
from ..dependencies.webserver_rpc import (
7+
get_wb_api_rpc_client,
8+
)
9+
10+
router = APIRouter()
11+
12+
13+
@router.post("/ping", include_in_schema=False)
14+
async def ping(
15+
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
16+
):
17+
return await wb_api_rpc.ping()

services/api-server/src/simcore_service_api_server/services_rpc/wb_api_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
from servicelib.rabbitmq.rpc_interfaces.resource_usage_tracker.errors import (
2727
NotEnoughAvailableSeatsError,
2828
)
29+
from servicelib.rabbitmq.rpc_interfaces.webserver.functions.functions import (
30+
ping as _ping,
31+
)
2932
from servicelib.rabbitmq.rpc_interfaces.webserver.licenses.licensed_items import (
3033
checkout_licensed_item_for_wallet as _checkout_licensed_item_for_wallet,
3134
)
@@ -194,6 +197,9 @@ async def release_licensed_item_for_wallet(
194197
num_of_seats=licensed_item_checkout_get.num_of_seats,
195198
)
196199

200+
async def ping(self) -> str:
201+
return await _ping(self._client)
202+
197203

198204
def setup(app: FastAPI, rabbitmq_rmp_client: RabbitMQRPCClient):
199205
wb_api_rpc_client = WbApiRpcClient(_client=rabbitmq_rmp_client)

services/docker-compose.devel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ services:
140140
WEBSERVER_LOGLEVEL: DEBUG
141141
WEBSERVER_PROFILING: ${WEBSERVER_PROFILING}
142142
WEBSERVER_REMOTE_DEBUGGING_PORT: 3000
143+
WEBSERVER_FUNCTIONS: ${WEBSERVER_FUNCTIONS}
143144

144145

145146
wb-api-server:

services/docker-compose.local.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ services:
136136
webserver:
137137
environment: &webserver_environment_local
138138
<<: *common_environment
139+
WEBSERVER_FUNCTIONS: ${WEBSERVER_FUNCTIONS}
139140
ports:
140141
- "8080"
141142
- "3001:3000"

services/static-webserver/client/source/class/osparc/desktop/account/MyAccountWindow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ qx.Class.define("osparc.desktop.account.MyAccountWindow", {
2121
construct: function() {
2222
this.base(arguments, "credits", this.tr("My Account"));
2323

24-
const width = 990;
24+
const width = 850;
2525
const height = 700;
2626
const maxHeight = 700;
2727
this.set({

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ qx.Class.define("osparc.desktop.preferences.pages.TagsPage", {
2424
const intro = osparc.ui.window.TabbedView.createHelpLabel(msg);
2525
this._add(intro);
2626

27-
this._add(new qx.ui.core.Spacer(null, 10));
28-
2927
this.__renderLayout();
3028
},
3129

services/static-webserver/client/source/class/osparc/file/TreeFolderView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@ qx.Class.define("osparc.file.TreeFolderView", {
166166
pollTasks.createPollingTask(fetchPromise)
167167
.then(task => {
168168
task.addListener("resultReceived", e => {
169-
const size = e.getData();
169+
const data = e.getData();
170+
const size = (data && "result" in data) ? osparc.utils.Utils.bytesToSize(data["result"]) : "-";
170171
totalSize.set({
171172
icon: null,
172-
label: this.tr("Total size: ") + osparc.utils.Utils.bytesToSize(size),
173+
label: this.tr("Total size: ") + size,
173174
});
174175
});
175176
task.addListener("pollingError", e => totalSize.hide());

0 commit comments

Comments
 (0)