-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dashboard' of https://github.com/unarxiv/CVPM into dash…
…board
- Loading branch information
Showing
22 changed files
with
636 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<v-card> | ||
<v-card-title> | ||
<h2>Actions</h2> | ||
</v-card-title> | ||
<v-card-actions> | ||
<v-btn color="indigo darken-1" outline @click="triggerDialog('test')">Test</v-btn> | ||
</v-card-actions> | ||
<v-dialog v-model="enableTest"> | ||
<cvpm-request | ||
v-if="enableTest" | ||
v-on:closeDialog="triggerDialog('test')" | ||
:config="config" | ||
:vendor="vendor" | ||
:packageName="packageName" | ||
></cvpm-request> | ||
</v-dialog> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import cvpmRequest from '@/components/CVPM-Request' | ||
export default { | ||
data () { | ||
return { | ||
enableTest: false | ||
} | ||
}, | ||
methods: { | ||
triggerDialog (name) { | ||
if (name === 'test') { | ||
this.enableTest = !this.enableTest | ||
} else { | ||
} | ||
} | ||
}, | ||
components: { | ||
'cvpm-request': cvpmRequest | ||
}, | ||
props: ['config', 'vendor', 'packageName'] | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<template> | ||
<v-card> | ||
<v-card-title> | ||
<h2>Solvers</h2> | ||
</v-card-title> | ||
<cvpm-solver-selection | ||
:config=config | ||
:vendor=vendor | ||
:packageName=packageName | ||
v-on:finishSelection="onFinishSelection" | ||
> | ||
</cvpm-solver-selection> | ||
<v-flex class="cvpm-solver-run-btn"> | ||
<v-btn @click="run()" color="indigo" outline>Run</v-btn> | ||
</v-flex> | ||
<v-expansion-panel> | ||
<v-expansion-panel-content> | ||
<div slot="header">Running</div> | ||
<v-list> | ||
<v-list-tile v-for="(solver, index) in runningSolvers" :key="index"> | ||
<v-list-tile-content> | ||
{{solver.SolverName}} | ||
</v-list-tile-content> | ||
<v-list-tile-avatar> | ||
{{solver.Port}} | ||
</v-list-tile-avatar> | ||
</v-list-tile> | ||
</v-list> | ||
</v-expansion-panel-content> | ||
</v-expansion-panel> | ||
<v-dialog persistent v-model="runningConfirmDialog" width="60%"> | ||
<v-card> | ||
<v-card-title> | ||
<span | ||
class="headline" | ||
>Running Solver {{selectedVendor}}/{{selectedPackage}}/{{selectedSolver}}</span> | ||
</v-card-title> | ||
<v-card-text> | ||
<v-text-field | ||
label="Running Port" | ||
v-model="runningPort" | ||
:rules="[rules.validPort]" | ||
hint="Keep it empty if you want to run it on any one of open ports" | ||
></v-text-field> | ||
<p v-if="responseRunningPort">This solver is running on {{responseRunningPort}}</p> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn color="indigo darken-1" flat @click="triggerDialog()" outline>Close</v-btn> | ||
<v-btn | ||
color="indigo darken-1" | ||
@loading="isRequesting" | ||
flat | ||
@click="confirmedRun()" | ||
outline | ||
>Run!</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import { systemService } from '@/services/system' | ||
import cvpmSolverSelection from '@/components/basic/CVPM-Solver-Selection' | ||
export default { | ||
data () { | ||
return { | ||
selectedSolver: '', | ||
selectedVendor: this.vendor[0], | ||
selectedPackage: this.packageName[0], | ||
runningConfirmDialog: false, | ||
runningPort: '', | ||
runningSolvers: [], | ||
responseRunningPort: '', | ||
isRequesting: false, | ||
rules: { | ||
validPort: value => { | ||
if (value === '') { | ||
return true | ||
} | ||
const pattern = /^\+?(0|[1-9]\d*)$/ | ||
if (pattern.test(value)) { | ||
if (parseInt(value) > 1024 && parseInt(value) < 65535) { | ||
return true | ||
} else { | ||
return 'Not a Valid Port Number (Must be a postive integer larger than 1024 and less than 65535)' | ||
} | ||
} else { | ||
return 'Not a Valid Port Number (Only numeric value is accepted)' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
components: { | ||
'cvpm-solver-selection': cvpmSolverSelection | ||
}, | ||
props: ['config', 'vendor', 'packageName'], | ||
methods: { | ||
fetchRunningSolver () { | ||
let self = this | ||
systemService | ||
.getRunningSolver(this.vendor, this.packageName) | ||
.then(function (res) { | ||
self.runningSolvers = res.data | ||
}) | ||
}, | ||
onFinishSelection (value) { | ||
this.selectedSolver = value.selectedSolver | ||
this.selectedVendor = value.selectedVendor | ||
this.selectedPackage = value.selectedPackage | ||
}, | ||
triggerDialog () { | ||
this.runningConfirmDialog = !this.runningConfirmDialog | ||
}, | ||
run () { | ||
if (this.selectedSolver === '') { | ||
alert('no solver specified') | ||
} else { | ||
this.triggerDialog() | ||
} | ||
}, | ||
confirmedRun () { | ||
this.isRequesting = true | ||
let self = this | ||
systemService | ||
.runRepoSolver( | ||
this.selectedVendor, | ||
this.selectedPackage, | ||
this.selectedSolver, | ||
this.runningPort | ||
) | ||
.then(function (res) { | ||
self.isRequesting = false | ||
self.responseRunningPort = res.data.port | ||
}) | ||
} | ||
}, | ||
created () { | ||
this.fetchRunningSolver() | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.cvpm-solver-runner-selection { | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 95%; | ||
} | ||
.cvpm-solver-run-btn { | ||
margin-right: 10%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,98 @@ | ||
<template> | ||
|
||
<v-card> | ||
<v-card-title> | ||
<h2>Test</h2> | ||
</v-card-title> | ||
<cvpm-solver-selection | ||
:config="config" | ||
:vendor="vendor" | ||
:packageName="packageName" | ||
v-on:finishSelection="onFinishSelection" | ||
></cvpm-solver-selection> | ||
<v-card class="cvpm-test-steps"> | ||
<v-stepper v-model="step"> | ||
<v-stepper-header> | ||
<v-stepper-step :complete="step > 1" step="1">Choose Image</v-stepper-step> | ||
<v-divider></v-divider> | ||
<v-stepper-step :complete="step > 2" step="2">Complete Parameters</v-stepper-step> | ||
<v-divider></v-divider> | ||
<v-stepper-step step="3">Check Results</v-stepper-step> | ||
</v-stepper-header> | ||
|
||
<v-stepper-items class="cvpm-test-content"> | ||
<v-stepper-content step="1"> | ||
<cvpm-image-upload v-on:fileSelected="onFileSelected"></cvpm-image-upload> | ||
</v-stepper-content> | ||
<v-stepper-content step="2"> | ||
<cvpm-parameter-input :file=file v-on:finishInfer="onFinishInfer"></cvpm-parameter-input> | ||
</v-stepper-content> | ||
<v-stepper-content step="3"> | ||
<cvpm-json-view :jsonObject="inferResponse"></cvpm-json-view> | ||
</v-stepper-content> | ||
</v-stepper-items> | ||
|
||
</v-stepper> | ||
</v-card> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn color="indigo darken-1" outline @click="closeDialog()">Close</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import cvpmSolverSelection from '@/components/basic/CVPM-Solver-Selection' | ||
import cvpmImageUpload from '@/components/basic/CVPM-Image-Upload' | ||
import cvpmParameterInput from '@/components/basic/CVPM-Parameter-Input' | ||
import cvpmJSONView from '@/components/basic/CVPM-JSON-View' | ||
export default { | ||
data () { | ||
return { | ||
selectedPackage: '', | ||
selectedVendor: '', | ||
selectedSolver: '', | ||
step: 1, | ||
file: null, | ||
inferResponse: {} | ||
} | ||
}, | ||
methods: { | ||
closeDialog () { | ||
this.$emit('closeDialog', true) | ||
}, | ||
onFinishSelection (value) { | ||
this.selectedSolver = value.selectedSolver | ||
this.selectedVendor = value.selectedVendor | ||
this.selectedPackage = value.selectedPackage | ||
}, | ||
onFileSelected (value) { | ||
this.step = 2 | ||
this.file = value | ||
}, | ||
onFinishInfer (value) { | ||
this.inferResponse = value.data | ||
this.step = 3 | ||
} | ||
}, | ||
components: { | ||
'cvpm-solver-selection': cvpmSolverSelection, | ||
'cvpm-image-upload': cvpmImageUpload, | ||
'cvpm-parameter-input': cvpmParameterInput, | ||
'cvpm-json-view': cvpmJSONView | ||
}, | ||
props: ['config', 'vendor', 'packageName'] | ||
} | ||
</script> | ||
|
||
<style> | ||
<style scoped> | ||
.cvpm-test-content { | ||
align-items: center; | ||
justify-content: center; | ||
text-align: center; | ||
} | ||
.cvpm-test-steps { | ||
width: 95%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.