hvanu commited on
Commit
bb756c3
·
verified ·
1 Parent(s): f214487

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +23 -6
index.html CHANGED
@@ -52,6 +52,7 @@
52
  type="text"
53
  id="url"
54
  placeholder="https://example.com/api"
 
55
  />
56
  </div>
57
  <div class="input-group">
@@ -370,6 +371,7 @@
370
  type="text"
371
  id="url-ocr"
372
  placeholder="https://example.com/api"
 
373
  />
374
  </div>
375
  <div class="input-group">
@@ -445,17 +447,17 @@
445
  class="upload-tab"
446
  >
447
  <div
448
- @click="$refs.fileInput.click()"
449
  @dragover.prevent="dragOver = true"
450
  @dragleave="dragOver = false"
451
- @drop.prevent="handleDrop($event)"
452
  :class="{'has-image': imageUrlOcr, 'border-primary': dragOver}"
453
  class="preview-area"
454
  >
455
  <input
456
  type="file"
457
- @change="handleFileSelect"
458
- x-ref="fileInput"
459
  accept="image/*"
460
  class="hidden"
461
  />
@@ -593,7 +595,7 @@
593
  </div>
594
 
595
  <!-- Confidence Interval Slider -->
596
- <div class="confidence-slider mt-2">
597
  <label
598
  for="confidence-slider"
599
  class="block text-sm font-medium text-gray-700"
@@ -610,7 +612,7 @@
610
  <p class="text-sm mt-1">
611
  Selected: <span x-text="confidenceThreshold"></span>%
612
  </p>
613
- </div>
614
 
615
  <!-- Predict Button -->
616
  <div class="mt-2">
@@ -906,6 +908,13 @@
906
  this.clearResults();
907
  }
908
  },
 
 
 
 
 
 
 
909
 
910
  handleDrop(e) {
911
  this.dragOver = false;
@@ -915,6 +924,14 @@
915
  this.clearResults();
916
  }
917
  },
 
 
 
 
 
 
 
 
918
 
919
  clearImage() {
920
  if (this.imageUrl) {
 
52
  type="text"
53
  id="url"
54
  placeholder="https://example.com/api"
55
+ value="https://api.app.deeploy.ml/workspaces/5aff1650-8d8c-4d0c-b4da-87146360ba82/deployments/8df40f37-11cc-473f-aff5-2112de56f84e/predict"
56
  />
57
  </div>
58
  <div class="input-group">
 
371
  type="text"
372
  id="url-ocr"
373
  placeholder="https://example.com/api"
374
+ value="https://api.app.deeploy.ml/workspaces/5aff1650-8d8c-4d0c-b4da-87146360ba82/deployments/796f79bd-bab8-495e-bc90-6654903312fe/predict"
375
  />
376
  </div>
377
  <div class="input-group">
 
447
  class="upload-tab"
448
  >
449
  <div
450
+ @click="$refs.fileInputOcr.click()"
451
  @dragover.prevent="dragOver = true"
452
  @dragleave="dragOver = false"
453
+ @drop.prevent="handleDropOcr($event)"
454
  :class="{'has-image': imageUrlOcr, 'border-primary': dragOver}"
455
  class="preview-area"
456
  >
457
  <input
458
  type="file"
459
+ @change="handleFileSelectOcr"
460
+ x-ref="fileInputOcr"
461
  accept="image/*"
462
  class="hidden"
463
  />
 
595
  </div>
596
 
597
  <!-- Confidence Interval Slider -->
598
+ <!-- <div class="confidence-slider mt-2">
599
  <label
600
  for="confidence-slider"
601
  class="block text-sm font-medium text-gray-700"
 
612
  <p class="text-sm mt-1">
613
  Selected: <span x-text="confidenceThreshold"></span>%
614
  </p>
615
+ </div> -->
616
 
617
  <!-- Predict Button -->
618
  <div class="mt-2">
 
908
  this.clearResults();
909
  }
910
  },
911
+ handleFileSelectOcr(e) {
912
+ const file = e.target.files[0];
913
+ if (file?.type.match("image.*")) {
914
+ this.imageUrlOcr = URL.createObjectURL(file);
915
+ this.clearResults();
916
+ }
917
+ },
918
 
919
  handleDrop(e) {
920
  this.dragOver = false;
 
924
  this.clearResults();
925
  }
926
  },
927
+ handleDropOcr(e) {
928
+ this.dragOver = false;
929
+ const file = e.dataTransfer.files[0];
930
+ if (file?.type.match("image.*")) {
931
+ this.imageUrlOcr = URL.createObjectURL(file);
932
+ this.clearResults();
933
+ }
934
+ },
935
 
936
  clearImage() {
937
  if (this.imageUrl) {