diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-11 20:57:30 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-12-11 20:57:30 +0200 |
| commit | 621230afe9d9040536b43241e63117c9bb34beaa (patch) | |
| tree | c9f3a3793372a1be6a7e73cdf633e2dae40c21c9 /Software/Visual_Studio/Tango.Web | |
| parent | 3f069bb4a5303b2c732ba1263229f62526acc693 (diff) | |
| download | Tango-621230afe9d9040536b43241e63117c9bb34beaa.tar.gz Tango-621230afe9d9040536b43241e63117c9bb34beaa.zip | |
Implemented Jobs, JobRuns & Machine Events Synchronization.
Added synchronizations to Updates view on Machine Designer.
Removed request response events logging from machine studio.
Fixed issue with exception throwing from machine service.
Implemented "New jobs synchronized" notification item to PPC.
Added synchronization to PPC settings.
Added Synchronization view to technician module.
Implemented PPC Schema synchronizer utility.
Added custom query support to EntityCollectionBuilder.
Added synchronization status to TangoUpdate.
Removed FK from Jobs and Job runs.
Diffstat (limited to 'Software/Visual_Studio/Tango.Web')
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Web/TangoWebClient.cs | 28 |
2 files changed, 27 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs index d82fcb5f2..3fd3d469e 100644 --- a/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs +++ b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs @@ -70,7 +70,7 @@ namespace Tango.Web.Controllers code = HttpStatusCode.Unauthorized; } - var httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage())); + var httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage(), ex)); #if DEBUG throw httpException; diff --git a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs index 1d2f9fc8e..7c3c6ad2a 100644 --- a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs +++ b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs @@ -37,6 +37,12 @@ namespace Tango.Web public WebToken WebToken { get; private set; } public bool IsAuthenticated { get; private set; } + public TimeSpan RequestTimeout + { + get { return _client.RequestTimeout; } + set { _client.RequestTimeout = value; } + } + public TangoWebClient(DeploymentSlot environment, String controller) { _client = new WebTransportClient(); @@ -57,6 +63,24 @@ namespace Tango.Web Token = token; } + public TangoWebClient(TangoWebClient<TLoginRequest, TLoginResponse> cloned) + { + _client = new WebTransportClient(); + Environment = cloned.Environment; + Address = cloned.Address; + Controller = cloned.Controller; + IsAuthenticated = cloned.IsAuthenticated; + RequestTimeout = cloned.RequestTimeout; + WebToken = cloned.WebToken; + _lastLoginRequest = cloned._lastLoginRequest; + Token = cloned.Token; + } + + public T Clone<T>() where T : TangoWebClient<TLoginRequest, TLoginResponse> + { + return Activator.CreateInstance(typeof(T), new object[] { this }) as T; + } + public async Task<TLoginResponse> Login(TLoginRequest request) { var response = await _client.PostJson<TLoginRequest, TLoginResponse>(GetActionAddress("Login"), request); @@ -85,7 +109,7 @@ namespace Tango.Web var response = await _client.PostJson<TRequest, TResponse>(GetActionAddress(action), request); return response; } - catch (TokenExpiredException) + catch (TokenExpiredException ex) { try { @@ -98,7 +122,7 @@ namespace Tango.Web throw; } } - catch + catch (Exception ex) { throw; } |
