feat(front-end): upload only supported file and add step warning message
This commit is contained in:
@@ -3,10 +3,16 @@
|
||||
<div class="section">
|
||||
@if (selectedFile()) {
|
||||
<div class="viewer-wrapper">
|
||||
<app-stl-viewer
|
||||
[file]="selectedFile()"
|
||||
[color]="getSelectedFileColor()">
|
||||
</app-stl-viewer>
|
||||
@if (isStepFile(selectedFile())) {
|
||||
<div class="step-warning">
|
||||
<p>{{ 'CALC.STEP_WARNING' | translate }}</p>
|
||||
</div>
|
||||
} @else {
|
||||
<app-stl-viewer
|
||||
[file]="selectedFile()"
|
||||
[color]="getSelectedFileColor()">
|
||||
</app-stl-viewer>
|
||||
}
|
||||
<!-- Close button removed as requested -->
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -202,6 +202,18 @@
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background: var(--color-brand);
|
||||
width: 0%;
|
||||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
.step-warning {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 300px;
|
||||
background: var(--color-neutral-100);
|
||||
border: 1px dashed var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--space-4);
|
||||
text-align: center;
|
||||
color: var(--color-text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,13 @@ export class UploadFormComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges';
|
||||
acceptedFormats = '.stl,.3mf,.step,.stp';
|
||||
|
||||
isStepFile(file: File | null): boolean {
|
||||
if (!file) return false;
|
||||
const name = file.name.toLowerCase();
|
||||
return name.endsWith('.step') || name.endsWith('.stp');
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.form = this.fb.group({
|
||||
|
||||
Reference in New Issue
Block a user