diff options
Diffstat (limited to 'src/main/scala/main/view/View.scala')
| -rw-r--r-- | src/main/scala/main/view/View.scala | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/src/main/scala/main/view/View.scala b/src/main/scala/main/view/View.scala index fd931a8..5213865 100644 --- a/src/main/scala/main/view/View.scala +++ b/src/main/scala/main/view/View.scala @@ -1,5 +1,9 @@ package main.view +import zio._ +import main.infrastructure._ +import main.services._ +import java.lang.System /** * @@ -7,9 +11,17 @@ package main.view * **/ -class View { +/** + * + * Trying to make the passed methods runnable by the fibers + * + **/ + +class View extends Runner { + var resources: Resources = new Resources + /** * General utils that will be used a lot later * */ @@ -62,20 +74,10 @@ class View { } } - def checkInput(input: String): Unit = { - - toInt(input) match { - - case 1 => println("stressing cpu") - case 2 => println("stressing ram") - case 3 => System.exit(0) - - } -} - - def menu: Unit = { + def menu: ZIO[Any, Throwable, Unit] = { var continue = true + var target = "" while (continue) { @@ -87,28 +89,38 @@ class View { _/ |_ ___________ ________ __ ____ \ __\/ _ \_ __ \/ ____/ | \_/ __ \ | | ( <_> ) | \< <_| | | /\ ___/ - |__| \____/|__| \__ |____/ \___ > + |__| \____/|__| \__ |____/ \___ > |__| \/ |======= Select the stress test ========| - | 1: CPU | - | 2: Ram | - | 3: Exit | + | 1: light Cpu | + | 2: Heavy Cpu | + | 3: Light Ram | + | 4: Heavy Ram | + | 5: Exit | |=======================================| """ ) - - checkInput(scala.io.StdIn.readLine()) - } + target = scala.io.StdIn.readLine() + continue = false + } - } + clearScreen + toInt(target) match { + + case 1 => lightCpuRun <&> resources.getCpuInfo + case 2 => heavyCpuRun <&> resources.getCpuInfo + case 3 => lightCpuRun <&> resources.getRamInfo + case 4 => heavyCpuRun <&> resources.getRamInfo - def serveView: Unit = { - + + } + } + + def serveView: ZIO[Any, Throwable, Unit] = { clearScreen header menu - } } |
