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:
@@ -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 || "-";
|
||||
|
||||
Reference in New Issue
Block a user