Procházet zdrojové kódy

Merge pull request #2261 from visuddhinanda/development

Development
visuddhinanda před 1 rokem
rodič
revize
69e2b99c86

+ 1 - 0
api-v8/app/Console/Commands/MqAiTranslate.php

@@ -167,6 +167,7 @@ class MqAiTranslate extends Command
                 'content' => $message->task->info->category,
                 'content_type' => 'markdown',
                 'type' => 'discussion',
+                'notification' => false,
             ];
             $response = Http::withToken($token)->post($url, $data);
             if ($response->failed()) {

+ 3 - 1
api-v8/app/Http/Controllers/DiscussionController.php

@@ -348,7 +348,9 @@ class DiscussionController extends Controller
             $parentInfo->increment('children_count', 1);
             $parentInfo->save();
         }
-        Mq::publish('discussion', new DiscussionResource($discussion));
+        if ($request->get('notification', true)) {
+            Mq::publish('discussion', new DiscussionResource($discussion));
+        }
 
         return $this->ok(new DiscussionResource($discussion));
     }

+ 2 - 2
api-v8/app/Http/Controllers/ModelLogController.php

@@ -41,10 +41,10 @@ class ModelLogController extends Controller
         );
 
         $table = $table->skip($request->get('offset', 0))
-            ->take($request->get('limit', 1000));
+            ->take($request->get('limit', 20));
 
         $result = $table->get();
-        return $this->ok(["rows" => ModelLogResource::collection($result), "count" => $count]);
+        return $this->ok(["rows" => ModelLogResource::collection($result), "total" => $count]);
     }
 
     /**

+ 1 - 4
dashboard-v4/dashboard/src/components/ai/AiModelEdit.tsx

@@ -91,10 +91,7 @@ const AiModelEdit = ({ studioName, modelId, onChange }: IWidget) => {
         />
       </ProForm.Group>
       <ProForm.Group>
-        <Publicity
-          name="privacy"
-          disable={["disable", "public_no_list", "blocked"]}
-        />
+        <Publicity name="privacy" disable={["public_no_list", "blocked"]} />
       </ProForm.Group>
       <ProForm.Group>
         <ProFormTextArea

+ 0 - 110
dashboard-v4/dashboard/src/components/ai/AiModelList.tsx

@@ -81,116 +81,6 @@ const AiModelList = ({ studioName }: IWidget) => {
         onRow={(record) => ({
           onClick: () => {},
         })}
-        columns={[
-          {
-            title: intl.formatMessage({
-              id: "dict.fields.sn.label",
-            }),
-            dataIndex: "sn",
-            key: "sn",
-            width: 50,
-            search: false,
-          },
-          {
-            title: intl.formatMessage({
-              id: "forms.fields.name.label",
-            }),
-            dataIndex: "name",
-            key: "name",
-            tooltip: "过长会自动收缩",
-            ellipsis: true,
-            render: (text, row, index, action) => {
-              return (
-                <div key={index}>
-                  <div>
-                    <Link to={`/studio/${studioName}/group/${row.uid}/show`}>
-                      {row.name}
-                    </Link>
-                  </div>
-                  <Text type="secondary"></Text>
-                </div>
-              );
-            },
-          },
-
-          {
-            title: intl.formatMessage({
-              id: "forms.fields.description.label",
-            }),
-            dataIndex: "description",
-            key: "description",
-            search: false,
-            tooltip: "过长会自动收缩",
-            ellipsis: true,
-          },
-          {
-            title: intl.formatMessage({
-              id: "forms.fields.role.label",
-            }),
-            dataIndex: "role",
-            key: "role",
-            width: 100,
-            search: false,
-            filters: true,
-            onFilter: true,
-            valueEnum: RoleValueEnum(),
-          },
-          {
-            title: intl.formatMessage({
-              id: "forms.fields.created-at.label",
-            }),
-            key: "created_at",
-            width: 100,
-            search: false,
-            dataIndex: "created_at",
-            valueType: "date",
-            sorter: true,
-          },
-          {
-            title: intl.formatMessage({ id: "buttons.option" }),
-            key: "option",
-            width: 120,
-            valueType: "option",
-            render: (text, row, index, action) => [
-              <Dropdown.Button
-                key={index}
-                type="link"
-                menu={{
-                  items: [
-                    {
-                      key: "remove",
-                      label: intl.formatMessage({
-                        id: "buttons.delete",
-                      }),
-                      icon: <DeleteOutlined />,
-                      danger: true,
-                    },
-                  ],
-                  onClick: (e) => {
-                    switch (e.key) {
-                      case "share":
-                        break;
-                      case "remove":
-                        showDeleteConfirm(row.uid, row.name);
-                        break;
-                      default:
-                        break;
-                    }
-                  },
-                }}
-              >
-                <Link
-                  to={`/studio/${studioName}/group/${row.uid}/edit`}
-                  target="_blank"
-                >
-                  {intl.formatMessage({
-                    id: "buttons.edit",
-                  })}
-                </Link>
-              </Dropdown.Button>,
-            ],
-          },
-        ]}
         metas={{
           title: {
             dataIndex: "name",

+ 1 - 0
dashboard-v4/dashboard/src/components/ai/AiModelLogList.tsx

@@ -125,6 +125,7 @@ const AiModelLogList = ({ modelId }: IWidget) => {
       pagination={{
         showQuickJumper: true,
         showSizeChanger: true,
+        pageSize: 20,
       }}
       search={false}
       options={{

+ 3 - 1
dashboard-v4/dashboard/src/components/studio/PublicityIcon.tsx

@@ -1,4 +1,4 @@
-import { GlobalOutlined } from "@ant-design/icons";
+import { GlobalOutlined, StopOutlined } from "@ant-design/icons";
 import { TPublicity } from "./PublicitySelect";
 import { LockIcon } from "../../assets/icon";
 
@@ -10,6 +10,8 @@ const PublicityIcon = ({ value }: IWidget) => {
     <GlobalOutlined />
   ) : value === "private" ? (
     <LockIcon />
+  ) : value === "disable" ? (
+    <StopOutlined style={{ color: "red" }} />
   ) : (
     <></>
   );