Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f47841fdc |
No files matched your search
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react";
|
||||
import { fetchAPI } from "@/shared/rpc/common-function";
|
||||
import { useSharedStore } from "@/shared/store/share";
|
||||
|
||||
type SubType = "mcp" | "skill" | "plugin";
|
||||
type SubType = "mcp";
|
||||
|
||||
type SubRecord = {
|
||||
id: string;
|
||||
@@ -16,8 +16,6 @@ type SubRecord = {
|
||||
|
||||
const TYPE_LABEL: Record<string, string> = {
|
||||
mcp: "MCP 服务",
|
||||
skill: "AI 技能",
|
||||
plugin: "AI 插件",
|
||||
};
|
||||
|
||||
const STATUS_LABEL: Record<string, { text: string; cls: string }> = {
|
||||
@@ -30,7 +28,7 @@ export default function SubmitPage() {
|
||||
// 网页登录态存在 zustand store(XPack_Shared),localStorage["user_token"] 只有扩展侧栏才会写,
|
||||
// 用 store 判断才不会把已登录用户误判为未登录
|
||||
const user_token = useSharedStore((s: any) => s.user_token);
|
||||
const [type, setType] = useState<SubType>("mcp");
|
||||
const type: SubType = "mcp";
|
||||
const [name, setName] = useState("");
|
||||
const [desc, setDesc] = useState("");
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
@@ -121,16 +119,10 @@ export default function SubmitPage() {
|
||||
return (
|
||||
<div className="max-w-xl mx-auto p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h1 className="text-2xl font-bold">上传 MCP / Skill / Plugin</h1>
|
||||
<h1 className="text-2xl font-bold">上传 MCP 服务</h1>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<select value={type} onChange={(e) => setType(e.target.value as SubType)} className={inputCls}>
|
||||
<option value="mcp">MCP 服务</option>
|
||||
<option value="skill">AI 技能</option>
|
||||
<option value="plugin">AI 插件</option>
|
||||
</select>
|
||||
|
||||
<input value={name} onChange={(e) => setName(e.target.value)} placeholder="名称" className={inputCls} required />
|
||||
<textarea value={desc} onChange={(e) => setDesc(e.target.value)} placeholder="描述" className={inputCls} rows={3} />
|
||||
|
||||
@@ -202,10 +194,6 @@ export default function SubmitPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{type !== "mcp" && (
|
||||
<input type="file" onChange={(e) => setFile(e.target.files?.[0] || null)} className={inputCls} />
|
||||
)}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={submitting}
|
||||
|
||||
@@ -22,6 +22,8 @@ RUN mkdir -p /$APP
|
||||
WORKDIR /$APP
|
||||
COPY requirements.txt /$APP/requirements.txt
|
||||
|
||||
# 国内 PyPI 镜像源(避免走代理直连 PyPI 过慢)
|
||||
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
RUN uv venv && source .venv/bin/activate && uv pip install -r requirements.txt
|
||||
RUN echo $VERSION > .version
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""User submission controller for MCP/Skill/Plugin marketplace."""
|
||||
"""User submission controller for MCP marketplace."""
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -141,7 +141,7 @@ def _publish_mcp_service(db: Session, sub: Submission) -> str:
|
||||
return service.id
|
||||
|
||||
|
||||
@router.post("/submission", summary="User submit MCP/Skill/Plugin")
|
||||
@router.post("/submission", summary="User submit MCP")
|
||||
async def create_submission(
|
||||
request: Request,
|
||||
type: str = Form(...),
|
||||
@@ -163,7 +163,7 @@ async def create_submission(
|
||||
if not user_id:
|
||||
return ResponseUtils.error(error_msg=error_msg.NO_PERMISSION)
|
||||
|
||||
if type not in ("mcp", "skill", "plugin"):
|
||||
if type != "mcp":
|
||||
return ResponseUtils.error(error_msg=error_msg.INVALID_PARAMETER)
|
||||
|
||||
# MCP submissions must declare where the service lives so that approving
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""User submission model for MCP/Skill/Plugin marketplace."""
|
||||
"""User submission model for MCP marketplace."""
|
||||
from sqlalchemy import Column, String, Text, DateTime, JSON, Enum
|
||||
from sqlalchemy.sql import func
|
||||
from services.common.models.base import Base
|
||||
|
||||
Reference in new issue
Block a user