-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d657f4b
commit 6d034ba
Showing
6 changed files
with
102 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@inject HttpClient Http | ||
|
||
<div class="file"> | ||
<span>@Cell.Content</span>: | ||
<InputFile OnChange="SupplyFileAsync" /> | ||
<div>@status</div> | ||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public blazoract.Shared.Cell Cell { get; set; } | ||
|
||
private string status; | ||
|
||
private async Task SupplyFileAsync(InputFileChangeEventArgs eventArgs) | ||
{ | ||
using var fileStream = eventArgs.File.OpenReadStream(maxAllowedSize: 5*1024*1024); | ||
|
||
status = $"Sending {eventArgs.File.Size} bytes..."; | ||
var url = $"api/code/uploadfile?notebookId={Cell.NotebookId}&variable={Cell.Content}"; | ||
await Http.PostAsync(url, new StreamContent(fileStream)); | ||
|
||
status = $"Finished sending {eventArgs.File.Size} bytes."; | ||
} | ||
} |
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,14 @@ | ||
.file { | ||
display: table; | ||
background-color: #eee; | ||
padding: 1em 2em; | ||
margin: 1em auto; | ||
} | ||
|
||
span { | ||
font-family: monospace; | ||
} | ||
|
||
::deep input[type=file] { | ||
margin-left: 3em; | ||
} |
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