project-model-interaction-window.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="project-model-interaction-window">
  3. <h1 class="headline">Model</h1>
  4. <h2>Predictions</h2>
  5. <button-row>
  6. <button-input type="primary"
  7. @click="predictUnlabeled">predict unlabeled
  8. </button-input>
  9. <button-input type="primary"
  10. @click="predictAll">predict all
  11. </button-input>
  12. <button-input type="primary"
  13. @click="download">download predictions
  14. </button-input>
  15. </button-row>
  16. <h2>Fit</h2>
  17. <div>
  18. <button-input type="primary"
  19. @click="fit">fit model with new data
  20. </button-input>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import ButtonInput from "@/components/base/button-input";
  26. import ButtonRow from "@/components/base/button-row";
  27. export default {
  28. name: "project-model-interaction-window",
  29. components: {ButtonRow, ButtonInput},
  30. props: ['currentProject', 'socket'],
  31. methods: {
  32. predictUnlabeled: function () {
  33. this.socket.post('/projects/' + this.currentProject.id, {'predictUnlabeled': true});
  34. },
  35. predictAll: function () {
  36. this.socket.post('/projects/' + this.currentProject.id, {'predictAll': true});
  37. },
  38. fit: function () {
  39. this.socket.post('/projects/' + this.currentProject.id, {'fit': true});
  40. },
  41. download: function () {
  42. window.location.href = this.socket.baseurl + '/projects/' + this.currentProject.id + '/predictions'
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped>
  48. .project-model-interaction-window {
  49. padding: 1rem;
  50. }
  51. .project-model-interaction-window > div {
  52. margin-bottom: 1rem;
  53. }
  54. h2 {
  55. margin-bottom: 0.5rem;
  56. }
  57. </style>