-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve UI for importing a GPO folder
- Loading branch information
Showing
3 changed files
with
64 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,73 @@ | ||
@page "/upload" | ||
@inject NavigationManager navigationManager; | ||
|
||
<title>Upload - PSS</title> | ||
<link href="css/Upload.css" rel="stylesheet"/> | ||
|
||
@{ | ||
jpgPaths = Directory.GetFiles(S.uploadFolderPath, "*.jp*g", SearchOption.AllDirectories); | ||
pngPaths = Directory.GetFiles(S.uploadFolderPath, "*.png", SearchOption.AllDirectories); | ||
gifPaths = Directory.GetFiles(S.uploadFolderPath, "*.gif", SearchOption.AllDirectories); | ||
mp4Paths = Directory.GetFiles(S.uploadFolderPath, "*.mp4", SearchOption.AllDirectories); | ||
mkvPaths = Directory.GetFiles(S.uploadFolderPath, "*.mkv", SearchOption.AllDirectories); | ||
allPaths = jpgPaths.Concat(pngPaths).Concat(gifPaths).Concat(mp4Paths).Concat(mkvPaths).ToArray(); | ||
|
||
<div id="mainDiv"> | ||
@if (allPaths.Length > 0) | ||
{ | ||
<span style="font-size: 25px; margin-bottom: 20px">Items Found in pss_upload Waiting to Be Added to Library</span> | ||
<span class="bigText">Items Found in pss_upload Waiting to Be Added to Library</span> | ||
<button class="textBtn"> | ||
<span class="material-icons-outlined">add_photo_alternate</span><a href="apply-upload">Go to Upload Apply</a> | ||
</button> | ||
} | ||
|
||
<span class="bigText">Import a Folder in pss_upload Sorted with GPO</span> | ||
|
||
<button class="textBtn"> | ||
<span class="material-icons-outlined">drive_folder_upload</span><a href="gpo-import">Import a Folder in pss_upload Sorted with GPO</a> | ||
<button class="textBtn" @onclick="@(() => gpoFolderInputVis = "visible")"> | ||
<span class="material-icons-outlined">drive_folder_upload</span><span>Click to Begin</span> | ||
</button> | ||
|
||
<input style="color: black; width: 650px; visibility: @gpoFolderInputVis" placeholder="Enter the Full Path to a GPO Folder" type="text" @bind="@GpoFolderPath" @bind:event="oninput"/> | ||
<span style="color: red; visibility: @errorSpanVis">Folder path is invalid</span> | ||
|
||
<button class="textBtn" style="visibility: @gpoBtnVis;"> | ||
<span class="material-icons-outlined">add_photo_alternate</span><a href="gpo-import">Begin Importing</a> | ||
</button> | ||
|
||
<input style="color: black; width: 400px" placeholder="Enter the Full Path to a GPO Folder" type="text" @bind="gpoFolderPath" @bind:event="oninput"/> | ||
</div> | ||
} | ||
|
||
@code { | ||
private static string[] jpgPaths, pngPaths, gifPaths, mp4Paths, mkvPaths, allPaths; | ||
public static string gpoFolderPath = ""; //Actually used in ImportGPOFolder.razor | ||
|
||
private static string gpoFolderPath; | ||
|
||
public static string GpoFolderPath //Actually used in ImportGPOFolder.razor | ||
{ | ||
get => gpoFolderPath; | ||
private set | ||
{ | ||
gpoFolderPath = value; | ||
if (!String.IsNullOrWhiteSpace(value) && Directory.Exists(value)) | ||
{ | ||
errorSpanVis = "hidden"; | ||
gpoBtnVis = "visible"; | ||
} | ||
else | ||
{ | ||
errorSpanVis = "visible"; | ||
gpoBtnVis = "hidden"; | ||
} | ||
} | ||
} | ||
|
||
private static string gpoFolderInputVis, errorSpanVis, gpoBtnVis; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
gpoFolderPath = ""; | ||
gpoFolderInputVis = "hidden"; | ||
errorSpanVis = "hidden"; | ||
gpoBtnVis = "hidden"; | ||
|
||
jpgPaths = Directory.GetFiles(S.uploadFolderPath, "*.jp*g", SearchOption.AllDirectories); | ||
pngPaths = Directory.GetFiles(S.uploadFolderPath, "*.png", SearchOption.AllDirectories); | ||
gifPaths = Directory.GetFiles(S.uploadFolderPath, "*.gif", SearchOption.AllDirectories); | ||
mp4Paths = Directory.GetFiles(S.uploadFolderPath, "*.mp4", SearchOption.AllDirectories); | ||
mkvPaths = Directory.GetFiles(S.uploadFolderPath, "*.mkv", SearchOption.AllDirectories); | ||
allPaths = jpgPaths.Concat(pngPaths).Concat(gifPaths).Concat(mp4Paths).Concat(mkvPaths).ToArray(); | ||
} | ||
|
||
} |
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