diff --git a/WebServer/Components/Pages/Home.razor b/WebServer/Components/Pages/Home.razor index 46c594cf..354c82cf 100644 --- a/WebServer/Components/Pages/Home.razor +++ b/WebServer/Components/Pages/Home.razor @@ -29,6 +29,7 @@ }else{
+

Account

UserName: @Session.UserName
@foreach(PurchasedStock cur in Session.TrackedStocks){ @@ -42,10 +43,16 @@
- Actions - - - +

Actions

+ @if (Debounce){ + + + + }else{ + + + + } @PredictError
@@ -54,22 +61,26 @@
- +

Current Signal

-
- @foreach (stockPredictionPair cur in predictions){ + @foreach (stockPredictionPair cur in predictions){ +
-

Symbol: @cur.Symbol


- @if (cur.Movement == -1){ -

Sell

- } else if (cur.Movement == 1){ -

Buy

- } else{ -

Hold

- } +

@cur.Symbol

- } -
+
+ -> +
+ @if (cur.Movement == -1){ +

Sell

+ } else if (cur.Movement == 1){ +

Buy

+ } else{ +

Hold

+ } + +
+ }
@@ -127,11 +138,11 @@ string predictButtonText = "Predict AI"; string PredictError = ""; - bool pullDebounce = true; + bool Debounce = true; async Task pull(){ PredictError = ""; - if (pullDebounce){ - pullDebounce = false; + if (Debounce){ + Debounce = false; pullButtonText = "Do not refresh the page. The data is pulling."; await Task.Delay(1); Task thread = new Task(async () => { @@ -141,17 +152,16 @@ await Task.Delay(2000); pullButtonText = "Pull Data"; await InvokeAsync(StateHasChanged); - pullDebounce = true; + Debounce = true; }); thread.Start(); } } - bool trainDebounce = true; async Task train(){ PredictError = ""; - if (trainDebounce){ - trainDebounce = false; + if (Debounce){ + Debounce = false; trainButtonText = "Do not refresh the page. The AI is training."; await Task.Delay(1); Task thread = new Task(async () => { @@ -161,7 +171,7 @@ await Task.Delay(2000); trainButtonText = "Train AI"; StateHasChanged(); - trainDebounce = true; + Debounce = true; }); thread.Start(); } @@ -169,26 +179,30 @@ async Task predict(){ PredictError = ""; - predictButtonText = "Do not refresh the page. The AI is predicting"; - await Task.Delay(1); - List threadpool = new List(); - foreach(stockPredictionPair cur in predictions){ - Task thread = new Task(() => { - (string, int)Result = aiModule.PredictAI(cur.Symbol); - if (string.IsNullOrEmpty(Result.Item1)){ - cur.Movement = Result.Item2; - }else{ - PredictError = Result.Item1; - } - Console.WriteLine("Received Signal [" + cur.Symbol + "] : " + cur.Movement); - }); - thread.Start(); - threadpool.Add(thread); + if (Debounce){ + Debounce = false; + predictButtonText = "Do not refresh the page. The AI is predicting"; + await Task.Delay(1); + List threadpool = new List(); + foreach(stockPredictionPair cur in predictions){ + Task thread = new Task(() => { + (string, int)Result = aiModule.PredictAI(cur.Symbol); + if (string.IsNullOrEmpty(Result.Item1)){ + cur.Movement = Result.Item2; + }else{ + PredictError = Result.Item1; + } + Console.WriteLine("Received Signal [" + cur.Symbol + "] : " + cur.Movement); + }); + thread.Start(); + threadpool.Add(thread); + } + await Task.WhenAll(threadpool); + predictButtonText = "Predictions loaded"; + await Task.Delay(2000); + predictButtonText = "Predict AI"; + Debounce = true; } - await Task.WhenAll(threadpool); - predictButtonText = "Predictions loaded"; - await Task.Delay(2000); - predictButtonText = "Predict AI"; } // Data Types diff --git a/WebServer/Components/Pages/Home.razor.css b/WebServer/Components/Pages/Home.razor.css index 54a0f148..516a066d 100644 --- a/WebServer/Components/Pages/Home.razor.css +++ b/WebServer/Components/Pages/Home.razor.css @@ -5,7 +5,6 @@ grid-auto-columns: auto; grid-auto-flow: column; grid-template-columns: max-content; - overflow: scroll; } .gridFrame { @@ -59,4 +58,30 @@ .loginRow button:last-of-type{ float: right; +} + +.signalBlock { + display: flex; +} + +.signalBlock > :nth-child(1) { + border: solid #040 1px; + border-radius: 15px; + width: 40px; + padding: 0px 20px; + background-color: greenyellow; +} + +.signalBlock > :nth-child(2) { + padding: 0 30px; + font-size: 30px; + align-content: center; +} + +.signalBlock > :nth-child(3) { + color: white; + padding: 0 30px; + width: 40px; + border: solid #000 1px; + border-radius: 15px; } \ No newline at end of file