-
-
-
+
+
+
+
+
+
+
+
+
- Click or drag a file to this area to upload
-
- Strictly prohibit from uploading sensitive information. For example, your bank card PIN
- or your credit card expiry date.
-
-
-
-
- Loading...
-
- v{{ version.version }} @
- {{ version.commit.substring(0, 6) }}
- {{ version.updatedAt }}
-
-
+
+
+
+ Cancel
+ Create
+
+
+
+
+
+ Create New Bundle
+
+
+ {{ isBundleMode ? 'Cancel' : 'Proceed to Upload' }}
+
+
+
+
+
+
+
+
+
+
+ Loading...
+
+ v{{ version.version }} @
+ {{ version.commit.substring(0, 6) }}
+ {{ version.updatedAt }}
+
+
diff --git a/DysonNetwork.Drive/Storage/BundleController.cs b/DysonNetwork.Drive/Storage/BundleController.cs
index 739f837..7c68eb7 100644
--- a/DysonNetwork.Drive/Storage/BundleController.cs
+++ b/DysonNetwork.Drive/Storage/BundleController.cs
@@ -20,7 +20,7 @@ public class BundleController(AppDatabase db) : ControllerBase
public Instant? ExpiredAt { get; set; }
}
-
+
[HttpGet("{id:guid}")]
[Authorize]
public async Task
> GetBundle([FromRoute] Guid id, [FromQuery] string? passcode)
@@ -35,13 +35,14 @@ public class BundleController(AppDatabase db) : ControllerBase
.FirstOrDefaultAsync();
if (bundle is null) return NotFound();
if (!bundle.VerifyPasscode(passcode)) return Forbid();
-
+
return Ok(bundle);
}
[HttpGet("me")]
[Authorize]
public async Task>> ListBundles(
+ [FromQuery] string? term,
[FromQuery] int offset = 0,
[FromQuery] int take = 20
)
@@ -53,10 +54,12 @@ public class BundleController(AppDatabase db) : ControllerBase
.Where(e => e.AccountId == accountId)
.OrderByDescending(e => e.CreatedAt)
.AsQueryable();
+ if (!string.IsNullOrEmpty(term))
+ query = query.Where(e => EF.Functions.ILike(e.Name, $"%{term}%"));
var total = await query.CountAsync();
Response.Headers.Append("X-Total", total.ToString());
-
+
var bundles = await query
.Skip(offset)
.Take(take)
@@ -114,7 +117,7 @@ public class BundleController(AppDatabase db) : ControllerBase
return StatusCode(403, "You must have a subscription to change the slug of a bundle");
bundle.Slug = request.Slug;
}
-
+
if (request.Name != null) bundle.Name = request.Name;
if (request.Description != null) bundle.Description = request.Description;
if (request.ExpiredAt != null) bundle.ExpiredAt = request.ExpiredAt;
diff --git a/DysonNetwork.Drive/Storage/CloudFile.cs b/DysonNetwork.Drive/Storage/CloudFile.cs
index 7e8c8b7..680ec4c 100644
--- a/DysonNetwork.Drive/Storage/CloudFile.cs
+++ b/DysonNetwork.Drive/Storage/CloudFile.cs
@@ -1,9 +1,9 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using System.Text.Json.Serialization;
using DysonNetwork.Shared.Data;
using DysonNetwork.Shared.Proto;
using Google.Protobuf;
-using Newtonsoft.Json;
using NodaTime;
using NodaTime.Serialization.Protobuf;
diff --git a/DysonNetwork.Shared/DysonNetwork.Shared.csproj b/DysonNetwork.Shared/DysonNetwork.Shared.csproj
index 89f6c1c..03783fe 100644
--- a/DysonNetwork.Shared/DysonNetwork.Shared.csproj
+++ b/DysonNetwork.Shared/DysonNetwork.Shared.csproj
@@ -22,7 +22,6 @@
-
diff --git a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj
index ea12a12..c8c8d6a 100644
--- a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj
+++ b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj
@@ -34,7 +34,6 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-