@@ -151,7 +153,7 @@
{
ShowImage = false;
}
-
+
if (!string.IsNullOrEmpty(Folder))
{
_folders = new List { new Folder { FolderId = -1, Name = Folder } };
@@ -369,5 +371,7 @@
public int GetFileId() => FileId;
+ public int GetFolderId() => FolderId;
+
public File GetFile() => _file;
}
diff --git a/Oqtane.Client/Modules/Controls/Pager.razor b/Oqtane.Client/Modules/Controls/Pager.razor
index 9a8b6c61..fec95246 100644
--- a/Oqtane.Client/Modules/Controls/Pager.razor
+++ b/Oqtane.Client/Modules/Controls/Pager.razor
@@ -215,7 +215,7 @@
}
else
{
- Class = "container";
+ Class = "container-fluid px-0";
}
}
diff --git a/Oqtane.Client/Resources/Modules/Admin/Pages/Add.resx b/Oqtane.Client/Resources/Modules/Admin/Pages/Add.resx
index 5f2f31e5..b29a4f1e 100644
--- a/Oqtane.Client/Resources/Modules/Admin/Pages/Add.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/Pages/Add.resx
@@ -181,7 +181,7 @@
Select whether the page is part of the site navigation or hidden
- Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used.
+ Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used. If the page is intended to be the root path specify '/'.Optionally enter a url which this page should redirect to when a user navigates to it
diff --git a/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx b/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
index ab2903cd..55987b3c 100644
--- a/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
@@ -169,7 +169,7 @@
Select whether the page is part of the site navigation or hidden
- Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used.
+ Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used. If the page is intended to be the root path specify '/'.Optionally enter a url which this page should redirect to when a user navigates to it
diff --git a/Oqtane.Client/Services/FileService.cs b/Oqtane.Client/Services/FileService.cs
index 17d93b02..84932e19 100644
--- a/Oqtane.Client/Services/FileService.cs
+++ b/Oqtane.Client/Services/FileService.cs
@@ -109,6 +109,9 @@ namespace Oqtane.Services
attempts += 1;
}
+ await interop.SetElementAttribute(id + "ProgressInfo", "style", "display: none;");
+ await interop.SetElementAttribute(id + "ProgressBar", "style", "display: none;");
+
if (!success)
{
result = result.Substring(0, result.Length - 1);
diff --git a/Oqtane.Client/UI/Interop.cs b/Oqtane.Client/UI/Interop.cs
index b54fde6f..2aa9fb9f 100644
--- a/Oqtane.Client/UI/Interop.cs
+++ b/Oqtane.Client/UI/Interop.cs
@@ -247,5 +247,20 @@ namespace Oqtane.UI
return new ValueTask(Task.FromResult(false));
}
}
+
+ public Task SetElementAttribute(string id, string attribute, string value)
+ {
+ try
+ {
+ _jsRuntime.InvokeVoidAsync(
+ "Oqtane.Interop.setElementAttribute",
+ id, attribute, value);
+ return Task.CompletedTask;
+ }
+ catch
+ {
+ return Task.CompletedTask;
+ }
+ }
}
}
diff --git a/Oqtane.Server/wwwroot/js/interop.js b/Oqtane.Server/wwwroot/js/interop.js
index 73d2398b..0db5c13e 100644
--- a/Oqtane.Server/wwwroot/js/interop.js
+++ b/Oqtane.Server/wwwroot/js/interop.js
@@ -298,10 +298,14 @@ Oqtane.Interop = {
return files;
},
uploadFiles: function (posturl, folder, id) {
- var files = document.getElementById(id + 'FileInput').files;
+ var fileinput = document.getElementById(id + 'FileInput');
+ var files = fileinput.files;
var progressinfo = document.getElementById(id + 'ProgressInfo');
var progressbar = document.getElementById(id + 'ProgressBar');
+ progressinfo.setAttribute("style", "display: inline;");
+ progressbar.setAttribute("style", "width: 200px; display: inline;");
+
for (var i = 0; i < files.length; i++) {
var FileChunk = [];
var file = files[i];
@@ -311,8 +315,6 @@ Oqtane.Interop = {
var EndPos = BufferChunkSize;
var Size = file.size;
- progressbar.setAttribute("style", "width:100%; visibility: visible;");
-
while (FileStreamPos < Size) {
FileChunk.push(file.slice(FileStreamPos, EndPos));
FileStreamPos = EndPos;
@@ -332,21 +334,22 @@ Oqtane.Interop = {
var request = new XMLHttpRequest();
request.open('POST', posturl, true);
request.upload.onloadstart = function (e) {
- progressbar.value = 0;
progressinfo.innerHTML = file.name + ' 0%';
+ progressbar.value = 0;
};
request.upload.onprogress = function (e) {
var percent = Math.ceil((e.loaded / e.total) * 100);
- progressbar.value = (percent / 100);
progressinfo.innerHTML = file.name + '[' + PartCount + '] ' + percent + '%';
+ progressbar.value = (percent / 100);
};
request.upload.onloadend = function (e) {
- progressbar.value = 1;
progressinfo.innerHTML = file.name + ' 100%';
+ progressbar.value = 1;
};
request.send(data);
}
}
+ fileinput.value = '';
},
refreshBrowser: function (reload, wait) {
setInterval(function () {
@@ -360,5 +363,11 @@ Oqtane.Interop = {
},
formValid: function (formRef) {
return formRef.checkValidity();
+ },
+ setElementAttribute: function (id, attribute, value) {
+ var element = document.getElementById(id);
+ if (element !== null) {
+ element.setAttribute(attribute, value);
+ }
}
};