1
1
import React , { useState , ChangeEvent , useEffect } from 'react' ;
2
2
import AppLayout from '@/Layouts/AppLayout' ;
3
3
import axios from 'axios' ;
4
+ import Steppers from '@/Components/Steppers' ;
5
+ import HeaderLabel from '@/Components/HeaderLabel' ;
6
+ import {
7
+ PlusCircleIcon ,
8
+ } from '@heroicons/react/24/outline' ;
9
+ import { Link } from '@inertiajs/react' ;
4
10
5
- // Skeleton for the inference run trigger.
6
11
export default function RunInference ( ) {
12
+ const [ currentStep , setCurrentStep ] = useState ( 1 ) ;
13
+ const steps = [
14
+ { label : 'Start Prediction' , step : 1 }
15
+ ] ;
7
16
8
17
const triggerInference = ( ) => {
9
18
document . getElementById ( "result_area" ) . innerHTML = "Creating inference run..." ;
@@ -19,22 +28,37 @@ export default function RunInference() {
19
28
</ h2 >
20
29
) }
21
30
>
22
- < div className = "py-12" >
23
- < div className = "max-w-7xl mx-auto sm:px-6 lg:px-8" >
24
- < div id = "info_area" >
25
- Triggers an inference run for the one sample model we have.
26
- </ div >
27
- < button id = "button_content"
28
- onClick = { triggerInference }
29
- className = "bg-gray-200 text-gray-700 py-2 px-3 rounded-lg mb-4"
30
- >
31
- Run Inference
32
- </ button >
33
- < div id = "result_area" >
34
- </ div >
35
- </ div >
31
+ < div className = "w-full flex flex-col" id = "main_area" >
32
+ < HeaderLabel className = "pl-12" iconObj = { < PlusCircleIcon aria-hidden = "true" className = "size-6 shrink-0" /> } majorTitle = "Actions" minorTitle = "Start Prediction" > </ HeaderLabel >
33
+ < Steppers currentStep = { currentStep } stepsDict = { steps } className = "pt-32 pb-12" />
34
+ < div className = "flex flex-col items-center justify-center w-full" >
35
+ < div className = "flex" > For the most up-to-date SST predictions we recommend starting a new prediction for each semester.</ div >
36
+ < div className = "flex pb-6" > Select the model and batch that you would like to run a prediction on.</ div >
37
+ < div className = "flex py-3 font-bold" > Step 1: Please select an existing batch or import new data.</ div >
38
+ < div className = "flex flex-row gap-x-6 w-full justify-center" >
39
+ < select className = "flex bg-white border border-gray-200 text-gray-700 py-2 px-6 mb-4 w-1/4 rounded-lg focus:outline-none focus:border-gray-500" id = "batch-id" >
40
+ < option > Batch 1</ option >
41
+ < option > Batch 2</ option >
42
+ </ select >
43
+ < span className = "text-black font-bold flex" > or</ span >
44
+ < Link
45
+ href = { route ( 'file-upload' ) }
46
+ as = "button"
47
+ className = "flex border border-[#f79222] text-[#f79222] bg-white font-semibold py-2 px-6 mb-4 rounded-lg" >
48
+ Upload Data
49
+ </ Link >
50
+ </ div >
51
+ < div className = "flex py-3 font-bold" > Step 2: Please select a model.</ div >
52
+ < select className = "flex bg-white border border-gray-200 text-gray-700 w-1/2 py-2 px-6 mb-4 rounded-lg focus:outline-none focus:border-gray-500" id = "model-id" >
53
+ < option > Model 1</ option >
54
+ < option > Model 2</ option >
55
+ </ select >
56
+ < div className = "flex w-full justify-end items-end pr-48 pt-12" >
57
+ < button id = "button_content" onClick = { triggerInference }
58
+ className = "px-6 bg-[#f79222] text-white font-semibold py-2 px-3 rounded-lg mb-4" > Generate Predictions</ button >
59
+ </ div >
36
60
</ div >
37
-
61
+ </ div >
38
62
</ AppLayout >
39
63
) ;
40
64
}
0 commit comments