parent
69b1d3d901
commit
886d4833fb
33 changed files with 853 additions and 783 deletions
@ -1,6 +1,15 @@ |
||||
[build] |
||||
rustflags = [ |
||||
"-L", "/home/ortem/src/rust/unki/static/lib", |
||||
"-L/usr/lib/musl/lib", |
||||
"-L/home/ortem/src/rust/unki/static/lib", |
||||
"--remap-path-prefix=/home/ortem/src/rust/unki=src", |
||||
"--remap-path-prefix=/home/ortem/.cargo=cargo" |
||||
] |
||||
target = "x86_64-unknown-linux-musl" |
||||
|
||||
[env] |
||||
STATIC_PREFIX = "static" |
||||
PQ_LIB_STATIC_X86_64_UNKNOWN_LINUX_MUSL = "true" |
||||
PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU = { value = "static/bin/pg_config", relative = true } |
||||
OPENSSL_STATIC = "true" |
||||
OPENSSL_DIR = { value = "static", relative = true } |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@ |
||||
<h2 mat-dialog-title>New payload</h2> |
||||
<mat-dialog-content> |
||||
<div class="info-dialog-forms-box-smol"> |
||||
<mat-form-field class="info-dlg-field" cdkFocusInitial> |
||||
<mat-label>Name</mat-label> |
||||
<input matInput [(ngModel)]="payload.name"> |
||||
</mat-form-field> |
||||
<input type="file" class="file-input" (change)="onFileSelected($event)" #fileUpload> |
||||
</div> |
||||
<div class="info-dialog-forms-box"> |
||||
<mat-form-field class="info-dlg-field" *ngIf="!uploadMode"> |
||||
<mat-label>Data</mat-label> |
||||
<textarea matInput [(ngModel)]="decodedPayload"></textarea> |
||||
</mat-form-field> |
||||
</div> |
||||
</mat-dialog-content> |
||||
<mat-dialog-actions align="end"> |
||||
<button mat-raised-button (click)="save()">Save</button> |
||||
<button mat-button mat-dialog-close>Close</button> |
||||
</mat-dialog-actions> |
@ -0,0 +1,43 @@ |
||||
import { Component, EventEmitter, Inject } from '@angular/core'; |
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { NewPayloadModel } from 'src/app/models/payload.model'; |
||||
|
||||
@Component({ |
||||
selector: 'new-payload-dialog', |
||||
templateUrl: 'new-payload-dialog.component.html', |
||||
styleUrls: ['../base-info-dialog.component.less'] |
||||
}) |
||||
export class NewPayloadDialogComponent { |
||||
decodedPayload = ""; |
||||
uploadMode = false; |
||||
onSave = new EventEmitter<NewPayloadModel>(); |
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public payload: NewPayloadModel) { } |
||||
|
||||
save() { |
||||
if (this.payload.data.length == 0) { |
||||
this.payload.data = Array.from(new TextEncoder().encode(this.decodedPayload)); |
||||
} |
||||
this.onSave.emit(this.payload); |
||||
} |
||||
|
||||
onFileSelected(event: any) { |
||||
const file: File = event.target.files[0]; |
||||
if (file) { |
||||
this.uploadMode = true |
||||
const reader = new FileReader(); |
||||
reader.onload = e => { |
||||
this.payload.name = file.name; |
||||
const result = e.target?.result; |
||||
if (result instanceof ArrayBuffer) { |
||||
const d = Array.from(new Uint8Array(result)); |
||||
this.payload.data = d; |
||||
console.log(this.payload.data) |
||||
} else { |
||||
alert!("no file") |
||||
} |
||||
} |
||||
reader.readAsArrayBuffer(file) |
||||
} |
||||
} |
||||
} |
@ -1,27 +1,34 @@ |
||||
<h2 mat-dialog-title>Payload</h2> |
||||
<h2 mat-dialog-title *ngIf="isPreview">Payload</h2> |
||||
<h2 mat-dialog-title *ngIf="!isPreview">Editing payload</h2> |
||||
<mat-dialog-content> |
||||
<div class="info-dialog-forms-box"> |
||||
<div class="info-dialog-forms-box-smol"> |
||||
<mat-form-field class="info-dlg-field" cdkFocusInitial> |
||||
<mat-label>ID</mat-label> |
||||
<input matInput readonly value="{{payload.id}}"> |
||||
<input matInput disabled value="{{payload.id}}"> |
||||
</mat-form-field> |
||||
<mat-form-field class="info-dlg-field"> |
||||
<mat-label>Name</mat-label> |
||||
<input matInput value="{{payload.name}}"> |
||||
<input matInput [readonly]="isPreview" [(ngModel)]="payload.name"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="info-dialog-forms-box-smol"> |
||||
<mat-form-field class="info-dlg-field"> |
||||
<mat-label>MIME-type</mat-label> |
||||
<input matInput value="{{payload.mime_type}}"> |
||||
<input matInput disabled value="{{payload.mime_type}}"> |
||||
</mat-form-field> |
||||
<mat-form-field class="info-dlg-field"> |
||||
<mat-label>Size</mat-label> |
||||
<input matInput value="{{payload.size}}"> |
||||
<input matInput disabled value="{{payload.size}}"> |
||||
</mat-form-field> |
||||
</div> |
||||
</div> |
||||
<div class="info-dialog-forms-box"> |
||||
<payload-overview [preview]="true" [payload]="payload"></payload-overview> |
||||
<payload-overview [preview]="isPreview" [payload]="payload.data"></payload-overview> |
||||
</div> |
||||
</mat-dialog-content> |
||||
<mat-dialog-actions align="end"> |
||||
<button mat-raised-button *ngIf="isPreview" (click)="isPreview = false">Edit</button> |
||||
<button mat-raised-button *ngIf="!isPreview" (click)="updatePayload()">Save</button> |
||||
<button mat-button mat-dialog-close>Close</button> |
||||
</mat-dialog-actions> |
@ -1,9 +1,6 @@ |
||||
<div class="info-dialog-forms-box"> |
||||
<mat-form-field class="info-dlg-field" floatLabel="always"> |
||||
<mat-form-field class="info-dlg-field" floatLabel="always"> |
||||
<mat-label>Payload data</mat-label> |
||||
<textarea matInput cdkTextareaAutosize *ngIf="!isTooBigPayload" [readonly]="isPreview" |
||||
[(ngModel)]="decodedPayload"> |
||||
<textarea matInput cdkTextareaAutosize *ngIf="!isTooBigPayload" [readonly]="isPreview" [(ngModel)]="decodedPayload"> |
||||
</textarea> |
||||
<input matInput *ngIf="isTooBigPayload" disabled placeholder="Payload is too big to display"> |
||||
</mat-form-field> |
||||
</div> |
||||
</mat-form-field> |
@ -1,4 +1,4 @@ |
||||
FROM rust:1.67 |
||||
FROM rust:1.72 |
||||
|
||||
RUN rustup target add x86_64-unknown-linux-musl |
||||
RUN mkdir -p /tests && chmod 777 /tests |
||||
|
Loading…
Reference in new issue