From 185004aceb400a207d3de6342ee4c2fd6bc34fdd Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Tue, 18 Jul 2023 14:30:36 +0800 Subject: [PATCH] * add prompt view detail block. --- module/ai/control.php | 9 +++++---- module/ai/css/promptview.css | 14 ++++++++++++++ module/ai/view/promptview.html.php | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 module/ai/css/promptview.css diff --git a/module/ai/control.php b/module/ai/control.php index fc0fc6df64..f3fb476927 100644 --- a/module/ai/control.php +++ b/module/ai/control.php @@ -146,10 +146,11 @@ class ai extends control { $prompt = $this->ai->getPromptById($id); - $this->view->prompt = $prompt; - $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('prompt', $id); - $this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name"; - $this->view->position[] = $this->lang->ai->prompts->common; + $this->view->dataPreview = $this->ai->generateDemoDataPrompt($prompt->module, $prompt->source); + $this->view->prompt = $prompt; + $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('prompt', $id); + $this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name"; + $this->view->position[] = $this->lang->ai->prompts->common; $this->display(); } diff --git a/module/ai/css/promptview.css b/module/ai/css/promptview.css new file mode 100644 index 0000000000..e76c90f814 --- /dev/null +++ b/module/ai/css/promptview.css @@ -0,0 +1,14 @@ +.detail-title { + font-weight: normal; + color:#838a9d; +} +.detail-title::before { + content: '['; +} +.detail-title::after { + content: ']'; +} + +.detail-content + .detail-title { + margin-top: 10px; +} diff --git a/module/ai/view/promptview.html.php b/module/ai/view/promptview.html.php index 874ba7d2b7..a5e9a4d15f 100644 --- a/module/ai/view/promptview.html.php +++ b/module/ai/view/promptview.html.php @@ -28,6 +28,30 @@
+
+
+
ai->prompts->role?>
+
role?>
+
ai->prompts->characterization?>
+
characterization?>
+
+
+
ai->prompts->object?>
+
lang->ai->dataSource[$prompt->module]['common']; ?>
+
ai->prompts->field?>
+
+
+
+
ai->prompts->setPurpose?>
+
purpose?>
+
ai->prompts->elaboration?>
+
elaboration?>
+
+
+
ai->prompts->selectTargetForm?>
+
lang->ai->targetForm[$prompt->module][explode('.', $prompt->targetForm)[1]]; ?>
+
+
' . $lang->goback, '', "class='btn'");?>