File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 2525from murfey .client .instance_environment import MurfeyInstanceEnvironment
2626from murfey .client .tui .app import MurfeyTUI
2727from murfey .client .tui .status_bar import StatusBar
28+ from murfey .server .api .session_control import router as session_router
2829from murfey .util .client import authorised_requests , read_config
2930from murfey .util .models import Visit
3031
3637def _get_visit_list (api_base : ParseResult , instrument_name : str ):
3738 proxy_path = api_base .path .rstrip ("/" )
3839 get_visits_url = api_base ._replace (
39- path = f"{ proxy_path } /instruments/ { instrument_name } /visits_raw "
40+ path = f"{ proxy_path } { session_router . url_path_for ( 'get_current_visits' , instrument_name = instrument_name ) } "
4041 )
4142 server_reply = requests .get (get_visits_url .geturl ())
4243 if server_reply .status_code != 200 :
Original file line number Diff line number Diff line change 99from sqlmodel import select
1010from werkzeug .utils import secure_filename
1111
12+ import murfey .server .ispyb
1213import murfey .server .prometheus as prom
1314
1415try :
4344 RsyncInstance ,
4445 Session ,
4546)
46- from murfey .util .models import FoilHoleParameters , GridSquareParameters , RsyncerInfo
47+ from murfey .util .models import (
48+ FoilHoleParameters ,
49+ GridSquareParameters ,
50+ RsyncerInfo ,
51+ Visit ,
52+ )
4753from murfey .workflows .spa .flush_spa_preprocess import (
4854 register_foil_hole as _register_foil_hole ,
4955)
@@ -74,6 +80,11 @@ async def new_client_id(db=murfey_db):
7480 return {"new_id" : sorted_ids [- 1 ] + 1 }
7581
7682
83+ @router .get ("/instruments/{instrument_name}/visits_raw" , response_model = List [Visit ])
84+ def get_current_visits (instrument_name : str , db = murfey .server .ispyb .DB ):
85+ return murfey .server .ispyb .get_all_ongoing_visits (instrument_name , db )
86+
87+
7788class SessionInfo (BaseModel ):
7889 session_id : Optional [int ]
7990 session_name : str = ""
You can’t perform that action at this time.
0 commit comments