Add repository management functionality with CRUD operations

- Implemented repoService for database interactions including count, list, get, create, update, and delete operations.
- Created RepoManager component for managing repositories with a user interface.
- Added forms for creating and editing repositories, including validation and error handling.
- Integrated API calls for fetching, creating, updating, and deleting repositories.
- Enhanced user experience with loading states and action feedback messages.
This commit is contained in:
2026-02-01 04:30:17 +00:00
parent f1ed790cab
commit 29cd473190
13 changed files with 855 additions and 116 deletions

View File

@@ -6,6 +6,7 @@ export default function PluginDetail() {
const [searchParams] = useSearchParams();
const provider = (searchParams.get("provider") || "github").toLowerCase();
const baseUrl = searchParams.get("baseUrl") || "";
const repoId = searchParams.get("repoId") || "";
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
@@ -20,6 +21,9 @@ export default function PluginDetail() {
if (baseUrl) {
query.set("baseUrl", baseUrl);
}
if (repoId) {
query.set("repoId", repoId);
}
const search = query.toString();
const response = await fetch(
`/api/plugins/${owner}/${repo}${search.length > 0 ? `?${search}` : ""}`
@@ -40,7 +44,7 @@ export default function PluginDetail() {
}, [owner, repo, provider, baseUrl]);
const manifest = data?.manifest;
const displayName = manifest?.plugin_name || data?.name || repo;
const displayName = data?.label || manifest?.plugin_name || data?.name || repo;
const description = manifest?.description || data?.description;
const author = manifest?.author || "-";
const version = manifest?.version || "-";