diff --git a/module/group/lang/de.php b/module/group/lang/de.php index c8aba8fa6b..671504ab88 100644 --- a/module/group/lang/de.php +++ b/module/group/lang/de.php @@ -558,6 +558,7 @@ $lang->group->package->deleteRoadmap = 'Delete Roadmap'; $lang->group->package->deleteDemandPool = 'Delete Demand Pool'; $lang->group->package->exportDatatable = 'Export Datatable'; $lang->group->package->ai = 'AI'; +$lang->group->package->aiChatting = 'AI Chat'; $lang->group->package->executePrompt = 'Execute Prompts'; $lang->group->package->manageLLM = 'Manage Models'; $lang->group->package->browsePrompt = 'Browse Prompts'; diff --git a/module/group/lang/en.php b/module/group/lang/en.php index 941b43fcab..6535c40483 100644 --- a/module/group/lang/en.php +++ b/module/group/lang/en.php @@ -558,6 +558,7 @@ $lang->group->package->deleteRoadmap = 'Delete Roadmap'; $lang->group->package->deleteDemandPool = 'Delete Demand Pool'; $lang->group->package->exportDatatable = 'Export Datatable'; $lang->group->package->ai = 'AI'; +$lang->group->package->aiChatting = 'AI Chat'; $lang->group->package->executePrompt = 'Execute Prompts'; $lang->group->package->manageLLM = 'Manage Models'; $lang->group->package->browsePrompt = 'Browse Prompts'; diff --git a/module/group/lang/fr.php b/module/group/lang/fr.php index ece9497483..8f21e16716 100644 --- a/module/group/lang/fr.php +++ b/module/group/lang/fr.php @@ -558,6 +558,7 @@ $lang->group->package->deleteRoadmap = 'Delete Roadmap'; $lang->group->package->deleteDemandPool = 'Delete Demand Pool'; $lang->group->package->exportDatatable = 'Export Datatable'; $lang->group->package->ai = 'AI'; +$lang->group->package->aiChatting = 'AI Chat'; $lang->group->package->executePrompt = 'Execute Prompts'; $lang->group->package->manageLLM = 'Manage Models'; $lang->group->package->browsePrompt = 'Browse Prompts'; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 3dea4dc03e..1ecba08fe4 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1862,6 +1862,7 @@ $lang->resource->ai->prompts = 'promptBrowse'; $lang->resource->ai->promptView = 'promptView'; $lang->resource->ai->promptExecute = 'promptExecute'; $lang->resource->ai->promptExecutionReset = 'promptExecutionReset'; +$lang->resource->ai->chat = 'chat'; $lang->api->methodOrder[0] = 'index'; $lang->api->methodOrder[5] = 'createLib'; diff --git a/module/group/lang/zh-cn.php b/module/group/lang/zh-cn.php index 4f880f78ff..e38d87f5c0 100644 --- a/module/group/lang/zh-cn.php +++ b/module/group/lang/zh-cn.php @@ -558,6 +558,7 @@ $lang->group->package->deleteRoadmap = '删除产品路标'; $lang->group->package->deleteDemandPool = '删除需求池'; $lang->group->package->exportDatatable = '导出数据表'; $lang->group->package->ai = 'AI'; +$lang->group->package->aiChatting = 'AI 聊天'; $lang->group->package->executePrompt = '执行提词'; $lang->group->package->manageLLM = '语言模型管理'; $lang->group->package->browsePrompt = '浏览提词'; diff --git a/module/group/packagemanager.php b/module/group/packagemanager.php index ff3e6b0f37..183c7202c0 100644 --- a/module/group/packagemanager.php +++ b/module/group/packagemanager.php @@ -3775,6 +3775,12 @@ $config->group->package->exportDatatable->subset = 'dataview'; $config->group->package->exportDatatable->privs = array(); $config->group->package->exportDatatable->privs['dataview-export'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 30, 'depend' => array('dataview-browse', 'dataview-query'), 'recommend' => array()); +$config->group->package->aiChatting = new stdclass(); +$config->group->package->aiChatting->order = 2020; +$config->group->package->aiChatting->subset = 'ai'; +$config->group->package->aiChatting->privs = array(); +$config->group->package->aiChatting->privs['ai-chat'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 10, 'depend' => array(), 'recommend' => array()); + $config->group->package->executePrompt = new stdclass(); $config->group->package->executePrompt->order = 2040; $config->group->package->executePrompt->subset = 'ai'; diff --git a/module/index/lang/de.php b/module/index/lang/de.php index 4f1d780868..d053c1d1f5 100644 --- a/module/index/lang/de.php +++ b/module/index/lang/de.php @@ -15,3 +15,11 @@ $lang->index->upgrade = 'Upgrade'; $lang->index->log = 'Log'; $lang->index->detailed = 'Details'; $lang->index->website = 'Please visit the official website'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = 'Chat'; +$lang->index->chat->ai = 'AI'; +$lang->index->chat->unconfiguredFormat = '%s is currently not configured. %s.'; +$lang->index->chat->goConfigureFormat = 'To configure the function, click to navigate to %s configuration'; +$lang->index->chat->contactAdminForHelp = 'Please contact an administrator for assistance'; +$lang->index->chat->unauthorized = 'You are not authorized to access AI chatting. Please contact an administrator for permission.'; diff --git a/module/index/lang/en.php b/module/index/lang/en.php index b2b1f44449..7af2e9d11c 100644 --- a/module/index/lang/en.php +++ b/module/index/lang/en.php @@ -15,3 +15,11 @@ $lang->index->upgrade = 'Upgrade'; $lang->index->log = 'Log'; $lang->index->detailed = 'Details'; $lang->index->website = 'Visit ZenTao official website'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = 'Chat'; +$lang->index->chat->ai = 'AI'; +$lang->index->chat->unconfiguredFormat = '%s is currently not configured. %s.'; +$lang->index->chat->goConfigureFormat = 'To configure the function, click to navigate to %s configuration'; +$lang->index->chat->contactAdminForHelp = 'Please contact an administrator for assistance'; +$lang->index->chat->unauthorized = 'You are not authorized to access AI chatting. Please contact an administrator for permission.'; diff --git a/module/index/lang/fr.php b/module/index/lang/fr.php index 4f1d780868..d053c1d1f5 100644 --- a/module/index/lang/fr.php +++ b/module/index/lang/fr.php @@ -15,3 +15,11 @@ $lang->index->upgrade = 'Upgrade'; $lang->index->log = 'Log'; $lang->index->detailed = 'Details'; $lang->index->website = 'Please visit the official website'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = 'Chat'; +$lang->index->chat->ai = 'AI'; +$lang->index->chat->unconfiguredFormat = '%s is currently not configured. %s.'; +$lang->index->chat->goConfigureFormat = 'To configure the function, click to navigate to %s configuration'; +$lang->index->chat->contactAdminForHelp = 'Please contact an administrator for assistance'; +$lang->index->chat->unauthorized = 'You are not authorized to access AI chatting. Please contact an administrator for permission.'; diff --git a/module/index/lang/vi.php b/module/index/lang/vi.php index 4f1d780868..d053c1d1f5 100644 --- a/module/index/lang/vi.php +++ b/module/index/lang/vi.php @@ -15,3 +15,11 @@ $lang->index->upgrade = 'Upgrade'; $lang->index->log = 'Log'; $lang->index->detailed = 'Details'; $lang->index->website = 'Please visit the official website'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = 'Chat'; +$lang->index->chat->ai = 'AI'; +$lang->index->chat->unconfiguredFormat = '%s is currently not configured. %s.'; +$lang->index->chat->goConfigureFormat = 'To configure the function, click to navigate to %s configuration'; +$lang->index->chat->contactAdminForHelp = 'Please contact an administrator for assistance'; +$lang->index->chat->unauthorized = 'You are not authorized to access AI chatting. Please contact an administrator for permission.'; diff --git a/module/index/lang/zh-cn.php b/module/index/lang/zh-cn.php index 823c4281b4..b214fd2f5b 100644 --- a/module/index/lang/zh-cn.php +++ b/module/index/lang/zh-cn.php @@ -15,3 +15,11 @@ $lang->index->upgrade = '升级'; $lang->index->log = '查看版本更新日志 >'; $lang->index->detailed = '详情'; $lang->index->website = '请访问官网'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = '聊天'; +$lang->index->chat->ai = 'AI 对话'; +$lang->index->chat->unconfiguredFormat = '尚未配置 %s 功能,%s。'; +$lang->index->chat->goConfigureFormat = '点击前往 %s 配置页面 进行功能配置'; +$lang->index->chat->contactAdminForHelp = '请联系管理员进行功能配置'; +$lang->index->chat->unauthorized = '没有权限访问 AI 聊天功能,请联系管理员进行权限分配。'; diff --git a/module/index/lang/zh-tw.php b/module/index/lang/zh-tw.php index d28d0333ca..705b864516 100644 --- a/module/index/lang/zh-tw.php +++ b/module/index/lang/zh-tw.php @@ -15,3 +15,11 @@ $lang->index->upgrade = '升級'; $lang->index->log = '查看版本更新日誌 >'; $lang->index->detailed = '詳情'; $lang->index->website = '請訪問官網'; + +$lang->index->chat = new stdclass(); +$lang->index->chat->chat = '聊天'; +$lang->index->chat->ai = 'AI 對話'; +$lang->index->chat->unconfiguredFormat = '尚未配置 %s 功能,%s。'; +$lang->index->chat->goConfigureFormat = '點擊前往 %s 配置頁面 進行功能配置'; +$lang->index->chat->contactAdminForHelp = '請聯繫管理員進行功能配置'; +$lang->index->chat->unauthorized = '沒有權限訪問 AI 聊天功能,請聯繫管理員進行權限分配。'; diff --git a/module/index/view/chatview.html.php b/module/index/view/chatview.html.php new file mode 100644 index 0000000000..cc8e151201 --- /dev/null +++ b/module/index/view/chatview.html.php @@ -0,0 +1,133 @@ + + * @package index + * @link https://www.zentao.net + */ +?> +config->xuanxuan->turnon) && $this->config->xuanxuan->turnon && $this->loadModel('im')->getXxdStatus() == 'online'; + $isAIConfigured = $this->loadModel('ai')->isModelConfigured(); + $hasAIChatPriv = commonModel::hasPriv('ai', 'chat'); + js::set('isXuanAvailable', $isXuanAvailable); + js::set('isAIConfigured', $isAIConfigured); + js::set('hasAIChatPriv', $hasAIChatPriv); +?> + +
+ +
+ +
index->chat->unconfiguredFormat, $lang->index->chat->chat, (common::hasPriv('setting', 'xuanxuan') ? sprintf($lang->index->chat->goConfigureFormat, helper::createLink('setting', 'xuanxuan'), $lang->index->chat->chat) : $lang->index->chat->contactAdminForHelp)); ?>
+ +
+
+ +
index->chat->unconfiguredFormat, $lang->index->chat->ai, (common::hasPriv('ai', 'models') ? sprintf($lang->index->chat->goConfigureFormat, helper::createLink('ai', 'models') . '#app=admin', $lang->index->chat->ai) : $lang->index->chat->contactAdminForHelp)); ?>
+ +
index->chat->unauthorized; ?>
+ + + +
+
+ diff --git a/module/index/view/index.html.php b/module/index/view/index.html.php index 32777b58d2..eadd67a4ba 100644 --- a/module/index/view/index.html.php +++ b/module/index/view/index.html.php @@ -152,6 +152,7 @@ js::set('showFeatures', $showFeatures); +searchAB);?> searchObjects)) . ',');?> index->search);?> diff --git a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php index b9c0fb5e72..cd411f7bc5 100644 --- a/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php +++ b/xuanxuan/extension/xuan/index/ext/view/index.xuanxuan.html.hook.php @@ -50,13 +50,13 @@ if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon && @@ -87,30 +87,18 @@ function handleXuanRouteChange(route) /* Set client global options*/ Xuanxuan.setGlobalOptions( { - position: 'right', - width: 280, - preload: true, - showHeader: false, - onNotice: handleXuanNoticeChange, - onRouteChange: handleXuanRouteChange, - lang: lang -}); - -$(function() { - /* Create chat button */ - var $chatBtn = $(''); - $chatBtn.insertBefore('#globalSearchDiv').on('click', toggleXuanClient); + position: 'right', + width: 330, + preload: true, + showHeader: false, + showCollapseButtons: false, + onNotice: handleXuanNoticeChange, + onRouteChange: handleXuanRouteChange, + lang: lang, }); /* Create client instance */ window.xuan = new Xuanxuan(xuanConfig); - -/* Hide xuan popover on click page */ -$(document).on('click', function(e) -{ - if(!window.xuan.shown || $(e.target).closest('#xx-embed-container,#chatBtn').length) return; - window.xuan.hide(); -});