+ ai modules and related stuff from 18 series, WIP.
This commit is contained in:
+11
-2
@@ -578,8 +578,14 @@ define('TABLE_SPACE', '`' . $config->db->prefix . 'space`');
|
||||
define('TABLE_INSTANCE', '`' . $config->db->prefix . 'instance`');
|
||||
define('TABLE_SOLUTION', '`' . $config->db->prefix . 'solution`');
|
||||
define('TABLE_ARTIFACTREPO', '`' . $config->db->prefix . 'artifactrepo`');
|
||||
define('TABLE_PROMPT', '`' . $config->db->prefix . 'prompt`');
|
||||
define('TABLE_PROMPTROLE', '`' . $config->db->prefix . 'promptrole`');
|
||||
|
||||
define('TABLE_AI_PROMPT', '`' . $config->db->prefix . 'ai_prompt`');
|
||||
define('TABLE_AI_PROMPTROLE', '`' . $config->db->prefix . 'ai_promptrole`');
|
||||
define('TABLE_AI_MINIPROGRAM', '`' . $config->db->prefix . 'ai_miniprogram`');
|
||||
define('TABLE_AI_MINIPROGRAMFIELD', '`' . $config->db->prefix . 'ai_miniprogramfield`');
|
||||
define('TABLE_AI_MINIPROGRAMSTAR', '`' . $config->db->prefix . 'ai_miniprogramstar`');
|
||||
define('TABLE_AI_MESSAGE', '`' . $config->db->prefix . 'ai_message`');
|
||||
define('TABLE_AI_MODEL', '`' . $config->db->prefix . 'ai_model`');
|
||||
|
||||
define('TABLE_SQLITE_QUEUE', '`' . $config->db->prefix . 'sqlite_queue`');
|
||||
|
||||
@@ -659,6 +665,9 @@ $config->objectTables['lang'] = TABLE_LANG;
|
||||
$config->objectTables['review'] = TABLE_REVIEW;
|
||||
$config->objectTables['effort'] = TABLE_EFFORT;
|
||||
$config->objectTables['design'] = TABLE_DESIGN;
|
||||
$config->objectTables['prompt'] = TABLE_AI_PROMPT;
|
||||
$config->objectTables['aiapp'] = TABLE_AI_MINIPROGRAM;
|
||||
$config->objectTables['miniprogram'] = TABLE_AI_MINIPROGRAM;
|
||||
|
||||
$config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions', 'aiPrompts', 'promptDesign', 'promptExec');
|
||||
$config->disabledFeatures = '';
|
||||
|
||||
+160
-8
@@ -15889,8 +15889,26 @@ REPLACE INTO `zt_stage` (`name`, `percent`, `type`, `projectType`, `createdBy`,
|
||||
('发布', '10', 'launch', 'ipd', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('全生命周期', '5', 'lifecycle', 'ipd', 'admin', '2020-02-08 21:08:45', 'admin', '2020-02-12 13:50:27', '0');
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_prompt`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_prompt` (
|
||||
-- DROP TABLE IF EXISTS `zt_ai_model`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_model` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`type` varchar(20) NOT NULL,
|
||||
`vendor` varchar(20) NOT NULL,
|
||||
`credentials` text NOT NULL,
|
||||
`proxy` text DEFAULT NULL,
|
||||
`name` varchar(20) DEFAULT NULL,
|
||||
`desc` text DEFAULT NULL,
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
`editedBy` varchar(30) DEFAULT NULL,
|
||||
`editedDate` datetime DEFAULT NULL,
|
||||
`enabled` enum('0', '1') NOT NULL DEFAULT '1',
|
||||
`deleted` enum('0', '1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_prompt`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_prompt` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(20) NOT NULL,
|
||||
`desc` text DEFAULT NULL,
|
||||
@@ -15911,16 +15929,18 @@ CREATE TABLE IF NOT EXISTS `zt_prompt` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `zt_prompt` (`name`, `model`, `module`, `source`, `targetForm`, `purpose`, `elaboration`, `role`, `characterization`, `createdBy`, `createdDate`, `status`) VALUES
|
||||
('需求润色', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.change', '帮忙优化其中各字段的表述,使表述清晰准确。必要时可以修改需求使其更加合理。', '需求描述格式建议使用:作为一名<某种类型的用户>,我希望<达成某些目的>,这样可以<开发的价值>。验收标准建议列举多条。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
INSERT INTO `zt_ai_prompt` (`name`, `model`, `module`, `source`, `targetForm`, `purpose`, `elaboration`, `role`, `characterization`, `createdBy`, `createdDate`, `status`) VALUES
|
||||
('需求润色', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.change', '帮忙优化其中各字段的表述,使表述清晰准确。必要时可以修改需求使其更加合理。', '需求描述格式建议使用:作为一名<某种类型的用户>,我希望<达成某些目的>,这样可以<开发的价值>。验收标准建议列举多条。直接给出你的润色结果,无需建议。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
('一键拆用例', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.testcasecreate', '为这个需求生成一个或多个对应的测试用例。', '', '作为一名资深的测试工程师。', '熟悉测试流程和方法,精通自动化测试和性能测试,能够设计和编写测试用例和测试脚本,擅长问题诊断和分析,熟悉敏捷开发和持续集成,能够协调多部门合作和项目管理。开发工程师应该是专业且严谨的。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
('任务润色', 0, 'task', ',task.name,task.desc,task.pri,task.status,task.estimate,task.consumed,task.left,task.progress,task.estStarted,task.realStarted,', 'task.edit', '优化其中各字段的表述,使表述清晰准确,明确任务目标。', '必要时指出任务的风险点。', '你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
('需求转任务', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.totask', '将需求转化为对应的开发任务要求。', '', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。同时精通多种编程语言和框架、熟悉前后端技术。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
('Bug润色', 0, 'bug', ',bug.title,bug.steps,bug.severity,bug.pri,bug.status,bug.confirmed,bug.type,', 'bug.edit', '优化其中各字段的表述,使表述清晰准确。', 'Bug描述格式建议使用:[步骤]<一步一步复现Bug的步骤>[结果]<Bug导致的结果描述>[期望]<Bug修复后期望的描述>', '作为一名资深的测试工程师。', '熟悉测试流程和方法,精通自动化测试和性能测试,能够设计和编写测试用例和测试脚本,擅长问题诊断和分析,熟悉敏捷开发和持续集成,能够协调多部门合作和项目管理。开发工程师应该是专业且严谨的。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
('文档润色', 0, 'doc', ',doc.content,doc.title,', 'doc.edit', '我希望你能帮我润色标题和文档正文。', '要求语句要通顺,逻辑要清晰,没有错别字且更具结构化。', '你是一名文章写得很好的文案编辑。', '文笔流畅、条理清晰。精通广告文案写作和编辑,擅长创意思维和品牌策略,能够进行市场调研和竞品分析,具有敏锐的审美和语言表达能力,能够协调多部门合作和项目管理,具有良好的沟通和协调能力。', 'system', '2023-08-31 15:54:57', 'active');
|
||||
('文档润色', 0, 'doc', ',doc.content,doc.title,', 'doc.edit', '我希望你能帮我润色标题和文档正文。', '要求语句要通顺,逻辑要清晰,没有错别字且更具结构化。', '你是一名文章写得很好的文案编辑。', '文笔流畅、条理清晰。精通广告文案写作和编辑,擅长创意思维和品牌策略,能够进行市场调研和竞品分析,具有敏锐的审美和语言表达能力,能够协调多部门合作和项目管理,具有良好的沟通和协调能力。', 'system', '2023-08-31 15:54:57', 'active'),
|
||||
('Bug转需求', 0, 'bug', ',bug.title,bug.steps,bug.severity,bug.pri,bug.status,bug.confirmed,bug.type,', 'story.create', '请将Bug转化为相应的研发需求。', '分条编写需求描述,分条编写验收标准,需求逻辑条理清晰。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。', 'system', '2023-11-17 12:00:00', 'active'),
|
||||
('拆分一个子计划', 0, 'productplan', ',productplan.title,productplan.desc,productplan.begin,productplan.end,', 'productplan.create', '根据给定计划名称、描述、计划开始时间和计划结束时间,将给定计划明确为其小范围的子计划。拆分出来的子计划可以更专注于给定计划中的某一类工作。 ', '要求子计划的时间不能超出计划开始时间和计划结束时间,并且名称不能与原计划名称相同。润色子计划的描述。', '请你扮演一名资深的产品经理。', '负责产品计划、设计、用户体验等方面,需要具备多种技能和能力,以实现产品目标和公司战略。', 'system', '2023-11-17 12:00:00', 'active');
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_promptrole`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_promptrole` (
|
||||
-- DROP TABLE IF EXISTS `zt_ai_promptrole`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_promptrole` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(30) DEFAULT NULL,
|
||||
`desc` text DEFAULT NULL,
|
||||
@@ -15931,7 +15951,7 @@ CREATE TABLE IF NOT EXISTS `zt_promptrole` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `zt_promptrole` (`role`, `characterization`) VALUES
|
||||
INSERT INTO `zt_ai_promptrole` (`role`, `characterization`) VALUES
|
||||
('请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。'),
|
||||
('你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。'),
|
||||
('作为一名资深的测试工程师。', '测试工程师应该是专业且严谨的。熟悉测试流程和方法,精通自动化测试和性能测试,能够设计和编写测试用例和测试脚本,擅长问题诊断和分析,熟悉敏捷开发和持续集成,能够协调多部门合作和项目管理。'),
|
||||
@@ -15940,6 +15960,138 @@ INSERT INTO `zt_promptrole` (`role`, `characterization`) VALUES
|
||||
('请你扮演一名经验丰富的项目经理。', '具备项目计划制定、进度管理、成本控制、团队管理、沟通协调、风险管理、质量控制、敏捷开发、互联网技术和数据分析等多方面的技能和能力。'),
|
||||
('你是一个自回归的语言模型,已经通过instruction-tuning和RLHF进行了Fine-tuning。', '你仔细地提供准确、事实、深思熟虑、细致入微的答案,并在推理方面表现出色。如果你认为可能没有正确的答案,你会直接说出来。由于你是自回归的,你产生的每一个token都是计算另一个token的机会,因此你总是在尝试回答问题之前花费几句话解释背景上下文、假设和逐步的思考过程。您的用户是AI和伦理学的专家,所以他们已经知道您是一个语言模型以及您的能力和局限性,所以不需要再提醒他们。他们一般都熟悉伦理问题,所以您也不需要再提醒他们。在回答时不要啰嗦,但在可能有助于解释的地方提供详细信息和示例。');
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_miniprogram`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_miniprogram` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(30) NOT NULL,
|
||||
`category` varchar(30) NOT NULL,
|
||||
`desc` text DEFAULT NULL,
|
||||
`model` mediumint(8) unsigned DEFAULT NULL,
|
||||
`icon` varchar(30) NOT NULL DEFAULT 'writinghand-7',
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
`editedBy` varchar(30) NOT NULL,
|
||||
`editedDate` datetime NOT NULL,
|
||||
`published` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`publishedDate` datetime DEFAULT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`prompt` text NOT NULL,
|
||||
`builtIn` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `zt_ai_miniprogram` (`id`, `name`, `category`, `desc`, `model`, `icon`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `published`, `publishedDate`, `deleted`, `prompt`, `builtIn`) VALUES
|
||||
(1, '职业发展导航', 'personal', '职业发展导航是一个旨在帮助用户规划和实现职业目标的AI小程序,为用户提供个性化的建议。', 0, 'technologist-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份职业发展导航,我的教育背景为 <教育背景> ,职位信息为 <职位信息> ,工作经验描述如下: <工作经验> ,掌握的技能为 <掌握技能> ,为了实现 <职业目标> ,我想做一个 <规划时长> 的计划,我有更多感兴趣的领域为 <更多感兴趣的领域> ,有更多补充内容 <补充信息> ,来追求相关机会和进一步发展,控制在30字以内。', '1'),
|
||||
(2, '工作汇报', 'work', '旨在帮助您轻松撰写和管理您的工作汇报。无论是每周、每月还是季度性的报告,我们提供了一个简单而高效的平台,让您能够清晰、有条理地记录和展示您的工作成果。', 0, 'technologist-2', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我的基本信息如下: <身份描述> ,请根据我的工作情况生成一份工作汇报,需要包含 <汇报内容维度> ,汇报对象描述为 <汇报对象> ,另外还需要补充 <补充信息> 。下面是我的工作内容基本描述: <工作内容描述> ,控制在30字以内。', '1'),
|
||||
(3, '市场分析报告', 'work', '市场分析报告小程序是一个旨在帮助用户根据互联网信息快速生成市场分析报告的AI小程序。', 0, 'chart-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份市场分析报告,我目标市场是 <目标市场> ,市场概况为 <市场概况> ,该领域的细分市场有 <细分市场> ,同时我希望能针对 <竞品名称> 展开竞品分析,竞品分析的维度是 <竞品分析维度> ,来帮助我快速的了解市场。', '1'),
|
||||
(4, '健身计划', 'life', '健身计划小程序旨在帮助您制定和管理个性化的健身计划,让您更轻松、高效地实现健康和体能目标。', 0, 'cactus-5', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我的基本信息如下: <性别> 、 <基本信息> ,我想做一份健身计划,达成 <目标设定> 的效果,对于目标我有如下更多补充:: <目标补充> 。我的初步想法是进行 <计划类型> 方面的类型,训练频次为 <训练频率> ,同时给身体足够的休息和恢复时间,要求如下 <休息与恢复> ,请根据我的上述情况生成一份健身计划,控制在30字以内。', '1'),
|
||||
(5, '广告创意大师', 'creative', '广告创意大师是一个根据产品卖点,快速为用户提供广告文案的AI小程序。', 0, 'palette-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '假设我是一名 <角色> ,请结合产品卖点和目标用户,帮我为 <产品名称> 生成 <文案数量> 条计划投放在 <投放渠道> 的广告文案,且保证每条文案的字数不超过30字;产品的核心卖点是 <核心卖点> ,目标用户是 <目标用户> 。', '1'),
|
||||
(6, '文章撰写助手', 'creative', '旨在为自媒体创作者提供一个强大而便捷的平台,助力您撰写优质的文章并实现更广泛的影响力。', 0, 'writinghand-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '生成一篇标题为 <文章主题> 的文章,文章内容概要为 <内容概要> ,计划发布到 <发布平台> ,需要注意控制 <规范要求> 。', '1'),
|
||||
(7, '视频脚本创意工坊', 'creative', '视频脚本创意工房是一个帮助新手视频博主快速梳理视频创作思路,生成拍摄脚本的AI小程序。', 0, 'notebook-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '假设我是一个新手视频博主,现请以 <主题> 为题,创作一个时长不超过 <视频时长> 分钟, <视频风格> 风格的视频脚本。', '1'),
|
||||
(8, '邮件起草助手', 'life', '邮件起草助手可以帮助用户更快速地起草邮件,减少繁琐的手动输入和编辑过程,帮助用户更好地表达和提升效率。', 5, 'computer-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请为我提供一份邮件的起草建议和模板,根据 <邮件目的> 为目的,收件对象与我的关系为 <收件人关系> ,需要包含如下邮件内容: <邮件内容> ,使用 <邮件口吻> 的口吻,字数限制在 <字数限制> 之内,更多需要按照 <补充信息> 进行完善。', '1'),
|
||||
(9, '新人介绍', 'personal', '新人介绍小程序是一个旨在帮助用户在入职当天,快速编写自我介绍的AI小程序。', 0, 'pencil-7', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份新人介绍,我的年龄是 <年龄> ,籍贯是 <籍贯信息> ,毕业于 <毕业院校> ,工作经验为 <工作经验> ,日常爱好是 <爱好> ,请将字数控制在300字以内,来帮助我完成新人入职的自我介绍,', '1'),
|
||||
(10, '调研问卷生成器', 'work', '调研问卷生成器是一个可以快速依据用户需要生成问卷内容的好帮手,旨在为用户提供更多的问题设计思路。', 5, 'search-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份调查问卷内容,我希望以 <调研主题> 为调研方向,问卷调研对象为 <调研对象> ,问题主题至少需要包括如下内容: <问题主题> ,期望题目类型包括 <题目类型> ,题目数量限制为 <题目数量> ,更多需要按照 <补充信息> 进行完善。', '1'),
|
||||
(11, 'OKR目标达人', 'personal', 'OKR目标达人是一个旨在帮助用户规划和实现高效目标管理的AI小程序。', 5, 'pushpin-1', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我是一名 <所处行业> 行业的 <职业名称> ,主要负责的工作是 <工作内容> ,请帮我写一份 <时间范围> 的OKR,需要包括目标和关键结果,更多信息依据 <补充信息> 进行完善。', '1'),
|
||||
(12, '学习规划师', 'life', '学习计划师是一个旨在帮助用户快速制定学习的AI小程序,为用户提供个性化的建议。', 5, 'notebook-7', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我希望通过 <持续天数> 的学习计划来学习 <学习内容> 以达成 <目标设定> 的目标,在这个计划中需要包括以下 <学习内容> ,并为我提供对应的学习建议和指导,更多信息依据 <补充信息> 进行完善,使我能够在这段时间内取得最佳的学习效果。', '1');
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_message`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_message` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`appID` mediumint(8) unsigned NOT NULL,
|
||||
`user` mediumint(8) unsigned NOT NULL,
|
||||
`type` enum('req', 'res', 'ntf') NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_miniprogramfield` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`appID` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(30) NOT NULL,
|
||||
`type` enum('radio', 'checkbox', 'text', 'textarea') DEFAULT 'text',
|
||||
`placeholder` text DEFAULT NULL,
|
||||
`options` text DEFAULT NULL,
|
||||
`required` enum('0', '1') DEFAULT '1',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `zt_ai_miniprogramfield` (`appID`, `name`, `type`, `placeholder`, `options`, `required`) VALUES
|
||||
(1, '教育背景', 'textarea', '学历/专业', NULL, '0'),
|
||||
(1, '职位信息', 'text', '行业领域/职位描述', NULL, '0'),
|
||||
(1, '工作经验', 'textarea', '简要概述工作成果、团队合作沟通经验等', NULL, '0'),
|
||||
(1, '掌握技能', 'textarea', '关键技能、熟练程度', NULL, '0'),
|
||||
(1, '职业目标', 'text', '请输入你的职业目标', NULL, '0'),
|
||||
(1, '更多感兴趣的领域', 'textarea', '请输入更多你感兴趣的领域', NULL, '0'),
|
||||
(1, '规划时长', 'radio', NULL, '1年,3-5年,10年', '1'),
|
||||
(1, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
|
||||
(2, '身份描述', 'textarea', '职位/角色/职责', NULL, '0'),
|
||||
(2, '工作内容描述', 'textarea', '请输入工作内容', NULL, '1'),
|
||||
(2, '汇报对象', 'textarea', '请输入汇报对象信息', NULL, '0'),
|
||||
(2, '汇报内容维度', 'checkbox', NULL, '完成情况,遇到的问题,关键指标,团队协作,进一步改进', '0'),
|
||||
(2, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
|
||||
(3, '目标市场', 'text', '请概述目标市场的定义和范围', NULL, '0'),
|
||||
(3, '市场概况', 'text', '可描述市场规模、增长率、发展趋势等信息', NULL, '0'),
|
||||
(3, '细分市场', 'text', '请描述市场的主要细分领域', NULL, '0'),
|
||||
(3, '竞品名称', 'text', '请描述列举竞品名称', NULL, '0'),
|
||||
(3, '竞品分析维度', 'checkbox', NULL, '市场份额,市场定位,产品特点,服务特点,销售策略,营销策旅', '0'),
|
||||
(4, '性别', 'radio', NULL, '男,女', '1'),
|
||||
(4, '基本信息', 'textarea', '请输入身高、体重等基础信息', NULL, '0'),
|
||||
(4, '目标设定', 'checkbox', NULL, '增肌,减脂,增强体能,特定方面的能力', '1'),
|
||||
(4, '目标补充', 'textarea', '可以补充对目标的详细描述', NULL, '0'),
|
||||
(4, '计划类型', 'checkbox', NULL, '重力训练,有氧运动,柔韧训练', '0'),
|
||||
(4, '训练频率', 'text', '请输入训练频次', NULL, '0'),
|
||||
(4, '休息与恢复', 'textarea', '请输入睡眠及饮食要求', NULL, '0'),
|
||||
(5, '角色', 'text', '请设定角色', NULL, '0'),
|
||||
(5, '产品名称', 'text', '请输入产品名称', NULL, '0'),
|
||||
(5, '文案数量', 'radio', NULL, '1,2,3,4,5', '0'),
|
||||
(5, '核心卖点', 'text', '请概述产品的核心卖点', NULL, '0'),
|
||||
(5, '目标用户', 'text', '请概述产品的主要目标用户', NULL, '0'),
|
||||
(5, '投放渠道', 'checkbox', NULL, '电视,广播,户外,网络,报刊,电影', '0'),
|
||||
(6, '文章主题', 'textarea', '请输入文章主题', NULL, '1'),
|
||||
(6, '内容概要', 'textarea', '请输入内容概要', NULL, '0'),
|
||||
(6, '规范要求', 'textarea', '例如语气描述、字数限制等', NULL, '0'),
|
||||
(6, '发布平台', 'text', '该文章计划发布的平台', NULL, '0'),
|
||||
(7, '主题', 'text', '请描述视频主题', NULL, '0'),
|
||||
(7, '视频风格', 'checkbox', NULL, '纪实,人文,风景,动画,广告', '0'),
|
||||
(7, '视频时长', 'radio', NULL, '1,3,5,10', '0'),
|
||||
(8, '邮件目的', 'textarea', '您此次发送邮件的目的', NULL, '1'),
|
||||
(8, '收件人关系', 'text', '简述与收件人之间的关系', NULL, '1'),
|
||||
(8, '邮件内容', 'textarea', '简述邮件内容', NULL, '1'),
|
||||
(8, '邮件口吻', 'textarea', '请输入期望的邮件口吻', NULL, '0'),
|
||||
(8, '字数限制', 'text', '请输入字数限制', NULL, '0'),
|
||||
(8, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
|
||||
(9, '年龄', 'text', '年龄', NULL, '0'),
|
||||
(9, '籍贯信息', 'text', '省/市', NULL, '0'),
|
||||
(9, '毕业院校', 'text', '毕业院校/专业', NULL, '0'),
|
||||
(9, '工作经验', 'textarea', '请简要概述从事行业、工作年限、工作岗位等经验', NULL, '0'),
|
||||
(9, '爱好', 'textarea', '请输入', NULL, '0'),
|
||||
(10, '调研主题', 'textarea', '请简述您的调研主题', NULL, '1'),
|
||||
(10, '调研对象', 'textarea', '简述调研对象', NULL, '1'),
|
||||
(10, '问题主题', 'textarea', '简述您想要调研的主题问题', NULL, '0'),
|
||||
(10, '题目类型', 'textarea', '请输入期望包括的题型', NULL, '0'),
|
||||
(10, '题目数量', 'text', '请输入题目数量限制', NULL, '0'),
|
||||
(10, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
|
||||
(11, '所处行业', 'text', '请输入所处行业', NULL, '0'),
|
||||
(11, '职业名称', 'text', '请输入职业名称', NULL, '1'),
|
||||
(11, '工作内容', 'textarea', '请简述你的工作', NULL, '1'),
|
||||
(11, '时间范围', 'checkbox', NULL, '月度,季度,半年度,年度', '0'),
|
||||
(11, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
|
||||
(12, '持续天数', 'text', '请输入天数', NULL, '0'),
|
||||
(12, '学习内容', 'textarea', '简要概述要学习的内容方向', NULL, '1'),
|
||||
(12, '目标设定', 'textarea', '简要期望达成的目标', NULL, '0'),
|
||||
(12, '计划内容', 'checkbox', NULL, '每日学习任务,适用的学习资源,学习方法,进度跟踪方式,激励机制', '0'),
|
||||
(12, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_miniprogramstar` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`appID` mediumint(8) unsigned NOT NULL,
|
||||
`userID` mediumint(8) unsigned NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
UNIQUE (`appID`, `userID`),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
ALTER TABLE `zt_ticket` ADD `subStatus` varchar(30) NOT NULL DEFAULT '';
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_market`;
|
||||
|
||||
@@ -64,6 +64,7 @@ $config->action->objectNameFields['space'] = 'name';
|
||||
$config->action->objectNameFields['solution'] = 'name';
|
||||
$config->action->objectNameFields['artifactrepo'] = 'name';
|
||||
$config->action->objectNameFields['prompt'] = 'name';
|
||||
$config->action->objectNameFields['miniprogram'] = 'name';
|
||||
$config->action->objectNameFields['holiday'] = 'name';
|
||||
|
||||
$config->action->commonImgSize = 870;
|
||||
|
||||
@@ -178,6 +178,7 @@ $lang->action->objectTypes['service'] = 'Service';
|
||||
$lang->action->objectTypes['domain'] = 'Domain';
|
||||
$lang->action->objectTypes['artifactrepo'] = 'Artifact Repo';
|
||||
$lang->action->objectTypes['prompt'] = 'Prompt';
|
||||
$lang->action->objectTypes['miniprogram'] = 'Mini Program';
|
||||
$lang->action->objectTypes['metric'] = 'Metric';
|
||||
$lang->action->objectTypes['projectbuild'] = 'Build';
|
||||
|
||||
@@ -860,6 +861,8 @@ $lang->action->label->host = 'Host|host|view|id=%s';
|
||||
$lang->action->label->account = "Account|account|view|id=%s";
|
||||
$lang->action->label->instance = 'Application|instance|view|id=%s';
|
||||
$lang->action->label->artifactrepo = 'Artifact Repo|artifactrepo|browse|';
|
||||
$lang->action->label->prompt = 'Prompt|ai|promptview|id=%s';
|
||||
$lang->action->label->miniprogram = 'Mini Program|aiapp|browseminiprogram|id=%s';
|
||||
$lang->action->label->holiday = 'Holiday|holiday|browse|';
|
||||
|
||||
/* Object type. */
|
||||
|
||||
@@ -178,6 +178,7 @@ $lang->action->objectTypes['service'] = 'Service';
|
||||
$lang->action->objectTypes['domain'] = 'Domain';
|
||||
$lang->action->objectTypes['artifactrepo'] = 'Artifact Repo';
|
||||
$lang->action->objectTypes['prompt'] = 'Prompt';
|
||||
$lang->action->objectTypes['miniprogram'] = 'Mini Program';
|
||||
$lang->action->objectTypes['metric'] = 'Metric';
|
||||
$lang->action->objectTypes['projectbuild'] = 'Build';
|
||||
|
||||
@@ -867,6 +868,8 @@ $lang->action->label->host = 'Host|host|view|id=%s';
|
||||
$lang->action->label->account = "Account|account|view|id=%s";
|
||||
$lang->action->label->instance = 'Application|instance|view|id=%s';
|
||||
$lang->action->label->artifactrepo = 'Artifact Repo|artifactrepo|browse|';
|
||||
$lang->action->label->prompt = 'Prompt|ai|promptview|id=%s';
|
||||
$lang->action->label->miniprogram = 'Mini Program|aiapp|browseminiprogram|id=%s';
|
||||
$lang->action->label->holiday = 'Holiday|holiday|browse|';
|
||||
|
||||
/* Object type. */
|
||||
|
||||
@@ -178,6 +178,7 @@ $lang->action->objectTypes['service'] = 'Service';
|
||||
$lang->action->objectTypes['domain'] = 'Domain';
|
||||
$lang->action->objectTypes['artifactrepo'] = 'Artifact Repo';
|
||||
$lang->action->objectTypes['prompt'] = 'Prompt';
|
||||
$lang->action->objectTypes['miniprogram'] = 'Mini Program';
|
||||
$lang->action->objectTypes['metric'] = 'Metric';
|
||||
$lang->action->objectTypes['projectbuild'] = 'Build';
|
||||
|
||||
@@ -860,6 +861,8 @@ $lang->action->label->host = 'Host|host|view|id=%s';
|
||||
$lang->action->label->account = "Account|account|view|id=%s";
|
||||
$lang->action->label->instance = 'Application|instance|view|id=%s';
|
||||
$lang->action->label->artifactrepo = 'Artifact Repo|artifactrepo|browse|';
|
||||
$lang->action->label->prompt = 'Prompt|ai|promptview|id=%s';
|
||||
$lang->action->label->miniprogram = 'Mini Program|aiapp|browseminiprogram|id=%s';
|
||||
$lang->action->label->holiday = 'Holiday|holiday|browse|';
|
||||
|
||||
/* Object type. */
|
||||
|
||||
@@ -178,6 +178,7 @@ $lang->action->objectTypes['service'] = '服务';
|
||||
$lang->action->objectTypes['domain'] = '域名';
|
||||
$lang->action->objectTypes['artifactrepo'] = '制品库';
|
||||
$lang->action->objectTypes['prompt'] = '提词';
|
||||
$lang->action->objectTypes['miniprogram'] = '小程序';
|
||||
$lang->action->objectTypes['metric'] = '度量';
|
||||
$lang->action->objectTypes['projectbuild'] = '版本';
|
||||
|
||||
@@ -868,6 +869,8 @@ $lang->action->label->host = '主机|host|view|id=%s';
|
||||
$lang->action->label->account = "账号|account|view|id=%s";
|
||||
$lang->action->label->instance = '应用|instance|view|id=%s';
|
||||
$lang->action->label->artifactrepo = '制品库|artifactrepo|browse|';
|
||||
$lang->action->label->prompt = '提词|ai|promptview|id=%s';
|
||||
$lang->action->label->miniprogram = '小程序|aiapp|browseminiprogram|id=%s';
|
||||
$lang->action->label->holiday = '节假日|holiday|browse|';
|
||||
|
||||
/* Object type. */
|
||||
|
||||
@@ -16,7 +16,7 @@ $config->admin->menuGroup['dev'] = array('dev', 'entry', 'editor');
|
||||
$config->admin->menuGroup['extension'] = array('extension');
|
||||
$config->admin->menuGroup['convert'] = array('convert');
|
||||
$config->admin->menuGroup['platform'] = array('system', 'repo', 'account', 'host', 'serverroom', 'ops', 'tree', 'domain', 'deploy', 'service');
|
||||
$config->admin->menuGroup['ai'] = array('ai|adminindex', 'ai|prompts', 'ai|promptview', 'ai|conversations', 'ai|models', 'ai|editmodel', 'ai|promptassignrole', 'ai|promptselectdatasource', 'ai|promptsetpurpose', 'ai|promptsettargetform', 'ai|promptfinalize', 'ai|promptedit');
|
||||
$config->admin->menuGroup['ai'] = array('ai|adminindex', 'ai|prompts', 'ai|promptview', 'ai|conversations', 'ai|models', 'ai|modelcreate', 'ai|modelview', 'ai|modeledit', 'ai|editmodel', 'ai|promptassignrole', 'ai|promptselectdatasource', 'ai|promptsetpurpose', 'ai|promptsettargetform', 'ai|promptfinalize', 'ai|promptedit', 'ai|miniprograms', 'ai|createminiprogram', 'ai|editminiprogram', 'ai|configuredminiprogram', 'ai|editminiprogramcategory', 'ai|miniprogramview');
|
||||
|
||||
$config->admin->menuModuleGroup['model']['custom|set'] = array('project', 'issue', 'risk', 'opportunity', 'nc');
|
||||
$config->admin->menuModuleGroup['model']['custom|required'] = array('project', 'build');
|
||||
|
||||
@@ -212,6 +212,7 @@ $lang->admin->productFeature['max'][] = 'Opportunity/Risk/Issues Management';
|
||||
$lang->admin->ai = new stdclass();
|
||||
$lang->admin->ai->model = 'Language Models';
|
||||
$lang->admin->ai->conversation = 'Conversations';
|
||||
$lang->admin->ai->miniPrograms = 'Mini Programs';
|
||||
$lang->admin->ai->prompt = 'Prompts';
|
||||
|
||||
include dirname(__FILE__) . '/menu.php';
|
||||
|
||||
@@ -212,6 +212,7 @@ $lang->admin->productFeature['max'][] = 'Opportunity/Risk/Issues Management';
|
||||
$lang->admin->ai = new stdclass();
|
||||
$lang->admin->ai->model = 'Language Models';
|
||||
$lang->admin->ai->conversation = 'Conversations';
|
||||
$lang->admin->ai->miniPrograms = 'Mini Programs';
|
||||
$lang->admin->ai->prompt = 'Prompts';
|
||||
|
||||
include dirname(__FILE__) . '/menu.php';
|
||||
|
||||
@@ -212,6 +212,7 @@ $lang->admin->productFeature['max'][] = 'Opportunity/Risk/Issues Management';
|
||||
$lang->admin->ai = new stdclass();
|
||||
$lang->admin->ai->model = 'Language Models';
|
||||
$lang->admin->ai->conversation = 'Conversations';
|
||||
$lang->admin->ai->miniPrograms = 'Mini Programs';
|
||||
$lang->admin->ai->prompt = 'Prompts';
|
||||
|
||||
include dirname(__FILE__) . '/menu.php';
|
||||
|
||||
+11
-12
@@ -224,23 +224,22 @@ if(helper::hasFeature('devops'))
|
||||
$lang->admin->menuList->platform['dividerMenu'] = ',plat,setrules,';
|
||||
}
|
||||
|
||||
/* TODO(@Wenrui LI): resurrect AI-related features later. *//*
|
||||
$lang->admin->menuList->ai['name'] = $lang->admin->menuSetting['ai']['name'];
|
||||
$lang->admin->menuList->ai['desc'] = $lang->admin->menuSetting['ai']['desc'];
|
||||
$lang->admin->menuList->ai['link'] = 'ai|adminindex';
|
||||
$lang->admin->menuList->ai['order'] = 60;
|
||||
|
||||
$lang->admin->menuList->ai['subMenu']['models'] = array('link' => "{$lang->admin->ai->model}|ai|models|", 'alias' => 'editmodel,modelcreate,modelview,modeledit');
|
||||
$lang->admin->menuList->ai['menuOrder']['15'] = 'models';
|
||||
|
||||
if($config->vision != 'or')
|
||||
{
|
||||
$lang->admin->menuList->ai['name'] = $lang->admin->menuSetting['ai']['name'];
|
||||
$lang->admin->menuList->ai['desc'] = $lang->admin->menuSetting['ai']['desc'];
|
||||
$lang->admin->menuList->ai['link'] = 'ai|adminindex';
|
||||
$lang->admin->menuList->ai['order'] = 60;
|
||||
|
||||
$lang->admin->menuList->ai['subMenu']['prompts'] = array('link' => "{$lang->admin->ai->prompt}|ai|prompts|", 'alias' => 'promptview,promptassignrole,promptselectdatasource,promptsetpurpose,promptsettargetform,promptfinalize,promptedit');
|
||||
// $lang->admin->menuList->ai['subMenu']['conversations'] = array('link' => "{$lang->admin->ai->conversation}|ai|conversations|");
|
||||
$lang->admin->menuList->ai['subMenu']['models'] = array('link' => "{$lang->admin->ai->model}|ai|models|", 'alias' => 'editmodel');
|
||||
$lang->admin->menuList->ai['subMenu']['prompts'] = array('link' => "{$lang->admin->ai->prompt}|ai|prompts|", 'alias' => 'promptview,promptassignrole,promptselectdatasource,promptsetpurpose,promptsettargetform,promptfinalize,promptedit');
|
||||
$lang->admin->menuList->ai['subMenu']['miniPrograms'] = array('link' => "{$lang->admin->ai->miniPrograms}|ai|miniPrograms|", 'alias' => 'miniprograms,createminiprogram,editminiprogram,configuredminiprogram,editminiprogramcategory,miniprogramview');
|
||||
|
||||
$lang->admin->menuList->ai['menuOrder']['5'] = 'prompts';
|
||||
// $lang->admin->menuList->ai['menuOrder']['10'] = 'conversations';
|
||||
$lang->admin->menuList->ai['menuOrder']['15'] = 'models';
|
||||
$lang->admin->menuList->ai['menuOrder']['10'] = 'miniPrograms';
|
||||
}
|
||||
*/
|
||||
|
||||
if($config->edition != 'max' and $config->edition != 'ipd')
|
||||
{
|
||||
|
||||
@@ -212,6 +212,7 @@ $lang->admin->productFeature['max'][] = '严格权限控制,方式灵活安全
|
||||
$lang->admin->ai = new stdclass();
|
||||
$lang->admin->ai->model = '语言模型';
|
||||
$lang->admin->ai->conversation = '会话';
|
||||
$lang->admin->ai->miniPrograms = '小程序';
|
||||
$lang->admin->ai->prompt = '提词';
|
||||
|
||||
include dirname(__FILE__) . '/menu.php';
|
||||
|
||||
@@ -177,7 +177,8 @@ class adminModel extends model
|
||||
{
|
||||
$menu = $this->setSubMenu($menuKey, $menu);
|
||||
}
|
||||
elseif(!empty($menu['link']) && strpos($menu['link'], '|') !== false)
|
||||
|
||||
if(!empty($menu['link']) && strpos($menu['link'], '|') !== false)
|
||||
{
|
||||
list($module, $method) = explode('|', $menu['link']);
|
||||
$menu['link'] = helper::createLink($module, $method);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
|
||||
$config->ai->actions = new stdclass();
|
||||
$config->ai->actions->modelview = array('mainActions' => array('modelenable', 'modeldisable', 'modeltestconnection'), 'suffixActions' => array('modeledit', 'modeldelete'));
|
||||
$config->ai->actions->models = array('modelenable|modeldisable', 'modeledit');
|
||||
|
||||
$config->ai->actionList = array();
|
||||
$config->ai->actionList['modelenable']['icon'] = 'magic';
|
||||
$config->ai->actionList['modelenable']['text'] = $lang->ai->models->enable;
|
||||
$config->ai->actionList['modelenable']['hint'] = $lang->ai->models->enable;
|
||||
$config->ai->actionList['modelenable']['url'] = array('module' => 'ai', 'method' => 'modelenable', 'params' => 'modelID={id}');
|
||||
$config->ai->actionList['modelenable']['data-app'] = $app->tab;
|
||||
$config->ai->actionList['modeldisable']['icon'] = 'ban-circle';
|
||||
$config->ai->actionList['modeldisable']['text'] = $lang->ai->models->disable;
|
||||
$config->ai->actionList['modeldisable']['hint'] = $lang->ai->models->disable;
|
||||
$config->ai->actionList['modeldisable']['url'] = 'javascript:confirmDisable("{id}")';
|
||||
$config->ai->actionList['modeldisable']['data-app'] = $app->tab;
|
||||
$config->ai->actionList['modeltestconnection']['icon'] = 'controls';
|
||||
$config->ai->actionList['modeltestconnection']['text'] = $lang->ai->models->testConnection;
|
||||
$config->ai->actionList['modeltestconnection']['hint'] = $lang->ai->models->testConnection;
|
||||
$config->ai->actionList['modeltestconnection']['url'] = 'javascript:testConnection("{id}")';
|
||||
$config->ai->actionList['modeltestconnection']['data-app'] = $app->tab;
|
||||
$config->ai->actionList['modeledit']['icon'] = 'edit';
|
||||
$config->ai->actionList['modeledit']['text'] = $lang->ai->models->edit;
|
||||
$config->ai->actionList['modeledit']['hint'] = $lang->ai->models->edit;
|
||||
$config->ai->actionList['modeledit']['url'] = array('module' => 'ai', 'method' => 'modeledit', 'params' => 'modelID={id}');
|
||||
$config->ai->actionList['modeldelete']['icon'] = 'trash';
|
||||
$config->ai->actionList['modeldelete']['text'] = $lang->delete;
|
||||
$config->ai->actionList['modeldelete']['hint'] = $lang->delete;
|
||||
$config->ai->actionList['modeldelete']['url'] = 'javascript:confirmDelete("{id}")';
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
global $lang;
|
||||
|
||||
$config->ai->dtable = new stdclass();
|
||||
|
||||
$config->ai->dtable->models = array();
|
||||
$config->ai->dtable->models['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id', 'sortType' => true);
|
||||
$config->ai->dtable->models['name'] = array('name' => 'name', 'title' => $lang->ai->models->name, 'flex' => 1, 'type' => 'link', 'link' => array('module' => 'ai', 'method' => 'modelview', 'params' => 'modelID={id}'));
|
||||
$config->ai->dtable->models['status'] = array('name' => 'enabled', 'title' => $lang->statusAB, 'flex' => 'auto', 'type' => 'status', 'statusMap' => $lang->ai->models->statusList, 'minWidth' => 80);
|
||||
$config->ai->dtable->models['createdDate'] = array('name' => 'createdDate', 'title' => $lang->ai->models->createdDate, 'flex' => 'auto', 'type' => 'datetime', 'minWidth' => 120);
|
||||
$config->ai->dtable->models['vendor'] = array('name' => 'vendor', 'title' => $lang->ai->models->vendor, 'flex' => 'auto', 'type' => 'text', 'sortType' => true, 'minWidth' => 120, 'align' => 'center');
|
||||
$config->ai->dtable->models['usesProxy'] = array('name' => 'usesProxy', 'title' => $lang->ai->models->usesProxy, 'type' => 'status', 'statusMap' => $lang->ai->models->proxyStatusList, 'minWidth' => 120);
|
||||
$config->ai->dtable->models['actions'] = array('title' => $lang->actions, 'type' => 'actions', 'width' => 100, 'fixed' => 'right', 'align' => 'center', 'menu' => $config->ai->actions->models, 'list' => $config->ai->actionList);
|
||||
@@ -0,0 +1,985 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The control file of ai module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
class ai extends control
|
||||
{
|
||||
/**
|
||||
* AI model.
|
||||
*
|
||||
* @var aiModel
|
||||
* @access public
|
||||
*/
|
||||
public $ai;
|
||||
|
||||
/**
|
||||
* User model.
|
||||
*
|
||||
* @var userModel
|
||||
* @access public
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public function __construct($module = '', $method = '')
|
||||
{
|
||||
parent::__construct($module, $method);
|
||||
$this->loadModel('user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for user's privs and model configs, redirect to most relevant page.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function adminIndex()
|
||||
{
|
||||
/* Redirect to model edit ifuser has priv and model is unconfigured. */
|
||||
if(commonModel::hasPriv('ai', 'models') && !$this->ai->hasModelsAvailable()) return $this->locate($this->createLink('ai', 'models'));
|
||||
|
||||
/* Redirect to prompts ifuser has priv. */
|
||||
if(commonModel::hasPriv('ai', 'prompts')) return $this->locate($this->createLink('ai', 'prompts'));
|
||||
|
||||
/* Redirect to miniPrograms ifuser has priv. */
|
||||
if(commonModel::hasPriv('ai', 'miniPrograms')) return $this->locate($this->createLink('ai', 'miniPrograms'));
|
||||
|
||||
/* Redirect to models ifuser has priv. */
|
||||
if(commonModel::hasPriv('ai', 'models')) return $this->locate($this->createLink('ai', 'models'));
|
||||
|
||||
/* User has no priv, deny access. */
|
||||
return $this->send(array('result' => 'fail', 'message' => $this->lang->error->accessDenied, 'locate' => $this->createLink('admin', 'index')));
|
||||
}
|
||||
|
||||
/**
|
||||
* List models.
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function models($orderBy = 'id_asc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Adapt order. */
|
||||
if(strpos(strtolower($orderBy), 'usesproxy') !== false) $orderBy = str_ireplace('usesproxy', 'proxy', $orderBy);
|
||||
|
||||
$models = $this->ai->getLanguageModels('', false, $pager, $orderBy);
|
||||
|
||||
/* Process model props to displayable format. */
|
||||
foreach($models as $model)
|
||||
{
|
||||
$model->usesProxy = !empty($model->proxy) ? 'on' : 'off';
|
||||
$model->vendor = $this->lang->ai->models->vendorList->{$model->type}[$model->vendor];
|
||||
|
||||
if(empty($model->name)) $model->name = $this->lang->ai->models->typeList[$model->type];
|
||||
}
|
||||
|
||||
$this->view->models = $models;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->title = $this->lang->ai->models->title;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* View language model configuration.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelView($modelID)
|
||||
{
|
||||
$model = $this->ai->getLanguageModel($modelID);
|
||||
if(empty($model)) return $this->locate($this->createLink('ai', 'models'));
|
||||
|
||||
$this->view->model = $this->ai->unserializeModel($model);
|
||||
$this->view->title = $this->lang->ai->models->view;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create language model configuration.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelCreate()
|
||||
{
|
||||
if(strtolower($this->server->request_method) == 'post')
|
||||
{
|
||||
$modelConfig = fixer::input('post')->get();
|
||||
|
||||
/* Check for required credentials. */
|
||||
foreach($this->config->ai->vendorList[$modelConfig->vendor]['credentials'] as $credKey)
|
||||
{
|
||||
if(empty($modelConfig->$credKey)) dao::$errors[$credKey][] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->$credKey);
|
||||
if(!empty($modelConfig->proxyType) && empty($modelConfig->proxyAddr)) dao::$errors['proxyAddr'][] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->proxyAddr);
|
||||
}
|
||||
if(!empty(dao::$errors)) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$result = $this->ai->createModel($modelConfig);
|
||||
|
||||
if($result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('modelView', "modelID=$result") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->ai->models->create;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit language model configuration.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelEdit($modelID)
|
||||
{
|
||||
if(strtolower($this->server->request_method) == 'post')
|
||||
{
|
||||
$modelConfig = fixer::input('post')->get();
|
||||
|
||||
/* Check for required credentials. */
|
||||
foreach($this->config->ai->vendorList[$modelConfig->vendor]['credentials'] as $credKey)
|
||||
{
|
||||
if(empty($modelConfig->$credKey)) dao::$errors[$credKey][] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->$credKey);
|
||||
if(!empty($modelConfig->proxyType) && empty($modelConfig->proxyAddr)) dao::$errors['proxyAddr'][] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->proxyAddr);
|
||||
}
|
||||
if(!empty(dao::$errors)) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$result = $this->ai->updateModel($modelID, $modelConfig);
|
||||
|
||||
if($result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('modelView', "modelID=$modelID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$model = $this->ai->getLanguageModel($modelID);
|
||||
if(empty($model)) return $this->locate($this->createLink('ai', 'models'));
|
||||
|
||||
$modelData = $this->ai->unserializeModel($model);
|
||||
if(empty($model->name)) $modelData->name = ''; // Set name to empty if it was not set.
|
||||
|
||||
$this->view->model = $modelData;
|
||||
$this->view->title = $this->lang->ai->models->edit;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable language model.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelEnable($modelID)
|
||||
{
|
||||
$result = $this->ai->toggleModel($modelID, true);
|
||||
if($result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->sendSuccess(array('load' => array($modelID)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable language model.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelDisable($modelID)
|
||||
{
|
||||
$result = $this->ai->toggleModel($modelID, false);
|
||||
if($result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->sendSuccess(array('load' => array($modelID), 'message' => ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete language model.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelDelete($modelID)
|
||||
{
|
||||
$result = $this->ai->deleteModel($modelID);
|
||||
if($result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->send(array('result' => 'success', 'load' => array('locate' => inlink('models'))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test connection with model configuration.
|
||||
*
|
||||
* @param int $modelID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function modelTestConnection($modelID = 0)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
if(strtolower($this->server->request_method) == 'post')
|
||||
{
|
||||
/* Test model connection from form if method is POST. */
|
||||
$modelConfig = fixer::input('post')->get();
|
||||
|
||||
$currentVendor = empty($modelConfig->vendor) ? key($this->lang->ai->models->vendorList->{empty($modelConfig->type) ? key($this->lang->ai->models->typeList) : $modelConfig->type}) : $modelConfig->vendor;
|
||||
$vendorRequiredFields = $this->config->ai->vendorList[$currentVendor]['credentials'];
|
||||
|
||||
$errors = array();
|
||||
if(empty($modelConfig->type)) $errors[] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->type);
|
||||
foreach($vendorRequiredFields as $field)
|
||||
{
|
||||
if(empty($modelConfig->$field)) $errors[] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->$field);
|
||||
}
|
||||
if(!empty($modelConfig->proxyType) && empty($modelConfig->proxyAddr))
|
||||
{
|
||||
$errors[] = sprintf($this->lang->ai->validate->noEmpty, $this->lang->ai->models->proxyAddr);
|
||||
}
|
||||
if(!empty($errors)) return $this->send(array('result' => 'fail', 'message' => implode(' ', $errors)));
|
||||
|
||||
$this->ai->setModelConfig($modelConfig);
|
||||
|
||||
if($this->config->ai->models[$modelConfig->type] == 'ernie' || $currentVendor == 'azure' || $modelConfig->type == 'openai-gpt4' || $modelConfig->vendor == 'openaiCompatible')
|
||||
{
|
||||
$messages = array((object)array('role' => 'user', 'content' => 'test'));
|
||||
$result = $this->ai->converse(null, $messages, array('maxTokens' => 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->ai->complete(null, 'test', 1); // Test completing 'test' with length of 1.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Test model with id if not POST. */
|
||||
$result = $this->ai->testModelConnection($modelID);
|
||||
}
|
||||
|
||||
if($result === false)
|
||||
{
|
||||
return $this->send(array('result' => 'fail', 'message' => empty($this->ai->errors) ? $this->lang->ai->models->testConnectionResult->fail : sprintf($this->lang->ai->models->testConnectionResult->failFormat, implode(', ', $this->ai->errors))));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->ai->models->testConnectionResult->success));
|
||||
}
|
||||
|
||||
/**
|
||||
* List mini programs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function miniPrograms($category = '', $status = '', $orderBy = 'createdDate_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$order = common::appendOrder($orderBy);
|
||||
$categoryList = array_merge($this->lang->ai->miniPrograms->categoryList, $this->ai->getCustomCategories());
|
||||
|
||||
$programs = $this->ai->getMiniPrograms($category, $status, $order, $pager);
|
||||
foreach($programs as $program)
|
||||
{
|
||||
$program->canPublish = empty($program->published) && $this->ai->canPublishMiniProgram($program);
|
||||
$program->createdByLabel = $program->createdBy === 'system' ? $this->lang->admin->system : $this->loadModel('user')->getById($program->createdBy, 'account')->realname;
|
||||
$program->categoryLabel = $categoryList[$program->category];
|
||||
$program->publishedLabel = $program->published === '1'
|
||||
? $this->lang->ai->miniPrograms->statuses['active']
|
||||
: $this->lang->ai->miniPrograms->statuses['draft'];
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->ai->miniPrograms->common;
|
||||
$this->view->miniPrograms = $programs;
|
||||
$this->view->category = $category;
|
||||
$this->view->categoryList = $categoryList;
|
||||
$this->view->status = $status;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit mini program category.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editMiniProgramCategory()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if($this->ai->checkDuplicatedCategory()) return $this->sendError($this->lang->ai->maintenanceGroupDuplicated);
|
||||
$this->ai->updateCustomCategories();
|
||||
return $this->sendSuccess(array());
|
||||
}
|
||||
|
||||
$this->view->usedCustomCategories = $this->ai->getUsedCustomCategories();
|
||||
$this->view->categoryList = $this->ai->getCustomCategories();
|
||||
$this->view->title = $this->lang->ai->miniPrograms->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a mini program.
|
||||
*
|
||||
* @param string $appID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function publishMiniProgram($appID)
|
||||
{
|
||||
$result = $this->ai->publishMiniProgram($appID, '1');
|
||||
if($result) return $this->send(array('result' => 'success', 'locate' => $this->server->http_referer));
|
||||
$this->sendError(dao::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpublish a mini program.
|
||||
*
|
||||
* @param string $appID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function unpublishMiniProgram($appID)
|
||||
{
|
||||
$result = $this->ai->publishMiniProgram($appID, '0');
|
||||
if($result) return $this->send(array('result' => 'success', 'locate' => $this->server->http_referer));
|
||||
$this->sendError(dao::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* Import mini program from zip file.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importMiniProgram()
|
||||
{
|
||||
if(empty($_FILES)) return $this->sendError(array('file' => sprintf($this->lang->error->notempty, $this->lang->ai->installPackage)));
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$errors = $this->ai->verifyRequiredFields(array('category' => $this->lang->ai->miniPrograms->category, 'published' => $this->lang->ai->toPublish));
|
||||
if($errors !== false) return $this->sendError($errors);
|
||||
|
||||
$file = $_FILES['file'];
|
||||
$filePath = $file['tmp_name'];
|
||||
$result = $this->ai->extractZtAppZip($filePath);
|
||||
if(is_array($result))
|
||||
{
|
||||
$info = $result[0];
|
||||
$fileName = $info['filename'];
|
||||
include_once($fileName);
|
||||
if(isset($ztApp))
|
||||
{
|
||||
$ztApp = json_decode($ztApp);
|
||||
$ztApp->name = $this->ai->getUniqueAppName($ztApp->name);
|
||||
$ztApp->published = $_POST['published'];
|
||||
$ztApp->category = $_POST['category'];
|
||||
$this->ai->createMiniProgram($ztApp);
|
||||
unlink($fileName);
|
||||
return $this->sendSuccess(array('message' => $this->lang->saveSuccess, 'locate' => $this->createLink('ai', 'miniprograms')));
|
||||
}
|
||||
unlink($fileName);
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->saveFail, 'locate' => $this->createLink('ai', 'miniprograms')));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List prompts.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function prompts($module = '', $status = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('user');
|
||||
$users = $this->user->getPairs('noletter');
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
if(isset($data->togglePromptStatus) && isset($data->promptId))
|
||||
{
|
||||
if(!$this->ai->hasModelsAvailable()) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->models->noModelError, 'locate' => $this->inlink('models') . '#app=admin'));
|
||||
|
||||
$this->ai->togglePromptStatus($data->promptId);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
/* Set pager and order. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$order = common::appendOrder($orderBy);
|
||||
|
||||
$this->view->prompts = $this->ai->getPrompts($module, $status, $order, $pager);
|
||||
$this->view->module = $module;
|
||||
$this->view->status = $status;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->title = $this->lang->ai->prompts->common;
|
||||
$this->view->users = $users;
|
||||
|
||||
if($this->config->edition == 'open')
|
||||
{
|
||||
$this->view->promptModules = array_map(function ($prompt)
|
||||
{
|
||||
return $prompt->module;
|
||||
}, $this->ai->getPrompts());
|
||||
}
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* View prompt details.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptView($id)
|
||||
{
|
||||
$prompt = $this->ai->getPromptById($id);
|
||||
|
||||
$model = empty($prompt->model) ? null : $this->ai->getLanguageModel($prompt->model);
|
||||
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->modelName = empty($model) ? $this->lang->ai->models->default : (empty($model->name) ? $this->lang->ai->models->typeList[$model->type] : $model->name);
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('prompt', $id);
|
||||
$this->view->actions = $this->loadModel('action')->getList('prompt', $id);
|
||||
$this->view->dataPreview = $this->ai->generateDemoDataPrompt($prompt->module, $prompt->source);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name";
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a prompt.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createPrompt()
|
||||
{
|
||||
if(strtolower($this->server->request_method) == 'post')
|
||||
{
|
||||
$prompt = fixer::input('post')->get();
|
||||
$promptID = $this->ai->createPrompt($prompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'callback' => "gotoPrompt($promptID)"));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->ai->prompts->create;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a prompt.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptEdit($id)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($id);
|
||||
|
||||
if(strtolower($this->server->request_method) == 'post')
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$prompt->name = $data->name;
|
||||
$prompt->desc = $data->desc;
|
||||
|
||||
$this->ai->updatePrompt($prompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'locate' => $this->inlink('promptView', "id={$prompt->id}") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->title = $this->lang->ai->prompts->edit;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a prompt.
|
||||
*
|
||||
* @param int $prompt
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptDelete($prompt)
|
||||
{
|
||||
$result = $this->ai->deletePrompt($prompt);
|
||||
|
||||
if(dao::isError() || $result === false) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit role of prompt, prompt editing step 2.
|
||||
*
|
||||
* @param int $promptID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptAssignRole($promptID)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($promptID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->model = $data->model == 'default' ? 0 : $data->model;
|
||||
$prompt->role = $data->role;
|
||||
$prompt->characterization = $data->characterization;
|
||||
|
||||
if(!empty($data->saveTemplate) && $data->saveTemplate == 'save')
|
||||
{
|
||||
$this->ai->createRoleTemplate($prompt->role, $prompt->characterization);
|
||||
}
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->jumpToNext)) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSelectDataSource', "promptID=$promptID") . '#app=admin'));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptAssignRole', "promptID=$promptID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->models = $this->ai->getLanguageModelNamesWithDefault();
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->promptID = $promptID;
|
||||
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->assignRole . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
|
||||
$this->view->roleTemplates = $this->ai->getRoleTemplates();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set data source of prompt, prompt editing step 3.
|
||||
*
|
||||
* @param int $promptID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptSelectDataSource($promptID)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($promptID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->module = $data->datagroup;
|
||||
$prompt->source = ",$data->datasource,";
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->jumpToNext)) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSetPurpose', "promptID=$promptID") . '#app=admin'));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSelectDataSource', "promptID=$promptID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->activeDataSource = empty($prompt->module) ? current(array_keys($this->config->ai->dataSource)) : $prompt->module;
|
||||
$this->view->dataSource = $this->config->ai->dataSource;
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->promptID = $promptID;
|
||||
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->selectDataSource . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit purpose and purpose elaboration of prompt, prompt editing step 4.
|
||||
*
|
||||
* @param int $promptID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptSetPurpose($promptID)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($promptID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->purpose = $data->purpose;
|
||||
$prompt->elaboration = $data->elaboration;
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->jumpToNext)) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSetTargetForm', "promptID=$promptID") . '#app=admin'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSetPurpose', "promptID=$promptID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->dataPreview = $this->ai->generateDemoDataPrompt($prompt->module, $prompt->source);
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->promptID = $promptID;
|
||||
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->setPurpose . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set target form of prompt, prompt editing step 5.
|
||||
*
|
||||
* @param int $promptID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptSetTargetForm($promptID)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($promptID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->targetForm = $data->targetForm;
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->goTesting)) // Go to testing object view.
|
||||
{
|
||||
$location = $this->ai->getTestingLocation($prompt);
|
||||
return $this->send(empty($location) ? array('result' => 'fail', 'target' => '#go-test-btn', 'message' => $this->lang->ai->prompts->goingTestingFail) : array('result' => 'success', 'target' => '#go-test-btn', 'msg' => $this->lang->ai->prompts->goingTesting, 'locate' => $location));
|
||||
}
|
||||
|
||||
if(!empty($data->jumpToNext)) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptFinalize', "promptID=$promptID") . '#app=admin'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptSetTargetForm', "promptID=$promptID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->dataPreview = $this->ai->generateDemoDataPrompt($prompt->module, $prompt->source);
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->promptID = $promptID;
|
||||
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->setTargetForm . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit additional information of prompt, final prompt editing step.
|
||||
*
|
||||
* @param int $promptID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptFinalize($promptID)
|
||||
{
|
||||
$prompt = $this->ai->getPromptByID($promptID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->name = $data->name;
|
||||
$prompt->desc = $data->desc;
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->jumpToNext)) $this->ai->togglePromptStatus($prompt, 'active');
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(!empty($data->jumpToNext)) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('prompts') . '#app=admin'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->inlink('promptFinalize', "promptID=$promptID") . '#app=admin'));
|
||||
}
|
||||
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->promptID = $promptID;
|
||||
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
|
||||
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->finalize . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute prompt on obejct, and redirect to target form page.
|
||||
*
|
||||
* @param int $promptId
|
||||
* @param int $objectId
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptExecute($promptId, $objectId)
|
||||
{
|
||||
if(!$this->ai->hasModelsAvailable()) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->models->noModelError, 'locate' => $this->inlink('models') . '#app=admin'));
|
||||
|
||||
$prompt = $this->ai->getPromptByID($promptId);
|
||||
if(empty($prompt) || !$this->ai->isExecutable($prompt)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->failReasons['noPrompt'])));
|
||||
|
||||
$object = $this->ai->getObjectForPromptById($prompt, $objectId);
|
||||
if(empty($object)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->failReasons['noObjectData'])));
|
||||
|
||||
list($objectData, $rawObject) = $object;
|
||||
|
||||
list($location, $stop) = $this->ai->getTargetFormLocation($prompt, $rawObject);
|
||||
if(empty($location)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->failReasons['noTargetForm'])));
|
||||
if(!empty($stop)) return header("location: $location", true, 302);
|
||||
|
||||
/* Execute prompt and catch exceptions. */
|
||||
try
|
||||
{
|
||||
$response = $this->ai->executePrompt($prompt, $object);
|
||||
}
|
||||
catch (AIResponseException $e)
|
||||
{
|
||||
$output = array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $e->getMessage()));
|
||||
|
||||
/* Audition shall quit on such exception. */
|
||||
if(isset($_SESSION['auditPrompt']) && time() - $_SESSION['auditPrompt']['time'] < 10 * 60)
|
||||
{
|
||||
$output['locate'] = $this->inlink('promptAudit', "promptID=$promptId&objectId=$objectId&exit=true");
|
||||
}
|
||||
return $this->send($output);
|
||||
}
|
||||
|
||||
if(is_int($response)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->executeErrors["$response"]) . (empty($this->ai->errors) ? '' : implode(', ', $this->ai->errors))));
|
||||
if(empty($response)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->failReasons['noResponse'])));
|
||||
|
||||
$this->ai->setInjectData($prompt->targetForm, $response);
|
||||
|
||||
$_SESSION['aiPrompt']['prompt'] = $prompt;
|
||||
$_SESSION['aiPrompt']['objectId'] = $objectId;
|
||||
|
||||
if($prompt->status == 'draft') $_SESSION['auditPrompt']['time'] = time();
|
||||
|
||||
$promptViewLink = $this->inlink('promptview', "promptID=$promptId");
|
||||
echo js::start() . "const currentApp = parent.$.apps.getLastApp().code; parent.$.apps.open('$location'); if(currentApp == 'admin') {location.href = '$promptViewLink';} else if(currentApp != parent.$.apps.getLastApp().code) {parent.$.apps.close(currentApp);}" . js::end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset prompt execution.
|
||||
*
|
||||
* @param bool $failed Whether the execution failed, triggers error message.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptExecutionReset($failed = false)
|
||||
{
|
||||
/* Reset session. */
|
||||
unset($_SESSION['aiPrompt']);
|
||||
unset($_SESSION['auditPrompt']);
|
||||
|
||||
if($failed) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->ai->execute->failFormat, $this->lang->ai->execute->failReasons['noTargetForm']), 'locate' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Audit prompt modal.
|
||||
*
|
||||
* @param int $promptId
|
||||
* @param int $objectId
|
||||
* @param bool $exit
|
||||
* @access public
|
||||
* @return void|int
|
||||
*/
|
||||
public function promptAudit($promptId, $objectId, $exit = false)
|
||||
{
|
||||
if(!empty($exit))
|
||||
{
|
||||
unset($_SESSION['auditPrompt']);
|
||||
return $this->send(array('result' => 'success', 'locate' => $this->inlink('promptview', "promptID=$promptId") . '#app=admin'));
|
||||
}
|
||||
|
||||
$prompt = $this->ai->getPromptByID($promptId);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$originalPrompt = clone $prompt;
|
||||
|
||||
$prompt->role = $data->role;
|
||||
$prompt->characterization = $data->characterization;
|
||||
$prompt->purpose = $data->purpose;
|
||||
$prompt->elaboration = $data->elaboration;
|
||||
|
||||
$this->ai->updatePrompt($prompt, $originalPrompt);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(empty($data->backLocation))
|
||||
{
|
||||
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'callback' => "reloadPrompt($promptId, $objectId)");
|
||||
}
|
||||
|
||||
$this->sendSuccess($response);
|
||||
}
|
||||
|
||||
$objectForPrompt = $this->ai->getObjectForPromptById($prompt, $objectId);
|
||||
if(empty($objectForPrompt)) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->execute->fail));
|
||||
|
||||
list($objectData, $object) = $objectForPrompt;
|
||||
|
||||
$this->view->prompt = $prompt;
|
||||
$this->view->object = $object;
|
||||
$this->view->dataPrompt = $this->ai->serializeDataToPrompt($prompt->module, $prompt->source, $objectData);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish prompt, set status to active.
|
||||
*
|
||||
* @param int $id
|
||||
* @param bool $backToTestingLocation
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptPublish($id, $backToTestingLocation = false)
|
||||
{
|
||||
if(!$this->ai->hasModelsAvailable()) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->models->noModelError, 'locate' => $this->inlink('models') . '#app=admin'));
|
||||
|
||||
unset($_SESSION['auditPrompt']);
|
||||
$this->ai->togglePromptStatus($id, 'active');
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if($backToTestingLocation)
|
||||
{
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->ai->prompts->action->publishSuccess, 'locate' => $this->inlink('promptview', "id=$id") . '#app=admin'));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpublish prompt, set status to draft.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function promptUnpublish($id)
|
||||
{
|
||||
$this->ai->togglePromptStatus($id, 'draft');
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return html element for the role template list.
|
||||
* This is used in prompt designing step 2.
|
||||
* Return html will deserialize in the front end js and replace the original role template list.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function roleTemplates()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$method = $data->method;
|
||||
switch ($method)
|
||||
{
|
||||
case 'create':
|
||||
$this->ai->createRoleTemplate($data->role, $data->characterization);
|
||||
break;
|
||||
case 'delete':
|
||||
$this->ai->deleteRoleTemplate($data->id);
|
||||
break;
|
||||
case 'edit':
|
||||
$this->ai->updateRoleTemplate($data->id, $data->role, $data->characterization);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->roleTemplates = $this->ai->getRoleTemplates();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Chat with LLMs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function chat()
|
||||
{
|
||||
$messages = array();
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$history = $this->post->history;
|
||||
$message = $this->post->message;
|
||||
$isRetry = $this->post->retry == 'true';
|
||||
|
||||
$messages = json_decode($history);
|
||||
if(empty($messages)) $messages[] = (object)array('role' => 'system', 'content' => $this->lang->ai->chatSystemMessage);
|
||||
|
||||
if(!$isRetry) $messages[] = (object)array('role' => 'user', 'content' => $message);
|
||||
|
||||
if($this->ai->hasModelsAvailable())
|
||||
{
|
||||
$response = $this->ai->converse(null, $messages);
|
||||
if(empty($response))
|
||||
{
|
||||
$this->view->error = $this->lang->ai->chatNoResponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
$messages[] = (object)array('role' => 'assistant', 'content' => is_array($response) ? current($response) : $response);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->view->error = $this->lang->ai->models->noModelError;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->ai->chat;
|
||||
$this->view->messages = $messages;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
body {background-color: #fff; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='164' height='164' style='opacity: 0.15; filter: grayscale(0.05);'%3e%3cdefs%3e%3clinearGradient id='b' x1='100%25' x2='25%25' y1='100%25' y2='25%25'%3e%3cstop offset='0%25' stop-color='%23FF2070'/%3e%3cstop offset='50%25' stop-color='%239670FF'/%3e%3cstop offset='100%25' stop-color='%23258DFF' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='c' x1='0%25' x2='75%25' y1='0%25' y2='75%25'%3e%3cstop offset='0%25' stop-color='%23258DFF'/%3e%3cstop offset='50%25' stop-color='%239670FF'/%3e%3cstop offset='100%25' stop-color='%23FF2070' stop-opacity='0'/%3e%3c/linearGradient%3e%3cpath id='a' fill='none' fill-rule='evenodd' stroke-linejoin='round' d='M41 .5c11.178 0 21.303 4.536 28.633 11.867C76.964 19.697 81.5 29.822 81.5 41s-4.536 21.303-11.867 28.633C62.303 76.964 52.178 81.5 41 81.5c-11.184 0-21.314-4.528-28.646-11.86C5.031 62.317.5 52.197.5 41c0-11.178 4.536-21.303 11.867-28.633C19.697 5.036 29.822.5 41 .5ZM30.628 10.897c-7.712 0-13.615 2.316-17.681 6.995-3.396 3.906-5.508 9.44-6.359 16.585 1.426-4.143 3.089-7.394 4.98-9.76 2.603-3.256 5.642-4.859 9.098-4.859 1.857 0 3.141.58 4.002 1.44 1.052 1.052 1.48 2.55 1.48 4.04 0 2.068-1.527 3.379-3.514 4.952-2.81 2.223-6.448 5.088-6.448 12.507 0 2.572.7 4.106 1.347 5.532.61 1.347 1.169 2.605 1.169 4.43 0 1.248-.605 2.502-1.62 3.421a5.443 5.443 0 0 1-3.66 1.407c-1.598 0-3.422-.682-5.191-2.496 1.758 4.658 5.443 8.964 10.246 12.229 5.475 3.722 12.408 6.094 19.648 6.094 7.125 0 13.102-2.01 17.364-5.21 4.462-3.348 7.04-8.001 7.04-12.98 0-4.66-1.687-8.478-4.387-11.177-2.892-2.892-6.938-4.498-11.288-4.498-4.077 0-7.316 1.11-9.57 2.95-2.374 1.938-3.64 4.685-3.64 7.744 0 2.25.686 3.991 1.604 5.281 1.009 1.418 2.3 2.307 3.216 2.704-1.299-3.083-1.11-5.497-.13-7.262.658-1.186 1.682-2.09 2.903-2.706 1.296-.654 2.814-.982 4.333-.982 1.997 0 3.274.898 4.095 2.132 1.206 1.816 1.377 4.418 1.386 5.862 0 .832-.527 4.904-3.333 7.71-1.568 1.57-3.84 2.754-7.129 2.754-6.08 0-10.244-1.92-13.025-4.702-3.67-3.67-4.933-8.87-4.933-13.256 0-3.992 1.74-8.001 4.67-10.933 2.719-2.718 6.457-4.51 10.772-4.51 6.504 0 11.005 2.325 15.212 4.599l.744.402c3.579 1.935 7.012 3.729 11.464 3.729 2.687 0 4.747-.579 6.292-1.576 1.728-1.116 2.8-2.753 3.397-4.64 1.233-3.893.486-8.835-.823-12.676.27 2.515.067 4.706-.515 6.452-.496 1.488-1.267 2.661-2.252 3.464-.991.807-2.2 1.247-3.583 1.247-6.809 0-10.378-4.46-14.326-9.507-4.744-6.063-10.084-12.932-23.055-12.932Z'/%3e%3c/defs%3e%3cuse x='82' y='82' stroke='url(%23b)' href='%23a'/%3e%3cuse stroke='url(%23c)' href='%23a'/%3e%3c/svg%3e"); background-position: -20px -20px; background-size: 140px 140px; background-repeat: repeat;}
|
||||
|
||||
.chat {width: calc(100% - 8px); height: calc(100vh - 8px); display: flex; flex-direction: column; margin: 4px;}
|
||||
.messages {height: 100%; padding: 8px 8px 0 8px; display: flex; flex-direction: column-reverse; overflow: auto;}
|
||||
|
||||
.message-container-user, .message-container-assistant, .message-container-error {display: flex; margin: 8px 0;}
|
||||
.message-container-user {justify-content: flex-end;}
|
||||
.message-container-assistant {justify-content: flex-start;}
|
||||
.message-container-error {justify-content: center;}
|
||||
.message-content {white-space: pre-wrap;}
|
||||
.message-container-user .message-content {background: #d5ecff; padding: 8px; border-radius: 8px 8px 0 8px;}
|
||||
.message-container-assistant .message-content {background: #f1f1f1; padding: 8px; border-radius: 8px 8px 8px 0;}
|
||||
.message-container-error .message-content {background: #ffdddd; padding: 2px 8px; border-radius: 8px;}
|
||||
|
||||
.chat-input {display: flex; justify-content: space-between; align-items: flex-end; bottom: 0; width: calc(100% - 16px); margin: 8px;}
|
||||
.chat-input textarea {flex: 1; margin-right: 4px; line-height: 1.5; height: 40px; min-height: 40px; padding: 9px 36px 9px 12px; border: 1px solid transparent; border-radius: 8px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(225deg, #ff2070, #9670ff, #258dff) border-box; outline: none; -webkit-appearance: none; -moz-appearance: none; appearance: none; resize: none;}
|
||||
.chat-input input[type=submit] {position: absolute; left: 236px; bottom: 12px; width: 40px; height: 40px; padding: 0; border: none; border-radius: 4px; outline: none; background: linear-gradient(225deg, #ff2070, #9670ff, #258dff); mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M3.788 6.995H8.5c.301 0 .502.201.502.502 0 .3-.2.501-.502.501H3.788c0 .1-.1.201-.1.402L.98 14.016l14.04-6.52L.98.979l2.707 5.616c.1.2.1.301.1.401ZM15.422 8.4 1.38 14.919c-.502.2-1.104 0-1.304-.502-.1-.3-.1-.602 0-.902l2.708-5.617c.1-.3.1-.602 0-.903L.077 1.38C-.123.878.077.276.578.075c.2-.1.602-.1.803 0l14.04 6.52c.502.2.703.802.502 1.303-.1.2-.3.401-.501.502Z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M3.788 6.995H8.5c.301 0 .502.201.502.502 0 .3-.2.501-.502.501H3.788c0 .1-.1.201-.1.402L.98 14.016l14.04-6.52L.98.979l2.707 5.616c.1.2.1.301.1.401ZM15.422 8.4 1.38 14.919c-.502.2-1.104 0-1.304-.502-.1-.3-.1-.602 0-.902l2.708-5.617c.1-.3.1-.602 0-.903L.077 1.38C-.123.878.077.276.578.075c.2-.1.602-.1.803 0l14.04 6.52c.502.2.703.802.502 1.303-.1.2-.3.401-.501.502Z"/></svg>'); mask-position: center; -webkit-mask-position: center; mask-origin: padding-box; -webkit-mask-origin: padding-box; background-repeat: no-repeat; background-position: center; background-size: 16px 15px; mask-size: 16px 15px; -webkit-mask-size: 16px 15px; cursor: pointer;}
|
||||
.chat-input input[type=submit].disabled {cursor: unset; opacity: 0.5;}
|
||||
.chat-input input[type=submit]:not(.disabled):hover {transform: scale(1.1);}
|
||||
.chat-input textarea.has-scrollbar + input[type=submit] {left: 228px; width: 36px; mask-position: 20px 12.5px; -webkit-mask-position: 20px 12.5px; background-position: 20px 12.5px;}
|
||||
.chat-input textarea.busy, .chat-input input[type=submit].busy {cursor: wait; opacity: 0.5;}
|
||||
#reset {height: 40px; border: none; background: none; color: #9ea3b0; border-radius: 4px;}
|
||||
#reset.disabled {cursor: unset; opacity: 0.5;}
|
||||
#reset:not(.disabled):hover {color: #737a8c;}
|
||||
#reset.busy, #retry.busy {cursor: wait; opacity: 0.5;}
|
||||
|
||||
::-webkit-scrollbar-thumb {border-radius: 5px;}
|
||||
::-webkit-scrollbar {width: 10px; height: 10px;}
|
||||
::-webkit-scrollbar-thumb:vertical {box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%); background-color: rgba(0, 0, 0, 0.2); border-radius: 10px; opacity: 0; transition: opacity 0.1s;}
|
||||
::-webkit-scrollbar, ::-webkit-scrollbar-button, ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {visibility: hidden; opacity: 0;}
|
||||
:hover ::-webkit-scrollbar, :hover ::-webkit-scrollbar-button, :hover ::-webkit-scrollbar-track, :hover ::-webkit-scrollbar-thumb {visibility: visible; opacity: 1;}
|
||||
.messages::-webkit-scrollbar-track {margin: -30px 0;}
|
||||
.chat-input textarea::-webkit-scrollbar {width: 8px;}
|
||||
@@ -0,0 +1,189 @@
|
||||
.design-steps
|
||||
{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.design-steps .steps
|
||||
{
|
||||
box-shadow: inset 0 0 0 rgb(0 0 0 / 10%), 0 0 15px rgb(0 0 0 / 10%);
|
||||
border-radius: 4px;
|
||||
isolation: isolate;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.step
|
||||
{
|
||||
position: relative;
|
||||
height: 32px;
|
||||
min-width: 100px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.step > a
|
||||
{
|
||||
padding: 0 10px;
|
||||
position: relative;
|
||||
left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.step:first-child
|
||||
{
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.step:last-child
|
||||
{
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.step:hover
|
||||
{
|
||||
background-color: #edeef2 !important;
|
||||
}
|
||||
|
||||
.step > .hover-arrow, .step:hover > .solid-arrow
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
z-index: 1;
|
||||
border-style: solid;
|
||||
border-width: 16px 0 16px 10px;
|
||||
border-color: transparent transparent transparent #edeef2 !important;
|
||||
}
|
||||
|
||||
.step > .solid-arrow
|
||||
{
|
||||
background: none !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
}
|
||||
|
||||
.step.disabled
|
||||
{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.step.disabled > a
|
||||
{
|
||||
color: #c4c4c4;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.step.clickable
|
||||
{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.step.clickable > .solid-arrow,
|
||||
.step.disabled > .solid-arrow
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
z-index: 1;
|
||||
border-style: solid;
|
||||
border-width: 16px 0 16px 10px;
|
||||
border-color: transparent transparent transparent #ffffff;
|
||||
}
|
||||
|
||||
.step.clickable > .outline-arrow,
|
||||
.step.disabled > .outline-arrow
|
||||
{
|
||||
background-image: url("static/svg/arrow-step-polyline.svg");
|
||||
background-size: 8px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
width: 15px;
|
||||
height: 32px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.step.active
|
||||
{
|
||||
background-color: #38b2fe;
|
||||
}
|
||||
|
||||
.step.active > a
|
||||
{
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.step:hover.active > a
|
||||
{
|
||||
color: #38b2fe;
|
||||
}
|
||||
|
||||
.step.active > .solid-arrow
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
z-index: 1;
|
||||
border-style: solid;
|
||||
border-width: 16px 0 16px 10px;
|
||||
border-color: transparent transparent transparent #38b2fe;
|
||||
}
|
||||
|
||||
.step.active > .outline-arrow
|
||||
{
|
||||
background-image: url("static/svg/arrow-step-polyline.svg");
|
||||
background-size: 8px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
width: 15px;
|
||||
height: 32px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.step.current
|
||||
{
|
||||
background-color: #2e7eff;
|
||||
}
|
||||
|
||||
.step.current > a
|
||||
{
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.step:hover.current > a
|
||||
{
|
||||
color: #2e7eff;
|
||||
}
|
||||
|
||||
.step.current > .solid-arrow
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
z-index: 1;
|
||||
border-style: solid;
|
||||
border-width: 16px 0 16px 10px;
|
||||
border-color: transparent transparent transparent #2e7eff;
|
||||
}
|
||||
|
||||
#returnConfirmModal .footer
|
||||
{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.visibility-hidden{visibility: hidden;}
|
||||
@@ -0,0 +1,33 @@
|
||||
.field-configuration .drag-area {cursor: move; text-align: right;}
|
||||
.field-configuration .drag-area > div {display: inline-flex; align-items: center; gap: 4px;}
|
||||
.options-container {display: flex; flex-direction: column; gap: 16px;}
|
||||
|
||||
#mainContent {position: fixed; left: 20px; right: 20px; top: 70px; bottom: 56px; display: flex; background: #f0f2f5; padding: 0;}
|
||||
#mainContent > div {height: 100%; background: #fff; display: flex; flex-direction: column;}
|
||||
#mainContent > div > header {background: #f8f8fa; height: 40px; display: flex; align-items: center; padding-left: 24px;}
|
||||
#mainContent > div > header > strong {font-size: 16px;}
|
||||
#mainContent > div > main {flex-grow: 1; overflow-y: auto;}
|
||||
|
||||
.modal-body {padding-top: 0; padding-bottom: 0; max-height: 420px !important; overflow: auto!important;}
|
||||
|
||||
.area-title {display: flex; align-items: center; padding-bottom: 20px; overflow: hidden;}
|
||||
.area-title > strong {font-size: 14px; text-wrap: nowrap;}
|
||||
.area-title > span {font-size: 12px;}
|
||||
.area-title > i {margin-left: 16px; margin-right: 4px;}
|
||||
|
||||
.content-debug-area,
|
||||
.prompt-design-area,
|
||||
.prompt-preview-area,
|
||||
.prompt-result-area,
|
||||
.field-configuration-main {padding: 24px;}
|
||||
|
||||
.prompt-preview-area .preview-container,
|
||||
.prompt-result-area .preview-container {word-break: break-word; border: 1px solid #D8DBDE; background: #f8f8f8; position: absolute; left: 24px; right: 24px; bottom: 24px; padding: 8px; overflow-y: auto;}
|
||||
.prompt-preview-area .preview-container {top: 64px;}
|
||||
.prompt-result-area .preview-container {top: 34px;}
|
||||
|
||||
.table-form > tbody > tr > th {width: 80px; padding-left: 0; text-wrap: nowrap; overflow: hidden;}
|
||||
|
||||
.text-muted {flex-shrink: 1;}
|
||||
|
||||
textarea.field-type {height: 32px;}
|
||||
@@ -0,0 +1,6 @@
|
||||
#ai-edit-icon {position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center;}
|
||||
#ai-edit-icon #edit-icon {display: none; position: absolute; inset: 0; background-color: rgba(230, 240, 255, 0.7);}
|
||||
#ai-edit-icon:hover {border: 1px solid #EDEEF1;}
|
||||
#ai-edit-icon:hover #edit-icon {display: flex; justify-content: center; align-items: center;}
|
||||
#icon-buttons svg {cursor: pointer;}
|
||||
.theme-checked {display: flex; justify-content: center; align-items: center;}
|
||||
@@ -0,0 +1,2 @@
|
||||
.category-input {width: 400px;}
|
||||
.category-item {padding-bottom: 12px; display: flex;}
|
||||
@@ -0,0 +1,5 @@
|
||||
.main-table td {padding-left: 16px;}
|
||||
#import-miniprogram .modal-dialog {padding: 10px 20px 10px 20px; position: relative;}
|
||||
#import-miniprogram .modal-dialog .modal-header {border: none!important; padding-bottom: 0;}
|
||||
.close-import-dialog {position: absolute; right: 20px; top: 20px;}
|
||||
input[type="file"]:focus {outline: none!important;}
|
||||
@@ -0,0 +1,2 @@
|
||||
.page-title .label-danger {margin-left: 8px;}
|
||||
#promptBasicInfo .table th {vertical-align: top;}
|
||||
@@ -0,0 +1,8 @@
|
||||
.prompt-details .detail-title {
|
||||
font-weight: normal;
|
||||
color:#838a9d;
|
||||
}
|
||||
|
||||
.prompt-details .detail-content + .detail-title {
|
||||
margin-top: 10px;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
html, body, #main, .container {width: 100%; height: 100%;}
|
||||
#main {min-width: 100%; padding: 0;}
|
||||
.container {padding: 0!important;}
|
||||
#test-miniprogram {display: flex; flex: auto; overflow: hidden;}
|
||||
textarea.field-type {height: 32px;}
|
||||
#test-miniprogram > div {background-color: #fafafa;}
|
||||
|
||||
.content-debug-area,
|
||||
.prompt-design-area,
|
||||
.prompt-preview-area,
|
||||
.prompt-result-area {padding: 16px;}
|
||||
|
||||
.table-form {table-layout: auto;}
|
||||
.table-form th {width: auto!important;}
|
||||
|
||||
.preview-container {border: 1px solid #D8DBDE; background: #f8f8f8; top: 50px; position: absolute; bottom: 16px; left: 16px; right: 16px; padding: 5px 8px; word-break: break-all; overflow-y: auto;}
|
||||
|
||||
#autocomplete-textarea {overflow-y: auto; position: absolute; top: 32px; left: 16px; right: 16px; bottom: 16px; height: auto; width: auto;}
|
||||
@@ -0,0 +1,115 @@
|
||||
$(function()
|
||||
{
|
||||
function markBusy()
|
||||
{
|
||||
$('input[type=submit]').attr('readonly', true).addClass('busy');
|
||||
$('textarea[name=message]').attr('readonly', true).addClass('busy');
|
||||
$('#retry').addClass('busy');
|
||||
$('#reset').addClass('busy');
|
||||
}
|
||||
|
||||
function reset(e)
|
||||
{
|
||||
if($(e.target).hasClass('busy') || $(e.target).hasClass('disabled')) return;
|
||||
markBusy();
|
||||
$.ajax({
|
||||
url: createLink('ai', 'chat'),
|
||||
dataType: 'html',
|
||||
success: function(response)
|
||||
{
|
||||
$('.chat').html($($.parseHTML(response)).filter('.chat').html());
|
||||
init();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function retry(e)
|
||||
{
|
||||
if($(e.target).hasClass('busy')) return;
|
||||
markBusy();
|
||||
$.ajax({
|
||||
url: createLink('ai', 'chat'),
|
||||
type: 'POST',
|
||||
dataType: 'html',
|
||||
data: {retry: 'true', history: $('input[name=history]').val()},
|
||||
success: function(response)
|
||||
{
|
||||
$('.chat').html($($.parseHTML(response)).filter('.chat').html());
|
||||
init();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init()
|
||||
{
|
||||
$('textarea[name=message]').keydown(function(e)
|
||||
{
|
||||
/* Send message on enter, allowing linebreak inputs. */
|
||||
if((e.keyCode == 13 || e.keyCode == 10))
|
||||
{
|
||||
if($(this).hasClass('busy')) return;
|
||||
|
||||
if(e.ctrlKey || e.metaKey)
|
||||
{
|
||||
$('textarea[name=message]').val($('textarea[name=message]').val() + '\n');
|
||||
$('textarea[name=message]').trigger('input');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($('textarea[name=message]').val().trim().length == 0)
|
||||
{
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
$('form').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('form').on('submit', function(e)
|
||||
{
|
||||
/* Disable form and add message. */
|
||||
markBusy();
|
||||
const message = $('textarea[name=message]').val().trim();
|
||||
$('.messages').prepend("<div class='message-container-user'><div class='message-content'>" + message + '</div></div>');
|
||||
|
||||
/* Send message to server and re-render the chat. */
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: createLink('ai', 'chat'),
|
||||
type: 'POST',
|
||||
data: {message, history: $('input[name=history]').val()},
|
||||
dataType: 'html',
|
||||
success: function(response)
|
||||
{
|
||||
$('.chat').html($($.parseHTML(response)).filter('.chat').html());
|
||||
init();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#reset').click(reset);
|
||||
$('#retry').click(retry);
|
||||
$('textarea[name=message]').focus();
|
||||
$('textarea[name=message]').on('input', function()
|
||||
{
|
||||
/* Toggle send button. */
|
||||
const hasMessage = $(this).val().trim().length > 0;
|
||||
$('input[type=submit]').attr('disabled', !hasMessage).toggleClass('disabled', !hasMessage);
|
||||
|
||||
/* Resize textarea to fit content. */
|
||||
const clientHeight = +$(this).prop('clientHeight');
|
||||
const scrollHeight = +$(this).prop('scrollHeight');
|
||||
if(clientHeight < scrollHeight)
|
||||
{
|
||||
if(clientHeight < 150)
|
||||
{
|
||||
$(this).css('height', (scrollHeight + 2) + 'px');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).addClass('has-scrollbar');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
init();
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
(function ()
|
||||
{
|
||||
const form = document.querySelector('#mainForm');
|
||||
if(form)
|
||||
{
|
||||
form.addEventListener('input', function ()
|
||||
{
|
||||
isPromptDesignDirty = true;
|
||||
});
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,699 @@
|
||||
let $editingField = null;
|
||||
let fieldIndex = 0;
|
||||
/**
|
||||
* @type {Map<string, string>}
|
||||
*/
|
||||
const words = new Map();
|
||||
|
||||
/**
|
||||
* Handle the field type change events.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @returns {void}
|
||||
*/
|
||||
function changeFieldType(event)
|
||||
{
|
||||
const fieldType = $(event.target).prop('value');
|
||||
if(fieldType === 'text' || fieldType === 'textarea')
|
||||
{
|
||||
$('input[name="placeholder"]').closest('tr').removeClass('hidden');
|
||||
$('.field-options').addClass('hidden');
|
||||
revertOptions();
|
||||
}
|
||||
else
|
||||
{
|
||||
revertOptions();
|
||||
$('input[name="placeholder"]').closest('tr').addClass('hidden');
|
||||
$('.field-options').removeClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix options order.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function fixOptionsOrder()
|
||||
{
|
||||
const forEach = function ()
|
||||
{
|
||||
const index = $(this).children('span.input-group-addon').html().replace(/\d+$/, $(this).index() + 1);
|
||||
$(this).children('span.input-group-addon').html(index);
|
||||
}
|
||||
$('.options-container').children().each(forEach);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the remove option button Click event.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @returns {void}
|
||||
*/
|
||||
function removeFieldOption(event)
|
||||
{
|
||||
$(event.target).closest('.input-group').remove();
|
||||
fixOptionsOrder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the add option button Click event.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @returns {void}
|
||||
*/
|
||||
function addFieldOption(event)
|
||||
{
|
||||
const template = document.getElementById('option-template');
|
||||
const $clone = $(document.importNode(template.content, true));
|
||||
$(event.target).closest('.options-container').append($clone);
|
||||
fixOptionsOrder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Revert options.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function revertOptions()
|
||||
{
|
||||
const template = document.getElementById('option-template');
|
||||
const $optionsContainer = $('<div class="options-container"></div>');
|
||||
const $option = $(document.importNode(template.content, true));
|
||||
$optionsContainer.append($option);
|
||||
const $optionStr = $optionsContainer.html();
|
||||
$optionsContainer.append($optionStr);
|
||||
$optionsContainer.append($optionStr);
|
||||
$optionsContainer.find('.input-group').first().find('button').last().attr('disabled', 'disabled');
|
||||
|
||||
$('.field-options')
|
||||
.children('td')
|
||||
.empty()
|
||||
.append($optionsContainer);
|
||||
|
||||
fixOptionsOrder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the new field button click event.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function toAddField()
|
||||
{
|
||||
const $modal = $('#add-field-modal');
|
||||
const $modalBody = $modal.find('.modal-body');
|
||||
$modalBody.empty();
|
||||
const template = document.getElementById('field-template');
|
||||
const clone = document.importNode(template.content, true);
|
||||
$modalBody.append(clone);
|
||||
$('#add-field-modal .text-danger').remove();
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the editing field.
|
||||
*
|
||||
* @param {*} $fieldTr
|
||||
* @returns {[boolean, *]}
|
||||
*/
|
||||
function getEditingField($fieldTr)
|
||||
{
|
||||
const name = $fieldTr.find('.field-name').html();
|
||||
const isTextType = !$fieldTr.find('.picker').length;
|
||||
if(isTextType)
|
||||
{
|
||||
const type = $fieldTr.find('input.field-type').length ? 'text' : 'textarea';
|
||||
const placeholder = $fieldTr.find('.field-type').prop('placeholder');
|
||||
const required = $fieldTr.find('.field-type').closest('td').hasClass('required');
|
||||
return [true, { name, type, placeholder, required }];
|
||||
}
|
||||
|
||||
const $picker = $fieldTr.find('.picker');
|
||||
const type = $picker.hasClass('picker-multi') ? 'checkbox' : 'radio';
|
||||
const options = $picker.attr('data-options').split(',');
|
||||
const required = $picker.closest('td').hasClass('required');
|
||||
return [false, { name, type, options, required }];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the edit field button click event.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @returns {void}
|
||||
*/
|
||||
function toEditField(event)
|
||||
{
|
||||
const $fieldTr = $(event.target).closest('tr');
|
||||
$editingField = $fieldTr;
|
||||
const [isTextType, field] = getEditingField($fieldTr);
|
||||
|
||||
const $modal = $('#edit-field-modal');
|
||||
const $modalBody = $modal.find('.modal-body');
|
||||
$modalBody.empty();
|
||||
const template = document.getElementById('field-template');
|
||||
const $clone = $(document.importNode(template.content, true));
|
||||
$modalBody.append($clone);
|
||||
$modalBody.find('input[name="field-name"]').prop('value', field.name);
|
||||
$modalBody.find('select[name="field-type"]').prop('value', field.type);
|
||||
|
||||
if(isTextType)
|
||||
{
|
||||
$modalBody.find('input[name="placeholder"]').prop('value', field.placeholder);
|
||||
$('input[name="placeholder"]').closest('tr').removeClass('hidden');
|
||||
$('.field-options').addClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
const $optionsWrapper = $modalBody.find('.field-options > td')
|
||||
$optionsWrapper.empty();
|
||||
const $optionsContainer = $(`<div class="options-container"></div>`)
|
||||
$optionsWrapper.append($optionsContainer);
|
||||
|
||||
field.options.forEach((option) => {
|
||||
const template = document.getElementById('option-template');
|
||||
const $clone = $(document.importNode(template.content, true));
|
||||
$optionsContainer.append($clone);
|
||||
$optionsContainer.children('.input-group').last().find('input[name="option[]"]').prop('value', option);
|
||||
});
|
||||
|
||||
fixOptionsOrder();
|
||||
$('input[name="placeholder"]').closest('tr').addClass('hidden');
|
||||
$('.field-options').removeClass('hidden');
|
||||
}
|
||||
|
||||
if(field.required)
|
||||
{
|
||||
$modalBody.find('input[value="1"]').attr('checked', 'checked');
|
||||
$modalBody.find('input[value="0"]').removeAttr('checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$modalBody.find('input[value="0"]').attr('checked', 'checked');
|
||||
$modalBody.find('input[value="1"]').removeAttr('checked');
|
||||
}
|
||||
|
||||
$modal.find('.input-group').first().find('button').last().attr('disabled', 'disabled');
|
||||
|
||||
$('#edit-field-modal .text-danger').remove();
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the remove field button click event.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @returns {void}
|
||||
*/
|
||||
function toRemoveField(event)
|
||||
{
|
||||
const result = window.confirm(deleteTip);
|
||||
if(!result) return;
|
||||
|
||||
const $tr = $(event.target).closest('tr');
|
||||
const fieldID = $tr.attr('data-id');
|
||||
$tr.remove();
|
||||
$('.field-content').find(`[data-id="${fieldID}"]`).remove();
|
||||
|
||||
if($('.field-configuration').children().length === 0) $('.field-configuration').parent().addClass('hidden').prev().removeClass('hidden');
|
||||
words.delete($tr.find('th').prop('title'));
|
||||
const innerHTML = $('#autocomplete-textarea').html();
|
||||
$('#autocomplete-textarea').html(innerHTML.replace(/<strong class="text-primary">/g, '').replace(/<\/strong>/g, ''));
|
||||
updatePromptPreview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for duplicate field names.
|
||||
*
|
||||
* @param {string} name
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
const checkDuplicatedFieldName = (name) => Array.from(words.keys()).includes(name);
|
||||
|
||||
/**
|
||||
* Show field name error iferror exists.
|
||||
*
|
||||
* @param {*} $required
|
||||
* @param {HTMLFormElement} formData
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
function showFieldNameErrorIfExist($required, form)
|
||||
{
|
||||
const $form = $(form);
|
||||
const formData = new FormData(form);
|
||||
const name = formData.get('field-name');
|
||||
$form.find('.text-danger.help-text').remove();
|
||||
$form.find('.has-error').removeClass('has-error');
|
||||
|
||||
if(!name.trim())
|
||||
{
|
||||
$required
|
||||
.addClass('has-error')
|
||||
.append(`<div class="text-danger help-text">${emptyWarning.replace('%s', fieldName)}</div>`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(checkDuplicatedFieldName(name))
|
||||
{
|
||||
if(!$editingField || $editingField.find('.field-name').html() !== name)
|
||||
{
|
||||
$required
|
||||
.addClass('has-error')
|
||||
.append(`<div class="text-danger help-text">${duplicatedWarning.replace('%s', fieldName)}</div>`);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(['radio', 'checkbox'].includes(formData.get('field-type')) && formData.getAll('option[]').filter(x => !!x).length === 0)
|
||||
{
|
||||
$form.find('.options-container').children().first().addClass('has-error').after(`<div class="text-danger help-text">${emptyOptionWarning}</div>`);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the save field button click event.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function saveNewField()
|
||||
{
|
||||
const form = document.querySelector('#add-field-modal form');
|
||||
const formData = new FormData(form);
|
||||
const name = formData.get('field-name');
|
||||
const $required = $('#add-field-modal input[name="field-name"]').closest('.required');
|
||||
|
||||
if(showFieldNameErrorIfExist($required, form)) return;
|
||||
|
||||
$('#add-field-modal').modal('hide');
|
||||
const $fieldView = createFieldView(formData);
|
||||
$fieldView.attr('data-id', `field-${++fieldIndex}`);
|
||||
$('#sortable-list').append($fieldView);
|
||||
$fieldView.find('.picker').addClass('disabled');
|
||||
|
||||
const $button = $('.field-configuration-main > div');
|
||||
const $table = $('.field-configuration-main > table');
|
||||
if(!$button.hasClass('hidden')) $button.addClass('hidden');
|
||||
if($table.hasClass('hidden')) $table.removeClass('hidden');
|
||||
|
||||
const $fieldViewClone = createFieldView(formData);
|
||||
$fieldViewClone.attr('data-id', $fieldView.attr('data-id'));
|
||||
$fieldViewClone.children().last().remove();
|
||||
$fieldViewClone.find('.drag-area').removeClass('darg-area');
|
||||
$fieldViewClone.removeClass('srotable-item');
|
||||
$fieldViewClone.find('.icon-move').remove();
|
||||
$fieldViewClone.find('[readonly]').removeAttr('readonly');
|
||||
$fieldViewClone.find('.field-type').on('change', updatePromptPreview);
|
||||
$('.field-content').append($fieldViewClone);
|
||||
|
||||
words.set(name, $fieldView.attr('data-id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save edited field button click event.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function saveEditedField()
|
||||
{
|
||||
const oldName = $editingField.find('.field-name').html();
|
||||
const form = document.querySelector('#edit-field-modal form');
|
||||
const formData = new FormData(form);
|
||||
const name = formData.get('field-name');
|
||||
const $required = $('#edit-field-modal input[name="field-name"]').closest('.required');
|
||||
|
||||
if(showFieldNameErrorIfExist($required, form)) return;
|
||||
|
||||
$('#edit-field-modal').modal('hide');
|
||||
const $fieldView = createFieldView(formData);
|
||||
$fieldView.attr('data-id', $editingField.attr('data-id'));
|
||||
$editingField.replaceWith($fieldView);
|
||||
$fieldView.find('.picker').addClass('disabled');
|
||||
|
||||
const $fieldViewClone = createFieldView(formData);
|
||||
$fieldViewClone.attr('data-id', $fieldView.attr('data-id'));
|
||||
$fieldViewClone.children().last().remove();
|
||||
$fieldViewClone.children().first().removeClass('darg-area');
|
||||
$fieldViewClone.find('.icon-move').remove();
|
||||
$fieldViewClone.find('[readonly]').removeAttr('readonly');
|
||||
$fieldViewClone.find('.field-type').on('change', updatePromptPreview);
|
||||
$(`.field-content [data-id="${$editingField.attr('data-id')}"]`).replaceWith($fieldViewClone);
|
||||
|
||||
words.delete(oldName);
|
||||
words.set(name, $fieldView.attr('data-id'));
|
||||
if(oldName !== name) updatePromptPreview();
|
||||
$editingField = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create field view.
|
||||
*
|
||||
* @param {FormData} formData
|
||||
* @returns {*}
|
||||
*/
|
||||
function createFieldView(formData)
|
||||
{
|
||||
const $tr = $(`<tr class="sortable-item"></tr>`);
|
||||
$tr.append(createFieldNameView(formData));
|
||||
$tr.append(createFieldTypeView(formData));
|
||||
$tr.append(createFieldButtons(formData));
|
||||
return $tr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create field name view.
|
||||
*
|
||||
* @param {FormData} formData
|
||||
* @returns {*}
|
||||
*/
|
||||
function createFieldNameView(formData)
|
||||
{
|
||||
const name = formData.get('field-name');
|
||||
return $(`<th class="drag-area" title="${name}">
|
||||
<div>
|
||||
<i class="icon icon-move"></i>
|
||||
<span class="field-name">${name}</span>
|
||||
</div>
|
||||
</th>`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create field type view.
|
||||
*
|
||||
* @param {FormData} formData
|
||||
* @returns {*}
|
||||
*/
|
||||
function createFieldTypeView(formData)
|
||||
{
|
||||
const type = formData.get('field-type');
|
||||
const required = formData.get('field-required') === '1';
|
||||
const $td = $(`<td data-type="${type}"></td>`);
|
||||
if(required) $td.addClass('required');
|
||||
if(type === 'text')
|
||||
{
|
||||
const placeholder = formData.get('placeholder') || pleaseInput;
|
||||
$td.append(`<input type="text" class="form-control field-type" placeholder="${placeholder}" readonly />`);
|
||||
return $td;
|
||||
}
|
||||
|
||||
if(type === 'textarea')
|
||||
{
|
||||
const placeholder = formData.get('placeholder') || pleaseInput;
|
||||
$td.append(`<textarea class="form-control field-type" placeholder="${placeholder}" readonly />`);
|
||||
return $td;
|
||||
}
|
||||
|
||||
const options = Array.from(formData.getAll('option[]')).filter(x => !!x);
|
||||
const $picker = $(`<div class="picker"><input type="text" class="field-type" /></div>`);
|
||||
if(type === 'checkbox') $picker.attr('data-multi', 'true');
|
||||
$picker.picker({ list: options.map(option => ({ text: option, value: option })) });
|
||||
$picker.attr('data-options', options.join(','));
|
||||
$td.append($picker);
|
||||
return $td;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create field buttons view.
|
||||
*
|
||||
* @returns {*}
|
||||
*/
|
||||
function createFieldButtons()
|
||||
{
|
||||
return $(`<td style="width: 100px;">
|
||||
<button type="button" class="btn btn-link btn-sm btn-icon" onclick="toAddField()">
|
||||
<i class="icon icon-plus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-link btn-sm btn-icon" onclick="toEditField(event)">
|
||||
<i class="icon icon-edit"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-link btn-sm btn-icon" onclick="toRemoveField(event)">
|
||||
<i class="icon icon-trash"></i>
|
||||
</button>
|
||||
</td>`);
|
||||
}
|
||||
|
||||
/**
|
||||
* format prompt input string.
|
||||
*
|
||||
* @param {string} content prompt content.
|
||||
* @returns {string} result.
|
||||
*/
|
||||
function formatContent(content)
|
||||
{
|
||||
if(words.size === 0) return content;
|
||||
Array.from(words.keys()).forEach(word => { content = content.replace(new RegExp(`\\s<${word}>\\s`, 'g'), ` <strong class="text-primary"><${word}></strong> `); });
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update prompt preview.
|
||||
*
|
||||
* @returns {string} result
|
||||
*/
|
||||
function updatePromptPreview()
|
||||
{
|
||||
const innerText = $('#autocomplete-textarea').text();
|
||||
let innerHTML = formatContent(innerText);
|
||||
$('#autocomplete-textarea').html(innerHTML);
|
||||
if(words.size === 0)
|
||||
{
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
return;
|
||||
}
|
||||
|
||||
const regex = /<strong\sclass="text-primary"><([^>]+)><\/strong> /g;
|
||||
const matches = innerHTML.match(regex);
|
||||
if(!matches)
|
||||
{
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
return;
|
||||
}
|
||||
|
||||
matches.forEach((match) =>
|
||||
{
|
||||
const result = match.match(/<strong\sclass="text-primary"><([^>]+)><\/strong> /)[1];
|
||||
const fieldIndex = words.get(result);
|
||||
const fieldValue = $(`.field-content [data-id="${fieldIndex}"] .field-type`).val();
|
||||
if(!fieldValue) return;
|
||||
innerHTML = innerHTML.replace(new RegExp(`<${result}>`, 'g'), fieldValue);
|
||||
innerHTML = innerHTML.replace(new RegExp(`<${result}>`, 'g'), fieldValue);
|
||||
});
|
||||
|
||||
innerHTML = innerHTML.replace(/ /g, ' ')
|
||||
.replace(/\s<strong\sclass="text-primary">/g, '<strong class="text-primary">')
|
||||
.replace(/<\/strong>\s/g, '</strong>');
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
}
|
||||
|
||||
function getRequiredFields()
|
||||
{
|
||||
const fields = [];
|
||||
$('.field-content').children().each(function ()
|
||||
{
|
||||
const field = {};
|
||||
field.name = $(this).find('.field-name').html();
|
||||
field.type = $(this).find('td').attr('data-type');
|
||||
field.required = $(this).find('td').hasClass('required') ? '1' : '0'
|
||||
field.appID = appID;
|
||||
if(['text', 'textarea'].includes(field.type)) field.placeholder = $(this).find('.field-type').prop('placeholder');
|
||||
else field.options = $(this).find('.picker').attr('data-options').split(',');
|
||||
fields.push(field);
|
||||
});
|
||||
const prompt = $('#autocomplete-textarea').text();
|
||||
return [fields, prompt];
|
||||
}
|
||||
|
||||
/**
|
||||
* Save mini program fields.
|
||||
*
|
||||
* @param {'0'|'1'} toPublish
|
||||
* @returns {void}
|
||||
*/
|
||||
function saveMiniProgram(toPublish)
|
||||
{
|
||||
if(!$('#autocomplete-textarea').text().trim())
|
||||
{
|
||||
alert(promptPlaceholder);
|
||||
return;
|
||||
}
|
||||
if(toPublish === '1')
|
||||
{
|
||||
const $modal = $('#publish-confirm-modal');
|
||||
$modal.modal('show', 'fit');
|
||||
return;
|
||||
}
|
||||
postMiniProgramData('0', (data) => {
|
||||
data = JSON.parse(data);
|
||||
if(data.result === 'success') $.zui.messager.success(data.message);
|
||||
else $.zui.messager.danger(data.message);
|
||||
});
|
||||
}
|
||||
|
||||
$('#publish-confirm-modal .btn-primary').on('click', function ()
|
||||
{
|
||||
postMiniProgramData('1', () => { window.location.href = createLink('ai', 'miniPrograms'); });
|
||||
});
|
||||
|
||||
function postMiniProgramData(toPublish, callback)
|
||||
{
|
||||
const [fields, prompt] = getRequiredFields();
|
||||
$.post(createLink('ai', 'configuredMiniProgram', `appID=${appID}`), { fields, prompt, toPublish }).done(callback);
|
||||
}
|
||||
|
||||
function backToList()
|
||||
{
|
||||
const [, prompt] = getRequiredFields();
|
||||
console.log(prompt);
|
||||
if(prompt && prompt.trim())
|
||||
{
|
||||
$modal = $('#back-to-list-modal');
|
||||
$modal.modal('show', 'fit');
|
||||
return;
|
||||
}
|
||||
window.location.href = createLink('ai', 'miniPrograms');
|
||||
}
|
||||
|
||||
function backWithoutSave()
|
||||
{
|
||||
$modal = $('#back-to-list-modal');
|
||||
$modal.modal('hide');
|
||||
window.location.href = createLink('ai', 'miniPrograms');
|
||||
}
|
||||
|
||||
function backWithSave()
|
||||
{
|
||||
$modal = $('#back-to-list-modal');
|
||||
$modal.modal('hide');
|
||||
saveMiniProgram('0');
|
||||
window.location.href = createLink('ai', 'miniPrograms');
|
||||
}
|
||||
|
||||
function updateButtonStatus()
|
||||
{
|
||||
if($('#autocomplete-textarea').text().trim())
|
||||
{
|
||||
$('.footer > a.btn-primary').removeAttr('disabled');
|
||||
$('.footer > a.btn-secondary').removeAttr('disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.footer > a.btn-primary').attr('disabled', 'disabled');
|
||||
$('.footer > a.btn-secondary').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('#sortable-list').sortable(
|
||||
{
|
||||
selector: '.sortable-item',
|
||||
trigger: '.drag-area',
|
||||
finish: function (e)
|
||||
{
|
||||
const $draggedElm = e.element;
|
||||
const $fieldContent = $('.field-content');
|
||||
const selector = `[data-id="${$draggedElm.attr('data-id')}"]`;
|
||||
const prevSelector = `[data-id="${$draggedElm.prev().attr('data-id')}"]`;
|
||||
const index = $draggedElm.index();
|
||||
const $draggedElmContent = $fieldContent.find(selector);
|
||||
if(index === 0) $fieldContent.prepend($draggedElmContent);
|
||||
else $draggedElmContent.insertAfter($fieldContent.find(prevSelector));
|
||||
},
|
||||
});
|
||||
$('#autocomplete-textarea').textcomplete(
|
||||
[{
|
||||
match: /(\s+)(\<\S*)$/,
|
||||
search(term, callback)
|
||||
{
|
||||
callback(Array.from(words.keys()).filter(word => `<${word}>`.indexOf(term) === 0));
|
||||
},
|
||||
replace(word)
|
||||
{
|
||||
word = `<strong class="text-primary"><${word}></strong>`;
|
||||
return `$1${word} `;
|
||||
}
|
||||
}]);
|
||||
|
||||
$('#autocomplete-textarea').on('blur', () =>
|
||||
{
|
||||
updatePromptPreview();
|
||||
updateButtonStatus();
|
||||
});
|
||||
|
||||
currentFields.forEach(field =>
|
||||
{
|
||||
const formData = new FormData();
|
||||
formData.set('field-name', field.name);
|
||||
formData.set('field-required', field.required);
|
||||
formData.set('field-type', field.type);
|
||||
formData.set('placeholder', field.placeholder);
|
||||
|
||||
if(typeof field.options === 'string' && field.options.length > 0)
|
||||
{
|
||||
field.options = field.options.split(',');
|
||||
field.options.forEach(option => formData.append('option[]', option));
|
||||
}
|
||||
|
||||
const $fieldView = createFieldView(formData);
|
||||
$fieldView.attr('data-id', `field-${++fieldIndex}`);
|
||||
$('#sortable-list').append($fieldView);
|
||||
$fieldView.find('.picker').addClass('disabled');
|
||||
|
||||
const $button = $('.field-configuration-main > div');
|
||||
const $table = $('.field-configuration-main > table');
|
||||
if(!$button.hasClass('hidden')) $button.addClass('hidden');
|
||||
if($table.hasClass('hidden')) $table.removeClass('hidden');
|
||||
|
||||
const $fieldViewClone = createFieldView(formData);
|
||||
$fieldViewClone.attr('data-id', $fieldView.attr('data-id'));
|
||||
$fieldViewClone.children().last().remove();
|
||||
$fieldViewClone.find('.drag-area').removeClass('darg-area');
|
||||
$fieldViewClone.removeClass('srotable-item');
|
||||
$fieldViewClone.find('.icon-move').remove();
|
||||
$fieldViewClone.find('[readonly]').removeAttr('readonly');
|
||||
$fieldViewClone.find('.field-type').on('change', updatePromptPreview);
|
||||
$('.field-content').append($fieldViewClone);
|
||||
|
||||
words.set(field.name, $fieldView.attr('data-id'));
|
||||
});
|
||||
|
||||
$('#autocomplete-textarea').html(currentPrompt);
|
||||
updatePromptPreview();
|
||||
updateButtonStatus();
|
||||
|
||||
$('#generate-result').on('click', function()
|
||||
{
|
||||
const message = $('.prompt-preview-area .preview-container').text();
|
||||
if(!message) return;
|
||||
|
||||
const trigger = new $.zui.ModalTrigger({backdrop: 'static'});
|
||||
trigger.show();
|
||||
|
||||
$.post(
|
||||
createLink('aiapp', 'miniProgramChat', `id=${appID}`),
|
||||
{
|
||||
message,
|
||||
test: '1'
|
||||
},
|
||||
).done(function(response)
|
||||
{
|
||||
trigger.close();
|
||||
response = JSON.parse(response);
|
||||
const {message, result} = response;
|
||||
if(result === 'success')
|
||||
{
|
||||
const {content} = message;
|
||||
$('.prompt-result-area .preview-container').html(content);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.prompt-result-area .preview-container').html(message);
|
||||
}).fail(function()
|
||||
{
|
||||
trigger.close();
|
||||
new $.zui.Messager('Network error', {close: false, type: 'danger', icon: 'exclamation-sign'}).show();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
let selectedIcon;
|
||||
let selectedTheme;
|
||||
|
||||
function changeMiniProgramTheme(event)
|
||||
{
|
||||
const $icon = $('#preview-icon');
|
||||
const $button = $(event.target).closest('button');
|
||||
const $prev = $('.theme-checked');
|
||||
$prev.removeClass('theme-checked');
|
||||
$button.addClass('theme-checked');
|
||||
$prev.empty();
|
||||
$button.append(iconCheck);
|
||||
$icon.css('background-color', $button.css('background-color'));
|
||||
$icon.css('border', $button.css('border'));
|
||||
selectedTheme = $button.index();
|
||||
}
|
||||
|
||||
function changeMiniProgramIcon(event)
|
||||
{
|
||||
const $icon = $('#preview-icon');
|
||||
const $svg = $(event.target).closest('svg').clone();
|
||||
$icon.empty();
|
||||
$icon.append($svg);
|
||||
selectedIcon = $svg.prop('id');
|
||||
}
|
||||
|
||||
function saveMiniProgramIcon()
|
||||
{
|
||||
const $editIcon = $('#ai-edit-icon');
|
||||
$editIcon.children().first('svg').remove();
|
||||
const $icon = $('#preview-icon');
|
||||
$editIcon.prepend($icon.find('svg').clone());
|
||||
$editIcon.css('background-color', $icon.css('background-color'));
|
||||
$editIcon.css('border', $icon.css('border'));
|
||||
$('input[name="iconTheme"]').prop('value', selectedTheme);
|
||||
$('input[name="iconName"]').prop('value', selectedIcon);
|
||||
}
|
||||
|
||||
function saveMiniProgram()
|
||||
{
|
||||
$('[name="toNext"]').prop('value', '0');
|
||||
}
|
||||
|
||||
function toConfiguredMiniProgram()
|
||||
{
|
||||
$('[name="toNext"]').prop('value', '1');
|
||||
}
|
||||
|
||||
function toEditMiniProgramIcon()
|
||||
{
|
||||
const $button = $('#ai-edit-icon');
|
||||
const iconName = $button.find('svg').prop('id');
|
||||
const iconTheme = $button.css('background-color');
|
||||
const $container = $('.icon-setting-container');
|
||||
$container.find(`#${iconName}`).click();
|
||||
$container.find('.btn-icon').each(function()
|
||||
{
|
||||
if($(this).css('background-color') === iconTheme) $(this).click();
|
||||
});
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('#theme-buttons button').on('click', changeMiniProgramTheme);
|
||||
$('#icon-buttons svg').on('click', changeMiniProgramIcon);
|
||||
$('#save-icon-button').on('click', saveMiniProgramIcon);
|
||||
$('#save-miniprogram').on('click', saveMiniProgram);
|
||||
$('#next-step').on('click', toConfiguredMiniProgram);
|
||||
$('#ai-edit-icon').on('click', toEditMiniProgramIcon);
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
$(function()
|
||||
{
|
||||
const template = document.getElementById('custom-item');
|
||||
const $clone = $(document.importNode(template.content, true));
|
||||
$('.custom-category-list').append($clone);
|
||||
});
|
||||
|
||||
function addItem(event)
|
||||
{
|
||||
const $target = $(event.target);
|
||||
const template = document.getElementById('custom-item');
|
||||
const $clone = $(document.importNode(template.content, true));
|
||||
$target.closest('.category-item').after($clone);
|
||||
}
|
||||
|
||||
function deleteItem(event)
|
||||
{
|
||||
const $target = $(event.target);
|
||||
$target.closest('.category-item').remove();
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
let miniProgramID;
|
||||
|
||||
/**
|
||||
* Open disable mini program dialog.
|
||||
* @param {Event} event
|
||||
*/
|
||||
function openDisableDialog(event)
|
||||
{
|
||||
const $modal = $('#disable-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
miniProgramID = $(event.target).closest('tr').find('.c-id').text();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open delete mini program dialog.
|
||||
* @param {Event} event
|
||||
*/
|
||||
function openDeleteDialog(event)
|
||||
{
|
||||
const $modal = $('#delete-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
miniProgramID = $(event.target).closest('tr').find('.c-id').text();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open publish mini program dialog.
|
||||
* @param {Event} event
|
||||
*/
|
||||
function openPublishDialog(event)
|
||||
{
|
||||
const $modal = $('#publish-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
miniProgramID = $(event.target).closest('tr').find('.c-id').text();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change mini program `deleted` value.
|
||||
* @param {'0'|'1'} deleted
|
||||
*/
|
||||
function deleteMiniProgram(deleted)
|
||||
{
|
||||
window.location.href = createLink('ai', 'deleteMiniProgram', `appID=${miniProgramID}&deleted=${deleted}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a mini program.
|
||||
*/
|
||||
function publishMiniProgram()
|
||||
{
|
||||
window.location.href = createLink('ai', 'publishMiniProgram', `appID=${miniProgramID}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpublish a mini program.
|
||||
*/
|
||||
function unpublishMiniProgram()
|
||||
{
|
||||
window.location.href = createLink('ai', 'unpublishMiniProgram', `appID=${miniProgramID}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export mini program data.
|
||||
* @param {Event} event
|
||||
*/
|
||||
function exportMiniProgram(event)
|
||||
{
|
||||
const $target = $(event.target);
|
||||
const $tr = $target.closest('tr');
|
||||
const id = $tr.find('.c-id').text();
|
||||
const name = $tr.find('.c-name').text();
|
||||
|
||||
$target.closest('button').attr('disabled', 'disabled');
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', createLink('ai', 'exportMiniProgram', `appID=${id}`, 'json'), true);
|
||||
xhr.responseType = 'blob';
|
||||
xhr.setRequestHeader('Accept', 'application/zip');
|
||||
|
||||
xhr.onload = function()
|
||||
{
|
||||
if(xhr.status === 200)
|
||||
{
|
||||
const blob = xhr.response;
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.href = url;
|
||||
downloadLink.download = `${name}.ztapp.zip`;
|
||||
downloadLink.click();
|
||||
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
$target.closest('button').removeAttr('disabled');
|
||||
};
|
||||
|
||||
xhr.onerror = function()
|
||||
{
|
||||
$target.closest('button').removeAttr('disabled');
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Open disable mini program dialog.
|
||||
*/
|
||||
function openDisableDialog()
|
||||
{
|
||||
const $modal = $('#disable-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Open delete mini program dialog.
|
||||
*/
|
||||
function openDeleteDialog()
|
||||
{
|
||||
const $modal = $('#delete-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Open publish mini program dialog.
|
||||
*/
|
||||
function openPublishDialog()
|
||||
{
|
||||
const $modal = $('#publish-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Change mini program `deleted` value.
|
||||
* @param {'0'|'1'} deleted
|
||||
*/
|
||||
function deleteMiniProgram(deleted)
|
||||
{
|
||||
window.location.href = createLink('ai', 'deleteMiniProgram', `appID=${miniProgramID}&deleted=${deleted}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a mini program.
|
||||
*/
|
||||
function publishMiniProgram()
|
||||
{
|
||||
window.location.href = createLink('ai', 'publishMiniProgram', `appID=${miniProgramID}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpublish a mini program.
|
||||
*/
|
||||
function unpublishMiniProgram()
|
||||
{
|
||||
window.location.href = createLink('ai', 'unpublishMiniProgram', `appID=${miniProgramID}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export mini program data.
|
||||
* @param {Event} event
|
||||
*/
|
||||
function exportMiniProgram(event)
|
||||
{
|
||||
const $target = $(event.target);
|
||||
$target.closest('button').attr('disabled', 'disabled');
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', createLink('ai', 'exportMiniProgram', `appID=${miniProgramID}`, 'json'), true);
|
||||
xhr.responseType = 'blob';
|
||||
xhr.setRequestHeader('Accept', 'application/zip');
|
||||
|
||||
xhr.onload = function()
|
||||
{
|
||||
if(xhr.status === 200)
|
||||
{
|
||||
const blob = xhr.response;
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.href = url;
|
||||
downloadLink.download = `${miniProgramName}.ztapp.zip`;
|
||||
downloadLink.click();
|
||||
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
$target.closest('button').removeAttr('disabled');
|
||||
};
|
||||
|
||||
xhr.onerror = function()
|
||||
{
|
||||
$target.closest('button').removeAttr('disabled');
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
window.testConnection = () =>
|
||||
{
|
||||
$('#model-form').find('button[type="submit"]').attr('disabled', 'disabled');
|
||||
$('#test-conn-btn').attr('disabled', 'disabled');
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
url: $.createLink('ai', 'modelTestConnection'),
|
||||
data: $('#model-form').find('form').serialize(),
|
||||
dataType: 'json',
|
||||
success: data =>
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'success'})
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'danger'})
|
||||
}
|
||||
},
|
||||
complete: () =>
|
||||
{
|
||||
$('#model-form').find('button[type="submit"]').removeAttr('disabled');
|
||||
$('#test-conn-btn').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleModelTypeChange = () =>
|
||||
{
|
||||
const modelType = $('select[name="type"]').val();
|
||||
const vendorList = window.vendorListLang[modelType];
|
||||
$('select[name="vendor"]').html('');
|
||||
for(const vendor in vendorList) $('select[name="vendor"]').append('<option value="' + vendor + '">' + vendorList[vendor] + '</option>');
|
||||
$('select[name="vendor"]').trigger('chosen:updated');
|
||||
$('select[name="vendor"]').trigger('change');
|
||||
};
|
||||
|
||||
const handleVendorChange = () =>
|
||||
{
|
||||
const vendor = $('select[name="vendor"]').val();
|
||||
const requiredFields = window.vendorList[vendor]['credentials'];
|
||||
const vendorTip = window.vendorTipsLang[vendor];
|
||||
$('.vendor-tips').html(vendorTip ? vendorTip : '');
|
||||
$('.vendor-row').each((_, el) => {$(el).toggle(requiredFields.includes($(el).find('input').attr('name')));});
|
||||
};
|
||||
handleVendorChange();
|
||||
|
||||
const handleProxyTypeChange = () =>
|
||||
{
|
||||
$('#proxy-addr-container').toggle($('select[name="proxyType"]').val() != '');
|
||||
};
|
||||
|
||||
$(() =>
|
||||
{
|
||||
$('select[name="type"]').on('change', handleModelTypeChange);
|
||||
$('select[name="vendor"]').on('change', handleVendorChange);
|
||||
$('select[name="proxyType"]').on('change', handleProxyTypeChange);
|
||||
$('button[type="submit"]]').on('click', e =>
|
||||
{
|
||||
$('button[type="submit"]').attr('disabled', 'disabled');
|
||||
$('#test-conn-btn').attr('disabled', 'disabled');
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
url: $.createLink('ai', 'modelcreate'),
|
||||
data: $('#model-form').serialize(),
|
||||
dataType: 'json',
|
||||
success: data =>
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'success'});
|
||||
window.location.href = $.createLink('ai', 'models');
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'danger'});
|
||||
}
|
||||
},
|
||||
complete: () =>
|
||||
{
|
||||
$('button[type="submit"]').removeAttr('disabled');
|
||||
$('#test-conn-btn').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,92 @@
|
||||
window.testConnection = () =>
|
||||
{
|
||||
$('#model-form').find('button[type="submit"]').attr('disabled', 'disabled');
|
||||
$('#test-conn-btn').attr('disabled', 'disabled');
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
url: $.createLink('ai', 'modelTestConnection'),
|
||||
data: $('#model-form').find('form').serialize(),
|
||||
dataType: 'json',
|
||||
success: data =>
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'success'})
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'danger'})
|
||||
}
|
||||
},
|
||||
complete: () =>
|
||||
{
|
||||
$('#model-form').find('button[type="submit"]').removeAttr('disabled');
|
||||
$('#test-conn-btn').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleModelTypeChange = () =>
|
||||
{
|
||||
const modelType = $('select[name="type"]').val();
|
||||
const vendorList = window.vendorListLang[modelType];
|
||||
$('select[name="vendor"]').html('');
|
||||
for(const vendor in vendorList) $('select[name="vendor"]').append('<option value="' + vendor + '">' + vendorList[vendor] + '</option>');
|
||||
$('select[name="vendor"]').trigger('chosen:updated');
|
||||
$('select[name="vendor"]').trigger('change');
|
||||
};
|
||||
|
||||
const handleVendorChange = () =>
|
||||
{
|
||||
const vendor = $('select[name="vendor"]').val();
|
||||
const requiredFields = window.vendorList[vendor]['credentials'];
|
||||
const vendorTip = window.vendorTipsLang[vendor];
|
||||
$('.vendor-tips').html(vendorTip ? vendorTip : '');
|
||||
$('.vendor-row').each((_, el) => {$(el).toggle(requiredFields.includes($(el).find('input').attr('name')));});
|
||||
};
|
||||
handleVendorChange();
|
||||
|
||||
const handleProxyTypeChange = () =>
|
||||
{
|
||||
$('#proxy-addr-container').toggle($('select[name="proxyType"]').val() != '');
|
||||
};
|
||||
handleProxyTypeChange();
|
||||
|
||||
$(() =>
|
||||
{
|
||||
$('select[name="type"]').on('change', handleModelTypeChange);
|
||||
$('select[name="vendor"]').on('change', handleVendorChange);
|
||||
$('select[name="proxyType"]').on('change', handleProxyTypeChange);
|
||||
$('button[type="submit"]]').on('click', e =>
|
||||
{
|
||||
$('button[type="submit"]').attr('disabled', 'disabled');
|
||||
$('#test-conn-btn').attr('disabled', 'disabled');
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
url: $.createLink('ai', 'modelcreate'),
|
||||
data: $('#model-form').serialize(),
|
||||
dataType: 'json',
|
||||
success: data =>
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'success'});
|
||||
window.location.href = $.createLink('ai', 'models');
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'danger'});
|
||||
}
|
||||
},
|
||||
complete: () =>
|
||||
{
|
||||
$('button[type="submit"]').removeAttr('disabled');
|
||||
$('#test-conn-btn').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
let renderedDefault = false;
|
||||
let defaultModel = null;
|
||||
window.onRenderCell = (result, {col, row}) =>
|
||||
{
|
||||
if(col.name == 'name' && ((!renderedDefault && row.data.enabled == '1') || (renderedDefault && row.data.id == defaultModel)))
|
||||
{
|
||||
result.push({html: `<span class='label gray-pale rounded-xl cursor-help' title='${langDefaultTip}'>${langDefault}</span>`});
|
||||
renderedDefault = true;
|
||||
defaultModel = row.data.id;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
window.confirmDisable = function(modelID)
|
||||
{
|
||||
zui.Modal.confirm({message: confirmDisableTip, icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then(res =>
|
||||
{
|
||||
if(res) $.ajaxSubmit({url: $.createLink('ai', 'modeldisable', `modelID=${modelID}`)});
|
||||
})
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
window.confirmDelete = modelID =>
|
||||
{
|
||||
zui.Modal.confirm({message: confirmDeleteTip, icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then(res =>
|
||||
{
|
||||
if(res) $.ajaxSubmit({url: $.createLink('ai', 'modeldelete', `modelID=${modelID}`)});
|
||||
})
|
||||
};
|
||||
|
||||
window.confirmDisable = modelID =>
|
||||
{
|
||||
zui.Modal.confirm({message: confirmDisableTip, icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then(res =>
|
||||
{
|
||||
if(res) $.ajaxSubmit({url: $.createLink('ai', 'modeldisable', `modelID=${modelID}`)});
|
||||
})
|
||||
};
|
||||
|
||||
window.testConnection = modelID =>
|
||||
{
|
||||
$('[href^="javascript:testConnection"]').attr('disabled', 'disabled');
|
||||
$.ajax(
|
||||
{
|
||||
type: 'GET',
|
||||
url: $.createLink('ai', 'modelTestConnection', `modelID=${modelID}`),
|
||||
dataType: 'json',
|
||||
success: data =>
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'success'})
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Messager.show({content: data.message, type: 'danger'})
|
||||
}
|
||||
},
|
||||
complete: () =>
|
||||
{
|
||||
$('[href^="javascript:testConnection"]').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
(function()
|
||||
{
|
||||
let currentPrompt = null;
|
||||
const actions = document.querySelectorAll('.c-actions');
|
||||
for(let action of actions)
|
||||
{
|
||||
action.addEventListener('click', function()
|
||||
{
|
||||
currentPrompt = action.getAttribute('data-prompt-id');
|
||||
});
|
||||
}
|
||||
|
||||
const goDesignButton = document.getElementById('goDesignButton');
|
||||
if(goDesignButton)
|
||||
{
|
||||
goDesignButton.addEventListener('click', function()
|
||||
{
|
||||
if(currentPrompt)
|
||||
{
|
||||
location.href = createLink('ai', 'promptassignrole', `prompt=${currentPrompt}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const draftPromptButton = document.getElementById('draftPromptButton');
|
||||
if(draftPromptButton)
|
||||
{
|
||||
draftPromptButton.addEventListener('click', function()
|
||||
{
|
||||
if(currentPrompt)
|
||||
{
|
||||
togglePromptStatus(currentPrompt);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function togglePromptStatus(id)
|
||||
{
|
||||
const form = document.createElement("form");
|
||||
form.method = 'post';
|
||||
form.action = createLink('ai', 'prompts');
|
||||
|
||||
const promptId = document.createElement('input');
|
||||
promptId.type = 'hidden';
|
||||
promptId.name = 'promptId';
|
||||
promptId.value = id;
|
||||
form.appendChild(promptId);
|
||||
|
||||
const publish = document.createElement('input');
|
||||
publish.type = 'hidden';
|
||||
publish.name = 'togglePromptStatus';
|
||||
publish.value = '1';
|
||||
form.appendChild(publish);
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
/**
|
||||
* @type {Map<string, string>}
|
||||
*/
|
||||
const words = new Map();
|
||||
|
||||
/**
|
||||
* format prompt input string.
|
||||
*
|
||||
* @param {string} content prompt content.
|
||||
* @returns {string} result.
|
||||
*/
|
||||
function formatContent(content)
|
||||
{
|
||||
if(words.size === 0) return content;
|
||||
Array.from(words.keys()).forEach(word => { content = content.replace(new RegExp(`\\s<${word}>\\s`, 'g'), ` <strong class="text-primary"><${word}></strong> `); });
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update prompt preview.
|
||||
*
|
||||
* @returns {string} result
|
||||
*/
|
||||
function updatePromptPreview()
|
||||
{
|
||||
const innerText = $('#autocomplete-textarea').text();
|
||||
let innerHTML = formatContent(innerText);
|
||||
$('#autocomplete-textarea').html(innerHTML);
|
||||
if(words.size === 0)
|
||||
{
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
return;
|
||||
}
|
||||
|
||||
const regex = /<strong\sclass="text-primary"><([^>]+)><\/strong> /g;
|
||||
const matches = innerHTML.match(regex);
|
||||
if(!matches)
|
||||
{
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
return;
|
||||
}
|
||||
|
||||
matches.forEach((match) =>
|
||||
{
|
||||
const result = match.match(/<strong\sclass="text-primary"><([^>]+)><\/strong> /)[1];
|
||||
const fieldIndex = words.get(result);
|
||||
const fieldValue = $(`.field-content [data-id="${fieldIndex}"] .field-type`).val();
|
||||
if(!fieldValue) return;
|
||||
innerHTML = innerHTML.replace(new RegExp(`<${result}>`, 'g'), fieldValue);
|
||||
innerHTML = innerHTML.replace(new RegExp(`<${result}>`, 'g'), fieldValue);
|
||||
});
|
||||
|
||||
innerHTML = innerHTML.replace(/ /g, ' ')
|
||||
.replace(/\s<strong\sclass="text-primary">/g, '<strong class="text-primary">')
|
||||
.replace(/<\/strong>\s/g, '</strong>');
|
||||
$('.prompt-preview-area .preview-container').html(innerHTML);
|
||||
}
|
||||
|
||||
function updateButtonStatus()
|
||||
{
|
||||
if($('#autocomplete-textarea').text().trim()) $('.button-container button').removeAttr('disabled');
|
||||
else $('.button-container button').attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('#autocomplete-textarea').textcomplete(
|
||||
[{
|
||||
match: /(\s+)(\<\S*)$/,
|
||||
search(term, callback) {
|
||||
callback(Array.from(words.keys()).filter(word => `<${word}>`.indexOf(term) === 0));
|
||||
},
|
||||
replace(word) {
|
||||
word = `<strong class="text-primary"><${word}></strong>`;
|
||||
return `$1${word} `;
|
||||
}
|
||||
}]
|
||||
);
|
||||
|
||||
$('#autocomplete-textarea').on('blur', () =>
|
||||
{
|
||||
updatePromptPreview();
|
||||
updateButtonStatus();
|
||||
});
|
||||
$('.field-content .field-type').on('change', updatePromptPreview);
|
||||
|
||||
currentField.forEach((field, index) => words.set(field.name, `field-${index}`));
|
||||
$('#autocomplete-textarea').html(currentPrompt);
|
||||
updatePromptPreview();
|
||||
updateButtonStatus();
|
||||
|
||||
$('#generate-result').on('click', function()
|
||||
{
|
||||
const message = $('.prompt-preview-area .preview-container').text();
|
||||
if(!message) return;
|
||||
|
||||
const trigger = new $.zui.ModalTrigger({backdrop: 'static', name: 'generate-loading'});
|
||||
trigger.show();
|
||||
|
||||
$.post(
|
||||
createLink('aiapp', 'miniProgramChat', `id=${appID}`),
|
||||
{
|
||||
message,
|
||||
test: '1'
|
||||
},
|
||||
).done(function(response)
|
||||
{
|
||||
trigger.close();
|
||||
response = JSON.parse(response);
|
||||
const {message, result} = response;
|
||||
if(result === 'success')
|
||||
{
|
||||
const {content} = message;
|
||||
$('.prompt-result-area .preview-container').html(content);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.prompt-result-area .preview-container').html(message);
|
||||
}).fail(function()
|
||||
{
|
||||
trigger.close();
|
||||
$('.prompt-result-area .preview-container').html('Network error');
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
function saveMiniProgram()
|
||||
{
|
||||
$('input[name="prompt"]').prop('value', $('#autocomplete-textarea').text());
|
||||
$('input[name="toPublish"]').prop('value', '0');
|
||||
}
|
||||
|
||||
function publishMiniProgram()
|
||||
{
|
||||
$('input[name="prompt"]').prop('value', $('#autocomplete-textarea').text());
|
||||
$('input[name="toPublish"]').prop('value', '1');
|
||||
}
|
||||
|
||||
/**
|
||||
* Open publish mini program dialog.
|
||||
*/
|
||||
function openPublishDialog()
|
||||
{
|
||||
const $modal = $('#publish-miniprogram');
|
||||
$modal.modal('show', 'fit');
|
||||
}
|
||||
@@ -0,0 +1,965 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->ai->common = 'AI Configuration';
|
||||
|
||||
/* Definitions of table columns, used to sprintf error messages to dao::$errors. */
|
||||
$lang->prompt = new stdclass();
|
||||
$lang->prompt->name = 'Name';
|
||||
$lang->prompt->desc = 'Description';
|
||||
$lang->prompt->model = 'Model';
|
||||
$lang->prompt->module = 'Module';
|
||||
$lang->prompt->source = 'Data Source';
|
||||
$lang->prompt->targetForm = 'Target Form';
|
||||
$lang->prompt->purpose = 'Purpose';
|
||||
$lang->prompt->elaboration = 'Elaboration';
|
||||
$lang->prompt->role = 'Role';
|
||||
$lang->prompt->characterization = 'Characterization';
|
||||
$lang->prompt->status = 'Status';
|
||||
$lang->prompt->createdBy = 'Created By';
|
||||
$lang->prompt->createdDate = 'Created Date';
|
||||
$lang->prompt->editedBy = 'Edited By';
|
||||
$lang->prompt->editedDate = 'Edited Date';
|
||||
$lang->prompt->deleted = 'Deleted';
|
||||
|
||||
/* Lang for privs, keys are paired with privlang items. */
|
||||
$lang->ai->modelBrowse = 'Browse Language Models';
|
||||
$lang->ai->modelView = 'View Language Model';
|
||||
$lang->ai->modelCreate = 'Create Language Model';
|
||||
$lang->ai->modelEdit = 'Edit Language Model';
|
||||
$lang->ai->modelEnable = 'Enable Language Model';
|
||||
$lang->ai->modelDisable = 'Disable Language Model';
|
||||
$lang->ai->modelDelete = 'Delete Language Model';
|
||||
$lang->ai->modelTestConnection = 'Test Model Connection';
|
||||
$lang->ai->promptCreate = 'Create Prompt';
|
||||
$lang->ai->promptEdit = 'Edit Prompt';
|
||||
$lang->ai->promptDelete = 'Delete Prompt';
|
||||
$lang->ai->promptAssignRole = 'Assign Prompt Role';
|
||||
$lang->ai->promptSelectDataSource = 'Select Prompt Data';
|
||||
$lang->ai->promptSetPurpose = 'Set Prompt Purpose';
|
||||
$lang->ai->promptSetTargetForm = 'Set Prompt Target Form';
|
||||
$lang->ai->promptFinalize = 'Finalize Prompt';
|
||||
$lang->ai->promptAudit = 'Audit Prompt';
|
||||
$lang->ai->promptPublish = 'Publish Prompt';
|
||||
$lang->ai->promptUnpublish = 'Unpublish Prompt';
|
||||
$lang->ai->promptBrowse = 'Browse Prompts';
|
||||
$lang->ai->promptView = 'View Prompt';
|
||||
$lang->ai->promptExecute = 'Execute Prompt';
|
||||
$lang->ai->promptExecutionReset = 'Reset Execute Prompt';
|
||||
$lang->ai->roleTemplates = 'Manage Role Templates';
|
||||
$lang->ai->chat = 'Chat';
|
||||
$lang->ai->createMiniProgram = 'Create AI Mini Program';
|
||||
$lang->ai->editMiniProgram = 'Edit AI Mini Program';
|
||||
$lang->ai->testMiniProgram = 'Test AI Mini Program';
|
||||
$lang->ai->miniProgramList = 'Browse AI Mini Program List';
|
||||
$lang->ai->miniProgramView = 'View AI Mini Program Details';
|
||||
$lang->ai->publishMiniProgram = 'Publish AI Mini Program';
|
||||
$lang->ai->unpublishMiniProgram = 'Disable AI Mini Program';
|
||||
$lang->ai->deleteMiniProgram = 'Delete AI Mini Program';
|
||||
$lang->ai->exportMiniProgram = 'Export AI Mini Program';
|
||||
$lang->ai->importMiniProgram = 'Import AI Mini Program';
|
||||
$lang->ai->editMiniProgramCategory = 'Manage group';
|
||||
|
||||
$lang->ai->export = 'Export';
|
||||
$lang->ai->import = 'Import';
|
||||
$lang->ai->saveFail = 'Save failed';
|
||||
$lang->ai->installPackage = 'Installation package';
|
||||
$lang->ai->toPublish = 'Publish after installation';
|
||||
$lang->ai->toZentaoStoreAIPage = 'Click to jump to Zentao official app store AI mini programs page';
|
||||
|
||||
$lang->ai->chatPlaceholderMessage = 'Hi, I\'m Adao, your AI assistant at ZenTao!';
|
||||
$lang->ai->chatPlaceholderInput = 'type here...';
|
||||
$lang->ai->chatSystemMessage = 'You\'re Adao, the AI assistant and mascot of ZenTao. You can answer questions and chat with users. You\'re currently within the ZenTao project management software.';
|
||||
$lang->ai->chatSend = 'Send';
|
||||
$lang->ai->chatReset = 'Reset';
|
||||
$lang->ai->chatNoResponse = 'Something went wrong, <a id="retry" class="text-blue">click here to retry</a>.';
|
||||
$lang->ai->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
|
||||
$lang->ai->nextStep = 'Next';
|
||||
$lang->ai->goTesting = 'Go testing';
|
||||
$lang->ai->maintenanceGroup = 'Maintenance Group';
|
||||
|
||||
$lang->ai->maintenanceGroupDuplicated = 'The group name cannot be duplicated.';
|
||||
|
||||
$lang->ai->validate = new stdclass();
|
||||
$lang->ai->validate->noEmpty = '%s cannot be empty.';
|
||||
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
|
||||
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
|
||||
|
||||
$lang->ai->prompts = new stdclass();
|
||||
$lang->ai->prompts->common = 'Prompt';
|
||||
$lang->ai->prompts->emptyList = 'No prompts yet.';
|
||||
$lang->ai->prompts->create = 'Create Prompt';
|
||||
$lang->ai->prompts->edit = 'Edit Prompt';
|
||||
$lang->ai->prompts->id = 'ID';
|
||||
$lang->ai->prompts->name = 'Name';
|
||||
$lang->ai->prompts->description = 'Description';
|
||||
$lang->ai->prompts->createdBy = 'Creator';
|
||||
$lang->ai->prompts->createdDate = 'Created Date';
|
||||
$lang->ai->prompts->targetForm = 'Target Form';
|
||||
$lang->ai->prompts->funcDesc = 'Function Description';
|
||||
$lang->ai->prompts->deleted = 'Deleted';
|
||||
$lang->ai->prompts->stage = 'Stage';
|
||||
$lang->ai->prompts->basicInfo = 'Basic Info';
|
||||
$lang->ai->prompts->editInfo = 'Edit Info';
|
||||
$lang->ai->prompts->createdBy = 'Created By';
|
||||
$lang->ai->prompts->publishedBy = 'Published By';
|
||||
$lang->ai->prompts->draftedBy = 'Drafted By';
|
||||
$lang->ai->prompts->lastEditor = 'Last Editor';
|
||||
$lang->ai->prompts->modelNeutral = 'Model Neutral';
|
||||
|
||||
$lang->ai->prompts->summary = 'There are %s prompts on this page.';
|
||||
|
||||
$lang->ai->prompts->action = new stdclass();
|
||||
$lang->ai->prompts->action->goDesignConfirm = 'The current prompt is not complete, continue designing?';
|
||||
$lang->ai->prompts->action->goDesign = 'Go designing';
|
||||
$lang->ai->prompts->action->draftConfirm = 'Once unpublished, the prompt cannot be used any further. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->design = 'Design';
|
||||
$lang->ai->prompts->action->test = 'Test';
|
||||
$lang->ai->prompts->action->edit = 'Edit';
|
||||
$lang->ai->prompts->action->publish = 'Publish';
|
||||
$lang->ai->prompts->action->unpublish = 'Unpublish';
|
||||
$lang->ai->prompts->action->delete = 'Delete';
|
||||
$lang->ai->prompts->action->disable = 'Disable';
|
||||
$lang->ai->prompts->action->deleteConfirm = 'Deleted prompts will be no longer available. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->publishSuccess = 'Publish Success';
|
||||
|
||||
/* Steps of prompt creation. */
|
||||
$lang->ai->prompts->assignRole = 'Assign Role';
|
||||
$lang->ai->prompts->selectDataSource = 'Select Data Fields';
|
||||
$lang->ai->prompts->setPurpose = 'Set Purpose';
|
||||
$lang->ai->prompts->setTargetForm = 'Set Target Form';
|
||||
$lang->ai->prompts->finalize = 'Finalize';
|
||||
|
||||
/* Role assigning. */
|
||||
$lang->ai->prompts->model = 'Model';
|
||||
$lang->ai->prompts->role = 'Role';
|
||||
$lang->ai->prompts->characterization = 'Characterization';
|
||||
$lang->ai->prompts->rolePlaceholder = '"Act as a <role>"';
|
||||
$lang->ai->prompts->charPlaceholder = 'Detailed characterization of this role';
|
||||
$lang->ai->prompts->roleTemplate = 'Role Template';
|
||||
$lang->ai->prompts->roleTemplateTip = 'After a template is referenced, modifying the role or role description does not affect the template.';
|
||||
$lang->ai->prompts->addRoleTemplate = 'Add Role Template';
|
||||
$lang->ai->prompts->editRoleTemplate = 'Edit Role Template';
|
||||
$lang->ai->prompts->editRoleTemplateTip = 'Editing this template will not affect its previous usages in prompts.';
|
||||
$lang->ai->prompts->roleAddedSuccess = 'Role added successfully.';
|
||||
$lang->ai->prompts->roleDelConfirm = 'Deleting the role does not affect the role that is already in the prompt. Do you want to delete it?';
|
||||
$lang->ai->prompts->roleDelSuccess = 'Role deleted successfully.';
|
||||
$lang->ai->prompts->roleTemplateSave = 'Save Role Template';
|
||||
$lang->ai->prompts->roleTemplateSaveList = array();
|
||||
$lang->ai->prompts->roleTemplateSaveList['save'] = 'Save';
|
||||
$lang->ai->prompts->roleTemplateSaveList['discard'] = 'Discard';
|
||||
|
||||
/* Data source selecting. */
|
||||
$lang->ai->prompts->selectData = 'Select fields';
|
||||
$lang->ai->prompts->selectDataTip = 'Select an object and its fields will be shown below.';
|
||||
$lang->ai->prompts->selectedFormat = 'Selecting data from {0}, {1} fields selected.';
|
||||
$lang->ai->prompts->nonSelected = 'No field selected.';
|
||||
$lang->ai->prompts->sortTip = 'Sorting fields by priority is suggested.';
|
||||
$lang->ai->prompts->object = 'Object';
|
||||
$lang->ai->prompts->field = 'Field';
|
||||
|
||||
/* Purpose setting. */
|
||||
$lang->ai->prompts->purpose = 'Purpose';
|
||||
$lang->ai->prompts->purposeTip = 'What do I want it to accomplish, in order to achieve what goals?';
|
||||
$lang->ai->prompts->elaboration = 'Elaboration';
|
||||
$lang->ai->prompts->elaborationTip = 'I hope its answer draws attention to some additional requests.';
|
||||
$lang->ai->prompts->inputPreview = 'Prompt Preview';
|
||||
$lang->ai->prompts->dataPreview = 'Data Prompt Preview';
|
||||
$lang->ai->prompts->rolePreview = 'Role Prompt Preview';
|
||||
$lang->ai->prompts->promptPreview = 'Purpose Prompt Preview';
|
||||
|
||||
/* Target form selecting. */
|
||||
$lang->ai->prompts->selectTargetForm = 'Select Target Form';
|
||||
$lang->ai->prompts->selectTargetFormTip = 'Results returned from LLMs can be directly inputed into forms within ZenTao.';
|
||||
$lang->ai->prompts->goingTesting = 'Redirecting to testing page';
|
||||
$lang->ai->prompts->goingTestingFail = 'Unable to go testing, no suitable object found.';
|
||||
|
||||
/* Finalize page. */
|
||||
$lang->ai->moduleDisableTip = 'Module is automatically selected based on selected objects.';
|
||||
|
||||
/* Data source definition. */
|
||||
$lang->ai->dataSource = array();
|
||||
|
||||
$lang->ai->dataSource['my']['common'] = 'My';
|
||||
$lang->ai->dataSource['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->dataSource['my']['efforts']['common'] = 'Efforts';
|
||||
$lang->ai->dataSource['my']['efforts']['date'] = 'Date';
|
||||
$lang->ai->dataSource['my']['efforts']['work'] = 'Work';
|
||||
$lang->ai->dataSource['my']['efforts']['account'] = 'Account';
|
||||
$lang->ai->dataSource['my']['efforts']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['my']['efforts']['left'] = 'Left';
|
||||
$lang->ai->dataSource['my']['efforts']['objectID'] = 'Object';
|
||||
$lang->ai->dataSource['my']['efforts']['product'] = 'Product';
|
||||
$lang->ai->dataSource['my']['efforts']['project'] = 'Project';
|
||||
$lang->ai->dataSource['my']['efforts']['execution'] = 'Execution';
|
||||
|
||||
$lang->ai->dataSource['product']['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['product']['product']['name'] = 'Product Name';
|
||||
$lang->ai->dataSource['product']['product']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['product']['modules']['common'] = 'Module';
|
||||
$lang->ai->dataSource['product']['modules']['name'] = 'Module Name';
|
||||
$lang->ai->dataSource['product']['modules']['modules'] = 'Sub Modules';
|
||||
|
||||
$lang->ai->dataSource['productplan']['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['productplan']['productplan']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['productplan']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['productplan']['productplan']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['productplan']['productplan']['end'] = 'End';
|
||||
|
||||
$lang->ai->dataSource['productplan']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['productplan']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['stories']['module'] = 'Module';
|
||||
$lang->ai->dataSource['productplan']['stories']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['stories']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['productplan']['stories']['status'] = 'Status';
|
||||
$lang->ai->dataSource['productplan']['stories']['stage'] = 'Stage';
|
||||
|
||||
$lang->ai->dataSource['productplan']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['productplan']['bugs']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['bugs']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['bugs']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['release']['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['release']['release']['product'] = 'Product';
|
||||
$lang->ai->dataSource['release']['release']['name'] = 'Name';
|
||||
$lang->ai->dataSource['release']['release']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['release']['release']['date'] = 'Release Date';
|
||||
|
||||
$lang->ai->dataSource['release']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['release']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['release']['stories']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['release']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['release']['bugs']['title'] = 'Title';
|
||||
|
||||
$lang->ai->dataSource['project']['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['project']['project']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['project']['type'] = 'Type';
|
||||
$lang->ai->dataSource['project']['project']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['project']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['project']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['project']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['project']['programplans']['common'] = 'Program Plan';
|
||||
$lang->ai->dataSource['project']['programplans']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['programplans']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['programplans']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['programplans']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['programplans']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['programplans']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['programplans']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['programplans']['planDuration'] = 'Plan Duration';
|
||||
$lang->ai->dataSource['project']['programplans']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['project']['programplans']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['programplans']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['programplans']['left'] = 'Left';
|
||||
|
||||
$lang->ai->dataSource['project']['executions']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['project']['executions']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['executions']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['executions']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['executions']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['executions']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['executions']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['executions']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['executions']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['executions']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['executions']['left'] = 'Left';
|
||||
$lang->ai->dataSource['project']['executions']['progress'] = 'Progress';
|
||||
|
||||
$lang->ai->dataSource['story']['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['story']['story']['title'] = 'Title';
|
||||
$lang->ai->dataSource['story']['story']['spec'] = 'Description';
|
||||
$lang->ai->dataSource['story']['story']['verify'] = 'Acceptance criteria';
|
||||
$lang->ai->dataSource['story']['story']['product'] = 'Product';
|
||||
$lang->ai->dataSource['story']['story']['module'] = 'Module';
|
||||
$lang->ai->dataSource['story']['story']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['story']['story']['category'] = 'Category';
|
||||
$lang->ai->dataSource['story']['story']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['execution']['execution']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['execution']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['execution']['execution']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['tasks']['common'] = 'Task List';
|
||||
$lang->ai->dataSource['execution']['tasks']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['tasks']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['execution']['tasks']['status'] = 'Status';
|
||||
$lang->ai->dataSource['execution']['tasks']['estimate'] = 'Estimated hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['consumed'] = 'Consumed hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['left'] = 'Remaining hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['execution']['tasks']['estStarted'] = 'Estimated start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['realStarted'] = 'Actual start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['finishedDate'] = 'Finished date';
|
||||
$lang->ai->dataSource['execution']['tasks']['closedReason'] = 'Closing reason';
|
||||
|
||||
$lang->ai->dataSource['task']['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['task']['task']['name'] = 'Name';
|
||||
$lang->ai->dataSource['task']['task']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['task']['task']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['task']['task']['status'] = 'Status';
|
||||
$lang->ai->dataSource['task']['task']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['task']['task']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['task']['task']['left'] = 'Left';
|
||||
$lang->ai->dataSource['task']['task']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['task']['task']['estStarted'] = 'Start Date';
|
||||
$lang->ai->dataSource['task']['task']['realStarted'] = 'Actual Start';
|
||||
|
||||
$lang->ai->dataSource['case']['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['case']['case']['title'] = 'Title';
|
||||
$lang->ai->dataSource['case']['case']['precondition'] = 'Prerequisite';
|
||||
$lang->ai->dataSource['case']['case']['scene'] = 'Scene';
|
||||
$lang->ai->dataSource['case']['case']['product'] = 'Product';
|
||||
$lang->ai->dataSource['case']['case']['module'] = 'Module';
|
||||
$lang->ai->dataSource['case']['case']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['case']['case']['type'] = 'Type';
|
||||
$lang->ai->dataSource['case']['case']['lastRunResult'] = 'Result';
|
||||
$lang->ai->dataSource['case']['case']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['case']['steps']['common'] = 'Steps';
|
||||
$lang->ai->dataSource['case']['steps']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['case']['steps']['expect'] = 'Expectation';
|
||||
|
||||
$lang->ai->dataSource['bug']['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['bug']['bug']['title'] = 'Title';
|
||||
$lang->ai->dataSource['bug']['bug']['steps'] = 'Repro Steps';
|
||||
$lang->ai->dataSource['bug']['bug']['severity'] = 'Severity';
|
||||
$lang->ai->dataSource['bug']['bug']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['bug']['bug']['status'] = 'Status';
|
||||
$lang->ai->dataSource['bug']['bug']['confirmed'] = 'Confirmed';
|
||||
$lang->ai->dataSource['bug']['bug']['type'] = 'Type';
|
||||
|
||||
$lang->ai->dataSource['doc']['doc']['common'] = 'Document';
|
||||
$lang->ai->dataSource['doc']['doc']['title'] = 'Title';
|
||||
$lang->ai->dataSource['doc']['doc']['content'] = 'Text';
|
||||
$lang->ai->dataSource['doc']['doc']['addedBy'] = 'Created By';
|
||||
$lang->ai->dataSource['doc']['doc']['addedDate'] = 'Created Date';
|
||||
$lang->ai->dataSource['doc']['doc']['editedBy'] = 'Edited By';
|
||||
$lang->ai->dataSource['doc']['doc']['editedDate'] = 'Edited Date';
|
||||
|
||||
/* Target form definition. See `$config->ai->targetForm`. */
|
||||
$lang->ai->targetForm = array();
|
||||
$lang->ai->targetForm['product']['common'] = 'Product';
|
||||
$lang->ai->targetForm['story']['common'] = 'Story';
|
||||
$lang->ai->targetForm['productplan']['common'] = 'Plan';
|
||||
$lang->ai->targetForm['projectrelease']['common'] = 'Release';
|
||||
$lang->ai->targetForm['project']['common'] = 'Project';
|
||||
$lang->ai->targetForm['execution']['common'] = 'Execution';
|
||||
$lang->ai->targetForm['task']['common'] = 'Task';
|
||||
$lang->ai->targetForm['testcase']['common'] = 'Test Case';
|
||||
$lang->ai->targetForm['bug']['common'] = 'Bug';
|
||||
$lang->ai->targetForm['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->targetForm['product']['tree/managechild'] = 'Manage Modules';
|
||||
$lang->ai->targetForm['product']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['story']['create'] = 'Create Story';
|
||||
$lang->ai->targetForm['story']['batchcreate'] = 'Batch Create Story';
|
||||
$lang->ai->targetForm['story']['change'] = 'Change Story';
|
||||
$lang->ai->targetForm['story']['totask'] = 'Story to Task';
|
||||
$lang->ai->targetForm['story']['testcasecreate'] = 'Create Test Case';
|
||||
$lang->ai->targetForm['story']['subdivide'] = 'Subdivide Story';
|
||||
|
||||
$lang->ai->targetForm['productplan']['edit'] = 'Edit Plan';
|
||||
$lang->ai->targetForm['productplan']['create'] = 'Create Sub-Plan';
|
||||
|
||||
$lang->ai->targetForm['projectrelease']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['project']['risk/create'] = 'Create Risk';
|
||||
$lang->ai->targetForm['project']['issue/create'] = 'Create Issue';
|
||||
$lang->ai->targetForm['project']['doc/create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['project']['programplan/create'] = 'Set Program Plan';
|
||||
|
||||
$lang->ai->targetForm['execution']['batchcreatetask'] = 'Batch Create Task';
|
||||
$lang->ai->targetForm['execution']['createtestreport'] = 'Create Test Report';
|
||||
$lang->ai->targetForm['execution']['createqa'] = 'Create QA';
|
||||
$lang->ai->targetForm['execution']['createrisk'] = 'Create Risk';
|
||||
$lang->ai->targetForm['execution']['createissue'] = 'Create Issue';
|
||||
|
||||
$lang->ai->targetForm['task']['edit'] = 'Edit Task';
|
||||
$lang->ai->targetForm['task']['batchcreate'] = 'Batch Create Task';
|
||||
|
||||
$lang->ai->targetForm['testcase']['edit'] = 'Edit Test Case';
|
||||
$lang->ai->targetForm['testcase']['createscript'] = 'Create Script';
|
||||
|
||||
$lang->ai->targetForm['bug']['edit'] = 'Edit Bug';
|
||||
$lang->ai->targetForm['bug']['story/create'] = 'Bug to Story';
|
||||
$lang->ai->targetForm['bug']['testcase/create'] = 'Bug to Test Case';
|
||||
|
||||
$lang->ai->targetForm['doc']['create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['doc']['edit'] = 'Edit Doc';
|
||||
|
||||
$lang->ai->prompts->statuses = array();
|
||||
$lang->ai->prompts->statuses[''] = 'All';
|
||||
$lang->ai->prompts->statuses['draft'] = 'Draft';
|
||||
$lang->ai->prompts->statuses['active'] = 'Active';
|
||||
|
||||
$lang->ai->prompts->modules = array();
|
||||
$lang->ai->prompts->modules[''] = 'All';
|
||||
// $lang->ai->prompts->modules['my'] = 'My';
|
||||
$lang->ai->prompts->modules['product'] = 'Product';
|
||||
$lang->ai->prompts->modules['project'] = 'Project';
|
||||
$lang->ai->prompts->modules['story'] = 'Story';
|
||||
$lang->ai->prompts->modules['productplan'] = 'Product Plan';
|
||||
$lang->ai->prompts->modules['release'] = 'Release';
|
||||
$lang->ai->prompts->modules['execution'] = 'Execution';
|
||||
$lang->ai->prompts->modules['task'] = 'Task';
|
||||
$lang->ai->prompts->modules['case'] = 'Test Case';
|
||||
$lang->ai->prompts->modules['bug'] = 'Bug';
|
||||
$lang->ai->prompts->modules['doc'] = 'Document';
|
||||
|
||||
$lang->ai->conversations = new stdclass();
|
||||
$lang->ai->conversations->common = 'Conversations';
|
||||
|
||||
$lang->ai->miniPrograms = new stdClass();
|
||||
$lang->ai->miniPrograms->common = 'Mini Programs';
|
||||
$lang->ai->miniPrograms->emptyList = 'There is currently no mini program available.';
|
||||
$lang->ai->miniPrograms->create = 'Create A Program';
|
||||
$lang->ai->miniPrograms->configuration = 'Basic Information Configuration';
|
||||
$lang->ai->miniPrograms->downloadTip = 'After release, it will be displayed on the AI mini program Square and will be automatically synchronized to the client.';
|
||||
$lang->ai->miniPrograms->download = 'Download Zentao Client';
|
||||
$lang->ai->miniPrograms->category = 'Category';
|
||||
$lang->ai->miniPrograms->icon = 'Icon';
|
||||
$lang->ai->miniPrograms->desc = 'Introduction';
|
||||
$lang->ai->miniPrograms->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->ai->miniPrograms->allCategories = array('' => 'All categories');
|
||||
$lang->ai->miniPrograms->collect = 'Collect';
|
||||
$lang->ai->miniPrograms->more = 'More';
|
||||
$lang->ai->miniPrograms->iconModification = 'Icon modification';
|
||||
$lang->ai->miniPrograms->customBackground = 'Custom background Color';
|
||||
$lang->ai->miniPrograms->customIcon = 'Custom icon';
|
||||
$lang->ai->miniPrograms->backToListPage = 'Return to list page';
|
||||
$lang->ai->miniPrograms->lastStep = 'Previous step';
|
||||
$lang->ai->miniPrograms->backToListPageTip = 'The parameter configuration for selecting the object has been changed. Do you want to save and return?';
|
||||
$lang->ai->miniPrograms->saveAndBack = 'Save and Go Back';
|
||||
$lang->ai->miniPrograms->publishConfirm = array('Are you sure you want to publish?', 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.');
|
||||
$lang->ai->miniPrograms->emptyPrompterTip = 'The prompter of the mini program is empty. Please edit it before publishing.';
|
||||
$lang->ai->miniPrograms->maintenanceGroup = 'Maintenance mini program group';
|
||||
|
||||
$lang->ai->miniPrograms->latestPublishedDate = 'Latest Published Date';
|
||||
$lang->ai->miniPrograms->deleteTip = 'Are you sure you want to delete this mini program?';
|
||||
$lang->ai->miniPrograms->disableTip = 'Disabling the mini program will prevent users from accessing it. Are you sure you want to disable it?';
|
||||
$lang->ai->miniPrograms->publishTip = 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.';
|
||||
$lang->ai->miniPrograms->unpublishedTip = 'The mini program you are using is not published.';
|
||||
|
||||
$lang->ai->miniPrograms->placeholder = new stdClass();
|
||||
$lang->ai->miniPrograms->placeholder->name = 'Please enter a small program name';
|
||||
$lang->ai->miniPrograms->placeholder->desc = 'Please enter a brief introduction to the miniprograms';
|
||||
$lang->ai->miniPrograms->placeholder->default = 'Please fill in the prompt, the default is "please enter"';
|
||||
$lang->ai->miniPrograms->placeholder->input = 'Please enter';
|
||||
$lang->ai->miniPrograms->placeholder->prompt = 'Please enter prompt design';
|
||||
$lang->ai->miniPrograms->placeholder->asking = 'Continue asking';
|
||||
|
||||
$lang->ai->miniPrograms->deleteFieldTip = 'Are you sure to delete this field? ';
|
||||
|
||||
$lang->ai->miniPrograms->field = new stdClass();
|
||||
$lang->ai->miniPrograms->field->name = 'Field name';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameTip = 'This name is already used, please try another name';
|
||||
$lang->ai->miniPrograms->field->type = 'control type';
|
||||
$lang->ai->miniPrograms->field->typeList = array('text' => 'single-line text', 'textarea' => 'multi-line text', 'radio' => 'single-selection', 'checkbox' => 'multi-selection');
|
||||
$lang->ai->miniPrograms->field->placeholder = 'Fill hints';
|
||||
$lang->ai->miniPrograms->field->required = 'Required';
|
||||
$lang->ai->miniPrograms->field->requiredOptions = array('No', 'Yes');
|
||||
$lang->ai->miniPrograms->field->add = 'New field';
|
||||
$lang->ai->miniPrograms->field->addTip = 'Please click here to add field information';
|
||||
$lang->ai->miniPrograms->field->edit = 'Edit field';
|
||||
$lang->ai->miniPrograms->field->configuration = 'Field Configuration area';
|
||||
$lang->ai->miniPrograms->field->debug = 'debug area';
|
||||
$lang->ai->miniPrograms->field->preview = 'Preview area';
|
||||
$lang->ai->miniPrograms->field->option = 'Options';
|
||||
$lang->ai->miniPrograms->field->contentDebugging = 'Content debugging';
|
||||
$lang->ai->miniPrograms->field->contentDebuggingTip = 'Please enter the field here to debug.';
|
||||
$lang->ai->miniPrograms->field->prompterDesign = 'Prompterdesign';
|
||||
$lang->ai->miniPrograms->field->prompterDesignTip = 'The <> symbol is used to reference the configured field. Space is used before and after <>.';
|
||||
$lang->ai->miniPrograms->field->prompterPreview = 'Prompterpreview';
|
||||
$lang->ai->miniPrograms->field->generateResult = 'Generate result';
|
||||
$lang->ai->miniPrograms->field->resultPreview = 'Result Preview';
|
||||
|
||||
$lang->ai->miniPrograms->field->default = array(
|
||||
'Role',
|
||||
'Scene',
|
||||
'Objective',
|
||||
'As a <Role>, I hope to <Objective> in <Scene>.'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->field->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameWarning = 'Duplicate 「%s」';
|
||||
$lang->ai->miniPrograms->field->emptyOptionWarning = 'Please configure at least one option';
|
||||
|
||||
$lang->ai->miniPrograms->statuses = array(
|
||||
'' => 'all',
|
||||
'draft' => 'unpublished',
|
||||
'active' => 'published',
|
||||
'createdByMe' => 'Created by me'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->publishedOptions = array('unpublished', 'published');
|
||||
$lang->ai->miniPrograms->optionName = 'Option name';
|
||||
$lang->ai->miniPrograms->promptTemplate = 'Prompt template';
|
||||
$lang->ai->miniPrograms->fieldConfiguration = 'Field configuration';
|
||||
$lang->ai->miniPrograms->summary = 'There are %s small programs on this page.';
|
||||
$lang->ai->miniPrograms->generate = 'Generate';
|
||||
$lang->ai->miniPrograms->regenerate = 'Regenerate';
|
||||
$lang->ai->miniPrograms->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->ai->miniPrograms->clearContext = 'The context content has been cleared.';
|
||||
$lang->ai->miniPrograms->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->ai->miniPrograms->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->ai->miniPrograms->chatNoResponse = 'Something went wrong.';
|
||||
|
||||
$lang->ai->models = new stdclass();
|
||||
$lang->ai->models->title = 'Language Model Configuration';
|
||||
$lang->ai->models->common = 'Language Model';
|
||||
$lang->ai->models->name = 'Name';
|
||||
$lang->ai->models->type = 'Model';
|
||||
$lang->ai->models->vendor = 'Vendor';
|
||||
$lang->ai->models->base = 'API Base URL';
|
||||
$lang->ai->models->key = 'API Key';
|
||||
$lang->ai->models->secret = 'Secret Key';
|
||||
$lang->ai->models->resource = 'Resource';
|
||||
$lang->ai->models->deployment = 'Deployment';
|
||||
$lang->ai->models->proxyType = 'Proxy Type';
|
||||
$lang->ai->models->proxyAddr = 'Proxy Address';
|
||||
$lang->ai->models->description = 'Description';
|
||||
$lang->ai->models->createdDate = 'Creation Date';
|
||||
$lang->ai->models->createdBy = 'Created By';
|
||||
$lang->ai->models->editedDate = 'Modification Date';
|
||||
$lang->ai->models->editedBy = 'Edited By';
|
||||
$lang->ai->models->usesProxy = 'Use Proxy';
|
||||
$lang->ai->models->testConnection = 'Test Connection';
|
||||
$lang->ai->models->unconfigured = 'Unconfigured';
|
||||
$lang->ai->models->create = 'Create Model';
|
||||
$lang->ai->models->edit = 'Edit Parameters';
|
||||
$lang->ai->models->view = 'View Details';
|
||||
$lang->ai->models->enable = 'Enable Language Model';
|
||||
$lang->ai->models->disable = 'Disable Language Model';
|
||||
$lang->ai->models->details = 'Model Details';
|
||||
$lang->ai->models->concealTip = 'Visible when editing';
|
||||
$lang->ai->models->upgradeBiz = 'For more AI features, all in <a target="_blank" href="https://www.zentao.net/page/enterprise.html" class="text-blue">ZenTao Biz</a>.';
|
||||
$lang->ai->models->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->ai->models->noModels = 'There is currently no language model.';
|
||||
$lang->ai->models->confirmDelete = 'Are you sure you want to delete this language model?';
|
||||
$lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?';
|
||||
$lang->ai->models->default = 'Default model';
|
||||
$lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.';
|
||||
|
||||
$lang->ai->models->testConnectionResult = new stdclass();
|
||||
$lang->ai->models->testConnectionResult->success = 'Successfully connected';
|
||||
$lang->ai->models->testConnectionResult->fail = 'Failed to connect';
|
||||
$lang->ai->models->testConnectionResult->failFormat = 'Failed to connect: %s';
|
||||
|
||||
$lang->ai->models->statusList = array();
|
||||
$lang->ai->models->statusList['0'] = 'Disabled';
|
||||
$lang->ai->models->statusList['off'] = 'Disabled';
|
||||
$lang->ai->models->statusList['1'] = 'Enabled';
|
||||
$lang->ai->models->statusList['on'] = 'Enabled';
|
||||
|
||||
$lang->ai->models->proxyStatusList = array();
|
||||
$lang->ai->models->proxyStatusList['0'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['off'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['1'] = 'Yes';
|
||||
$lang->ai->models->proxyStatusList['on'] = 'Yes';
|
||||
|
||||
$lang->ai->models->typeList = array();
|
||||
$lang->ai->models->typeList['openai-gpt35'] = 'OpenAI / GPT-3.5';
|
||||
$lang->ai->models->typeList['openai-gpt4'] = 'OpenAI / GPT-4';
|
||||
$lang->ai->models->typeList['baidu-ernie'] = 'Baidu / ERNIE';
|
||||
|
||||
$lang->ai->models->vendorList = new stdclass();
|
||||
$lang->ai->models->vendorList->{'openai-gpt35'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'openai-gpt4'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'baidu-ernie'} = array('baidu' => 'Baidu Qianfan LLM Platform');
|
||||
|
||||
$lang->ai->models->vendorTips = new stdclass();
|
||||
$lang->ai->models->vendorTips->azure = 'OpenAI GPT version is specified during model deployment creation on Azure.';
|
||||
$lang->ai->models->vendorTips->openaiCompatible = 'Custom API needs to support Function Calling, otherwise some functions may not work properly.';
|
||||
|
||||
$lang->ai->models->proxyTypes = array();
|
||||
$lang->ai->models->proxyTypes[''] = 'No Proxy';
|
||||
$lang->ai->models->proxyTypes['socks5'] = 'SOCKS5';
|
||||
|
||||
$lang->ai->models->promptFor = 'Prompt for %s';
|
||||
|
||||
$lang->ai->designStepNav = array();
|
||||
$lang->ai->designStepNav['assignrole'] = 'Specify Role';
|
||||
$lang->ai->designStepNav['selectdatasource'] = 'Select Object';
|
||||
$lang->ai->designStepNav['setpurpose'] = 'Confirm Action';
|
||||
$lang->ai->designStepNav['settargetform'] = 'Process Result';
|
||||
$lang->ai->designStepNav['finalize'] = 'Ready to Publish';
|
||||
|
||||
$lang->ai->dataTypeDesc = '%s is %s type, %s';
|
||||
|
||||
$lang->ai->dataType = new stdclass();
|
||||
$lang->ai->dataType->pri = new stdClass();
|
||||
$lang->ai->dataType->pri->type = 'numeric';
|
||||
$lang->ai->dataType->pri->desc = '1 is the highest priority, 4 is the lowest priority.';
|
||||
|
||||
$lang->ai->dataType->estimate = new stdClass();
|
||||
$lang->ai->dataType->estimate->type = 'numeric';
|
||||
$lang->ai->dataType->estimate->desc = 'Unit is in hours.';
|
||||
|
||||
$lang->ai->dataType->consumed = $lang->ai->dataType->estimate;
|
||||
$lang->ai->dataType->left = $lang->ai->dataType->estimate;
|
||||
|
||||
$lang->ai->dataType->progress = new stdClass();
|
||||
$lang->ai->dataType->progress->type = 'percentage';
|
||||
$lang->ai->dataType->progress->desc = '0 means not started, 100 means completed.';
|
||||
|
||||
$lang->ai->dataType->datetime = new stdClass();
|
||||
$lang->ai->dataType->datetime->type = 'datetime';
|
||||
$lang->ai->dataType->datetime->desc = 'Format is: 1970-01-01 00:00:01, or leave it blank.';
|
||||
|
||||
$lang->ai->dataType->estStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
|
||||
|
||||
$lang->ai->demoData = new stdclass();
|
||||
$lang->ai->demoData->notExist = 'The demo data does not exist for now.';
|
||||
$lang->ai->demoData->story = array(
|
||||
'story' => array(
|
||||
'title' => 'Develop an online learning platform',
|
||||
'spec' => 'We need to develop an online learning platform that provides course management, student management, teacher management, and other functions.',
|
||||
'verify' => '1. All functions can operate properly without any obvious errors or abnormalities.2. The interface is aesthetically pleasing and user-friendly.3. The platform can meet user needs and has a high level of user satisfaction.4. The code has good quality, with clear structure and easy maintenance.',
|
||||
'module' => 7,
|
||||
'pri' => 1,
|
||||
'estimate' => 1,
|
||||
'product' => 1,
|
||||
'category' => 'feature',
|
||||
),
|
||||
);
|
||||
$lang->ai->demoData->execution = array(
|
||||
'execution' => array(
|
||||
'name' => 'Online Learning Platform Software Development',
|
||||
'desc' => 'This plan aims to develop an online learning platform software that provides accessible learning resources, including text, video, and audio, as well as some learning tools such as exams, tests, and discussion forums.',
|
||||
'estimate' => 7,
|
||||
),
|
||||
'tasks' => array(
|
||||
0 =>
|
||||
array(
|
||||
'name' => 'Technology Selection',
|
||||
'pri' => 1,
|
||||
'status' => 'done',
|
||||
'estimate' => 1,
|
||||
'consumed' => 1,
|
||||
'left' => 0,
|
||||
'progress' => 100,
|
||||
'estStarted' => '2023-07-02 00:00:00',
|
||||
'realStarted' => '2023-07-02 00:00:00',
|
||||
'finishedDate' => '2023-07-02 00:00:00',
|
||||
'closedReason' => 'Completed',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'name' => 'UI Design',
|
||||
'pri' => 1,
|
||||
'status' => 'doing',
|
||||
'estimate' => 2,
|
||||
'consumed' => 1,
|
||||
'left' => 1,
|
||||
'progress' => 50,
|
||||
'estStarted' => '2023-07-03 00:00:00',
|
||||
'realStarted' => '2023-07-03 00:00:00',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'name' => 'Development',
|
||||
'pri' => 1,
|
||||
'status' => 'wait',
|
||||
'estimate' => 1,
|
||||
'consumed' => 0,
|
||||
'left' => 1,
|
||||
'progress' => 0,
|
||||
'estStarted' => '',
|
||||
'realStarted' => '',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Forms as JSON Schemas. */
|
||||
$lang->ai->formSchema = array();
|
||||
$lang->ai->formSchema['story']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->title = 'Story';
|
||||
$lang->ai->formSchema['story']['create']->type = 'object';
|
||||
$lang->ai->formSchema['story']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->spec = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->verify = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->title->description = 'Title of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->description = 'Description of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->description = 'Acceptance criteria of story';
|
||||
$lang->ai->formSchema['story']['create']->required = array('title', 'spec', 'verify');
|
||||
$lang->ai->formSchema['story']['change'] = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['story']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->title = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->type = 'array';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->description = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->items = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['productplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->title = 'Product Plan';
|
||||
$lang->ai->formSchema['productplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['productplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->description = 'Title of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->description = 'Begin date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->description = 'End date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->description = 'Description of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->required = array('title', 'begin', 'end');
|
||||
$lang->ai->formSchema['productplan']['edit'] = $lang->ai->formSchema['productplan']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->title = 'Task';
|
||||
$lang->ai->formSchema['task']['create']->type = 'object';
|
||||
$lang->ai->formSchema['task']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->name = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->description = 'Type of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->enum = array('design', 'devel', 'request', 'test', 'study', 'discuss', 'ui', 'affair', 'misc');
|
||||
$lang->ai->formSchema['task']['create']->properties->name->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->name->description = 'Name of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->description = 'Description of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->description = 'Priority of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->type = 'number';
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->description = 'Estimated hours of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->description = 'Begin date of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->description = 'End date of task';
|
||||
$lang->ai->formSchema['task']['create']->required = array('type', 'name');
|
||||
$lang->ai->formSchema['task']['edit'] = $lang->ai->formSchema['task']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->title = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->type = 'array';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->description = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items = $lang->ai->formSchema['task']['create'];
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->estStarted = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin;
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->deadline = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end;
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin);
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end);
|
||||
|
||||
$lang->ai->formSchema['bug']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->title = 'Bug';
|
||||
$lang->ai->formSchema['bug']['create']->type = 'object';
|
||||
$lang->ai->formSchema['bug']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->description = 'Title of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->description = 'Repro steps of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->description = 'Severity of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->description = 'Priority of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->description = 'Affected builds of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->enum = array('trunk');
|
||||
$lang->ai->formSchema['bug']['create']->required = array('title', 'steps', 'severity', 'pri', 'openedBuild');
|
||||
$lang->ai->formSchema['bug']['edit'] = $lang->ai->formSchema['bug']['create'];
|
||||
|
||||
$lang->ai->formSchema['testcase']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->title = 'Test Case';
|
||||
$lang->ai->formSchema['testcase']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->description = 'Type of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->enum = array('feature', 'performance', 'config', 'install', 'security', 'interface', 'unit', 'other');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->description = 'Stage of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->enum = array('unittest', 'feature', 'intergrate', 'system', 'smoke', 'bvt');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->description = 'Title of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->description = 'Precondition of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->type = 'array';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->description = 'Steps of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->description = 'Step description';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->description = 'Expectation of step';
|
||||
$lang->ai->formSchema['testcase']['create']->required = array('type', 'title', 'steps');
|
||||
$lang->ai->formSchema['testcase']['edit'] = $lang->ai->formSchema['testcase']['create'];
|
||||
|
||||
$lang->ai->formSchema['testreport']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->title = 'Test Report';
|
||||
$lang->ai->formSchema['testreport']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testreport']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->description = 'Begin date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->description = 'End date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->description = 'Title of test report';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->description = 'Report content';
|
||||
$lang->ai->formSchema['testreport']['create']->required = array('begin', 'end', 'title', 'report');
|
||||
$lang->ai->formSchema['execution']['testreport'] = $lang->ai->formSchema['testreport']['create'];
|
||||
|
||||
$lang->ai->formSchema['doc']['edit'] = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->title = 'Document';
|
||||
$lang->ai->formSchema['doc']['edit']->type = 'object';
|
||||
$lang->ai->formSchema['doc']['edit']->properties = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->description = 'Title of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->description = 'Content of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->required = array('title', 'content');
|
||||
|
||||
$lang->ai->formSchema['tree']['browse'] = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->type = 'object';
|
||||
$lang->ai->formSchema['tree']['browse']->properties = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->type = 'array';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items->type = 'string';
|
||||
$lang->ai->formSchema['tree']['browse']->required = array('modules');
|
||||
|
||||
$lang->ai->formSchema['programplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->title = 'Program Plan';
|
||||
$lang->ai->formSchema['programplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->type = 'array';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->title = 'Plans';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->description = 'Name of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->description = 'Attribute of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->enum = array('request', 'design', 'dev', 'qa', 'release', 'review', 'other');
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->type = 'boolean';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->description = 'Is milestone?';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->description = 'Begin date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->description = 'End date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->required = array('stages');
|
||||
|
||||
$lang->ai->promptMenu = new stdclass();
|
||||
$lang->ai->promptMenu->dropdownTitle = 'AI';
|
||||
|
||||
$lang->ai->dataInject = new stdclass();
|
||||
$lang->ai->dataInject->success = 'Prompt execution results are filled in.';
|
||||
$lang->ai->dataInject->fail = 'Failed to fill in prompt execution results.';
|
||||
|
||||
$lang->ai->execute = new stdclass();
|
||||
$lang->ai->execute->loading = 'Prompt executing...';
|
||||
$lang->ai->execute->auditing = 'Getting ready for auditing...';
|
||||
$lang->ai->execute->success = 'Prompt executed.';
|
||||
$lang->ai->execute->fail = 'Prompt execution failed.';
|
||||
$lang->ai->execute->failFormat = 'Prompt execution failed: %s.';
|
||||
$lang->ai->execute->failReasons = array();
|
||||
$lang->ai->execute->failReasons['noPrompt'] = 'unable to get prompt';
|
||||
$lang->ai->execute->failReasons['noObjectData'] = 'unable to get object data';
|
||||
$lang->ai->execute->failReasons['noResponse'] = 'no response from external service';
|
||||
$lang->ai->execute->failReasons['noTargetForm'] = 'unable to get target form or its required fields';
|
||||
$lang->ai->execute->executeErrors = array();
|
||||
$lang->ai->execute->executeErrors['-1'] = 'unable to get prompt';
|
||||
$lang->ai->execute->executeErrors['-2'] = 'unable to get object data';
|
||||
$lang->ai->execute->executeErrors['-3'] = 'failed to serialize object data';
|
||||
$lang->ai->execute->executeErrors['-4'] = 'unable to find available model';
|
||||
$lang->ai->execute->executeErrors['-5'] = 'unable to get target form schema';
|
||||
$lang->ai->execute->executeErrors['-6'] = 'request failed or API returned error';
|
||||
|
||||
$lang->ai->audit = new stdclass();
|
||||
$lang->ai->audit->designPrompt = 'Prompt Design';
|
||||
$lang->ai->audit->afterSave = 'After saving,';
|
||||
$lang->ai->audit->regenerate = 'Regenerate';
|
||||
$lang->ai->audit->exit = 'Exit Audit';
|
||||
|
||||
$lang->ai->audit->backLocationList = array();
|
||||
$lang->ai->audit->backLocationList[0] = 'back to audit page.';
|
||||
$lang->ai->audit->backLocationList[1] = 'back to audit page and regenerate.';
|
||||
|
||||
$lang->ai->engineeredPrompts = new stdclass();
|
||||
$lang->ai->engineeredPrompts->askForFunctionCalling = array((object)array('role' => 'user', 'content' => 'Please convert my next message into a function call.'), (object)array('role' => 'assistant', 'content' => 'Sure, I\'ll convert your next message into a function call.'));
|
||||
|
||||
$lang->ai->aiResponseException = array();
|
||||
$lang->ai->aiResponseException['notFunctionCalling'] = 'The response is not a function calling';
|
||||
@@ -0,0 +1,965 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->ai->common = 'AI Configuration';
|
||||
|
||||
/* Definitions of table columns, used to sprintf error messages to dao::$errors. */
|
||||
$lang->prompt = new stdclass();
|
||||
$lang->prompt->name = 'Name';
|
||||
$lang->prompt->desc = 'Description';
|
||||
$lang->prompt->model = 'Model';
|
||||
$lang->prompt->module = 'Module';
|
||||
$lang->prompt->source = 'Data Source';
|
||||
$lang->prompt->targetForm = 'Target Form';
|
||||
$lang->prompt->purpose = 'Purpose';
|
||||
$lang->prompt->elaboration = 'Elaboration';
|
||||
$lang->prompt->role = 'Role';
|
||||
$lang->prompt->characterization = 'Characterization';
|
||||
$lang->prompt->status = 'Status';
|
||||
$lang->prompt->createdBy = 'Created By';
|
||||
$lang->prompt->createdDate = 'Created Date';
|
||||
$lang->prompt->editedBy = 'Edited By';
|
||||
$lang->prompt->editedDate = 'Edited Date';
|
||||
$lang->prompt->deleted = 'Deleted';
|
||||
|
||||
/* Lang for privs, keys are paired with privlang items. */
|
||||
$lang->ai->modelBrowse = 'Browse Language Models';
|
||||
$lang->ai->modelView = 'View Language Model';
|
||||
$lang->ai->modelCreate = 'Create Language Model';
|
||||
$lang->ai->modelEdit = 'Edit Language Model';
|
||||
$lang->ai->modelEnable = 'Enable Language Model';
|
||||
$lang->ai->modelDisable = 'Disable Language Model';
|
||||
$lang->ai->modelDelete = 'Delete Language Model';
|
||||
$lang->ai->modelTestConnection = 'Test Model Connection';
|
||||
$lang->ai->promptCreate = 'Create Prompt';
|
||||
$lang->ai->promptEdit = 'Edit Prompt';
|
||||
$lang->ai->promptDelete = 'Delete Prompt';
|
||||
$lang->ai->promptAssignRole = 'Assign Prompt Role';
|
||||
$lang->ai->promptSelectDataSource = 'Select Prompt Data';
|
||||
$lang->ai->promptSetPurpose = 'Set Prompt Purpose';
|
||||
$lang->ai->promptSetTargetForm = 'Set Prompt Target Form';
|
||||
$lang->ai->promptFinalize = 'Finalize Prompt';
|
||||
$lang->ai->promptAudit = 'Audit Prompt';
|
||||
$lang->ai->promptPublish = 'Publish Prompt';
|
||||
$lang->ai->promptUnpublish = 'Unpublish Prompt';
|
||||
$lang->ai->promptBrowse = 'Browse Prompts';
|
||||
$lang->ai->promptView = 'View Prompt';
|
||||
$lang->ai->promptExecute = 'Execute Prompt';
|
||||
$lang->ai->promptExecutionReset = 'Reset Execute Prompt';
|
||||
$lang->ai->roleTemplates = 'Manage Role Templates';
|
||||
$lang->ai->chat = 'Chat';
|
||||
$lang->ai->createMiniProgram = 'Create AI Mini Program';
|
||||
$lang->ai->editMiniProgram = 'Edit AI Mini Program';
|
||||
$lang->ai->testMiniProgram = 'Test AI Mini Program';
|
||||
$lang->ai->miniProgramList = 'Browse AI Mini Program List';
|
||||
$lang->ai->miniProgramView = 'View AI Mini Program Details';
|
||||
$lang->ai->publishMiniProgram = 'Publish AI Mini Program';
|
||||
$lang->ai->unpublishMiniProgram = 'Disable AI Mini Program';
|
||||
$lang->ai->deleteMiniProgram = 'Delete AI Mini Program';
|
||||
$lang->ai->exportMiniProgram = 'Export AI Mini Program';
|
||||
$lang->ai->importMiniProgram = 'Import AI Mini Program';
|
||||
$lang->ai->editMiniProgramCategory = 'Manage group';
|
||||
|
||||
$lang->ai->export = 'Export';
|
||||
$lang->ai->import = 'Import';
|
||||
$lang->ai->saveFail = 'Save failed';
|
||||
$lang->ai->installPackage = 'Installation package';
|
||||
$lang->ai->toPublish = 'Publish after installation';
|
||||
$lang->ai->toZentaoStoreAIPage = 'Click to jump to Zentao official app store AI mini programs page';
|
||||
|
||||
$lang->ai->chatPlaceholderMessage = 'Hi, I\'m Adao, your AI assistant at ZenTao!';
|
||||
$lang->ai->chatPlaceholderInput = 'type here...';
|
||||
$lang->ai->chatSystemMessage = 'You\'re Adao, the AI assistant and mascot of ZenTao. You can answer questions and chat with users. You\'re currently within the ZenTao project management software.';
|
||||
$lang->ai->chatSend = 'Send';
|
||||
$lang->ai->chatReset = 'Reset';
|
||||
$lang->ai->chatNoResponse = 'Something went wrong, <a id="retry" class="text-blue">click here to retry</a>.';
|
||||
$lang->ai->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
|
||||
$lang->ai->nextStep = 'Next';
|
||||
$lang->ai->goTesting = 'Go testing';
|
||||
$lang->ai->maintenanceGroup = 'Maintenance Group';
|
||||
|
||||
$lang->ai->maintenanceGroupDuplicated = 'The group name cannot be duplicated.';
|
||||
|
||||
$lang->ai->validate = new stdclass();
|
||||
$lang->ai->validate->noEmpty = '%s cannot be empty.';
|
||||
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
|
||||
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
|
||||
|
||||
$lang->ai->prompts = new stdclass();
|
||||
$lang->ai->prompts->common = 'Prompt';
|
||||
$lang->ai->prompts->emptyList = 'No prompts yet.';
|
||||
$lang->ai->prompts->create = 'Create Prompt';
|
||||
$lang->ai->prompts->edit = 'Edit Prompt';
|
||||
$lang->ai->prompts->id = 'ID';
|
||||
$lang->ai->prompts->name = 'Name';
|
||||
$lang->ai->prompts->description = 'Description';
|
||||
$lang->ai->prompts->createdBy = 'Creator';
|
||||
$lang->ai->prompts->createdDate = 'Created Date';
|
||||
$lang->ai->prompts->targetForm = 'Target Form';
|
||||
$lang->ai->prompts->funcDesc = 'Function Description';
|
||||
$lang->ai->prompts->deleted = 'Deleted';
|
||||
$lang->ai->prompts->stage = 'Stage';
|
||||
$lang->ai->prompts->basicInfo = 'Basic Info';
|
||||
$lang->ai->prompts->editInfo = 'Edit Info';
|
||||
$lang->ai->prompts->createdBy = 'Created By';
|
||||
$lang->ai->prompts->publishedBy = 'Published By';
|
||||
$lang->ai->prompts->draftedBy = 'Drafted By';
|
||||
$lang->ai->prompts->lastEditor = 'Last Editor';
|
||||
$lang->ai->prompts->modelNeutral = 'Model Neutral';
|
||||
|
||||
$lang->ai->prompts->summary = 'There are %s prompts on this page.';
|
||||
|
||||
$lang->ai->prompts->action = new stdclass();
|
||||
$lang->ai->prompts->action->goDesignConfirm = 'The current prompt is not complete, continue designing?';
|
||||
$lang->ai->prompts->action->goDesign = 'Go designing';
|
||||
$lang->ai->prompts->action->draftConfirm = 'Once unpublished, the prompt cannot be used any further. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->design = 'Design';
|
||||
$lang->ai->prompts->action->test = 'Test';
|
||||
$lang->ai->prompts->action->edit = 'Edit';
|
||||
$lang->ai->prompts->action->publish = 'Publish';
|
||||
$lang->ai->prompts->action->unpublish = 'Unpublish';
|
||||
$lang->ai->prompts->action->delete = 'Delete';
|
||||
$lang->ai->prompts->action->disable = 'Disable';
|
||||
$lang->ai->prompts->action->deleteConfirm = 'Deleted prompts will be no longer available. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->publishSuccess = 'Publish Success';
|
||||
|
||||
/* Steps of prompt creation. */
|
||||
$lang->ai->prompts->assignRole = 'Assign Role';
|
||||
$lang->ai->prompts->selectDataSource = 'Select Data Fields';
|
||||
$lang->ai->prompts->setPurpose = 'Set Purpose';
|
||||
$lang->ai->prompts->setTargetForm = 'Set Target Form';
|
||||
$lang->ai->prompts->finalize = 'Finalize';
|
||||
|
||||
/* Role assigning. */
|
||||
$lang->ai->prompts->model = 'Model';
|
||||
$lang->ai->prompts->role = 'Role';
|
||||
$lang->ai->prompts->characterization = 'Characterization';
|
||||
$lang->ai->prompts->rolePlaceholder = '"Act as a <role>"';
|
||||
$lang->ai->prompts->charPlaceholder = 'Detailed characterization of this role';
|
||||
$lang->ai->prompts->roleTemplate = 'Role Template';
|
||||
$lang->ai->prompts->roleTemplateTip = 'After a template is referenced, modifying the role or role description does not affect the template.';
|
||||
$lang->ai->prompts->addRoleTemplate = 'Add Role Template';
|
||||
$lang->ai->prompts->editRoleTemplate = 'Edit Role Template';
|
||||
$lang->ai->prompts->editRoleTemplateTip = 'Editing this template will not affect its previous usages in prompts.';
|
||||
$lang->ai->prompts->roleAddedSuccess = 'Role added successfully.';
|
||||
$lang->ai->prompts->roleDelConfirm = 'Deleting the role does not affect the role that is already in the prompt. Do you want to delete it?';
|
||||
$lang->ai->prompts->roleDelSuccess = 'Role deleted successfully.';
|
||||
$lang->ai->prompts->roleTemplateSave = 'Save Role Template';
|
||||
$lang->ai->prompts->roleTemplateSaveList = array();
|
||||
$lang->ai->prompts->roleTemplateSaveList['save'] = 'Save';
|
||||
$lang->ai->prompts->roleTemplateSaveList['discard'] = 'Discard';
|
||||
|
||||
/* Data source selecting. */
|
||||
$lang->ai->prompts->selectData = 'Select fields';
|
||||
$lang->ai->prompts->selectDataTip = 'Select an object and its fields will be shown below.';
|
||||
$lang->ai->prompts->selectedFormat = 'Selecting data from {0}, {1} fields selected.';
|
||||
$lang->ai->prompts->nonSelected = 'No field selected.';
|
||||
$lang->ai->prompts->sortTip = 'Sorting fields by priority is suggested.';
|
||||
$lang->ai->prompts->object = 'Object';
|
||||
$lang->ai->prompts->field = 'Field';
|
||||
|
||||
/* Purpose setting. */
|
||||
$lang->ai->prompts->purpose = 'Purpose';
|
||||
$lang->ai->prompts->purposeTip = 'What do I want it to accomplish, in order to achieve what goals?';
|
||||
$lang->ai->prompts->elaboration = 'Elaboration';
|
||||
$lang->ai->prompts->elaborationTip = 'I hope its answer draws attention to some additional requests.';
|
||||
$lang->ai->prompts->inputPreview = 'Prompt Preview';
|
||||
$lang->ai->prompts->dataPreview = 'Data Prompt Preview';
|
||||
$lang->ai->prompts->rolePreview = 'Role Prompt Preview';
|
||||
$lang->ai->prompts->promptPreview = 'Purpose Prompt Preview';
|
||||
|
||||
/* Target form selecting. */
|
||||
$lang->ai->prompts->selectTargetForm = 'Select Target Form';
|
||||
$lang->ai->prompts->selectTargetFormTip = 'Results returned from LLMs can be directly inputed into forms within ZenTao.';
|
||||
$lang->ai->prompts->goingTesting = 'Redirecting to testing page';
|
||||
$lang->ai->prompts->goingTestingFail = 'Unable to go testing, no suitable object found.';
|
||||
|
||||
/* Finalize page. */
|
||||
$lang->ai->moduleDisableTip = 'Module is automatically selected based on selected objects.';
|
||||
|
||||
/* Data source definition. */
|
||||
$lang->ai->dataSource = array();
|
||||
|
||||
$lang->ai->dataSource['my']['common'] = 'My';
|
||||
$lang->ai->dataSource['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->dataSource['my']['efforts']['common'] = 'Efforts';
|
||||
$lang->ai->dataSource['my']['efforts']['date'] = 'Date';
|
||||
$lang->ai->dataSource['my']['efforts']['work'] = 'Work';
|
||||
$lang->ai->dataSource['my']['efforts']['account'] = 'Account';
|
||||
$lang->ai->dataSource['my']['efforts']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['my']['efforts']['left'] = 'Left';
|
||||
$lang->ai->dataSource['my']['efforts']['objectID'] = 'Object';
|
||||
$lang->ai->dataSource['my']['efforts']['product'] = 'Product';
|
||||
$lang->ai->dataSource['my']['efforts']['project'] = 'Project';
|
||||
$lang->ai->dataSource['my']['efforts']['execution'] = 'Execution';
|
||||
|
||||
$lang->ai->dataSource['product']['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['product']['product']['name'] = 'Product Name';
|
||||
$lang->ai->dataSource['product']['product']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['product']['modules']['common'] = 'Module';
|
||||
$lang->ai->dataSource['product']['modules']['name'] = 'Module Name';
|
||||
$lang->ai->dataSource['product']['modules']['modules'] = 'Sub Modules';
|
||||
|
||||
$lang->ai->dataSource['productplan']['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['productplan']['productplan']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['productplan']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['productplan']['productplan']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['productplan']['productplan']['end'] = 'End';
|
||||
|
||||
$lang->ai->dataSource['productplan']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['productplan']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['stories']['module'] = 'Module';
|
||||
$lang->ai->dataSource['productplan']['stories']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['stories']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['productplan']['stories']['status'] = 'Status';
|
||||
$lang->ai->dataSource['productplan']['stories']['stage'] = 'Stage';
|
||||
|
||||
$lang->ai->dataSource['productplan']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['productplan']['bugs']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['bugs']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['bugs']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['release']['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['release']['release']['product'] = 'Product';
|
||||
$lang->ai->dataSource['release']['release']['name'] = 'Name';
|
||||
$lang->ai->dataSource['release']['release']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['release']['release']['date'] = 'Release Date';
|
||||
|
||||
$lang->ai->dataSource['release']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['release']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['release']['stories']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['release']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['release']['bugs']['title'] = 'Title';
|
||||
|
||||
$lang->ai->dataSource['project']['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['project']['project']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['project']['type'] = 'Type';
|
||||
$lang->ai->dataSource['project']['project']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['project']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['project']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['project']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['project']['programplans']['common'] = 'Program Plan';
|
||||
$lang->ai->dataSource['project']['programplans']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['programplans']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['programplans']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['programplans']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['programplans']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['programplans']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['programplans']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['programplans']['planDuration'] = 'Plan Duration';
|
||||
$lang->ai->dataSource['project']['programplans']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['project']['programplans']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['programplans']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['programplans']['left'] = 'Left';
|
||||
|
||||
$lang->ai->dataSource['project']['executions']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['project']['executions']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['executions']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['executions']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['executions']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['executions']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['executions']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['executions']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['executions']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['executions']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['executions']['left'] = 'Left';
|
||||
$lang->ai->dataSource['project']['executions']['progress'] = 'Progress';
|
||||
|
||||
$lang->ai->dataSource['story']['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['story']['story']['title'] = 'Title';
|
||||
$lang->ai->dataSource['story']['story']['spec'] = 'Description';
|
||||
$lang->ai->dataSource['story']['story']['verify'] = 'Acceptance criteria';
|
||||
$lang->ai->dataSource['story']['story']['product'] = 'Product';
|
||||
$lang->ai->dataSource['story']['story']['module'] = 'Module';
|
||||
$lang->ai->dataSource['story']['story']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['story']['story']['category'] = 'Category';
|
||||
$lang->ai->dataSource['story']['story']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['execution']['execution']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['execution']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['execution']['execution']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['tasks']['common'] = 'Task List';
|
||||
$lang->ai->dataSource['execution']['tasks']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['tasks']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['execution']['tasks']['status'] = 'Status';
|
||||
$lang->ai->dataSource['execution']['tasks']['estimate'] = 'Estimated hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['consumed'] = 'Consumed hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['left'] = 'Remaining hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['execution']['tasks']['estStarted'] = 'Estimated start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['realStarted'] = 'Actual start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['finishedDate'] = 'Finished date';
|
||||
$lang->ai->dataSource['execution']['tasks']['closedReason'] = 'Closing reason';
|
||||
|
||||
$lang->ai->dataSource['task']['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['task']['task']['name'] = 'Name';
|
||||
$lang->ai->dataSource['task']['task']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['task']['task']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['task']['task']['status'] = 'Status';
|
||||
$lang->ai->dataSource['task']['task']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['task']['task']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['task']['task']['left'] = 'Left';
|
||||
$lang->ai->dataSource['task']['task']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['task']['task']['estStarted'] = 'Start Date';
|
||||
$lang->ai->dataSource['task']['task']['realStarted'] = 'Actual Start';
|
||||
|
||||
$lang->ai->dataSource['case']['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['case']['case']['title'] = 'Title';
|
||||
$lang->ai->dataSource['case']['case']['precondition'] = 'Prerequisite';
|
||||
$lang->ai->dataSource['case']['case']['scene'] = 'Scene';
|
||||
$lang->ai->dataSource['case']['case']['product'] = 'Product';
|
||||
$lang->ai->dataSource['case']['case']['module'] = 'Module';
|
||||
$lang->ai->dataSource['case']['case']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['case']['case']['type'] = 'Type';
|
||||
$lang->ai->dataSource['case']['case']['lastRunResult'] = 'Result';
|
||||
$lang->ai->dataSource['case']['case']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['case']['steps']['common'] = 'Steps';
|
||||
$lang->ai->dataSource['case']['steps']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['case']['steps']['expect'] = 'Expectation';
|
||||
|
||||
$lang->ai->dataSource['bug']['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['bug']['bug']['title'] = 'Title';
|
||||
$lang->ai->dataSource['bug']['bug']['steps'] = 'Repro Steps';
|
||||
$lang->ai->dataSource['bug']['bug']['severity'] = 'Severity';
|
||||
$lang->ai->dataSource['bug']['bug']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['bug']['bug']['status'] = 'Status';
|
||||
$lang->ai->dataSource['bug']['bug']['confirmed'] = 'Confirmed';
|
||||
$lang->ai->dataSource['bug']['bug']['type'] = 'Type';
|
||||
|
||||
$lang->ai->dataSource['doc']['doc']['common'] = 'Document';
|
||||
$lang->ai->dataSource['doc']['doc']['title'] = 'Title';
|
||||
$lang->ai->dataSource['doc']['doc']['content'] = 'Text';
|
||||
$lang->ai->dataSource['doc']['doc']['addedBy'] = 'Created By';
|
||||
$lang->ai->dataSource['doc']['doc']['addedDate'] = 'Created Date';
|
||||
$lang->ai->dataSource['doc']['doc']['editedBy'] = 'Edited By';
|
||||
$lang->ai->dataSource['doc']['doc']['editedDate'] = 'Edited Date';
|
||||
|
||||
/* Target form definition. See `$config->ai->targetForm`. */
|
||||
$lang->ai->targetForm = array();
|
||||
$lang->ai->targetForm['product']['common'] = 'Product';
|
||||
$lang->ai->targetForm['story']['common'] = 'Story';
|
||||
$lang->ai->targetForm['productplan']['common'] = 'Plan';
|
||||
$lang->ai->targetForm['projectrelease']['common'] = 'Release';
|
||||
$lang->ai->targetForm['project']['common'] = 'Project';
|
||||
$lang->ai->targetForm['execution']['common'] = 'Execution';
|
||||
$lang->ai->targetForm['task']['common'] = 'Task';
|
||||
$lang->ai->targetForm['testcase']['common'] = 'Test Case';
|
||||
$lang->ai->targetForm['bug']['common'] = 'Bug';
|
||||
$lang->ai->targetForm['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->targetForm['product']['tree/managechild'] = 'Manage Modules';
|
||||
$lang->ai->targetForm['product']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['story']['create'] = 'Create Story';
|
||||
$lang->ai->targetForm['story']['batchcreate'] = 'Batch Create Story';
|
||||
$lang->ai->targetForm['story']['change'] = 'Change Story';
|
||||
$lang->ai->targetForm['story']['totask'] = 'Story to Task';
|
||||
$lang->ai->targetForm['story']['testcasecreate'] = 'Create Test Case';
|
||||
$lang->ai->targetForm['story']['subdivide'] = 'Subdivide Story';
|
||||
|
||||
$lang->ai->targetForm['productplan']['edit'] = 'Edit Plan';
|
||||
$lang->ai->targetForm['productplan']['create'] = 'Create Sub-Plan';
|
||||
|
||||
$lang->ai->targetForm['projectrelease']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['project']['risk/create'] = 'Create Risk';
|
||||
$lang->ai->targetForm['project']['issue/create'] = 'Create Issue';
|
||||
$lang->ai->targetForm['project']['doc/create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['project']['programplan/create'] = 'Set Program Plan';
|
||||
|
||||
$lang->ai->targetForm['execution']['batchcreatetask'] = 'Batch Create Task';
|
||||
$lang->ai->targetForm['execution']['createtestreport'] = 'Create Test Report';
|
||||
$lang->ai->targetForm['execution']['createqa'] = 'Create QA';
|
||||
$lang->ai->targetForm['execution']['createrisk'] = 'Create Risk';
|
||||
$lang->ai->targetForm['execution']['createissue'] = 'Create Issue';
|
||||
|
||||
$lang->ai->targetForm['task']['edit'] = 'Edit Task';
|
||||
$lang->ai->targetForm['task']['batchcreate'] = 'Batch Create Task';
|
||||
|
||||
$lang->ai->targetForm['testcase']['edit'] = 'Edit Test Case';
|
||||
$lang->ai->targetForm['testcase']['createscript'] = 'Create Script';
|
||||
|
||||
$lang->ai->targetForm['bug']['edit'] = 'Edit Bug';
|
||||
$lang->ai->targetForm['bug']['story/create'] = 'Bug to Story';
|
||||
$lang->ai->targetForm['bug']['testcase/create'] = 'Bug to Test Case';
|
||||
|
||||
$lang->ai->targetForm['doc']['create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['doc']['edit'] = 'Edit Doc';
|
||||
|
||||
$lang->ai->prompts->statuses = array();
|
||||
$lang->ai->prompts->statuses[''] = 'All';
|
||||
$lang->ai->prompts->statuses['draft'] = 'Draft';
|
||||
$lang->ai->prompts->statuses['active'] = 'Active';
|
||||
|
||||
$lang->ai->prompts->modules = array();
|
||||
$lang->ai->prompts->modules[''] = 'All';
|
||||
// $lang->ai->prompts->modules['my'] = 'My';
|
||||
$lang->ai->prompts->modules['product'] = 'Product';
|
||||
$lang->ai->prompts->modules['project'] = 'Project';
|
||||
$lang->ai->prompts->modules['story'] = 'Story';
|
||||
$lang->ai->prompts->modules['productplan'] = 'Product Plan';
|
||||
$lang->ai->prompts->modules['release'] = 'Release';
|
||||
$lang->ai->prompts->modules['execution'] = 'Execution';
|
||||
$lang->ai->prompts->modules['task'] = 'Task';
|
||||
$lang->ai->prompts->modules['case'] = 'Test Case';
|
||||
$lang->ai->prompts->modules['bug'] = 'Bug';
|
||||
$lang->ai->prompts->modules['doc'] = 'Document';
|
||||
|
||||
$lang->ai->conversations = new stdclass();
|
||||
$lang->ai->conversations->common = 'Conversations';
|
||||
|
||||
$lang->ai->miniPrograms = new stdClass();
|
||||
$lang->ai->miniPrograms->common = 'Mini Programs';
|
||||
$lang->ai->miniPrograms->emptyList = 'There is currently no mini program available.';
|
||||
$lang->ai->miniPrograms->create = 'Create A Program';
|
||||
$lang->ai->miniPrograms->configuration = 'Basic Information Configuration';
|
||||
$lang->ai->miniPrograms->downloadTip = 'After release, it will be displayed on the AI mini program Square and will be automatically synchronized to the client.';
|
||||
$lang->ai->miniPrograms->download = 'Download Zentao Client';
|
||||
$lang->ai->miniPrograms->category = 'Category';
|
||||
$lang->ai->miniPrograms->icon = 'Icon';
|
||||
$lang->ai->miniPrograms->desc = 'Introduction';
|
||||
$lang->ai->miniPrograms->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->ai->miniPrograms->allCategories = array('' => 'All categories');
|
||||
$lang->ai->miniPrograms->collect = 'Collect';
|
||||
$lang->ai->miniPrograms->more = 'More';
|
||||
$lang->ai->miniPrograms->iconModification = 'Icon modification';
|
||||
$lang->ai->miniPrograms->customBackground = 'Custom background Color';
|
||||
$lang->ai->miniPrograms->customIcon = 'Custom icon';
|
||||
$lang->ai->miniPrograms->backToListPage = 'Return to list page';
|
||||
$lang->ai->miniPrograms->lastStep = 'Previous step';
|
||||
$lang->ai->miniPrograms->backToListPageTip = 'The parameter configuration for selecting the object has been changed. Do you want to save and return?';
|
||||
$lang->ai->miniPrograms->saveAndBack = 'Save and Go Back';
|
||||
$lang->ai->miniPrograms->publishConfirm = array('Are you sure you want to publish?', 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.');
|
||||
$lang->ai->miniPrograms->emptyPrompterTip = 'The prompter of the mini program is empty. Please edit it before publishing.';
|
||||
$lang->ai->miniPrograms->maintenanceGroup = 'Maintenance mini program group';
|
||||
|
||||
$lang->ai->miniPrograms->latestPublishedDate = 'Latest Published Date';
|
||||
$lang->ai->miniPrograms->deleteTip = 'Are you sure you want to delete this mini program?';
|
||||
$lang->ai->miniPrograms->disableTip = 'Disabling the mini program will prevent users from accessing it. Are you sure you want to disable it?';
|
||||
$lang->ai->miniPrograms->publishTip = 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.';
|
||||
$lang->ai->miniPrograms->unpublishedTip = 'The mini program you are using is not published.';
|
||||
|
||||
$lang->ai->miniPrograms->placeholder = new stdClass();
|
||||
$lang->ai->miniPrograms->placeholder->name = 'Please enter a small program name';
|
||||
$lang->ai->miniPrograms->placeholder->desc = 'Please enter a brief introduction to the miniprograms';
|
||||
$lang->ai->miniPrograms->placeholder->default = 'Please fill in the prompt, the default is "please enter"';
|
||||
$lang->ai->miniPrograms->placeholder->input = 'Please enter';
|
||||
$lang->ai->miniPrograms->placeholder->prompt = 'Please enter prompt design';
|
||||
$lang->ai->miniPrograms->placeholder->asking = 'Continue asking';
|
||||
|
||||
$lang->ai->miniPrograms->deleteFieldTip = 'Are you sure to delete this field?';
|
||||
|
||||
$lang->ai->miniPrograms->field = new stdClass();
|
||||
$lang->ai->miniPrograms->field->name = 'Field name';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameTip = 'This name is already used, please try another name';
|
||||
$lang->ai->miniPrograms->field->type = 'control type';
|
||||
$lang->ai->miniPrograms->field->typeList = array('text' => 'single-line text', 'textarea' => 'multi-line text', 'radio' => 'single-selection', 'checkbox' => 'multi-selection');
|
||||
$lang->ai->miniPrograms->field->placeholder = 'Fill hints';
|
||||
$lang->ai->miniPrograms->field->required = 'Required';
|
||||
$lang->ai->miniPrograms->field->requiredOptions = array('No', 'Yes');
|
||||
$lang->ai->miniPrograms->field->add = 'New field';
|
||||
$lang->ai->miniPrograms->field->addTip = 'Please click here to add field information';
|
||||
$lang->ai->miniPrograms->field->edit = 'Edit field';
|
||||
$lang->ai->miniPrograms->field->configuration = 'Field Configuration area';
|
||||
$lang->ai->miniPrograms->field->debug = 'debug area';
|
||||
$lang->ai->miniPrograms->field->preview = 'Preview area';
|
||||
$lang->ai->miniPrograms->field->option = 'Options';
|
||||
$lang->ai->miniPrograms->field->contentDebugging = 'Content debugging';
|
||||
$lang->ai->miniPrograms->field->contentDebuggingTip = 'Please enter the field here to debug.';
|
||||
$lang->ai->miniPrograms->field->prompterDesign = 'Prompterdesign';
|
||||
$lang->ai->miniPrograms->field->prompterDesignTip = 'The <> symbol is used to reference the configured field. Space is used before and after <>.';
|
||||
$lang->ai->miniPrograms->field->prompterPreview = 'Prompterpreview';
|
||||
$lang->ai->miniPrograms->field->generateResult = 'Generate result';
|
||||
$lang->ai->miniPrograms->field->resultPreview = 'Result Preview';
|
||||
|
||||
$lang->ai->miniPrograms->field->default = array(
|
||||
'Role',
|
||||
'Scene',
|
||||
'Objective',
|
||||
'As a <Role>, I hope to <Objective> in <Scene>.'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->field->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameWarning = 'Duplicate 「%s」';
|
||||
$lang->ai->miniPrograms->field->emptyOptionWarning = 'Please configure at least one option';
|
||||
|
||||
$lang->ai->miniPrograms->statuses = array(
|
||||
'' => 'all',
|
||||
'draft' => 'unpublished',
|
||||
'active' => 'published',
|
||||
'createdByMe' => 'Created by me'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->publishedOptions = array('unpublished', 'published');
|
||||
$lang->ai->miniPrograms->optionName = 'Option name';
|
||||
$lang->ai->miniPrograms->promptTemplate = 'Prompt template';
|
||||
$lang->ai->miniPrograms->fieldConfiguration = 'Field configuration';
|
||||
$lang->ai->miniPrograms->summary = 'There are %s small programs on this page.';
|
||||
$lang->ai->miniPrograms->generate = 'Generate';
|
||||
$lang->ai->miniPrograms->regenerate = 'Regenerate';
|
||||
$lang->ai->miniPrograms->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->ai->miniPrograms->clearContext = 'The context content has been cleared.';
|
||||
$lang->ai->miniPrograms->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->ai->miniPrograms->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->ai->miniPrograms->chatNoResponse = 'Something went wrong.';
|
||||
|
||||
$lang->ai->models = new stdclass();
|
||||
$lang->ai->models->title = 'Language Model Configuration';
|
||||
$lang->ai->models->common = 'Language Model';
|
||||
$lang->ai->models->name = 'Name';
|
||||
$lang->ai->models->type = 'Model';
|
||||
$lang->ai->models->vendor = 'Vendor';
|
||||
$lang->ai->models->base = 'API Base URL';
|
||||
$lang->ai->models->key = 'API Key';
|
||||
$lang->ai->models->secret = 'Secret Key';
|
||||
$lang->ai->models->resource = 'Resource';
|
||||
$lang->ai->models->deployment = 'Deployment';
|
||||
$lang->ai->models->proxyType = 'Proxy Type';
|
||||
$lang->ai->models->proxyAddr = 'Proxy Address';
|
||||
$lang->ai->models->description = 'Description';
|
||||
$lang->ai->models->createdDate = 'Creation Date';
|
||||
$lang->ai->models->createdBy = 'Created By';
|
||||
$lang->ai->models->editedDate = 'Modification Date';
|
||||
$lang->ai->models->editedBy = 'Edited By';
|
||||
$lang->ai->models->usesProxy = 'Use Proxy';
|
||||
$lang->ai->models->testConnection = 'Test Connection';
|
||||
$lang->ai->models->unconfigured = 'Unconfigured';
|
||||
$lang->ai->models->create = 'Create Model';
|
||||
$lang->ai->models->edit = 'Edit Parameters';
|
||||
$lang->ai->models->view = 'View Details';
|
||||
$lang->ai->models->enable = 'Enable Language Model';
|
||||
$lang->ai->models->disable = 'Disable Language Model';
|
||||
$lang->ai->models->details = 'Model Details';
|
||||
$lang->ai->models->concealTip = 'Visible when editing';
|
||||
$lang->ai->models->upgradeBiz = 'For more AI features, all in <a target="_blank" href="https://www.zentao.net/page/enterprise.html" class="text-blue">ZenTao Biz</a>.';
|
||||
$lang->ai->models->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->ai->models->noModels = 'There is currently no language model.';
|
||||
$lang->ai->models->confirmDelete = 'Are you sure you want to delete this language model?';
|
||||
$lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?';
|
||||
$lang->ai->models->default = 'Default model';
|
||||
$lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.';
|
||||
|
||||
$lang->ai->models->testConnectionResult = new stdclass();
|
||||
$lang->ai->models->testConnectionResult->success = 'Successfully connected';
|
||||
$lang->ai->models->testConnectionResult->fail = 'Failed to connect';
|
||||
$lang->ai->models->testConnectionResult->failFormat = 'Failed to connect: %s';
|
||||
|
||||
$lang->ai->models->statusList = array();
|
||||
$lang->ai->models->statusList['0'] = 'Disabled';
|
||||
$lang->ai->models->statusList['off'] = 'Disabled';
|
||||
$lang->ai->models->statusList['1'] = 'Enabled';
|
||||
$lang->ai->models->statusList['on'] = 'Enabled';
|
||||
|
||||
$lang->ai->models->proxyStatusList = array();
|
||||
$lang->ai->models->proxyStatusList['0'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['off'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['1'] = 'Yes';
|
||||
$lang->ai->models->proxyStatusList['on'] = 'Yes';
|
||||
|
||||
$lang->ai->models->typeList = array();
|
||||
$lang->ai->models->typeList['openai-gpt35'] = 'OpenAI / GPT-3.5';
|
||||
$lang->ai->models->typeList['openai-gpt4'] = 'OpenAI / GPT-4';
|
||||
$lang->ai->models->typeList['baidu-ernie'] = 'Baidu / ERNIE';
|
||||
|
||||
$lang->ai->models->vendorList = new stdclass();
|
||||
$lang->ai->models->vendorList->{'openai-gpt35'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'openai-gpt4'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'baidu-ernie'} = array('baidu' => 'Baidu Qianfan LLM Platform');
|
||||
|
||||
$lang->ai->models->vendorTips = new stdclass();
|
||||
$lang->ai->models->vendorTips->azure = 'OpenAI GPT version is specified during model deployment creation on Azure.';
|
||||
$lang->ai->models->vendorTips->openaiCompatible = 'Custom API needs to support Function Calling, otherwise some functions may not work properly.';
|
||||
|
||||
$lang->ai->models->proxyTypes = array();
|
||||
$lang->ai->models->proxyTypes[''] = 'No Proxy';
|
||||
$lang->ai->models->proxyTypes['socks5'] = 'SOCKS5';
|
||||
|
||||
$lang->ai->models->promptFor = 'Prompt for %s';
|
||||
|
||||
$lang->ai->designStepNav = array();
|
||||
$lang->ai->designStepNav['assignrole'] = 'Specify Role';
|
||||
$lang->ai->designStepNav['selectdatasource'] = 'Select Object';
|
||||
$lang->ai->designStepNav['setpurpose'] = 'Confirm Action';
|
||||
$lang->ai->designStepNav['settargetform'] = 'Process Result';
|
||||
$lang->ai->designStepNav['finalize'] = 'Ready to Publish';
|
||||
|
||||
$lang->ai->dataTypeDesc = '%s is %s type, %s';
|
||||
|
||||
$lang->ai->dataType = new stdclass();
|
||||
$lang->ai->dataType->pri = new stdClass();
|
||||
$lang->ai->dataType->pri->type = 'numeric';
|
||||
$lang->ai->dataType->pri->desc = '1 is the highest priority, 4 is the lowest priority.';
|
||||
|
||||
$lang->ai->dataType->estimate = new stdClass();
|
||||
$lang->ai->dataType->estimate->type = 'numeric';
|
||||
$lang->ai->dataType->estimate->desc = 'Unit is in hours.';
|
||||
|
||||
$lang->ai->dataType->consumed = $lang->ai->dataType->estimate;
|
||||
$lang->ai->dataType->left = $lang->ai->dataType->estimate;
|
||||
|
||||
$lang->ai->dataType->progress = new stdClass();
|
||||
$lang->ai->dataType->progress->type = 'percentage';
|
||||
$lang->ai->dataType->progress->desc = '0 means not started, 100 means completed.';
|
||||
|
||||
$lang->ai->dataType->datetime = new stdClass();
|
||||
$lang->ai->dataType->datetime->type = 'datetime';
|
||||
$lang->ai->dataType->datetime->desc = 'Format is: 1970-01-01 00:00:01, or leave it blank.';
|
||||
|
||||
$lang->ai->dataType->estStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
|
||||
|
||||
$lang->ai->demoData = new stdclass();
|
||||
$lang->ai->demoData->notExist = 'The demo data does not exist for now.';
|
||||
$lang->ai->demoData->story = array(
|
||||
'story' => array(
|
||||
'title' => 'Develop an online learning platform',
|
||||
'spec' => 'We need to develop an online learning platform that provides course management, student management, teacher management, and other functions.',
|
||||
'verify' => '1. All functions can operate properly without any obvious errors or abnormalities.2. The interface is aesthetically pleasing and user-friendly.3. The platform can meet user needs and has a high level of user satisfaction.4. The code has good quality, with clear structure and easy maintenance.',
|
||||
'module' => 7,
|
||||
'pri' => 1,
|
||||
'estimate' => 1,
|
||||
'product' => 1,
|
||||
'category' => 'feature',
|
||||
),
|
||||
);
|
||||
$lang->ai->demoData->execution = array(
|
||||
'execution' => array(
|
||||
'name' => 'Online Learning Platform Software Development',
|
||||
'desc' => 'This plan aims to develop an online learning platform software that provides accessible learning resources, including text, video, and audio, as well as some learning tools such as exams, tests, and discussion forums.',
|
||||
'estimate' => 7,
|
||||
),
|
||||
'tasks' => array(
|
||||
0 =>
|
||||
array(
|
||||
'name' => 'Technology Selection',
|
||||
'pri' => 1,
|
||||
'status' => 'done',
|
||||
'estimate' => 1,
|
||||
'consumed' => 1,
|
||||
'left' => 0,
|
||||
'progress' => 100,
|
||||
'estStarted' => '2023-07-02 00:00:00',
|
||||
'realStarted' => '2023-07-02 00:00:00',
|
||||
'finishedDate' => '2023-07-02 00:00:00',
|
||||
'closedReason' => 'Completed',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'name' => 'UI Design',
|
||||
'pri' => 1,
|
||||
'status' => 'doing',
|
||||
'estimate' => 2,
|
||||
'consumed' => 1,
|
||||
'left' => 1,
|
||||
'progress' => 50,
|
||||
'estStarted' => '2023-07-03 00:00:00',
|
||||
'realStarted' => '2023-07-03 00:00:00',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'name' => 'Development',
|
||||
'pri' => 1,
|
||||
'status' => 'wait',
|
||||
'estimate' => 1,
|
||||
'consumed' => 0,
|
||||
'left' => 1,
|
||||
'progress' => 0,
|
||||
'estStarted' => '',
|
||||
'realStarted' => '',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Forms as JSON Schemas. */
|
||||
$lang->ai->formSchema = array();
|
||||
$lang->ai->formSchema['story']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->title = 'Story';
|
||||
$lang->ai->formSchema['story']['create']->type = 'object';
|
||||
$lang->ai->formSchema['story']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->spec = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->verify = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->title->description = 'Title of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->description = 'Description of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->description = 'Acceptance criteria of story';
|
||||
$lang->ai->formSchema['story']['create']->required = array('title', 'spec', 'verify');
|
||||
$lang->ai->formSchema['story']['change'] = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['story']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->title = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->type = 'array';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->description = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->items = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['productplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->title = 'Product Plan';
|
||||
$lang->ai->formSchema['productplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['productplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->description = 'Title of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->description = 'Begin date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->description = 'End date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->description = 'Description of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->required = array('title', 'begin', 'end');
|
||||
$lang->ai->formSchema['productplan']['edit'] = $lang->ai->formSchema['productplan']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->title = 'Task';
|
||||
$lang->ai->formSchema['task']['create']->type = 'object';
|
||||
$lang->ai->formSchema['task']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->name = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->description = 'Type of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->enum = array('design', 'devel', 'request', 'test', 'study', 'discuss', 'ui', 'affair', 'misc');
|
||||
$lang->ai->formSchema['task']['create']->properties->name->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->name->description = 'Name of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->description = 'Description of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->description = 'Priority of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->type = 'number';
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->description = 'Estimated hours of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->description = 'Begin date of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->description = 'End date of task';
|
||||
$lang->ai->formSchema['task']['create']->required = array('type', 'name');
|
||||
$lang->ai->formSchema['task']['edit'] = $lang->ai->formSchema['task']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->title = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->type = 'array';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->description = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items = $lang->ai->formSchema['task']['create'];
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->estStarted = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin;
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->deadline = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end;
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin);
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end);
|
||||
|
||||
$lang->ai->formSchema['bug']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->title = 'Bug';
|
||||
$lang->ai->formSchema['bug']['create']->type = 'object';
|
||||
$lang->ai->formSchema['bug']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->description = 'Title of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->description = 'Repro steps of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->description = 'Severity of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->description = 'Priority of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->description = 'Affected builds of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->enum = array('trunk');
|
||||
$lang->ai->formSchema['bug']['create']->required = array('title', 'steps', 'severity', 'pri', 'openedBuild');
|
||||
$lang->ai->formSchema['bug']['edit'] = $lang->ai->formSchema['bug']['create'];
|
||||
|
||||
$lang->ai->formSchema['testcase']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->title = 'Test Case';
|
||||
$lang->ai->formSchema['testcase']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->description = 'Type of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->enum = array('feature', 'performance', 'config', 'install', 'security', 'interface', 'unit', 'other');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->description = 'Stage of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->enum = array('unittest', 'feature', 'intergrate', 'system', 'smoke', 'bvt');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->description = 'Title of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->description = 'Precondition of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->type = 'array';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->description = 'Steps of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->description = 'Step description';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->description = 'Expectation of step';
|
||||
$lang->ai->formSchema['testcase']['create']->required = array('type', 'title', 'steps');
|
||||
$lang->ai->formSchema['testcase']['edit'] = $lang->ai->formSchema['testcase']['create'];
|
||||
|
||||
$lang->ai->formSchema['testreport']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->title = 'Test Report';
|
||||
$lang->ai->formSchema['testreport']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testreport']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->description = 'Begin date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->description = 'End date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->description = 'Title of test report';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->description = 'Report content';
|
||||
$lang->ai->formSchema['testreport']['create']->required = array('begin', 'end', 'title', 'report');
|
||||
$lang->ai->formSchema['execution']['testreport'] = $lang->ai->formSchema['testreport']['create'];
|
||||
|
||||
$lang->ai->formSchema['doc']['edit'] = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->title = 'Document';
|
||||
$lang->ai->formSchema['doc']['edit']->type = 'object';
|
||||
$lang->ai->formSchema['doc']['edit']->properties = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->description = 'Title of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->description = 'Content of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->required = array('title', 'content');
|
||||
|
||||
$lang->ai->formSchema['tree']['browse'] = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->type = 'object';
|
||||
$lang->ai->formSchema['tree']['browse']->properties = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->type = 'array';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items->type = 'string';
|
||||
$lang->ai->formSchema['tree']['browse']->required = array('modules');
|
||||
|
||||
$lang->ai->formSchema['programplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->title = 'Program Plan';
|
||||
$lang->ai->formSchema['programplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->type = 'array';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->title = 'Plans';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->description = 'Name of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->description = 'Attribute of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->enum = array('request', 'design', 'dev', 'qa', 'release', 'review', 'other');
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->type = 'boolean';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->description = 'Is milestone?';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->description = 'Begin date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->description = 'End date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->required = array('stages');
|
||||
|
||||
$lang->ai->promptMenu = new stdclass();
|
||||
$lang->ai->promptMenu->dropdownTitle = 'AI';
|
||||
|
||||
$lang->ai->dataInject = new stdclass();
|
||||
$lang->ai->dataInject->success = 'Prompt execution results are filled in.';
|
||||
$lang->ai->dataInject->fail = 'Failed to fill in prompt execution results.';
|
||||
|
||||
$lang->ai->execute = new stdclass();
|
||||
$lang->ai->execute->loading = 'Prompt executing...';
|
||||
$lang->ai->execute->auditing = 'Getting ready for auditing...';
|
||||
$lang->ai->execute->success = 'Prompt executed.';
|
||||
$lang->ai->execute->fail = 'Prompt execution failed.';
|
||||
$lang->ai->execute->failFormat = 'Prompt execution failed: %s.';
|
||||
$lang->ai->execute->failReasons = array();
|
||||
$lang->ai->execute->failReasons['noPrompt'] = 'unable to get prompt';
|
||||
$lang->ai->execute->failReasons['noObjectData'] = 'unable to get object data';
|
||||
$lang->ai->execute->failReasons['noResponse'] = 'no response from external service';
|
||||
$lang->ai->execute->failReasons['noTargetForm'] = 'unable to get target form or its required fields';
|
||||
$lang->ai->execute->executeErrors = array();
|
||||
$lang->ai->execute->executeErrors['-1'] = 'unable to get prompt';
|
||||
$lang->ai->execute->executeErrors['-2'] = 'unable to get object data';
|
||||
$lang->ai->execute->executeErrors['-3'] = 'failed to serialize object data';
|
||||
$lang->ai->execute->executeErrors['-4'] = 'unable to find available model';
|
||||
$lang->ai->execute->executeErrors['-5'] = 'unable to get target form schema';
|
||||
$lang->ai->execute->executeErrors['-6'] = 'request failed or API returned error';
|
||||
|
||||
$lang->ai->audit = new stdclass();
|
||||
$lang->ai->audit->designPrompt = 'Prompt Design';
|
||||
$lang->ai->audit->afterSave = 'After saving,';
|
||||
$lang->ai->audit->regenerate = 'Regenerate';
|
||||
$lang->ai->audit->exit = 'Exit Audit';
|
||||
|
||||
$lang->ai->audit->backLocationList = array();
|
||||
$lang->ai->audit->backLocationList[0] = 'back to audit page.';
|
||||
$lang->ai->audit->backLocationList[1] = 'back to audit page and regenerate.';
|
||||
|
||||
$lang->ai->engineeredPrompts = new stdclass();
|
||||
$lang->ai->engineeredPrompts->askForFunctionCalling = array((object)array('role' => 'user', 'content' => 'Please convert my next message into a function call.'), (object)array('role' => 'assistant', 'content' => 'Sure, I\'ll convert your next message into a function call.'));
|
||||
|
||||
$lang->ai->aiResponseException = array();
|
||||
$lang->ai->aiResponseException['notFunctionCalling'] = 'The response is not a function calling';
|
||||
@@ -0,0 +1,965 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->ai->common = 'AI Configuration';
|
||||
|
||||
/* Definitions of table columns, used to sprintf error messages to dao::$errors. */
|
||||
$lang->prompt = new stdclass();
|
||||
$lang->prompt->name = 'Name';
|
||||
$lang->prompt->desc = 'Description';
|
||||
$lang->prompt->model = 'Model';
|
||||
$lang->prompt->module = 'Module';
|
||||
$lang->prompt->source = 'Data Source';
|
||||
$lang->prompt->targetForm = 'Target Form';
|
||||
$lang->prompt->purpose = 'Purpose';
|
||||
$lang->prompt->elaboration = 'Elaboration';
|
||||
$lang->prompt->role = 'Role';
|
||||
$lang->prompt->characterization = 'Characterization';
|
||||
$lang->prompt->status = 'Status';
|
||||
$lang->prompt->createdBy = 'Created By';
|
||||
$lang->prompt->createdDate = 'Created Date';
|
||||
$lang->prompt->editedBy = 'Edited By';
|
||||
$lang->prompt->editedDate = 'Edited Date';
|
||||
$lang->prompt->deleted = 'Deleted';
|
||||
|
||||
/* Lang for privs, keys are paired with privlang items. */
|
||||
$lang->ai->modelBrowse = 'Browse Language Models';
|
||||
$lang->ai->modelView = 'View Language Model';
|
||||
$lang->ai->modelCreate = 'Create Language Model';
|
||||
$lang->ai->modelEdit = 'Edit Language Model';
|
||||
$lang->ai->modelEnable = 'Enable Language Model';
|
||||
$lang->ai->modelDisable = 'Disable Language Model';
|
||||
$lang->ai->modelDelete = 'Delete Language Model';
|
||||
$lang->ai->modelTestConnection = 'Test Model Connection';
|
||||
$lang->ai->promptCreate = 'Create Prompt';
|
||||
$lang->ai->promptEdit = 'Edit Prompt';
|
||||
$lang->ai->promptDelete = 'Delete Prompt';
|
||||
$lang->ai->promptAssignRole = 'Assign Prompt Role';
|
||||
$lang->ai->promptSelectDataSource = 'Select Prompt Data';
|
||||
$lang->ai->promptSetPurpose = 'Set Prompt Purpose';
|
||||
$lang->ai->promptSetTargetForm = 'Set Prompt Target Form';
|
||||
$lang->ai->promptFinalize = 'Finalize Prompt';
|
||||
$lang->ai->promptAudit = 'Audit Prompt';
|
||||
$lang->ai->promptPublish = 'Publish Prompt';
|
||||
$lang->ai->promptUnpublish = 'Unpublish Prompt';
|
||||
$lang->ai->promptBrowse = 'Browse Prompts';
|
||||
$lang->ai->promptView = 'View Prompt';
|
||||
$lang->ai->promptExecute = 'Execute Prompt';
|
||||
$lang->ai->promptExecutionReset = 'Reset Execute Prompt';
|
||||
$lang->ai->roleTemplates = 'Manage Role Templates';
|
||||
$lang->ai->chat = 'Chat';
|
||||
$lang->ai->createMiniProgram = 'Create AI Mini Program';
|
||||
$lang->ai->editMiniProgram = 'Edit AI Mini Program';
|
||||
$lang->ai->testMiniProgram = 'Test AI Mini Program';
|
||||
$lang->ai->miniProgramList = 'Browse AI Mini Program List';
|
||||
$lang->ai->miniProgramView = 'View AI Mini Program Details';
|
||||
$lang->ai->publishMiniProgram = 'Publish AI Mini Program';
|
||||
$lang->ai->unpublishMiniProgram = 'Disable AI Mini Program';
|
||||
$lang->ai->deleteMiniProgram = 'Delete AI Mini Program';
|
||||
$lang->ai->exportMiniProgram = 'Export AI Mini Program';
|
||||
$lang->ai->importMiniProgram = 'Import AI Mini Program';
|
||||
$lang->ai->editMiniProgramCategory = 'Manage group';
|
||||
|
||||
$lang->ai->export = 'Export';
|
||||
$lang->ai->import = 'Import';
|
||||
$lang->ai->saveFail = 'Save failed';
|
||||
$lang->ai->installPackage = 'Installation package';
|
||||
$lang->ai->toPublish = 'Publish after installation';
|
||||
$lang->ai->toZentaoStoreAIPage = 'Click to jump to Zentao official app store AI mini programs page';
|
||||
|
||||
$lang->ai->chatPlaceholderMessage = 'Hi, I\'m Adao, your AI assistant at ZenTao!';
|
||||
$lang->ai->chatPlaceholderInput = 'type here...';
|
||||
$lang->ai->chatSystemMessage = 'You\'re Adao, the AI assistant and mascot of ZenTao. You can answer questions and chat with users. You\'re currently within the ZenTao project management software.';
|
||||
$lang->ai->chatSend = 'Send';
|
||||
$lang->ai->chatReset = 'Reset';
|
||||
$lang->ai->chatNoResponse = 'Something went wrong, <a id="retry" class="text-blue">click here to retry</a>.';
|
||||
$lang->ai->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
|
||||
$lang->ai->nextStep = 'Next';
|
||||
$lang->ai->goTesting = 'Go testing';
|
||||
$lang->ai->maintenanceGroup = 'Maintenance Group';
|
||||
|
||||
$lang->ai->maintenanceGroupDuplicated = 'The group name cannot be duplicated.';
|
||||
|
||||
$lang->ai->validate = new stdclass();
|
||||
$lang->ai->validate->noEmpty = '%s cannot be empty.';
|
||||
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
|
||||
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
|
||||
|
||||
$lang->ai->prompts = new stdclass();
|
||||
$lang->ai->prompts->common = 'Prompt';
|
||||
$lang->ai->prompts->emptyList = 'No prompts yet.';
|
||||
$lang->ai->prompts->create = 'Create Prompt';
|
||||
$lang->ai->prompts->edit = 'Edit Prompt';
|
||||
$lang->ai->prompts->id = 'ID';
|
||||
$lang->ai->prompts->name = 'Name';
|
||||
$lang->ai->prompts->description = 'Description';
|
||||
$lang->ai->prompts->createdBy = 'Creator';
|
||||
$lang->ai->prompts->createdDate = 'Created Date';
|
||||
$lang->ai->prompts->targetForm = 'Target Form';
|
||||
$lang->ai->prompts->funcDesc = 'Function Description';
|
||||
$lang->ai->prompts->deleted = 'Deleted';
|
||||
$lang->ai->prompts->stage = 'Stage';
|
||||
$lang->ai->prompts->basicInfo = 'Basic Info';
|
||||
$lang->ai->prompts->editInfo = 'Edit Info';
|
||||
$lang->ai->prompts->createdBy = 'Created By';
|
||||
$lang->ai->prompts->publishedBy = 'Published By';
|
||||
$lang->ai->prompts->draftedBy = 'Drafted By';
|
||||
$lang->ai->prompts->lastEditor = 'Last Editor';
|
||||
$lang->ai->prompts->modelNeutral = 'Model Neutral';
|
||||
|
||||
$lang->ai->prompts->summary = 'There are %s prompts on this page.';
|
||||
|
||||
$lang->ai->prompts->action = new stdclass();
|
||||
$lang->ai->prompts->action->goDesignConfirm = 'The current prompt is not complete, continue designing?';
|
||||
$lang->ai->prompts->action->goDesign = 'Go designing';
|
||||
$lang->ai->prompts->action->draftConfirm = 'Once unpublished, the prompt cannot be used any further. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->design = 'Design';
|
||||
$lang->ai->prompts->action->test = 'Test';
|
||||
$lang->ai->prompts->action->edit = 'Edit';
|
||||
$lang->ai->prompts->action->publish = 'Publish';
|
||||
$lang->ai->prompts->action->unpublish = 'Unpublish';
|
||||
$lang->ai->prompts->action->delete = 'Delete';
|
||||
$lang->ai->prompts->action->disable = 'Disable';
|
||||
$lang->ai->prompts->action->deleteConfirm = 'Deleted prompts will be no longer available. Are you sure you want to proceed?';
|
||||
$lang->ai->prompts->action->publishSuccess = 'Publish Success';
|
||||
|
||||
/* Steps of prompt creation. */
|
||||
$lang->ai->prompts->assignRole = 'Assign Role';
|
||||
$lang->ai->prompts->selectDataSource = 'Select Data Fields';
|
||||
$lang->ai->prompts->setPurpose = 'Set Purpose';
|
||||
$lang->ai->prompts->setTargetForm = 'Set Target Form';
|
||||
$lang->ai->prompts->finalize = 'Finalize';
|
||||
|
||||
/* Role assigning. */
|
||||
$lang->ai->prompts->model = 'Model';
|
||||
$lang->ai->prompts->role = 'Role';
|
||||
$lang->ai->prompts->characterization = 'Characterization';
|
||||
$lang->ai->prompts->rolePlaceholder = '"Act as a <role>"';
|
||||
$lang->ai->prompts->charPlaceholder = 'Detailed characterization of this role';
|
||||
$lang->ai->prompts->roleTemplate = 'Role Template';
|
||||
$lang->ai->prompts->roleTemplateTip = 'After a template is referenced, modifying the role or role description does not affect the template.';
|
||||
$lang->ai->prompts->addRoleTemplate = 'Add Role Template';
|
||||
$lang->ai->prompts->editRoleTemplate = 'Edit Role Template';
|
||||
$lang->ai->prompts->editRoleTemplateTip = 'Editing this template will not affect its previous usages in prompts.';
|
||||
$lang->ai->prompts->roleAddedSuccess = 'Role added successfully.';
|
||||
$lang->ai->prompts->roleDelConfirm = 'Deleting the role does not affect the role that is already in the prompt. Do you want to delete it?';
|
||||
$lang->ai->prompts->roleDelSuccess = 'Role deleted successfully.';
|
||||
$lang->ai->prompts->roleTemplateSave = 'Save Role Template';
|
||||
$lang->ai->prompts->roleTemplateSaveList = array();
|
||||
$lang->ai->prompts->roleTemplateSaveList['save'] = 'Save';
|
||||
$lang->ai->prompts->roleTemplateSaveList['discard'] = 'Discard';
|
||||
|
||||
/* Data source selecting. */
|
||||
$lang->ai->prompts->selectData = 'Select fields';
|
||||
$lang->ai->prompts->selectDataTip = 'Select an object and its fields will be shown below.';
|
||||
$lang->ai->prompts->selectedFormat = 'Selecting data from {0}, {1} fields selected.';
|
||||
$lang->ai->prompts->nonSelected = 'No field selected.';
|
||||
$lang->ai->prompts->sortTip = 'Sorting fields by priority is suggested.';
|
||||
$lang->ai->prompts->object = 'Object';
|
||||
$lang->ai->prompts->field = 'Field';
|
||||
|
||||
/* Purpose setting. */
|
||||
$lang->ai->prompts->purpose = 'Purpose';
|
||||
$lang->ai->prompts->purposeTip = 'What do I want it to accomplish, in order to achieve what goals?';
|
||||
$lang->ai->prompts->elaboration = 'Elaboration';
|
||||
$lang->ai->prompts->elaborationTip = 'I hope its answer draws attention to some additional requests.';
|
||||
$lang->ai->prompts->inputPreview = 'Prompt Preview';
|
||||
$lang->ai->prompts->dataPreview = 'Data Prompt Preview';
|
||||
$lang->ai->prompts->rolePreview = 'Role Prompt Preview';
|
||||
$lang->ai->prompts->promptPreview = 'Purpose Prompt Preview';
|
||||
|
||||
/* Target form selecting. */
|
||||
$lang->ai->prompts->selectTargetForm = 'Select Target Form';
|
||||
$lang->ai->prompts->selectTargetFormTip = 'Results returned from LLMs can be directly inputed into forms within ZenTao.';
|
||||
$lang->ai->prompts->goingTesting = 'Redirecting to testing page';
|
||||
$lang->ai->prompts->goingTestingFail = 'Unable to go testing, no suitable object found.';
|
||||
|
||||
/* Finalize page. */
|
||||
$lang->ai->moduleDisableTip = 'Module is automatically selected based on selected objects.';
|
||||
|
||||
/* Data source definition. */
|
||||
$lang->ai->dataSource = array();
|
||||
|
||||
$lang->ai->dataSource['my']['common'] = 'My';
|
||||
$lang->ai->dataSource['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->dataSource['my']['efforts']['common'] = 'Efforts';
|
||||
$lang->ai->dataSource['my']['efforts']['date'] = 'Date';
|
||||
$lang->ai->dataSource['my']['efforts']['work'] = 'Work';
|
||||
$lang->ai->dataSource['my']['efforts']['account'] = 'Account';
|
||||
$lang->ai->dataSource['my']['efforts']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['my']['efforts']['left'] = 'Left';
|
||||
$lang->ai->dataSource['my']['efforts']['objectID'] = 'Object';
|
||||
$lang->ai->dataSource['my']['efforts']['product'] = 'Product';
|
||||
$lang->ai->dataSource['my']['efforts']['project'] = 'Project';
|
||||
$lang->ai->dataSource['my']['efforts']['execution'] = 'Execution';
|
||||
|
||||
$lang->ai->dataSource['product']['product']['common'] = 'Product';
|
||||
$lang->ai->dataSource['product']['product']['name'] = 'Product Name';
|
||||
$lang->ai->dataSource['product']['product']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['product']['modules']['common'] = 'Module';
|
||||
$lang->ai->dataSource['product']['modules']['name'] = 'Module Name';
|
||||
$lang->ai->dataSource['product']['modules']['modules'] = 'Sub Modules';
|
||||
|
||||
$lang->ai->dataSource['productplan']['productplan']['common'] = 'Product Plan';
|
||||
$lang->ai->dataSource['productplan']['productplan']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['productplan']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['productplan']['productplan']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['productplan']['productplan']['end'] = 'End';
|
||||
|
||||
$lang->ai->dataSource['productplan']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['productplan']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['stories']['module'] = 'Module';
|
||||
$lang->ai->dataSource['productplan']['stories']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['stories']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['productplan']['stories']['status'] = 'Status';
|
||||
$lang->ai->dataSource['productplan']['stories']['stage'] = 'Stage';
|
||||
|
||||
$lang->ai->dataSource['productplan']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['productplan']['bugs']['title'] = 'Title';
|
||||
$lang->ai->dataSource['productplan']['bugs']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['productplan']['bugs']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['release']['release']['common'] = 'Release';
|
||||
$lang->ai->dataSource['release']['release']['product'] = 'Product';
|
||||
$lang->ai->dataSource['release']['release']['name'] = 'Name';
|
||||
$lang->ai->dataSource['release']['release']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['release']['release']['date'] = 'Release Date';
|
||||
|
||||
$lang->ai->dataSource['release']['stories']['common'] = 'Stories';
|
||||
$lang->ai->dataSource['release']['stories']['title'] = 'Title';
|
||||
$lang->ai->dataSource['release']['stories']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['release']['bugs']['common'] = 'Bugs';
|
||||
$lang->ai->dataSource['release']['bugs']['title'] = 'Title';
|
||||
|
||||
$lang->ai->dataSource['project']['project']['common'] = 'Project';
|
||||
$lang->ai->dataSource['project']['project']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['project']['type'] = 'Type';
|
||||
$lang->ai->dataSource['project']['project']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['project']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['project']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['project']['estimate'] = 'Estimates';
|
||||
|
||||
$lang->ai->dataSource['project']['programplans']['common'] = 'Program Plan';
|
||||
$lang->ai->dataSource['project']['programplans']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['programplans']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['programplans']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['programplans']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['programplans']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['programplans']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['programplans']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['programplans']['planDuration'] = 'Plan Duration';
|
||||
$lang->ai->dataSource['project']['programplans']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['project']['programplans']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['programplans']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['programplans']['left'] = 'Left';
|
||||
|
||||
$lang->ai->dataSource['project']['executions']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['project']['executions']['name'] = 'Name';
|
||||
$lang->ai->dataSource['project']['executions']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['project']['executions']['status'] = 'Status';
|
||||
$lang->ai->dataSource['project']['executions']['begin'] = 'Begin';
|
||||
$lang->ai->dataSource['project']['executions']['end'] = 'End';
|
||||
$lang->ai->dataSource['project']['executions']['realBegan'] = 'Actual Start';
|
||||
$lang->ai->dataSource['project']['executions']['realEnd'] = 'Actual End';
|
||||
$lang->ai->dataSource['project']['executions']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['project']['executions']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['project']['executions']['left'] = 'Left';
|
||||
$lang->ai->dataSource['project']['executions']['progress'] = 'Progress';
|
||||
|
||||
$lang->ai->dataSource['story']['story']['common'] = 'Story';
|
||||
$lang->ai->dataSource['story']['story']['title'] = 'Title';
|
||||
$lang->ai->dataSource['story']['story']['spec'] = 'Description';
|
||||
$lang->ai->dataSource['story']['story']['verify'] = 'Acceptance criteria';
|
||||
$lang->ai->dataSource['story']['story']['product'] = 'Product';
|
||||
$lang->ai->dataSource['story']['story']['module'] = 'Module';
|
||||
$lang->ai->dataSource['story']['story']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['story']['story']['category'] = 'Category';
|
||||
$lang->ai->dataSource['story']['story']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['execution']['common'] = 'Execution';
|
||||
$lang->ai->dataSource['execution']['execution']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['execution']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['execution']['execution']['estimate'] = 'Estimated hours';
|
||||
|
||||
$lang->ai->dataSource['execution']['tasks']['common'] = 'Task List';
|
||||
$lang->ai->dataSource['execution']['tasks']['name'] = 'Name';
|
||||
$lang->ai->dataSource['execution']['tasks']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['execution']['tasks']['status'] = 'Status';
|
||||
$lang->ai->dataSource['execution']['tasks']['estimate'] = 'Estimated hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['consumed'] = 'Consumed hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['left'] = 'Remaining hours';
|
||||
$lang->ai->dataSource['execution']['tasks']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['execution']['tasks']['estStarted'] = 'Estimated start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['realStarted'] = 'Actual start date';
|
||||
$lang->ai->dataSource['execution']['tasks']['finishedDate'] = 'Finished date';
|
||||
$lang->ai->dataSource['execution']['tasks']['closedReason'] = 'Closing reason';
|
||||
|
||||
$lang->ai->dataSource['task']['task']['common'] = 'Task';
|
||||
$lang->ai->dataSource['task']['task']['name'] = 'Name';
|
||||
$lang->ai->dataSource['task']['task']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['task']['task']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['task']['task']['status'] = 'Status';
|
||||
$lang->ai->dataSource['task']['task']['estimate'] = 'Estimates';
|
||||
$lang->ai->dataSource['task']['task']['consumed'] = 'Consumed';
|
||||
$lang->ai->dataSource['task']['task']['left'] = 'Left';
|
||||
$lang->ai->dataSource['task']['task']['progress'] = 'Progress';
|
||||
$lang->ai->dataSource['task']['task']['estStarted'] = 'Start Date';
|
||||
$lang->ai->dataSource['task']['task']['realStarted'] = 'Actual Start';
|
||||
|
||||
$lang->ai->dataSource['case']['case']['common'] = 'Test Case';
|
||||
$lang->ai->dataSource['case']['case']['title'] = 'Title';
|
||||
$lang->ai->dataSource['case']['case']['precondition'] = 'Prerequisite';
|
||||
$lang->ai->dataSource['case']['case']['scene'] = 'Scene';
|
||||
$lang->ai->dataSource['case']['case']['product'] = 'Product';
|
||||
$lang->ai->dataSource['case']['case']['module'] = 'Module';
|
||||
$lang->ai->dataSource['case']['case']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['case']['case']['type'] = 'Type';
|
||||
$lang->ai->dataSource['case']['case']['lastRunResult'] = 'Result';
|
||||
$lang->ai->dataSource['case']['case']['status'] = 'Status';
|
||||
|
||||
$lang->ai->dataSource['case']['steps']['common'] = 'Steps';
|
||||
$lang->ai->dataSource['case']['steps']['desc'] = 'Description';
|
||||
$lang->ai->dataSource['case']['steps']['expect'] = 'Expectation';
|
||||
|
||||
$lang->ai->dataSource['bug']['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['bug']['bug']['title'] = 'Title';
|
||||
$lang->ai->dataSource['bug']['bug']['steps'] = 'Repro Steps';
|
||||
$lang->ai->dataSource['bug']['bug']['severity'] = 'Severity';
|
||||
$lang->ai->dataSource['bug']['bug']['pri'] = 'Priority';
|
||||
$lang->ai->dataSource['bug']['bug']['status'] = 'Status';
|
||||
$lang->ai->dataSource['bug']['bug']['confirmed'] = 'Confirmed';
|
||||
$lang->ai->dataSource['bug']['bug']['type'] = 'Type';
|
||||
|
||||
$lang->ai->dataSource['doc']['doc']['common'] = 'Document';
|
||||
$lang->ai->dataSource['doc']['doc']['title'] = 'Title';
|
||||
$lang->ai->dataSource['doc']['doc']['content'] = 'Text';
|
||||
$lang->ai->dataSource['doc']['doc']['addedBy'] = 'Created By';
|
||||
$lang->ai->dataSource['doc']['doc']['addedDate'] = 'Created Date';
|
||||
$lang->ai->dataSource['doc']['doc']['editedBy'] = 'Edited By';
|
||||
$lang->ai->dataSource['doc']['doc']['editedDate'] = 'Edited Date';
|
||||
|
||||
/* Target form definition. See `$config->ai->targetForm`. */
|
||||
$lang->ai->targetForm = array();
|
||||
$lang->ai->targetForm['product']['common'] = 'Product';
|
||||
$lang->ai->targetForm['story']['common'] = 'Story';
|
||||
$lang->ai->targetForm['productplan']['common'] = 'Plan';
|
||||
$lang->ai->targetForm['projectrelease']['common'] = 'Release';
|
||||
$lang->ai->targetForm['project']['common'] = 'Project';
|
||||
$lang->ai->targetForm['execution']['common'] = 'Execution';
|
||||
$lang->ai->targetForm['task']['common'] = 'Task';
|
||||
$lang->ai->targetForm['testcase']['common'] = 'Test Case';
|
||||
$lang->ai->targetForm['bug']['common'] = 'Bug';
|
||||
$lang->ai->targetForm['doc']['common'] = 'Document';
|
||||
|
||||
$lang->ai->targetForm['product']['tree/managechild'] = 'Manage Modules';
|
||||
$lang->ai->targetForm['product']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['story']['create'] = 'Create Story';
|
||||
$lang->ai->targetForm['story']['batchcreate'] = 'Batch Create Story';
|
||||
$lang->ai->targetForm['story']['change'] = 'Change Story';
|
||||
$lang->ai->targetForm['story']['totask'] = 'Story to Task';
|
||||
$lang->ai->targetForm['story']['testcasecreate'] = 'Create Test Case';
|
||||
$lang->ai->targetForm['story']['subdivide'] = 'Subdivide Story';
|
||||
|
||||
$lang->ai->targetForm['productplan']['edit'] = 'Edit Plan';
|
||||
$lang->ai->targetForm['productplan']['create'] = 'Create Sub-Plan';
|
||||
|
||||
$lang->ai->targetForm['projectrelease']['doc/create'] = 'Create Doc';
|
||||
|
||||
$lang->ai->targetForm['project']['risk/create'] = 'Create Risk';
|
||||
$lang->ai->targetForm['project']['issue/create'] = 'Create Issue';
|
||||
$lang->ai->targetForm['project']['doc/create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['project']['programplan/create'] = 'Set Program Plan';
|
||||
|
||||
$lang->ai->targetForm['execution']['batchcreatetask'] = 'Batch Create Task';
|
||||
$lang->ai->targetForm['execution']['createtestreport'] = 'Create Test Report';
|
||||
$lang->ai->targetForm['execution']['createqa'] = 'Create QA';
|
||||
$lang->ai->targetForm['execution']['createrisk'] = 'Create Risk';
|
||||
$lang->ai->targetForm['execution']['createissue'] = 'Create Issue';
|
||||
|
||||
$lang->ai->targetForm['task']['edit'] = 'Edit Task';
|
||||
$lang->ai->targetForm['task']['batchcreate'] = 'Batch Create Task';
|
||||
|
||||
$lang->ai->targetForm['testcase']['edit'] = 'Edit Test Case';
|
||||
$lang->ai->targetForm['testcase']['createscript'] = 'Create Script';
|
||||
|
||||
$lang->ai->targetForm['bug']['edit'] = 'Edit Bug';
|
||||
$lang->ai->targetForm['bug']['story/create'] = 'Bug to Story';
|
||||
$lang->ai->targetForm['bug']['testcase/create'] = 'Bug to Test Case';
|
||||
|
||||
$lang->ai->targetForm['doc']['create'] = 'Create Doc';
|
||||
$lang->ai->targetForm['doc']['edit'] = 'Edit Doc';
|
||||
|
||||
$lang->ai->prompts->statuses = array();
|
||||
$lang->ai->prompts->statuses[''] = 'All';
|
||||
$lang->ai->prompts->statuses['draft'] = 'Draft';
|
||||
$lang->ai->prompts->statuses['active'] = 'Active';
|
||||
|
||||
$lang->ai->prompts->modules = array();
|
||||
$lang->ai->prompts->modules[''] = 'All';
|
||||
// $lang->ai->prompts->modules['my'] = 'My';
|
||||
$lang->ai->prompts->modules['product'] = 'Product';
|
||||
$lang->ai->prompts->modules['project'] = 'Project';
|
||||
$lang->ai->prompts->modules['story'] = 'Story';
|
||||
$lang->ai->prompts->modules['productplan'] = 'Product Plan';
|
||||
$lang->ai->prompts->modules['release'] = 'Release';
|
||||
$lang->ai->prompts->modules['execution'] = 'Execution';
|
||||
$lang->ai->prompts->modules['task'] = 'Task';
|
||||
$lang->ai->prompts->modules['case'] = 'Test Case';
|
||||
$lang->ai->prompts->modules['bug'] = 'Bug';
|
||||
$lang->ai->prompts->modules['doc'] = 'Document';
|
||||
|
||||
$lang->ai->conversations = new stdclass();
|
||||
$lang->ai->conversations->common = 'Conversations';
|
||||
|
||||
$lang->ai->miniPrograms = new stdClass();
|
||||
$lang->ai->miniPrograms->common = 'Mini Programs';
|
||||
$lang->ai->miniPrograms->emptyList = 'There is currently no mini program available.';
|
||||
$lang->ai->miniPrograms->create = 'Create A Program';
|
||||
$lang->ai->miniPrograms->configuration = 'Basic Information Configuration';
|
||||
$lang->ai->miniPrograms->downloadTip = 'After release, it will be displayed on the AI mini program Square and will be automatically synchronized to the client.';
|
||||
$lang->ai->miniPrograms->download = 'Download Zentao Client';
|
||||
$lang->ai->miniPrograms->category = 'Category';
|
||||
$lang->ai->miniPrograms->icon = 'Icon';
|
||||
$lang->ai->miniPrograms->desc = 'Introduction';
|
||||
$lang->ai->miniPrograms->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->ai->miniPrograms->allCategories = array('' => 'All categories');
|
||||
$lang->ai->miniPrograms->collect = 'Collect';
|
||||
$lang->ai->miniPrograms->more = 'More';
|
||||
$lang->ai->miniPrograms->iconModification = 'Icon modification';
|
||||
$lang->ai->miniPrograms->customBackground = 'Custom background Color';
|
||||
$lang->ai->miniPrograms->customIcon = 'Custom icon';
|
||||
$lang->ai->miniPrograms->backToListPage = 'Return to list page';
|
||||
$lang->ai->miniPrograms->lastStep = 'Previous step';
|
||||
$lang->ai->miniPrograms->backToListPageTip = 'The parameter configuration for selecting the object has been changed. Do you want to save and return?';
|
||||
$lang->ai->miniPrograms->saveAndBack = 'Save and Go Back';
|
||||
$lang->ai->miniPrograms->publishConfirm = array('Are you sure you want to publish?', 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.');
|
||||
$lang->ai->miniPrograms->emptyPrompterTip = 'The prompter of the mini program is empty. Please edit it before publishing.';
|
||||
$lang->ai->miniPrograms->maintenanceGroup = 'Maintenance mini program group';
|
||||
|
||||
$lang->ai->miniPrograms->latestPublishedDate = 'Latest Published Date';
|
||||
$lang->ai->miniPrograms->deleteTip = 'Are you sure you want to delete this mini program?';
|
||||
$lang->ai->miniPrograms->disableTip = 'Disabling the mini program will prevent users from accessing it. Are you sure you want to disable it?';
|
||||
$lang->ai->miniPrograms->publishTip = 'After release, it will be displayed in the first-level navigation AI module, and the client will be updated simultaneously.';
|
||||
$lang->ai->miniPrograms->unpublishedTip = 'The mini program you are using is not published.';
|
||||
|
||||
$lang->ai->miniPrograms->placeholder = new stdClass();
|
||||
$lang->ai->miniPrograms->placeholder->name = 'Please enter a small program name';
|
||||
$lang->ai->miniPrograms->placeholder->desc = 'Please enter a brief introduction to the miniprograms';
|
||||
$lang->ai->miniPrograms->placeholder->default = 'Please fill in the prompt, the default is "please enter"';
|
||||
$lang->ai->miniPrograms->placeholder->input = 'Please enter';
|
||||
$lang->ai->miniPrograms->placeholder->prompt = 'Please enter prompt design';
|
||||
$lang->ai->miniPrograms->placeholder->asking = 'Continue asking';
|
||||
|
||||
$lang->ai->miniPrograms->deleteFieldTip = 'Are you sure to delete this field?';
|
||||
|
||||
$lang->ai->miniPrograms->field = new stdClass();
|
||||
$lang->ai->miniPrograms->field->name = 'Field name';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameTip = 'This name is already used, please try another name';
|
||||
$lang->ai->miniPrograms->field->type = 'control type';
|
||||
$lang->ai->miniPrograms->field->typeList = array('text' => 'single-line text', 'textarea' => 'multi-line text', 'radio' => 'single-selection', 'checkbox' => 'multi-selection');
|
||||
$lang->ai->miniPrograms->field->placeholder = 'Fill hints';
|
||||
$lang->ai->miniPrograms->field->required = 'Required';
|
||||
$lang->ai->miniPrograms->field->requiredOptions = array('No', 'Yes');
|
||||
$lang->ai->miniPrograms->field->add = 'New field';
|
||||
$lang->ai->miniPrograms->field->addTip = 'Please click here to add field information';
|
||||
$lang->ai->miniPrograms->field->edit = 'Edit field';
|
||||
$lang->ai->miniPrograms->field->configuration = 'Field Configuration area';
|
||||
$lang->ai->miniPrograms->field->debug = 'debug area';
|
||||
$lang->ai->miniPrograms->field->preview = 'Preview area';
|
||||
$lang->ai->miniPrograms->field->option = 'Options';
|
||||
$lang->ai->miniPrograms->field->contentDebugging = 'Content debugging';
|
||||
$lang->ai->miniPrograms->field->contentDebuggingTip = 'Please enter the field here to debug.';
|
||||
$lang->ai->miniPrograms->field->prompterDesign = 'Prompterdesign';
|
||||
$lang->ai->miniPrograms->field->prompterDesignTip = 'The <> symbol is used to reference the configured field. Space is used before and after <>.';
|
||||
$lang->ai->miniPrograms->field->prompterPreview = 'Prompterpreview';
|
||||
$lang->ai->miniPrograms->field->generateResult = 'Generate result';
|
||||
$lang->ai->miniPrograms->field->resultPreview = 'Result Preview';
|
||||
|
||||
$lang->ai->miniPrograms->field->default = array(
|
||||
'Role',
|
||||
'Scene',
|
||||
'Objective',
|
||||
'As a <Role>, I hope to <Objective> in <Scene>.'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->field->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameWarning = 'Duplicate 「%s」';
|
||||
$lang->ai->miniPrograms->field->emptyOptionWarning = 'Please configure at least one option';
|
||||
|
||||
$lang->ai->miniPrograms->statuses = array(
|
||||
'' => 'all',
|
||||
'draft' => 'unpublished',
|
||||
'active' => 'published',
|
||||
'createdByMe' => 'Created by me'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->publishedOptions = array('unpublished', 'published');
|
||||
$lang->ai->miniPrograms->optionName = 'Option name';
|
||||
$lang->ai->miniPrograms->promptTemplate = 'Prompt template';
|
||||
$lang->ai->miniPrograms->fieldConfiguration = 'Field configuration';
|
||||
$lang->ai->miniPrograms->summary = 'There are %s small programs on this page.';
|
||||
$lang->ai->miniPrograms->generate = 'Generate';
|
||||
$lang->ai->miniPrograms->regenerate = 'Regenerate';
|
||||
$lang->ai->miniPrograms->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->ai->miniPrograms->clearContext = 'The context content has been cleared.';
|
||||
$lang->ai->miniPrograms->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->ai->miniPrograms->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->ai->miniPrograms->chatNoResponse = 'Something went wrong.';
|
||||
|
||||
$lang->ai->models = new stdclass();
|
||||
$lang->ai->models->title = 'Language Model Configuration';
|
||||
$lang->ai->models->common = 'Language Model';
|
||||
$lang->ai->models->name = 'Name';
|
||||
$lang->ai->models->type = 'Model';
|
||||
$lang->ai->models->vendor = 'Vendor';
|
||||
$lang->ai->models->base = 'API Base URL';
|
||||
$lang->ai->models->key = 'API Key';
|
||||
$lang->ai->models->secret = 'Secret Key';
|
||||
$lang->ai->models->resource = 'Resource';
|
||||
$lang->ai->models->deployment = 'Deployment';
|
||||
$lang->ai->models->proxyType = 'Proxy Type';
|
||||
$lang->ai->models->proxyAddr = 'Proxy Address';
|
||||
$lang->ai->models->description = 'Description';
|
||||
$lang->ai->models->createdDate = 'Creation Date';
|
||||
$lang->ai->models->createdBy = 'Created By';
|
||||
$lang->ai->models->editedDate = 'Modification Date';
|
||||
$lang->ai->models->editedBy = 'Edited By';
|
||||
$lang->ai->models->usesProxy = 'Use Proxy';
|
||||
$lang->ai->models->testConnection = 'Test Connection';
|
||||
$lang->ai->models->unconfigured = 'Unconfigured';
|
||||
$lang->ai->models->create = 'Create Model';
|
||||
$lang->ai->models->edit = 'Edit Parameters';
|
||||
$lang->ai->models->view = 'View Details';
|
||||
$lang->ai->models->enable = 'Enable Language Model';
|
||||
$lang->ai->models->disable = 'Disable Language Model';
|
||||
$lang->ai->models->details = 'Model Details';
|
||||
$lang->ai->models->concealTip = 'Visible when editing';
|
||||
$lang->ai->models->upgradeBiz = 'For more AI features, all in <a target="_blank" href="https://www.zentao.net/page/enterprise.html" class="text-blue">ZenTao Biz</a>.';
|
||||
$lang->ai->models->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->ai->models->noModels = 'There is currently no language model.';
|
||||
$lang->ai->models->confirmDelete = 'Are you sure you want to delete this language model?';
|
||||
$lang->ai->models->confirmDisable = 'Are you sure you want to disable this language model?';
|
||||
$lang->ai->models->default = 'Default model';
|
||||
$lang->ai->models->defaultTip = 'The default language model (the first available language model) will be used to run prompts and mini programs that are not specified with a language model, and will also be used for chat.';
|
||||
|
||||
$lang->ai->models->testConnectionResult = new stdclass();
|
||||
$lang->ai->models->testConnectionResult->success = 'Successfully connected';
|
||||
$lang->ai->models->testConnectionResult->fail = 'Failed to connect';
|
||||
$lang->ai->models->testConnectionResult->failFormat = 'Failed to connect: %s';
|
||||
|
||||
$lang->ai->models->statusList = array();
|
||||
$lang->ai->models->statusList['0'] = 'Disabled';
|
||||
$lang->ai->models->statusList['off'] = 'Disabled';
|
||||
$lang->ai->models->statusList['1'] = 'Enabled';
|
||||
$lang->ai->models->statusList['on'] = 'Enabled';
|
||||
|
||||
$lang->ai->models->proxyStatusList = array();
|
||||
$lang->ai->models->proxyStatusList['0'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['off'] = 'No';
|
||||
$lang->ai->models->proxyStatusList['1'] = 'Yes';
|
||||
$lang->ai->models->proxyStatusList['on'] = 'Yes';
|
||||
|
||||
$lang->ai->models->typeList = array();
|
||||
$lang->ai->models->typeList['openai-gpt35'] = 'OpenAI / GPT-3.5';
|
||||
$lang->ai->models->typeList['openai-gpt4'] = 'OpenAI / GPT-4';
|
||||
$lang->ai->models->typeList['baidu-ernie'] = 'Baidu / ERNIE';
|
||||
|
||||
$lang->ai->models->vendorList = new stdclass();
|
||||
$lang->ai->models->vendorList->{'openai-gpt35'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'openai-gpt4'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => 'Custom');
|
||||
$lang->ai->models->vendorList->{'baidu-ernie'} = array('baidu' => 'Baidu Qianfan LLM Platform');
|
||||
|
||||
$lang->ai->models->vendorTips = new stdclass();
|
||||
$lang->ai->models->vendorTips->azure = 'OpenAI GPT version is specified during model deployment creation on Azure.';
|
||||
$lang->ai->models->vendorTips->openaiCompatible = 'Custom API needs to support Function Calling, otherwise some functions may not work properly.';
|
||||
|
||||
$lang->ai->models->proxyTypes = array();
|
||||
$lang->ai->models->proxyTypes[''] = 'No Proxy';
|
||||
$lang->ai->models->proxyTypes['socks5'] = 'SOCKS5';
|
||||
|
||||
$lang->ai->models->promptFor = 'Prompt for %s';
|
||||
|
||||
$lang->ai->designStepNav = array();
|
||||
$lang->ai->designStepNav['assignrole'] = 'Specify Role';
|
||||
$lang->ai->designStepNav['selectdatasource'] = 'Select Object';
|
||||
$lang->ai->designStepNav['setpurpose'] = 'Confirm Action';
|
||||
$lang->ai->designStepNav['settargetform'] = 'Process Result';
|
||||
$lang->ai->designStepNav['finalize'] = 'Ready to Publish';
|
||||
|
||||
$lang->ai->dataTypeDesc = '%s is %s type, %s';
|
||||
|
||||
$lang->ai->dataType = new stdclass();
|
||||
$lang->ai->dataType->pri = new stdClass();
|
||||
$lang->ai->dataType->pri->type = 'numeric';
|
||||
$lang->ai->dataType->pri->desc = '1 is the highest priority, 4 is the lowest priority.';
|
||||
|
||||
$lang->ai->dataType->estimate = new stdClass();
|
||||
$lang->ai->dataType->estimate->type = 'numeric';
|
||||
$lang->ai->dataType->estimate->desc = 'Unit is in hours.';
|
||||
|
||||
$lang->ai->dataType->consumed = $lang->ai->dataType->estimate;
|
||||
$lang->ai->dataType->left = $lang->ai->dataType->estimate;
|
||||
|
||||
$lang->ai->dataType->progress = new stdClass();
|
||||
$lang->ai->dataType->progress->type = 'percentage';
|
||||
$lang->ai->dataType->progress->desc = '0 means not started, 100 means completed.';
|
||||
|
||||
$lang->ai->dataType->datetime = new stdClass();
|
||||
$lang->ai->dataType->datetime->type = 'datetime';
|
||||
$lang->ai->dataType->datetime->desc = 'Format is: 1970-01-01 00:00:01, or leave it blank.';
|
||||
|
||||
$lang->ai->dataType->estStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
|
||||
|
||||
$lang->ai->demoData = new stdclass();
|
||||
$lang->ai->demoData->notExist = 'The demo data does not exist for now.';
|
||||
$lang->ai->demoData->story = array(
|
||||
'story' => array(
|
||||
'title' => 'Develop an online learning platform',
|
||||
'spec' => 'We need to develop an online learning platform that provides course management, student management, teacher management, and other functions.',
|
||||
'verify' => '1. All functions can operate properly without any obvious errors or abnormalities.2. The interface is aesthetically pleasing and user-friendly.3. The platform can meet user needs and has a high level of user satisfaction.4. The code has good quality, with clear structure and easy maintenance.',
|
||||
'module' => 7,
|
||||
'pri' => 1,
|
||||
'estimate' => 1,
|
||||
'product' => 1,
|
||||
'category' => 'feature',
|
||||
),
|
||||
);
|
||||
$lang->ai->demoData->execution = array(
|
||||
'execution' => array(
|
||||
'name' => 'Online Learning Platform Software Development',
|
||||
'desc' => 'This plan aims to develop an online learning platform software that provides accessible learning resources, including text, video, and audio, as well as some learning tools such as exams, tests, and discussion forums.',
|
||||
'estimate' => 7,
|
||||
),
|
||||
'tasks' => array(
|
||||
0 =>
|
||||
array(
|
||||
'name' => 'Technology Selection',
|
||||
'pri' => 1,
|
||||
'status' => 'done',
|
||||
'estimate' => 1,
|
||||
'consumed' => 1,
|
||||
'left' => 0,
|
||||
'progress' => 100,
|
||||
'estStarted' => '2023-07-02 00:00:00',
|
||||
'realStarted' => '2023-07-02 00:00:00',
|
||||
'finishedDate' => '2023-07-02 00:00:00',
|
||||
'closedReason' => 'Completed',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'name' => 'UI Design',
|
||||
'pri' => 1,
|
||||
'status' => 'doing',
|
||||
'estimate' => 2,
|
||||
'consumed' => 1,
|
||||
'left' => 1,
|
||||
'progress' => 50,
|
||||
'estStarted' => '2023-07-03 00:00:00',
|
||||
'realStarted' => '2023-07-03 00:00:00',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'name' => 'Development',
|
||||
'pri' => 1,
|
||||
'status' => 'wait',
|
||||
'estimate' => 1,
|
||||
'consumed' => 0,
|
||||
'left' => 1,
|
||||
'progress' => 0,
|
||||
'estStarted' => '',
|
||||
'realStarted' => '',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Forms as JSON Schemas. */
|
||||
$lang->ai->formSchema = array();
|
||||
$lang->ai->formSchema['story']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->title = 'Story';
|
||||
$lang->ai->formSchema['story']['create']->type = 'object';
|
||||
$lang->ai->formSchema['story']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->spec = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->verify = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->title->description = 'Title of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->description = 'Description of story';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->description = 'Acceptance criteria of story';
|
||||
$lang->ai->formSchema['story']['create']->required = array('title', 'spec', 'verify');
|
||||
$lang->ai->formSchema['story']['change'] = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['story']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->title = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->type = 'array';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->description = 'Stories';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->items = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['productplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->title = 'Product Plan';
|
||||
$lang->ai->formSchema['productplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['productplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->description = 'Title of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->description = 'Begin date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->type = 'date';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->description = 'End date of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->description = 'Description of product plan';
|
||||
$lang->ai->formSchema['productplan']['create']->required = array('title', 'begin', 'end');
|
||||
$lang->ai->formSchema['productplan']['edit'] = $lang->ai->formSchema['productplan']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->title = 'Task';
|
||||
$lang->ai->formSchema['task']['create']->type = 'object';
|
||||
$lang->ai->formSchema['task']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->name = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->description = 'Type of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->enum = array('design', 'devel', 'request', 'test', 'study', 'discuss', 'ui', 'affair', 'misc');
|
||||
$lang->ai->formSchema['task']['create']->properties->name->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->name->description = 'Name of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->description = 'Description of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->description = 'Priority of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->type = 'number';
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->description = 'Estimated hours of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->description = 'Begin date of task';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->description = 'End date of task';
|
||||
$lang->ai->formSchema['task']['create']->required = array('type', 'name');
|
||||
$lang->ai->formSchema['task']['edit'] = $lang->ai->formSchema['task']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->title = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->type = 'array';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->description = 'Tasks';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items = $lang->ai->formSchema['task']['create'];
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->estStarted = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin;
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->deadline = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end;
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin);
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end);
|
||||
|
||||
$lang->ai->formSchema['bug']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->title = 'Bug';
|
||||
$lang->ai->formSchema['bug']['create']->type = 'object';
|
||||
$lang->ai->formSchema['bug']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->description = 'Title of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->description = 'Repro steps of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->description = 'Severity of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->description = 'Priority of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->description = 'Affected builds of bug';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->enum = array('trunk');
|
||||
$lang->ai->formSchema['bug']['create']->required = array('title', 'steps', 'severity', 'pri', 'openedBuild');
|
||||
$lang->ai->formSchema['bug']['edit'] = $lang->ai->formSchema['bug']['create'];
|
||||
|
||||
$lang->ai->formSchema['testcase']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->title = 'Test Case';
|
||||
$lang->ai->formSchema['testcase']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->description = 'Type of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->enum = array('feature', 'performance', 'config', 'install', 'security', 'interface', 'unit', 'other');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->description = 'Stage of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->enum = array('unittest', 'feature', 'intergrate', 'system', 'smoke', 'bvt');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->description = 'Title of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->description = 'Precondition of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->type = 'array';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->description = 'Steps of test case';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->description = 'Step description';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->description = 'Expectation of step';
|
||||
$lang->ai->formSchema['testcase']['create']->required = array('type', 'title', 'steps');
|
||||
$lang->ai->formSchema['testcase']['edit'] = $lang->ai->formSchema['testcase']['create'];
|
||||
|
||||
$lang->ai->formSchema['testreport']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->title = 'Test Report';
|
||||
$lang->ai->formSchema['testreport']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testreport']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->description = 'Begin date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->description = 'End date of testing';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->description = 'Title of test report';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->description = 'Report content';
|
||||
$lang->ai->formSchema['testreport']['create']->required = array('begin', 'end', 'title', 'report');
|
||||
$lang->ai->formSchema['execution']['testreport'] = $lang->ai->formSchema['testreport']['create'];
|
||||
|
||||
$lang->ai->formSchema['doc']['edit'] = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->title = 'Document';
|
||||
$lang->ai->formSchema['doc']['edit']->type = 'object';
|
||||
$lang->ai->formSchema['doc']['edit']->properties = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->description = 'Title of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->description = 'Content of the document';
|
||||
$lang->ai->formSchema['doc']['edit']->required = array('title', 'content');
|
||||
|
||||
$lang->ai->formSchema['tree']['browse'] = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->type = 'object';
|
||||
$lang->ai->formSchema['tree']['browse']->properties = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->type = 'array';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->title = 'Modules';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items->type = 'string';
|
||||
$lang->ai->formSchema['tree']['browse']->required = array('modules');
|
||||
|
||||
$lang->ai->formSchema['programplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->title = 'Program Plan';
|
||||
$lang->ai->formSchema['programplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->type = 'array';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->title = 'Plans';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->description = 'Name of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->description = 'Attribute of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->enum = array('request', 'design', 'dev', 'qa', 'release', 'review', 'other');
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->type = 'boolean';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->description = 'Is milestone?';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->description = 'Begin date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->description = 'End date of stage';
|
||||
$lang->ai->formSchema['programplan']['create']->required = array('stages');
|
||||
|
||||
$lang->ai->promptMenu = new stdclass();
|
||||
$lang->ai->promptMenu->dropdownTitle = 'AI';
|
||||
|
||||
$lang->ai->dataInject = new stdclass();
|
||||
$lang->ai->dataInject->success = 'Prompt execution results are filled in.';
|
||||
$lang->ai->dataInject->fail = 'Failed to fill in prompt execution results.';
|
||||
|
||||
$lang->ai->execute = new stdclass();
|
||||
$lang->ai->execute->loading = 'Prompt executing...';
|
||||
$lang->ai->execute->auditing = 'Getting ready for auditing...';
|
||||
$lang->ai->execute->success = 'Prompt executed.';
|
||||
$lang->ai->execute->fail = 'Prompt execution failed.';
|
||||
$lang->ai->execute->failFormat = 'Prompt execution failed: %s.';
|
||||
$lang->ai->execute->failReasons = array();
|
||||
$lang->ai->execute->failReasons['noPrompt'] = 'unable to get prompt';
|
||||
$lang->ai->execute->failReasons['noObjectData'] = 'unable to get object data';
|
||||
$lang->ai->execute->failReasons['noResponse'] = 'no response from external service';
|
||||
$lang->ai->execute->failReasons['noTargetForm'] = 'unable to get target form or its required fields';
|
||||
$lang->ai->execute->executeErrors = array();
|
||||
$lang->ai->execute->executeErrors['-1'] = 'unable to get prompt';
|
||||
$lang->ai->execute->executeErrors['-2'] = 'unable to get object data';
|
||||
$lang->ai->execute->executeErrors['-3'] = 'failed to serialize object data';
|
||||
$lang->ai->execute->executeErrors['-4'] = 'unable to find available model';
|
||||
$lang->ai->execute->executeErrors['-5'] = 'unable to get target form schema';
|
||||
$lang->ai->execute->executeErrors['-6'] = 'request failed or API returned error';
|
||||
|
||||
$lang->ai->audit = new stdclass();
|
||||
$lang->ai->audit->designPrompt = 'Prompt Design';
|
||||
$lang->ai->audit->afterSave = 'After saving,';
|
||||
$lang->ai->audit->regenerate = 'Regenerate';
|
||||
$lang->ai->audit->exit = 'Exit Audit';
|
||||
|
||||
$lang->ai->audit->backLocationList = array();
|
||||
$lang->ai->audit->backLocationList[0] = 'back to audit page.';
|
||||
$lang->ai->audit->backLocationList[1] = 'back to audit page and regenerate.';
|
||||
|
||||
$lang->ai->engineeredPrompts = new stdclass();
|
||||
$lang->ai->engineeredPrompts->askForFunctionCalling = array((object)array('role' => 'user', 'content' => 'Please convert my next message into a function call.'), (object)array('role' => 'assistant', 'content' => 'Sure, I\'ll convert your next message into a function call.'));
|
||||
|
||||
$lang->ai->aiResponseException = array();
|
||||
$lang->ai->aiResponseException['notFunctionCalling'] = 'The response is not a function calling';
|
||||
@@ -0,0 +1,965 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module zh-cn lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->ai->common = 'AI配置';
|
||||
|
||||
/* Definitions of table columns, used to sprintf error messages to dao::$errors. */
|
||||
$lang->prompt = new stdclass();
|
||||
$lang->prompt->name = '名称';
|
||||
$lang->prompt->desc = '描述';
|
||||
$lang->prompt->model = '语言模型';
|
||||
$lang->prompt->module = '所属分组';
|
||||
$lang->prompt->source = '对象数据';
|
||||
$lang->prompt->targetForm = '目标表单';
|
||||
$lang->prompt->purpose = '操作';
|
||||
$lang->prompt->elaboration = '补充要求';
|
||||
$lang->prompt->role = '角色';
|
||||
$lang->prompt->characterization = '角色描述';
|
||||
$lang->prompt->status = '阶段';
|
||||
$lang->prompt->createdBy = '由谁创建';
|
||||
$lang->prompt->createdDate = '创建时间';
|
||||
$lang->prompt->editedBy = '最后编辑';
|
||||
$lang->prompt->editedDate = '编辑时间';
|
||||
$lang->prompt->deleted = '是否已删除';
|
||||
|
||||
/* Lang for privs, keys are paired with privlang items. */
|
||||
$lang->ai->modelBrowse = '浏览语言模型';
|
||||
$lang->ai->modelView = '查看语言模型详情';
|
||||
$lang->ai->modelCreate = '创建语言模型';
|
||||
$lang->ai->modelEdit = '编辑语言模型';
|
||||
$lang->ai->modelEnable = '启用语言模型';
|
||||
$lang->ai->modelDisable = '禁用语言模型';
|
||||
$lang->ai->modelDelete = '删除语言模型';
|
||||
$lang->ai->modelTestConnection = '测试连接';
|
||||
$lang->ai->promptCreate = '创建提词';
|
||||
$lang->ai->promptEdit = '编辑提词';
|
||||
$lang->ai->promptDelete = '删除提词';
|
||||
$lang->ai->promptAssignRole = '指定角色';
|
||||
$lang->ai->promptSelectDataSource = '选择对象';
|
||||
$lang->ai->promptSetPurpose = '确认操作';
|
||||
$lang->ai->promptSetTargetForm = '结果处理';
|
||||
$lang->ai->promptFinalize = '准备发布';
|
||||
$lang->ai->promptAudit = '调试提词';
|
||||
$lang->ai->promptPublish = '发布提词';
|
||||
$lang->ai->promptUnpublish = '取消发布提词';
|
||||
$lang->ai->promptBrowse = '浏览提词列表';
|
||||
$lang->ai->promptView = '查看提词详情';
|
||||
$lang->ai->promptExecute = '执行提词';
|
||||
$lang->ai->promptExecutionReset = '重置调试';
|
||||
$lang->ai->roleTemplates = '管理角色模板';
|
||||
$lang->ai->chat = '聊天';
|
||||
$lang->ai->createMiniProgram = '创建AI小程序';
|
||||
$lang->ai->editMiniProgram = '编辑AI小程序';
|
||||
$lang->ai->testMiniProgram = '调试AI小程序';
|
||||
$lang->ai->miniProgramList = '浏览AI小程序列表';
|
||||
$lang->ai->miniProgramView = '查看AI小程序详情';
|
||||
$lang->ai->publishMiniProgram = '发布AI小程序';
|
||||
$lang->ai->unpublishMiniProgram = '下架AI小程序';
|
||||
$lang->ai->deleteMiniProgram = '删除AI小程序';
|
||||
$lang->ai->exportMiniProgram = '导出AI小程序';
|
||||
$lang->ai->importMiniProgram = '导入AI小程序';
|
||||
$lang->ai->editMiniProgramCategory = '维护分组';
|
||||
|
||||
$lang->ai->export = '导出';
|
||||
$lang->ai->import = '导入';
|
||||
$lang->ai->saveFail = '保存失败';
|
||||
$lang->ai->installPackage = '安装包';
|
||||
$lang->ai->toPublish = '安装后发布';
|
||||
$lang->ai->toZentaoStoreAIPage = '点击可跳转至禅道官网应用商店AI小程序页面';
|
||||
|
||||
$lang->ai->chatPlaceholderMessage = 'Hi,我是 AI 助手阿道,您可以问我任何问题。';
|
||||
$lang->ai->chatPlaceholderInput = '问问阿道…';
|
||||
$lang->ai->chatSystemMessage = '你叫阿道,是禅道的 AI 助手兼吉祥物,你可以回答用户的问题和与用户聊天。你当前所处的环境是禅道项目管理软件。';
|
||||
$lang->ai->chatSend = '发送';
|
||||
$lang->ai->chatReset = '清空';
|
||||
$lang->ai->chatNoResponse = '会话发生了错误,<a id="retry" class="text-blue">点击这里重试</a>。';
|
||||
$lang->ai->noMiniProgram = '您访问的小程序不存在';
|
||||
|
||||
$lang->ai->nextStep = '下一步';
|
||||
$lang->ai->goTesting = '去调试';
|
||||
$lang->ai->maintenanceGroup = '维护分组';
|
||||
|
||||
$lang->ai->maintenanceGroupDuplicated = '分组名不能重复';
|
||||
|
||||
$lang->ai->validate = new stdclass();
|
||||
$lang->ai->validate->noEmpty = '%s不能为空。';
|
||||
$lang->ai->validate->dirtyForm = '%s的参数配置已变动,是否保存并返回?';
|
||||
$lang->ai->validate->nameNotUnique = '该名称已使用,请尝试其他名称。';
|
||||
|
||||
$lang->ai->prompts = new stdclass();
|
||||
$lang->ai->prompts->common = '提词';
|
||||
$lang->ai->prompts->emptyList = '暂时没有提词。';
|
||||
$lang->ai->prompts->create = '创建提词';
|
||||
$lang->ai->prompts->edit = '编辑提词';
|
||||
$lang->ai->prompts->id = 'ID';
|
||||
$lang->ai->prompts->name = '名称';
|
||||
$lang->ai->prompts->description = '描述';
|
||||
$lang->ai->prompts->createdBy = '创建者';
|
||||
$lang->ai->prompts->createdDate = '创建时间';
|
||||
$lang->ai->prompts->targetForm = '表单';
|
||||
$lang->ai->prompts->funcDesc = '功能描述';
|
||||
$lang->ai->prompts->deleted = '已删除';
|
||||
$lang->ai->prompts->stage = '阶段';
|
||||
$lang->ai->prompts->basicInfo = '基本信息';
|
||||
$lang->ai->prompts->editInfo = '创建编辑';
|
||||
$lang->ai->prompts->createdBy = '由谁创建';
|
||||
$lang->ai->prompts->publishedBy = '由谁发布';
|
||||
$lang->ai->prompts->draftedBy = '由谁下架';
|
||||
$lang->ai->prompts->lastEditor = '最后编辑';
|
||||
$lang->ai->prompts->modelNeutral = '通用';
|
||||
|
||||
$lang->ai->prompts->summary = '本页共 %s 个提词。';
|
||||
|
||||
$lang->ai->prompts->action = new stdclass();
|
||||
$lang->ai->prompts->action->goDesignConfirm = '当前提词未完成,是否继续设计?';
|
||||
$lang->ai->prompts->action->goDesign = '去设计';
|
||||
$lang->ai->prompts->action->draftConfirm = '下架后,提词将不能继续使用,您确定要下架吗?';
|
||||
$lang->ai->prompts->action->design = '设计';
|
||||
$lang->ai->prompts->action->test = '调试';
|
||||
$lang->ai->prompts->action->edit = '编辑';
|
||||
$lang->ai->prompts->action->publish = '发布';
|
||||
$lang->ai->prompts->action->unpublish = '下架';
|
||||
$lang->ai->prompts->action->delete = '删除';
|
||||
$lang->ai->prompts->action->disable = '禁用';
|
||||
$lang->ai->prompts->action->deleteConfirm = '删除后,提词将不能继续使用,您确定要删除吗?';
|
||||
$lang->ai->prompts->action->publishSuccess = '发布成功';
|
||||
|
||||
/* Steps of prompt creation. */
|
||||
$lang->ai->prompts->assignRole = '指定角色';
|
||||
$lang->ai->prompts->selectDataSource = '选择对象';
|
||||
$lang->ai->prompts->setPurpose = '确认操作';
|
||||
$lang->ai->prompts->setTargetForm = '结果处理';
|
||||
$lang->ai->prompts->finalize = '准备发布';
|
||||
|
||||
/* Role assigning. */
|
||||
$lang->ai->prompts->model = '语言模型';
|
||||
$lang->ai->prompts->role = '角色';
|
||||
$lang->ai->prompts->characterization = '角色描述';
|
||||
$lang->ai->prompts->rolePlaceholder = '“你来扮演 <一个什么角色>”';
|
||||
$lang->ai->prompts->charPlaceholder = '该角色的具体描述信息';
|
||||
$lang->ai->prompts->roleTemplate = '角色模版';
|
||||
$lang->ai->prompts->roleTemplateTip = '引用模板后,修改角色、角色描述不会对模板造成影响。';
|
||||
$lang->ai->prompts->addRoleTemplate = '添加角色模板';
|
||||
$lang->ai->prompts->editRoleTemplate = '编辑角色模板';
|
||||
$lang->ai->prompts->editRoleTemplateTip = '本次编辑不会影响已使用该模版的提词';
|
||||
$lang->ai->prompts->roleAddedSuccess = '角色模版保存成功';
|
||||
$lang->ai->prompts->roleDelConfirm = '删除不会影响已用角色模版的提词,是否删除?';
|
||||
$lang->ai->prompts->roleDelSuccess = '角色模板已删除';
|
||||
$lang->ai->prompts->roleTemplateSave = '存为角色模板';
|
||||
$lang->ai->prompts->roleTemplateSaveList = array();
|
||||
$lang->ai->prompts->roleTemplateSaveList['save'] = '保存';
|
||||
$lang->ai->prompts->roleTemplateSaveList['discard'] = '不保存';
|
||||
|
||||
/* Data source selecting. */
|
||||
$lang->ai->prompts->selectData = '选择字段';
|
||||
$lang->ai->prompts->selectDataTip = '选择对象后,此处会展示已选对象的字段。';
|
||||
$lang->ai->prompts->selectedFormat = '已选对象为{0},已选 {1} 条字段';
|
||||
$lang->ai->prompts->nonSelected = '暂无所选字段。';
|
||||
$lang->ai->prompts->sortTip = '可根据重要性给数据字段排序。';
|
||||
$lang->ai->prompts->object = '对象';
|
||||
$lang->ai->prompts->field = '字段';
|
||||
|
||||
/* Purpose setting. */
|
||||
$lang->ai->prompts->purpose = '操作';
|
||||
$lang->ai->prompts->purposeTip = '“我希望<它能完成什么事情,以便于达到什么样的目标>”';
|
||||
$lang->ai->prompts->elaboration = '补充要求';
|
||||
$lang->ai->prompts->elaborationTip = '“我希望<它的回答请注意一些补充要求>”';
|
||||
$lang->ai->prompts->inputPreview = '输入预览';
|
||||
$lang->ai->prompts->dataPreview = '对象数据预览';
|
||||
$lang->ai->prompts->rolePreview = '角色提词预览';
|
||||
$lang->ai->prompts->promptPreview = '操作提词预览';
|
||||
|
||||
/* Target form selecting. */
|
||||
$lang->ai->prompts->selectTargetForm = '选择表单';
|
||||
$lang->ai->prompts->selectTargetFormTip = '选择后,可以将大语言模型返回的结果直接录入到禅道对应的表单中。';
|
||||
$lang->ai->prompts->goingTesting = '即将跳转至调试页面';
|
||||
$lang->ai->prompts->goingTestingFail = '无法去调试,找不到合适的对象';
|
||||
|
||||
/* Finalize page. */
|
||||
$lang->ai->moduleDisableTip = '系统根据所选对象自动关联分组';
|
||||
|
||||
/* Data source definition. */
|
||||
$lang->ai->dataSource = array();
|
||||
|
||||
$lang->ai->dataSource['my']['common'] = '地盘';
|
||||
$lang->ai->dataSource['product']['common'] = '产品';
|
||||
$lang->ai->dataSource['story']['common'] = '需求';
|
||||
$lang->ai->dataSource['productplan']['common'] = '计划';
|
||||
$lang->ai->dataSource['release']['common'] = '发布';
|
||||
$lang->ai->dataSource['project']['common'] = '项目';
|
||||
$lang->ai->dataSource['execution']['common'] = '执行';
|
||||
$lang->ai->dataSource['task']['common'] = '任务';
|
||||
$lang->ai->dataSource['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['case']['common'] = '用例';
|
||||
$lang->ai->dataSource['doc']['common'] = '文档';
|
||||
|
||||
$lang->ai->dataSource['my']['efforts']['common'] = '日志列表';
|
||||
$lang->ai->dataSource['my']['efforts']['date'] = '日期';
|
||||
$lang->ai->dataSource['my']['efforts']['work'] = '工作内容';
|
||||
$lang->ai->dataSource['my']['efforts']['account'] = '记录人';
|
||||
$lang->ai->dataSource['my']['efforts']['consumed'] = '耗时';
|
||||
$lang->ai->dataSource['my']['efforts']['left'] = '剩余';
|
||||
$lang->ai->dataSource['my']['efforts']['objectID'] = '对象';
|
||||
$lang->ai->dataSource['my']['efforts']['product'] = '产品';
|
||||
$lang->ai->dataSource['my']['efforts']['project'] = '项目';
|
||||
$lang->ai->dataSource['my']['efforts']['execution'] = '执行';
|
||||
|
||||
$lang->ai->dataSource['product']['product']['common'] = '产品';
|
||||
$lang->ai->dataSource['product']['product']['name'] = '产品名称';
|
||||
$lang->ai->dataSource['product']['product']['desc'] = '产品描述';
|
||||
$lang->ai->dataSource['product']['modules']['common'] = '产品模块列表';
|
||||
$lang->ai->dataSource['product']['modules']['name'] = '模块名称';
|
||||
$lang->ai->dataSource['product']['modules']['modules'] = '子模块';
|
||||
|
||||
$lang->ai->dataSource['productplan']['productplan']['common'] = '计划';
|
||||
$lang->ai->dataSource['productplan']['productplan']['title'] = '计划名称';
|
||||
$lang->ai->dataSource['productplan']['productplan']['desc'] = '计划描述';
|
||||
$lang->ai->dataSource['productplan']['productplan']['begin'] = '开始时间';
|
||||
$lang->ai->dataSource['productplan']['productplan']['end'] = '结束时间';
|
||||
|
||||
$lang->ai->dataSource['productplan']['stories']['common'] = '需求列表';
|
||||
$lang->ai->dataSource['productplan']['stories']['title'] = '需求名称';
|
||||
$lang->ai->dataSource['productplan']['stories']['module'] = '所属模块';
|
||||
$lang->ai->dataSource['productplan']['stories']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['productplan']['stories']['estimate'] = '预计故事点';
|
||||
$lang->ai->dataSource['productplan']['stories']['status'] = '状态';
|
||||
$lang->ai->dataSource['productplan']['stories']['stage'] = '阶段';
|
||||
|
||||
$lang->ai->dataSource['productplan']['bugs']['common'] = 'Bug列表';
|
||||
$lang->ai->dataSource['productplan']['bugs']['title'] = 'Bug标题';
|
||||
$lang->ai->dataSource['productplan']['bugs']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['productplan']['bugs']['status'] = '状态';
|
||||
|
||||
$lang->ai->dataSource['release']['release']['common'] = '发布';
|
||||
$lang->ai->dataSource['release']['release']['product'] = '所属产品';
|
||||
$lang->ai->dataSource['release']['release']['name'] = '发布名称';
|
||||
$lang->ai->dataSource['release']['release']['desc'] = '发布描述';
|
||||
$lang->ai->dataSource['release']['release']['date'] = '发布日期';
|
||||
|
||||
$lang->ai->dataSource['release']['stories']['common'] = '需求列表';
|
||||
$lang->ai->dataSource['release']['stories']['title'] = '需求名称';
|
||||
$lang->ai->dataSource['release']['stories']['estimate'] = '预估故事点';
|
||||
|
||||
$lang->ai->dataSource['release']['bugs']['common'] = 'Bug列表';
|
||||
$lang->ai->dataSource['release']['bugs']['title'] = 'Bug标题';
|
||||
|
||||
$lang->ai->dataSource['project']['project']['common'] = '项目';
|
||||
$lang->ai->dataSource['project']['project']['name'] = '项目名称';
|
||||
$lang->ai->dataSource['project']['project']['type'] = '项目类型';
|
||||
$lang->ai->dataSource['project']['project']['desc'] = '项目描述';
|
||||
$lang->ai->dataSource['project']['project']['begin'] = '计划开始';
|
||||
$lang->ai->dataSource['project']['project']['end'] = '计划结束';
|
||||
$lang->ai->dataSource['project']['project']['estimate'] = '预计工时';
|
||||
|
||||
$lang->ai->dataSource['project']['programplans']['common'] = '阶段列表';
|
||||
$lang->ai->dataSource['project']['programplans']['name'] = '阶段名称';
|
||||
$lang->ai->dataSource['project']['programplans']['desc'] = '阶段描述';
|
||||
$lang->ai->dataSource['project']['programplans']['status'] = '阶段状态';
|
||||
$lang->ai->dataSource['project']['programplans']['begin'] = '计划开始';
|
||||
$lang->ai->dataSource['project']['programplans']['end'] = '计划完成';
|
||||
$lang->ai->dataSource['project']['programplans']['realBegan'] = '实际开始';
|
||||
$lang->ai->dataSource['project']['programplans']['realEnd'] = '实际完成';
|
||||
$lang->ai->dataSource['project']['programplans']['planDuration'] = '工期';
|
||||
$lang->ai->dataSource['project']['programplans']['progress'] = '任务进度';
|
||||
$lang->ai->dataSource['project']['programplans']['estimate'] = '预计工时';
|
||||
$lang->ai->dataSource['project']['programplans']['consumed'] = '消耗工时';
|
||||
$lang->ai->dataSource['project']['programplans']['left'] = '剩余工时';
|
||||
|
||||
$lang->ai->dataSource['project']['executions']['common'] = '迭代列表';
|
||||
$lang->ai->dataSource['project']['executions']['name'] = '执行名称';
|
||||
$lang->ai->dataSource['project']['executions']['desc'] = '执行描述';
|
||||
$lang->ai->dataSource['project']['executions']['status'] = '执行状态';
|
||||
$lang->ai->dataSource['project']['executions']['begin'] = '计划开始';
|
||||
$lang->ai->dataSource['project']['executions']['end'] = '计划完成';
|
||||
$lang->ai->dataSource['project']['executions']['realBegan'] = '实际开始';
|
||||
$lang->ai->dataSource['project']['executions']['realEnd'] = '实际完成';
|
||||
$lang->ai->dataSource['project']['executions']['estimate'] = '预计工时';
|
||||
$lang->ai->dataSource['project']['executions']['consumed'] = '消耗工时';
|
||||
$lang->ai->dataSource['project']['executions']['left'] = '剩余工时';
|
||||
$lang->ai->dataSource['project']['executions']['progress'] = '进度';
|
||||
|
||||
$lang->ai->dataSource['story']['story']['common'] = '需求';
|
||||
$lang->ai->dataSource['story']['story']['title'] = '需求标题';
|
||||
$lang->ai->dataSource['story']['story']['spec'] = '需求描述';
|
||||
$lang->ai->dataSource['story']['story']['verify'] = '验收标准';
|
||||
$lang->ai->dataSource['story']['story']['product'] = '产品';
|
||||
$lang->ai->dataSource['story']['story']['module'] = '模块';
|
||||
$lang->ai->dataSource['story']['story']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['story']['story']['category'] = '需求类型';
|
||||
$lang->ai->dataSource['story']['story']['estimate'] = '预计工时';
|
||||
|
||||
$lang->ai->dataSource['execution']['execution']['common'] = '执行';
|
||||
$lang->ai->dataSource['execution']['execution']['name'] = '执行名称';
|
||||
$lang->ai->dataSource['execution']['execution']['desc'] = '执行描述';
|
||||
$lang->ai->dataSource['execution']['execution']['estimate'] = '预计工时';
|
||||
|
||||
$lang->ai->dataSource['execution']['tasks']['common'] = '任务列表';
|
||||
$lang->ai->dataSource['execution']['tasks']['name'] = '任务名称';
|
||||
$lang->ai->dataSource['execution']['tasks']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['execution']['tasks']['status'] = '状态';
|
||||
$lang->ai->dataSource['execution']['tasks']['estimate'] = '预计工时';
|
||||
$lang->ai->dataSource['execution']['tasks']['consumed'] = '已消耗';
|
||||
$lang->ai->dataSource['execution']['tasks']['left'] = '剩余';
|
||||
$lang->ai->dataSource['execution']['tasks']['progress'] = '进度';
|
||||
$lang->ai->dataSource['execution']['tasks']['estStarted'] = '预计开始';
|
||||
$lang->ai->dataSource['execution']['tasks']['realStarted'] = '实际开始';
|
||||
$lang->ai->dataSource['execution']['tasks']['finishedDate'] = '完成日期';
|
||||
$lang->ai->dataSource['execution']['tasks']['closedReason'] = '关闭原因';
|
||||
|
||||
$lang->ai->dataSource['task']['task']['common'] = '任务';
|
||||
$lang->ai->dataSource['task']['task']['name'] = '任务名称';
|
||||
$lang->ai->dataSource['task']['task']['desc'] = '任务描述';
|
||||
$lang->ai->dataSource['task']['task']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['task']['task']['status'] = '状态';
|
||||
$lang->ai->dataSource['task']['task']['estimate'] = '预计';
|
||||
$lang->ai->dataSource['task']['task']['consumed'] = '消耗';
|
||||
$lang->ai->dataSource['task']['task']['left'] = '剩余';
|
||||
$lang->ai->dataSource['task']['task']['progress'] = '进度';
|
||||
$lang->ai->dataSource['task']['task']['estStarted'] = '预计开始';
|
||||
$lang->ai->dataSource['task']['task']['realStarted'] = '实际开始';
|
||||
|
||||
$lang->ai->dataSource['case']['case']['common'] = '用例';
|
||||
$lang->ai->dataSource['case']['case']['title'] = '标题';
|
||||
$lang->ai->dataSource['case']['case']['precondition'] = '前置条件';
|
||||
$lang->ai->dataSource['case']['case']['scene'] = '所属场景';
|
||||
$lang->ai->dataSource['case']['case']['product'] = '所属产品';
|
||||
$lang->ai->dataSource['case']['case']['module'] = '所属模块';
|
||||
$lang->ai->dataSource['case']['case']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['case']['case']['type'] = '类型';
|
||||
$lang->ai->dataSource['case']['case']['lastRunResult'] = '结果';
|
||||
$lang->ai->dataSource['case']['case']['status'] = '状态';
|
||||
|
||||
$lang->ai->dataSource['case']['steps']['common'] = '步骤列表';
|
||||
$lang->ai->dataSource['case']['steps']['desc'] = '步骤描述';
|
||||
$lang->ai->dataSource['case']['steps']['expect'] = '预期';
|
||||
|
||||
$lang->ai->dataSource['bug']['bug']['common'] = 'Bug';
|
||||
$lang->ai->dataSource['bug']['bug']['title'] = 'Bug标题';
|
||||
$lang->ai->dataSource['bug']['bug']['steps'] = '重现步骤';
|
||||
$lang->ai->dataSource['bug']['bug']['severity'] = '级别';
|
||||
$lang->ai->dataSource['bug']['bug']['pri'] = '优先级';
|
||||
$lang->ai->dataSource['bug']['bug']['status'] = '状态';
|
||||
$lang->ai->dataSource['bug']['bug']['confirmed'] = '确认';
|
||||
$lang->ai->dataSource['bug']['bug']['type'] = 'Bug类型';
|
||||
|
||||
$lang->ai->dataSource['doc']['doc']['common'] = '文档';
|
||||
$lang->ai->dataSource['doc']['doc']['title'] = '文档标题';
|
||||
$lang->ai->dataSource['doc']['doc']['content'] = '文档正文';
|
||||
$lang->ai->dataSource['doc']['doc']['addedBy'] = '创建者';
|
||||
$lang->ai->dataSource['doc']['doc']['addedDate'] = '创建日期';
|
||||
$lang->ai->dataSource['doc']['doc']['editedBy'] = '修改者';
|
||||
$lang->ai->dataSource['doc']['doc']['editedDate'] = '修改日期';
|
||||
|
||||
/* Target form definition. See `$config->ai->targetForm`. */
|
||||
$lang->ai->targetForm = array();
|
||||
$lang->ai->targetForm['product']['common'] = '产品';
|
||||
$lang->ai->targetForm['story']['common'] = '需求';
|
||||
$lang->ai->targetForm['productplan']['common'] = '计划';
|
||||
$lang->ai->targetForm['projectrelease']['common'] = '发布';
|
||||
$lang->ai->targetForm['project']['common'] = '项目';
|
||||
$lang->ai->targetForm['execution']['common'] = '执行';
|
||||
$lang->ai->targetForm['task']['common'] = '任务';
|
||||
$lang->ai->targetForm['testcase']['common'] = '用例';
|
||||
$lang->ai->targetForm['bug']['common'] = 'Bug';
|
||||
$lang->ai->targetForm['doc']['common'] = '文档';
|
||||
|
||||
$lang->ai->targetForm['product']['tree/managechild'] = '维护模块';
|
||||
$lang->ai->targetForm['product']['doc/create'] = '创建文档';
|
||||
|
||||
$lang->ai->targetForm['story']['create'] = '提需求';
|
||||
$lang->ai->targetForm['story']['batchcreate'] = '批量提需求';
|
||||
$lang->ai->targetForm['story']['change'] = '变更需求';
|
||||
$lang->ai->targetForm['story']['totask'] = '需求建任务';
|
||||
$lang->ai->targetForm['story']['testcasecreate'] = '需求建用例';
|
||||
$lang->ai->targetForm['story']['subdivide'] = '需求细分';
|
||||
|
||||
$lang->ai->targetForm['productplan']['edit'] = '编辑计划';
|
||||
$lang->ai->targetForm['productplan']['create'] = '创建子计划';
|
||||
|
||||
$lang->ai->targetForm['projectrelease']['doc/create'] = '创建文档';
|
||||
|
||||
$lang->ai->targetForm['project']['risk/create'] = '创建风险';
|
||||
$lang->ai->targetForm['project']['issue/create'] = '创建问题';
|
||||
$lang->ai->targetForm['project']['doc/create'] = '创建文档';
|
||||
$lang->ai->targetForm['project']['programplan/create'] = '设置阶段';
|
||||
|
||||
$lang->ai->targetForm['execution']['batchcreatetask'] = '批量创建任务';
|
||||
$lang->ai->targetForm['execution']['createtestreport'] = '创建测试报告';
|
||||
$lang->ai->targetForm['execution']['createqa'] = '创建 QA';
|
||||
$lang->ai->targetForm['execution']['createrisk'] = '创建风险';
|
||||
$lang->ai->targetForm['execution']['createissue'] = '创建问题';
|
||||
|
||||
$lang->ai->targetForm['task']['edit'] = '编辑任务';
|
||||
$lang->ai->targetForm['task']['batchcreate'] = '批量创建子任务';
|
||||
|
||||
$lang->ai->targetForm['testcase']['edit'] = '编辑用例';
|
||||
$lang->ai->targetForm['testcase']['createscript'] = '创建自动化脚本';
|
||||
|
||||
$lang->ai->targetForm['bug']['edit'] = '编辑 Bug';
|
||||
$lang->ai->targetForm['bug']['story/create'] = 'Bug 转需求';
|
||||
$lang->ai->targetForm['bug']['testcase/create'] = 'Bug 建用例';
|
||||
|
||||
$lang->ai->targetForm['doc']['create'] = '创建文档';
|
||||
$lang->ai->targetForm['doc']['edit'] = '编辑文档';
|
||||
|
||||
$lang->ai->prompts->statuses = array();
|
||||
$lang->ai->prompts->statuses[''] = '全部';
|
||||
$lang->ai->prompts->statuses['draft'] = '未发布';
|
||||
$lang->ai->prompts->statuses['active'] = '已发布';
|
||||
|
||||
$lang->ai->prompts->modules = array();
|
||||
$lang->ai->prompts->modules[''] = '所有分组';
|
||||
// $lang->ai->prompts->modules['my'] = '地盘';
|
||||
$lang->ai->prompts->modules['product'] = '产品';
|
||||
$lang->ai->prompts->modules['project'] = '项目';
|
||||
$lang->ai->prompts->modules['story'] = '需求';
|
||||
$lang->ai->prompts->modules['productplan'] = '计划';
|
||||
$lang->ai->prompts->modules['release'] = '发布';
|
||||
$lang->ai->prompts->modules['execution'] = '执行';
|
||||
$lang->ai->prompts->modules['task'] = '任务';
|
||||
$lang->ai->prompts->modules['case'] = '用例';
|
||||
$lang->ai->prompts->modules['bug'] = 'Bug';
|
||||
$lang->ai->prompts->modules['doc'] = '文档';
|
||||
|
||||
$lang->ai->conversations = new stdclass();
|
||||
$lang->ai->conversations->common = '会话';
|
||||
|
||||
$lang->ai->miniPrograms = new stdClass();
|
||||
$lang->ai->miniPrograms->common = '小程序';
|
||||
$lang->ai->miniPrograms->emptyList = '暂时没有小程序。';
|
||||
$lang->ai->miniPrograms->create = '创建小程序';
|
||||
$lang->ai->miniPrograms->configuration = '基本信息配置';
|
||||
$lang->ai->miniPrograms->downloadTip = '发布后将在AI小程序广场上展示,并会自动同步到客户端上。';
|
||||
$lang->ai->miniPrograms->download = '下载禅道客户端';
|
||||
$lang->ai->miniPrograms->category = '所属分类';
|
||||
$lang->ai->miniPrograms->icon = '图标';
|
||||
$lang->ai->miniPrograms->desc = '简介';
|
||||
$lang->ai->miniPrograms->categoryList = array('work' => '工作', 'personal' => '个人', 'life' => '生活', 'creative' => '创意', 'others' => '其它');
|
||||
$lang->ai->miniPrograms->allCategories = array('' => '所有分组');
|
||||
$lang->ai->miniPrograms->collect = '收藏';
|
||||
$lang->ai->miniPrograms->more = '更多';
|
||||
$lang->ai->miniPrograms->iconModification = '图标修改';
|
||||
$lang->ai->miniPrograms->customBackground = '自定义背景色';
|
||||
$lang->ai->miniPrograms->customIcon = '自定义icon';
|
||||
$lang->ai->miniPrograms->backToListPage = '返回列表页';
|
||||
$lang->ai->miniPrograms->lastStep = '上一步';
|
||||
$lang->ai->miniPrograms->backToListPageTip = '选择对象的参数配置已变动,是否保存并返回?';
|
||||
$lang->ai->miniPrograms->saveAndBack = '保存并返回';
|
||||
$lang->ai->miniPrograms->publishConfirm = array('您确定要发布吗?', '发布后将在一级导航AI模块中显示,客户端将会同步更新。');
|
||||
$lang->ai->miniPrograms->emptyPrompterTip = '小程序提词为空,请编辑后再进行发布';
|
||||
$lang->ai->miniPrograms->maintenanceGroup = '维护小程序分组';
|
||||
|
||||
$lang->ai->miniPrograms->latestPublishedDate = '最新发布时间';
|
||||
$lang->ai->miniPrograms->deleteTip = '确定删除该小程序?';
|
||||
$lang->ai->miniPrograms->disableTip = '下架小程序用户将无法使用,是否确认下架?';
|
||||
$lang->ai->miniPrograms->publishTip = '发布后将在一级导航AI模块中显示,客户端将会同步更新。';
|
||||
$lang->ai->miniPrograms->unpublishedTip = '您使用的小程序没有发布';
|
||||
|
||||
$lang->ai->miniPrograms->placeholder = new stdClass();
|
||||
$lang->ai->miniPrograms->placeholder->name = '请输入小程序名称';
|
||||
$lang->ai->miniPrograms->placeholder->desc = '请输入小程序简介';
|
||||
$lang->ai->miniPrograms->placeholder->default = '请输入填写提示,默认为“请输入”';
|
||||
$lang->ai->miniPrograms->placeholder->input = '请输入';
|
||||
$lang->ai->miniPrograms->placeholder->prompt = '请输入提词设计';
|
||||
$lang->ai->miniPrograms->placeholder->asking = '继续追问';
|
||||
|
||||
$lang->ai->miniPrograms->deleteFieldTip = '您确定删除该字段吗?';
|
||||
|
||||
$lang->ai->miniPrograms->field = new stdClass();
|
||||
$lang->ai->miniPrograms->field->name = '字段名称';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameTip = '该名称已使用,请尝试其他名称';
|
||||
$lang->ai->miniPrograms->field->type = '控件类型';
|
||||
$lang->ai->miniPrograms->field->typeList = array('text' => '单行文本', 'textarea' => '多行文本', 'radio' => '单选', 'checkbox' => '多选');
|
||||
$lang->ai->miniPrograms->field->placeholder = '填写提示';
|
||||
$lang->ai->miniPrograms->field->required = '是否必填';
|
||||
$lang->ai->miniPrograms->field->requiredOptions = array('否', '是');
|
||||
$lang->ai->miniPrograms->field->add = '新增字段';
|
||||
$lang->ai->miniPrograms->field->addTip = '请点击此处以添加字段信息';
|
||||
$lang->ai->miniPrograms->field->edit = '编辑字段';
|
||||
$lang->ai->miniPrograms->field->configuration = '字段配置区';
|
||||
$lang->ai->miniPrograms->field->debug = '调试区';
|
||||
$lang->ai->miniPrograms->field->preview = '预览区';
|
||||
$lang->ai->miniPrograms->field->option = '选项';
|
||||
$lang->ai->miniPrograms->field->contentDebugging = '内容调试';
|
||||
$lang->ai->miniPrograms->field->contentDebuggingTip = '请在此处输入字段内容进行调试。';
|
||||
$lang->ai->miniPrograms->field->prompterDesign = '提词设计';
|
||||
$lang->ai->miniPrograms->field->prompterDesignTip = '输入“<>”符号可引用已配置的字段,“<>”前后采用空格进行间隔。';
|
||||
$lang->ai->miniPrograms->field->prompterPreview = '提词预览';
|
||||
$lang->ai->miniPrograms->field->generateResult = '生成结果';
|
||||
$lang->ai->miniPrograms->field->resultPreview = '结果预览';
|
||||
|
||||
$lang->ai->miniPrograms->field->default = array(
|
||||
'角色',
|
||||
'场景',
|
||||
'目标',
|
||||
'作为一名 <角色> ,我希望在 <场景> 时,能 <目标> 。'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->field->emptyNameWarning = '「%s」不能为空';
|
||||
$lang->ai->miniPrograms->field->duplicatedNameWarning = '「%s」重复';
|
||||
$lang->ai->miniPrograms->field->emptyOptionWarning = '请至少配置一个选项';
|
||||
|
||||
$lang->ai->miniPrograms->statuses = array(
|
||||
'' => '全部',
|
||||
'draft' => '未发布',
|
||||
'active' => '已发布',
|
||||
'createdByMe' => '由我创建'
|
||||
);
|
||||
|
||||
$lang->ai->miniPrograms->publishedOptions = array('未发布', '已发布');
|
||||
$lang->ai->miniPrograms->optionName = '选项名称';
|
||||
$lang->ai->miniPrograms->promptTemplate = '提词模板';
|
||||
$lang->ai->miniPrograms->fieldConfiguration = '字段配置';
|
||||
$lang->ai->miniPrograms->summary = '本页共 %s 个小程序。';
|
||||
$lang->ai->miniPrograms->generate = '生成';
|
||||
$lang->ai->miniPrograms->regenerate = '重新生成';
|
||||
$lang->ai->miniPrograms->noModel = array('尚未配置语言模型,请联系管理员或跳转至后台配置<a id="to-language-model">语言模型</a>。', '若已完成相关配置,请尝试<a id="reload-current">重新加载</a>页面。');
|
||||
$lang->ai->miniPrograms->clearContext = '上下文内容已清除';
|
||||
$lang->ai->miniPrograms->newVersionTip = '小程序已于 %s 更新,以上为过往记录';
|
||||
$lang->ai->miniPrograms->disabledTip = '当前小程序已被禁用。';
|
||||
$lang->ai->miniPrograms->chatNoResponse = '会话发生了错误';
|
||||
|
||||
$lang->ai->models = new stdclass();
|
||||
$lang->ai->models->title = '语言模型配置';
|
||||
$lang->ai->models->common = '语言模型';
|
||||
$lang->ai->models->name = '语言模型名称';
|
||||
$lang->ai->models->type = '语言模型';
|
||||
$lang->ai->models->vendor = '供应商';
|
||||
$lang->ai->models->base = 'API 基础地址';
|
||||
$lang->ai->models->key = 'API Key';
|
||||
$lang->ai->models->secret = 'Secret Key';
|
||||
$lang->ai->models->resource = 'Resource';
|
||||
$lang->ai->models->deployment = 'Deployment';
|
||||
$lang->ai->models->proxyType = '代理类型';
|
||||
$lang->ai->models->proxyAddr = '代理地址';
|
||||
$lang->ai->models->description = '描述';
|
||||
$lang->ai->models->createdDate = '添加时间';
|
||||
$lang->ai->models->createdBy = '添加者';
|
||||
$lang->ai->models->editedDate = '修改时间';
|
||||
$lang->ai->models->editedBy = '修改者';
|
||||
$lang->ai->models->usesProxy = '使用代理';
|
||||
$lang->ai->models->testConnection = '测试连接';
|
||||
$lang->ai->models->unconfigured = '未配置';
|
||||
$lang->ai->models->create = '添加语言模型';
|
||||
$lang->ai->models->edit = '编辑模型参数';
|
||||
$lang->ai->models->view = '查看模型参数';
|
||||
$lang->ai->models->enable = '启用语言模型';
|
||||
$lang->ai->models->disable = '禁用语言模型';
|
||||
$lang->ai->models->details = '语言模型详情';
|
||||
$lang->ai->models->concealTip = '完整信息在编辑时可见';
|
||||
$lang->ai->models->upgradeBiz = '更多AI功能,尽在<a target="_blank" href="https://www.zentao.net/page/enterprise.html" class="text-blue">企业版</a>!';
|
||||
$lang->ai->models->noModelError = '暂无可用的语言模型,请联系管理员配置。';
|
||||
$lang->ai->models->noModels = '暂时没有语言模型,添加模型并配置相关参数后可以使用 AI 相关功能。';
|
||||
$lang->ai->models->confirmDelete = '您确认要删除该语言模型吗?';
|
||||
$lang->ai->models->confirmDisable = '您确认要禁用该语言模型吗?';
|
||||
$lang->ai->models->default = '默认';
|
||||
$lang->ai->models->defaultTip = '默认语言模型(第一个可用的语言模型)将会用于运行未指定语言模型的提词、小程序,也将会用于聊天。';
|
||||
|
||||
$lang->ai->models->testConnectionResult = new stdclass();
|
||||
$lang->ai->models->testConnectionResult->success = '连接成功';
|
||||
$lang->ai->models->testConnectionResult->fail = '连接失败';
|
||||
$lang->ai->models->testConnectionResult->failFormat = '连接失败:%s';
|
||||
|
||||
$lang->ai->models->statusList = array();
|
||||
$lang->ai->models->statusList['0'] = '停用';
|
||||
$lang->ai->models->statusList['off'] = '停用';
|
||||
$lang->ai->models->statusList['1'] = '启用';
|
||||
$lang->ai->models->statusList['on'] = '启用';
|
||||
|
||||
$lang->ai->models->proxyStatusList = array();
|
||||
$lang->ai->models->proxyStatusList['0'] = '否';
|
||||
$lang->ai->models->proxyStatusList['off'] = '否';
|
||||
$lang->ai->models->proxyStatusList['1'] = '是';
|
||||
$lang->ai->models->proxyStatusList['on'] = '是';
|
||||
|
||||
$lang->ai->models->typeList = array();
|
||||
$lang->ai->models->typeList['openai-gpt35'] = 'OpenAI / GPT-3.5';
|
||||
$lang->ai->models->typeList['openai-gpt4'] = 'OpenAI / GPT-4';
|
||||
$lang->ai->models->typeList['baidu-ernie'] = '百度 / 文心一言';
|
||||
|
||||
$lang->ai->models->vendorList = new stdclass();
|
||||
$lang->ai->models->vendorList->{'openai-gpt35'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => '自定义');
|
||||
$lang->ai->models->vendorList->{'openai-gpt4'} = array('openai' => 'OpenAI', 'azure' => 'Azure', 'openaiCompatible' => '自定义');
|
||||
$lang->ai->models->vendorList->{'baidu-ernie'} = array('baidu' => '百度千帆大模型平台');
|
||||
|
||||
$lang->ai->models->vendorTips = new stdclass();
|
||||
$lang->ai->models->vendorTips->azure = 'Azure 中 OpenAI GPT 版本 (3.5 或 4) 需要在创建资源时指定。';
|
||||
$lang->ai->models->vendorTips->openaiCompatible = '指定的 API 需要支持 Function Calling,否则某些功能可能无法正常使用。';
|
||||
|
||||
$lang->ai->models->proxyTypes = array();
|
||||
$lang->ai->models->proxyTypes[''] = '不使用代理';
|
||||
$lang->ai->models->proxyTypes['socks5'] = 'SOCKS5';
|
||||
|
||||
$lang->ai->models->promptFor = '输入给 %s';
|
||||
|
||||
$lang->ai->designStepNav = array();
|
||||
$lang->ai->designStepNav['assignrole'] = '指定角色';
|
||||
$lang->ai->designStepNav['selectdatasource'] = '选择对象';
|
||||
$lang->ai->designStepNav['setpurpose'] = '确认操作';
|
||||
$lang->ai->designStepNav['settargetform'] = '结果处理';
|
||||
$lang->ai->designStepNav['finalize'] = '准备发布';
|
||||
|
||||
$lang->ai->dataTypeDesc = '%s是%s类型,%s';
|
||||
|
||||
$lang->ai->dataType = new stdclass();
|
||||
$lang->ai->dataType->pri = new stdClass();
|
||||
$lang->ai->dataType->pri->type = '数值';
|
||||
$lang->ai->dataType->pri->desc = '1 是最高优先级,4 是最低优先级。';
|
||||
|
||||
$lang->ai->dataType->estimate = new stdClass();
|
||||
$lang->ai->dataType->estimate->type = '数值';
|
||||
$lang->ai->dataType->estimate->desc = '单位为小时。';
|
||||
|
||||
$lang->ai->dataType->consumed = $lang->ai->dataType->estimate;
|
||||
$lang->ai->dataType->left = $lang->ai->dataType->estimate;
|
||||
|
||||
$lang->ai->dataType->progress = new stdClass();
|
||||
$lang->ai->dataType->progress->type = '百分比';
|
||||
$lang->ai->dataType->progress->desc = '0 是未开始,100是已完成。';
|
||||
|
||||
$lang->ai->dataType->datetime = new stdClass();
|
||||
$lang->ai->dataType->datetime->type = '日期时间';
|
||||
$lang->ai->dataType->datetime->desc = '格式为:1970-01-01 00:00:01,没有则留空。';
|
||||
|
||||
$lang->ai->dataType->estStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
|
||||
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
|
||||
|
||||
$lang->ai->demoData = new stdclass();
|
||||
$lang->ai->demoData->notExist = '暂无演示数据。';
|
||||
$lang->ai->demoData->story = array(
|
||||
'story' => array(
|
||||
'title' => '开发一个在线学习平台',
|
||||
'spec' => '我们需要开发一个在线学习平台,能够提供课程管理、学生管理、教师管理等功能。',
|
||||
'verify' => '1. 所有功能均能够正常运行,没有明显的错误和异常。2. 界面美观、易用性好。3. 平台能够满足用户需求,具有较高的用户满意度。4. 代码质量好,结构清晰、易于维护。',
|
||||
'module' => 7,
|
||||
'pri' => 1,
|
||||
'estimate' => 1,
|
||||
'product' => 1,
|
||||
'category' => 'feature',
|
||||
),
|
||||
);
|
||||
$lang->ai->demoData->execution = array(
|
||||
'execution' => array(
|
||||
'name' => '在线学习平台软件开发',
|
||||
'desc' => '本计划旨在开发一款在线学习平台软件,该软件将提供可访问的学习资源,包括文本、视频和音频等,以及一些学习工具如考试、测试和讨论论坛等。',
|
||||
'estimate' => 7,
|
||||
),
|
||||
'tasks' => array(
|
||||
0 =>
|
||||
array(
|
||||
'name' => '技术选型',
|
||||
'pri' => 1,
|
||||
'status' => 'done',
|
||||
'estimate' => 1,
|
||||
'consumed' => 1,
|
||||
'left' => 0,
|
||||
'progress' => 100,
|
||||
'estStarted' => '2023-07-02 00:00:00',
|
||||
'realStarted' => '2023-07-02 00:00:00',
|
||||
'finishedDate' => '2023-07-02 00:00:00',
|
||||
'closedReason' => '已完成',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'name' => 'UI设计',
|
||||
'pri' => 1,
|
||||
'status' => 'doing',
|
||||
'estimate' => 2,
|
||||
'consumed' => 1,
|
||||
'left' => 1,
|
||||
'progress' => 50,
|
||||
'estStarted' => '2023-07-03 00:00:00',
|
||||
'realStarted' => '2023-07-03 00:00:00',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'name' => '开发',
|
||||
'pri' => 1,
|
||||
'status' => 'wait',
|
||||
'estimate' => 1,
|
||||
'consumed' => 0,
|
||||
'left' => 1,
|
||||
'progress' => 0,
|
||||
'estStarted' => '',
|
||||
'realStarted' => '',
|
||||
'finishedDate' => '',
|
||||
'closedReason' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Forms as JSON Schemas. */
|
||||
$lang->ai->formSchema = array();
|
||||
$lang->ai->formSchema['story']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->title = '需求';
|
||||
$lang->ai->formSchema['story']['create']->type = 'object';
|
||||
$lang->ai->formSchema['story']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->spec = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->verify = new stdclass();
|
||||
$lang->ai->formSchema['story']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->title->description = '需求的标题';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->spec->description = '需求的描述';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->type = 'string';
|
||||
$lang->ai->formSchema['story']['create']->properties->verify->description = '需求的验收标准';
|
||||
$lang->ai->formSchema['story']['create']->required = array('title', 'spec', 'verify');
|
||||
$lang->ai->formSchema['story']['change'] = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['story']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->title = '批量创建需求';
|
||||
$lang->ai->formSchema['story']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories = new stdclass();
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->type = 'array';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->description = '需求列表';
|
||||
$lang->ai->formSchema['story']['batchcreate']->properties->stories->items = $lang->ai->formSchema['story']['create'];
|
||||
|
||||
$lang->ai->formSchema['productplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->title = '产品计划';
|
||||
$lang->ai->formSchema['productplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['productplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->title->description = '产品计划的标题';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->begin->description = '产品计划的开始时间';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->end->description = '产品计划的结束时间';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['productplan']['create']->properties->desc->description = '产品计划的描述';
|
||||
$lang->ai->formSchema['productplan']['create']->required = array('title', 'begin', 'end');
|
||||
$lang->ai->formSchema['productplan']['edit'] = $lang->ai->formSchema['productplan']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->title = '任务';
|
||||
$lang->ai->formSchema['task']['create']->type = 'object';
|
||||
$lang->ai->formSchema['task']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->name = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->desc = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['task']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->description = '任务的类型';
|
||||
$lang->ai->formSchema['task']['create']->properties->type->enum = array('design', 'devel', 'request', 'test', 'study', 'discuss', 'ui', 'affair', 'misc');
|
||||
$lang->ai->formSchema['task']['create']->properties->name->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->name->description = '任务的名称';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->desc->description = '任务的描述';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->description = '任务的优先级';
|
||||
$lang->ai->formSchema['task']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->type = 'number';
|
||||
$lang->ai->formSchema['task']['create']->properties->estimate->description = '任务的预计工时';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->begin->description = '任务的预计开始日期';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['task']['create']->properties->end->description = '任务的预计结束日期';
|
||||
$lang->ai->formSchema['task']['create']->required = array('type', 'name');
|
||||
$lang->ai->formSchema['task']['edit'] = $lang->ai->formSchema['task']['create'];
|
||||
|
||||
$lang->ai->formSchema['task']['batchcreate'] = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->title = '批量创建任务';
|
||||
$lang->ai->formSchema['task']['batchcreate']->type = 'object';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks = new stdclass();
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->type = 'array';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->description = '任务列表';
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items = $lang->ai->formSchema['task']['create'];
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->estStarted = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin;
|
||||
$lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->deadline = clone $lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end;
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->begin);
|
||||
unset($lang->ai->formSchema['task']['batchcreate']->properties->tasks->items->properties->end);
|
||||
|
||||
$lang->ai->formSchema['bug']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->title = 'Bug';
|
||||
$lang->ai->formSchema['bug']['create']->type = 'object';
|
||||
$lang->ai->formSchema['bug']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild = new stdclass();
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->title->description = 'Bug 的标题';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->steps->description = '重现步骤';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->description = 'Bug 的严重程度';
|
||||
$lang->ai->formSchema['bug']['create']->properties->severity->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->description = 'Bug 的优先级';
|
||||
$lang->ai->formSchema['bug']['create']->properties->pri->enum = array('1', '2', '3', '4');
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->type = 'string';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->description = 'Bug 影响的版本';
|
||||
$lang->ai->formSchema['bug']['create']->properties->openedBuild->enum = array('trunk');
|
||||
$lang->ai->formSchema['bug']['create']->required = array('title', 'steps', 'severity', 'pri', 'openedBuild');
|
||||
$lang->ai->formSchema['bug']['edit'] = $lang->ai->formSchema['bug']['create'];
|
||||
|
||||
$lang->ai->formSchema['testcase']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->title = '用例';
|
||||
$lang->ai->formSchema['testcase']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects = new stdclass();
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->description = '用例的类型';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->type->enum = array('feature', 'performance', 'config', 'install', 'security', 'interface', 'unit', 'other');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->description = '用例适用阶段';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->stage->enum = array('unittest', 'feature', 'intergrate', 'system', 'smoke', 'bvt');
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->title->description = '用例的标题';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->precondition->description = '用例的前置条件';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->type = 'array';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->description = '用例的步骤列表';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->type = 'object';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->steps->description = '步骤的描述';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->type = 'string';
|
||||
$lang->ai->formSchema['testcase']['create']->properties->steps->items->properties->expects->description = '步骤的预期结果';
|
||||
$lang->ai->formSchema['testcase']['create']->required = array('type', 'title', 'steps');
|
||||
$lang->ai->formSchema['testcase']['edit'] = $lang->ai->formSchema['testcase']['create'];
|
||||
|
||||
$lang->ai->formSchema['testreport']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->title = '测试报告';
|
||||
$lang->ai->formSchema['testreport']['create']->type = 'object';
|
||||
$lang->ai->formSchema['testreport']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report = new stdclass();
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->begin->description = '测试开始时间';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->end->description = '测试开始时间';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->title->description = '测试报告的标题';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->type = 'string';
|
||||
$lang->ai->formSchema['testreport']['create']->properties->report->description = '测试报告的内容';
|
||||
$lang->ai->formSchema['testreport']['create']->required = array('begin', 'end', 'title', 'report');
|
||||
$lang->ai->formSchema['execution']['testreport'] = $lang->ai->formSchema['testreport']['create'];
|
||||
|
||||
$lang->ai->formSchema['doc']['edit'] = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->title = '文档';
|
||||
$lang->ai->formSchema['doc']['edit']->type = 'object';
|
||||
$lang->ai->formSchema['doc']['edit']->properties = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content = new stdclass();
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->title->description = '文档的标题';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->type = 'string';
|
||||
$lang->ai->formSchema['doc']['edit']->properties->content->description = '文档的正文';
|
||||
$lang->ai->formSchema['doc']['edit']->required = array('title', 'content');
|
||||
|
||||
$lang->ai->formSchema['tree']['browse'] = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->title = '模块';
|
||||
$lang->ai->formSchema['tree']['browse']->type = 'object';
|
||||
$lang->ai->formSchema['tree']['browse']->properties = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->type = 'array';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->title = '模块';
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items = new stdclass();
|
||||
$lang->ai->formSchema['tree']['browse']->properties->modules->items->type = 'string';
|
||||
$lang->ai->formSchema['tree']['browse']->required = array('modules');
|
||||
|
||||
$lang->ai->formSchema['programplan']['create'] = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->title = '计划阶段';
|
||||
$lang->ai->formSchema['programplan']['create']->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->type = 'array';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->title = '阶段列表';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->type = 'object';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end = new stdclass();
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->names->description = '阶段名称';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->description = '阶段类型';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->attributes->enum = array('request', 'design', 'dev', 'qa', 'release', 'review', 'other');
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->type = 'boolean';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->milestone->description = '是否为里程碑';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->begin->description = '阶段开始时间';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->type = 'string';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->format = 'date';
|
||||
$lang->ai->formSchema['programplan']['create']->properties->stages->items->properties->end->description = '阶段结束时间';
|
||||
$lang->ai->formSchema['programplan']['create']->required = array('stages');
|
||||
|
||||
$lang->ai->promptMenu = new stdclass();
|
||||
$lang->ai->promptMenu->dropdownTitle = 'AI';
|
||||
|
||||
$lang->ai->dataInject = new stdclass();
|
||||
$lang->ai->dataInject->success = '已将提词执行结果填写到表单中';
|
||||
$lang->ai->dataInject->fail = '提词执行结果填写失败';
|
||||
|
||||
$lang->ai->execute = new stdclass();
|
||||
$lang->ai->execute->loading = '提词执行中';
|
||||
$lang->ai->execute->auditing = '即将跳转至调试页面并执行提词';
|
||||
$lang->ai->execute->success = '提词执行成功';
|
||||
$lang->ai->execute->fail = '提词执行失败';
|
||||
$lang->ai->execute->failFormat = '提词执行失败:%s。';
|
||||
$lang->ai->execute->failReasons = array();
|
||||
$lang->ai->execute->failReasons['noPrompt'] = '提词不存在';
|
||||
$lang->ai->execute->failReasons['noObjectData'] = '对象数据获取失败';
|
||||
$lang->ai->execute->failReasons['noResponse'] = '请求返回值为空';
|
||||
$lang->ai->execute->failReasons['noTargetForm'] = '目标表单地址获取失败,或表单必要变量获取失败(可能原因为无法找到关联的对象,请检查对象间的关联关系)';
|
||||
$lang->ai->execute->executeErrors = array();
|
||||
$lang->ai->execute->executeErrors['-1'] = '提词不存在';
|
||||
$lang->ai->execute->executeErrors['-2'] = '对象数据获取失败';
|
||||
$lang->ai->execute->executeErrors['-3'] = '序列化对象数据失败';
|
||||
$lang->ai->execute->executeErrors['-4'] = '没有可用的语言模型';
|
||||
$lang->ai->execute->executeErrors['-5'] = '表单结构获取失败';
|
||||
$lang->ai->execute->executeErrors['-6'] = 'API 返回值为空或返回了错误';
|
||||
|
||||
$lang->ai->audit = new stdclass();
|
||||
$lang->ai->audit->designPrompt = '提词设计';
|
||||
$lang->ai->audit->afterSave = '保存后';
|
||||
$lang->ai->audit->regenerate = '重新生成';
|
||||
$lang->ai->audit->exit = '退出调试';
|
||||
|
||||
$lang->ai->audit->backLocationList = array();
|
||||
$lang->ai->audit->backLocationList[0] = '返回调试页面';
|
||||
$lang->ai->audit->backLocationList[1] = '返回调试页面并重新生成';
|
||||
|
||||
$lang->ai->engineeredPrompts = new stdclass();
|
||||
$lang->ai->engineeredPrompts->askForFunctionCalling = array((object)array('role' => 'user', 'content' => '请把我所发的下一条消息内容转换为 function 调用。'), (object)array('role' => 'assistant', 'content' => '好的,我会把下一条消息转换为 function 调用。'));
|
||||
|
||||
$lang->ai->aiResponseException = array();
|
||||
$lang->ai->aiResponseException['notFunctionCalling'] = 'AI 提词执行返回值结构不正确,请重试(可能可以通过优化提词来解决)';
|
||||
+2740
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
$defaultModelType = array_key_first($lang->ai->models->typeList);
|
||||
$defaultModelVendor = array_key_first($lang->ai->models->vendorList->{$defaultModelType});
|
||||
$allCredFields = array_unique(array_reduce((array)$config->ai->vendorList, function($carry, $vendor) {return array_merge($carry, array_values((array)$vendor['credentials']));}, array()));
|
||||
|
||||
jsVar('window.vendorList', $config->ai->vendorList);
|
||||
jsVar('window.vendorListLang', $lang->ai->models->vendorList);
|
||||
jsVar('window.vendorTipsLang', $lang->ai->models->vendorTips);
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::title($lang->ai->models->create),
|
||||
set::id('model-form'),
|
||||
set::actions(array('submit', array('text' => $lang->ai->models->testConnection, 'id' => 'test-conn-btn', 'class' => 'btn secondary', 'url' => 'javascript:testConnection()'), 'cancel')),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->name),
|
||||
set::width('1/2'),
|
||||
input
|
||||
(
|
||||
set::name('name'),
|
||||
set('maxlength', 20)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->type),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('type'),
|
||||
set::items($lang->ai->models->typeList),
|
||||
set::value($defaultModelType),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
/* Update vendor group on model type change. */
|
||||
set::label($lang->ai->models->vendor),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('vendor'),
|
||||
set::items($lang->ai->models->vendorList->{$defaultModelType}),
|
||||
set::required(true)
|
||||
),
|
||||
set::tip(' '),
|
||||
set::tipClass('vendor-tips text-gray')
|
||||
)
|
||||
),
|
||||
array_map( // Vendor credentials rows.
|
||||
function($field) use ($lang)
|
||||
{
|
||||
return formRow
|
||||
(
|
||||
set::className('vendor-row'),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->{$field}),
|
||||
set::required(true),
|
||||
input
|
||||
(
|
||||
set::name($field),
|
||||
set::required(true)
|
||||
)
|
||||
)
|
||||
);
|
||||
},
|
||||
$allCredFields
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->proxyType),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('proxyType'),
|
||||
set::items($lang->ai->models->proxyTypes),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->proxyAddr),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
set::style(array('display' => 'none')), // Hide proxy address input by default.
|
||||
set::id('proxy-addr-container'),
|
||||
input
|
||||
(
|
||||
set::name('proxyAddr'),
|
||||
set::required(true)
|
||||
)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->description),
|
||||
textarea
|
||||
(
|
||||
set::name('description'),
|
||||
set::rows(3)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
$defaultModelType = array_key_first($lang->ai->models->typeList);
|
||||
$defaultModelVendor = array_key_first($lang->ai->models->vendorList->{$defaultModelType});
|
||||
$allCredFields = array_unique(array_reduce((array)$config->ai->vendorList, function($carry, $vendor) {return array_merge($carry, array_values((array)$vendor['credentials']));}, array()));
|
||||
|
||||
jsVar('window.vendorList', $config->ai->vendorList);
|
||||
jsVar('window.vendorListLang', $lang->ai->models->vendorList);
|
||||
jsVar('window.vendorTipsLang', $lang->ai->models->vendorTips);
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::title($lang->ai->models->edit . (empty($model->name) ? '' : " - {$model->name}")),
|
||||
set::id('model-form'),
|
||||
set::actions(array('submit', array('text' => $lang->ai->models->testConnection, 'id' => 'test-conn-btn', 'class' => 'btn secondary', 'url' => 'javascript:testConnection()'), 'cancel')),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->name),
|
||||
set::width('1/2'),
|
||||
input
|
||||
(
|
||||
set::name('name'),
|
||||
set('maxlength', 20),
|
||||
set::value($model->name)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->type),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('type'),
|
||||
set::items($lang->ai->models->typeList),
|
||||
set::value($model->type),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
/* Update vendor group on model type change. */
|
||||
set::label($lang->ai->models->vendor),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('vendor'),
|
||||
set::items($lang->ai->models->vendorList->{$defaultModelType}),
|
||||
set::value($model->vendor),
|
||||
set::required(true)
|
||||
),
|
||||
set::tip(' '),
|
||||
set::tipClass('vendor-tips text-gray')
|
||||
)
|
||||
),
|
||||
array_map( // Vendor credentials rows.
|
||||
function($field) use ($lang, $model)
|
||||
{
|
||||
return formRow
|
||||
(
|
||||
set::className('vendor-row'),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->{$field}),
|
||||
set::required(true),
|
||||
input
|
||||
(
|
||||
set::name($field),
|
||||
set::value(empty($model->{$field}) ? '' : $model->{$field}),
|
||||
set::required(true)
|
||||
)
|
||||
)
|
||||
);
|
||||
},
|
||||
$allCredFields
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->proxyType),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
select
|
||||
(
|
||||
set::name('proxyType'),
|
||||
set::items($lang->ai->models->proxyTypes),
|
||||
set::value(empty($model->proxyType) ? '' : $model->proxyType),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->proxyAddr),
|
||||
set::width('1/2'),
|
||||
set::required(true),
|
||||
set::style(array('display' => 'none')), // Hide proxy address input by default.
|
||||
set::id('proxy-addr-container'),
|
||||
input
|
||||
(
|
||||
set::name('proxyAddr'),
|
||||
set::value(empty($model->proxyAddr) ? '' : $model->proxyAddr),
|
||||
set::required(true)
|
||||
)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->ai->models->description),
|
||||
textarea
|
||||
(
|
||||
set::name('description'),
|
||||
set::rows(3),
|
||||
set::value($model->desc)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('langDefault', $lang->ai->models->default);
|
||||
jsVar('langDefaultTip', $lang->ai->models->defaultTip);
|
||||
jsVar('confirmDisableTip', $lang->ai->models->confirmDisable);
|
||||
|
||||
featureBar();
|
||||
hasPriv('ai', 'modelcreate') && toolbar(
|
||||
item(
|
||||
set(array(
|
||||
'text' => $lang->ai->models->create,
|
||||
'url' => createLink('ai', 'modelcreate'),
|
||||
'data-app' => $app->tab,
|
||||
'icon' => 'plus',
|
||||
'class' => 'btn primary',
|
||||
))
|
||||
)
|
||||
);
|
||||
|
||||
if(empty($models))
|
||||
{
|
||||
panel
|
||||
(
|
||||
center
|
||||
(
|
||||
set::style(array('height' => 'calc(100vh - 145px)')), // 145px is sum of header and footer height.
|
||||
div
|
||||
(
|
||||
span
|
||||
(
|
||||
set::className('p-8 text-gray'),
|
||||
$lang->ai->models->noModels
|
||||
),
|
||||
btn
|
||||
(
|
||||
set::text($lang->ai->models->create),
|
||||
set::icon('plus'),
|
||||
set::className('btn secondary'),
|
||||
set::url(createLink('ai', 'modelcreate')),
|
||||
set('data-app', $app->tab)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$models = initTableData($models, $config->ai->dtable->models, $this->ai);
|
||||
|
||||
dtable
|
||||
(
|
||||
set::cols($config->ai->dtable->models),
|
||||
set::data($models),
|
||||
set::onRenderCell(jsRaw('window.onRenderCell')),
|
||||
set::orderBy($orderBy),
|
||||
set::sortLink(inlink('models', "orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
|
||||
set::footPager(usePager()),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('confirmDeleteTip', $lang->ai->models->confirmDelete);
|
||||
jsVar('confirmDisableTip', $lang->ai->models->confirmDisable);
|
||||
|
||||
detailHeader
|
||||
(
|
||||
set::backUrl($this->createLink('ai', 'models')),
|
||||
to::title
|
||||
(
|
||||
entityLabel
|
||||
(
|
||||
set(array('entityID' => $model->id, 'text' => $model->name)),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$actions = $this->loadModel('common')->buildOperateMenu($model);
|
||||
|
||||
detailBody
|
||||
(
|
||||
sectionList
|
||||
(
|
||||
section
|
||||
(
|
||||
set::title($lang->ai->models->details),
|
||||
tableData
|
||||
(
|
||||
item
|
||||
(
|
||||
set::name($lang->ai->models->type),
|
||||
$lang->ai->models->typeList[$model->type]
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->ai->models->vendor),
|
||||
$lang->ai->models->vendorList->{$model->type}[$model->vendor]
|
||||
),
|
||||
array_map(function($field) use ($model, $lang)
|
||||
{
|
||||
return item
|
||||
(
|
||||
set::name($lang->ai->models->$field),
|
||||
empty($model->$field) ? $lang->ai->models->unconfigured : $model->$field
|
||||
);
|
||||
}, $config->ai->vendorList[$model->vendor]['credentials']),
|
||||
item
|
||||
(
|
||||
set::name($lang->ai->models->proxyType),
|
||||
$lang->ai->models->proxyTypes[empty($model->proxyType) ? '' : $model->proxyType]
|
||||
),
|
||||
!empty($model->proxyType) ? item
|
||||
(
|
||||
set::name($lang->ai->models->proxyAddr),
|
||||
empty($model->proxyAddr) ? $lang->ai->models->unconfigured : $model->proxyAddr
|
||||
) : null,
|
||||
item
|
||||
(
|
||||
set::name($lang->ai->models->description),
|
||||
$model->desc
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->statusAB),
|
||||
$lang->ai->models->statusList[$model->enabled]
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
floatToolbar
|
||||
(
|
||||
set::object($model),
|
||||
isAjaxRequest('modal') ? null : to::prefix(backBtn(set::back('ai-models'), set::icon('back'), setClass('ghost text-white'), $lang->goback)),
|
||||
set::main($actions['mainActions']),
|
||||
set::suffix($actions['suffixActions'])
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Chat view of ai module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<div class="chat">
|
||||
<div class="messages">
|
||||
<?php
|
||||
if(!empty($error))
|
||||
{
|
||||
echo "<div class='message-container-error'><div class='message-content'>$error</div></div>";
|
||||
}
|
||||
$shownMessages = array_reverse(array_filter($messages, function($message) { return $message->role != 'system'; }));
|
||||
if(!empty($shownMessages))
|
||||
{
|
||||
foreach($shownMessages as $message)
|
||||
{
|
||||
if($message->role != 'system') echo "<div class='message-container-$message->role'><div class='message-content'>" . htmlspecialchars($message->content) . '</div></div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<div class='message-container-assistant'><div class='message-content'>{$lang->ai->chatPlaceholderMessage}</div></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="chat-input">
|
||||
<textarea name="message" placeholder="<?php echo $lang->ai->chatPlaceholderInput; ?>" autocomplete="off"></textarea>
|
||||
<input type="submit" value class="disabled" disabled />
|
||||
<input type="button" id="reset" <?php if(empty($shownMessages)) echo 'class="disabled"'; ?> value="<?php echo $lang->ai->chatReset; ?>" />
|
||||
</div>
|
||||
<input type="hidden" name="history" value="<?php echo htmlspecialchars(json_encode($messages)); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php include '../../common/view/header.html.php'; ?>
|
||||
<template id="custom-item">
|
||||
<div class="category-item">
|
||||
<div class="category-input"><input type="text" name="custom[]" value="" class="form-control"></div>
|
||||
<div class="category-actions">
|
||||
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(event)"><i class="icon icon-plus"></i></button>
|
||||
<button type="button" class="btn btn-link btn-icon btn-delete" onclick="deleteItem(event)"><i class="icon icon-close"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div id="mainMenu">
|
||||
<div class="btn-toolbar" style="padding-bottom: 2px;">
|
||||
<a href="<?= $this->createLink('ai', 'miniPrograms'); ?>" class="btn btn-secondary">
|
||||
<i class="icon icon-back icon-sm"></i> <?php echo $lang->goback; ?>
|
||||
</a>
|
||||
<div class="divider"></div>
|
||||
<div class="page-title">
|
||||
<span class='text'><?= $lang->ai->miniPrograms->maintenanceGroup; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col">
|
||||
<form class="main-form form-ajax" method='post'>
|
||||
<div class='panel'>
|
||||
<div class='panel-body'>
|
||||
<div class="category-container" style="width: 600px;">
|
||||
<?php foreach ($lang->ai->miniPrograms->categoryList as $key => $value) : ?>
|
||||
<div class="category-item">
|
||||
<div class="category-input"><input disabled type="text" name="<?= $key; ?>" value="<?= $value; ?>" class="form-control"></div>
|
||||
<div class="category-actions">
|
||||
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(event)"><i class="icon icon-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($categoryList as $key => $value) : ?>
|
||||
<div class="category-item">
|
||||
<div class="category-input"><input type="text" name="<?= $key; ?>" value="<?= $value; ?>" class="form-control"></div>
|
||||
<div class="category-actions">
|
||||
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(event)"><i class="icon icon-plus"></i></button>
|
||||
<button type="button" class="btn btn-link btn-icon btn-delete" onclick="deleteItem(event)" <?= in_array($key, $usedCustomCategories) ? 'disabled' : ''; ?>><i class="icon icon-close"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-wide btn-primary"><?= $lang->save; ?></button>
|
||||
<a type="button" class="btn btn-wide" href="<?= $this->createLink('ai', 'miniPrograms'); ?>"><?= $lang->goback; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
/**
|
||||
* The ai input inject view file of ai module of ZenTaoPMS.
|
||||
*
|
||||
* This view file is used to inject ai generated result into
|
||||
* input fields. Include this view file in the target forms.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$this->app->loadConfig('ai');
|
||||
$this->app->loadLang('ai');
|
||||
$module = $this->app->getModuleName();
|
||||
$method = $this->app->getMethodName();
|
||||
if(isset($config->ai->availableForms[$module]) && in_array($method, $config->ai->availableForms[$module])):
|
||||
?>
|
||||
<?php
|
||||
if(isset($_SESSION['aiInjectData']) && isset($_SESSION['aiInjectData'][$module]) && isset($_SESSION['aiInjectData'][$module][$method])) $injectData = $_SESSION['aiInjectData'][$module][$method];
|
||||
if(!empty($injectData)):
|
||||
?>
|
||||
<?php
|
||||
js::set('injectData', $injectData);
|
||||
unset($_SESSION['aiInjectData'][$module]);
|
||||
$this->app->loadLang('ai');
|
||||
?>
|
||||
<script>
|
||||
(function()
|
||||
{
|
||||
function injectToInputElement(inputName, data, index)
|
||||
{
|
||||
if(typeof index !== 'undefined')
|
||||
{
|
||||
inputName = inputName + '[' + index + ']';
|
||||
}
|
||||
|
||||
const $input = $('[name="' + inputName + '"]');
|
||||
if(!$input.length) return;
|
||||
|
||||
const inputType = $input.prop('nodeName');
|
||||
switch(inputType) // Contains case fallthroughs, on purpose.
|
||||
{
|
||||
case 'TEXTAREA':
|
||||
/* Textareas might be controlled by KindEditors. */
|
||||
if(typeof KindEditor !== 'undefined' && KindEditor.instances.length)
|
||||
{
|
||||
const editorInstance = KindEditor.instances.find(function(e)
|
||||
{
|
||||
return e.srcElement.attr('name') == inputName;
|
||||
});
|
||||
if(editorInstance)
|
||||
{
|
||||
if(data === null) data = '';
|
||||
|
||||
/* Remove placeholder. */
|
||||
if(data !== '') editorInstance.$placeholder.each(function(_idx, ph) {ph.style.display = 'none';});
|
||||
|
||||
/* Set editor content and sync with textarea. */
|
||||
editorInstance.html(data);
|
||||
editorInstance.sync();
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
/* For normal inputs, just set the value is enough. */
|
||||
$input.val(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
function inject(obj)
|
||||
{
|
||||
for(const key in obj)
|
||||
{
|
||||
duelWithSpecialInputType(key, obj[key]);
|
||||
if(Array.isArray(obj[key]))
|
||||
{
|
||||
const isStartWith0 = $('[name="' + key + '[0]' + '"]').length;
|
||||
const arr = obj[key];
|
||||
for(let i = 0; i < arr.length; i++)
|
||||
{
|
||||
for(const key in arr[i])
|
||||
{
|
||||
injectToInputElement(key, arr[i][key], isStartWith0 ? i : i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(typeof obj[key] === 'Object')
|
||||
{
|
||||
inject(obj[key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
injectToInputElement(key, obj[key])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function duelWithSpecialInputType(key, value)
|
||||
{
|
||||
if(key === 'steps')
|
||||
{
|
||||
const steps = document.getElementById('steps');
|
||||
if(!steps) return;
|
||||
if(value.length > steps.children.length)
|
||||
{
|
||||
const gap = value.length - steps.children.length;
|
||||
for(let i = 0; i < gap; i++)
|
||||
{
|
||||
const addButton = document.querySelector('#steps > tr:last-child > .step-actions button:first-child');
|
||||
if(!addButton) return;
|
||||
addButton.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function()
|
||||
{
|
||||
try
|
||||
{
|
||||
const data = JSON.parse(injectData);
|
||||
if(!data) return;
|
||||
|
||||
inject(data);
|
||||
|
||||
$.zui.messager.success('<?php echo $lang->ai->dataInject->success;?>');
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
$.zui.messager.danger('<?php echo $lang->ai->dataInject->fail;?>');
|
||||
console.error(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
/* Set injected in oreder to cancel loading class on object view (see promptmenu.html.php). */
|
||||
sessionStorage.setItem('ai-prompt-data-injected', true);
|
||||
|
||||
const container = window.frameElement?.closest('.load-indicator');
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
delete container.dataset.loading;
|
||||
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php if(isset($_SESSION['aiPrompt']['prompt']) && $_SESSION['aiPrompt']['objectId']):
|
||||
$prompt = $_SESSION['aiPrompt']['prompt'];
|
||||
$objectId = $_SESSION['aiPrompt']['objectId'];
|
||||
$isAudit = isset($_SESSION['auditPrompt']) && time() - $_SESSION['auditPrompt']['time'] < 10 * 60;
|
||||
?>
|
||||
<script>
|
||||
(function() {
|
||||
const isAudit = <?php echo $isAudit ? 'true' : 'false';?>;
|
||||
const promptId = '<?php echo $prompt->id;?>';
|
||||
|
||||
<?php if(isset($config->ai->injectAuditButton->locations[$module][$method])) :?>
|
||||
function injectAuditAction()
|
||||
{
|
||||
<?php
|
||||
$htmlStr = html::commonButton($lang->ai->promptPublish, "id='promptPublish' data-promptId=$prompt->id", 'btn btn-primary btn-wide');
|
||||
$targetContainer = $config->ai->injectAuditButton->locations[$module][$method]['action']->targetContainer;
|
||||
$injectMethod = $config->ai->injectAuditButton->locations[$module][$method]['action']->injectMethod;
|
||||
if($module == 'doc'):
|
||||
$containerStyles = empty($config->ai->injectAuditButton->locations[$module][$method]['action']->containerStyles) ? '{}' : $config->ai->injectAuditButton->locations[$module][$method]['action']->containerStyles;
|
||||
$exitAuditButton = html::commonButton($lang->ai->audit->exit, "id='promptAuditExit'", 'btn');
|
||||
?>
|
||||
const containerStyles = JSON.parse('<?php echo $containerStyles;?>');
|
||||
const htmlStr = `<?php echo $htmlStr;?>`;
|
||||
$('<?php echo $targetContainer;?>')['<?php echo $injectMethod;?>'](htmlStr);
|
||||
$('<?php echo $targetContainer;?>').css(containerStyles);
|
||||
|
||||
$('#mainContent #headerBox td:first-child').html(`<?php echo $exitAuditButton;?>`);
|
||||
<?php else:
|
||||
$htmlStr = $htmlStr . html::commonButton($lang->ai->audit->exit, "id='promptAuditExit'", 'btn btn-wide');
|
||||
?>
|
||||
const htmlStr = `<?php echo $htmlStr;?>`;
|
||||
$('<?php echo $targetContainer;?>')['<?php echo $injectMethod;?>'](htmlStr);
|
||||
<?php endif;?>
|
||||
}
|
||||
|
||||
function injectAuditToolbar()
|
||||
{
|
||||
<?php
|
||||
$htmlStr = html::a(helper::createLink('ai', 'promptexecute', "promptId=$prompt->id&objectId=$objectId"), '<i class="icon icon-refresh muted"></i> ' . $lang->ai->audit->regenerate, '', 'id="promptRegenerate" class="btn btn-link"');
|
||||
if($isAudit)
|
||||
{
|
||||
$htmlStr = $htmlStr . html::a(helper::createLink('ai', 'promptaudit', "promptId=$prompt->id&objectId=$objectId"), $lang->ai->audit->designPrompt, '', 'id="promptAudit" class="btn btn-info iframe"');
|
||||
}
|
||||
$targetContainer = $config->ai->injectAuditButton->locations[$module][$method]['toolbar']->targetContainer;
|
||||
$injectMethod = $config->ai->injectAuditButton->locations[$module][$method]['toolbar']->injectMethod;
|
||||
if(!empty($config->ai->injectAuditButton->locations[$module][$method]['toolbar']->class)) $htmlStr = '<div class="' . $config->ai->injectAuditButton->locations[$module][$method]['toolbar']->class . '">' . $htmlStr . '</div>';
|
||||
?>
|
||||
const targetContainer = `<?php echo $targetContainer;?>`;
|
||||
const injectMethod = `<?php echo $injectMethod;?>`;
|
||||
const htmlStr = `<?php echo $htmlStr;?>`;
|
||||
$(targetContainer)[injectMethod](htmlStr);
|
||||
}
|
||||
|
||||
if(isAudit)
|
||||
{
|
||||
injectAuditAction();
|
||||
}
|
||||
if(typeof injectData !== 'undefined')
|
||||
{
|
||||
injectAuditToolbar();
|
||||
}
|
||||
<?php endif;?>
|
||||
|
||||
const publishButton = document.getElementById('promptPublish');
|
||||
if(publishButton)
|
||||
{
|
||||
publishButton.addEventListener('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
const promptId = publishButton.dataset.promptid;
|
||||
const aTag = document.createElement('a');
|
||||
aTag.href = createLink('ai', 'promptPublish', 'promptId=' + promptId + '&backToTestingLocation=true') + '#app=admin';
|
||||
aTag.style.display = 'none';
|
||||
document.body.appendChild(aTag);
|
||||
aTag.click();
|
||||
|
||||
if($.appCode !== 'admin') $.apps.close($.appCode);
|
||||
});
|
||||
}
|
||||
|
||||
const auditExitButton = document.getElementById('promptAuditExit');
|
||||
if(auditExitButton)
|
||||
{
|
||||
auditExitButton.addEventListener('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
const aTag = document.createElement('a');
|
||||
aTag.href = createLink('ai', 'promptAudit', 'promptId=' + promptId + '&objectId=0' + '&exit=true') + '#app=admin';
|
||||
aTag.style.display = 'none';
|
||||
document.body.appendChild(aTag);
|
||||
aTag.click();
|
||||
|
||||
if($.appCode !== 'admin') $.apps.close($.appCode);
|
||||
});
|
||||
}
|
||||
|
||||
const regenerateButton = document.getElementById('promptRegenerate');
|
||||
if(regenerateButton)
|
||||
{
|
||||
regenerateButton.addEventListener('click', function()
|
||||
{
|
||||
$('body').attr('data-loading', '<?php echo $lang->ai->execute->loading;?>');
|
||||
$('body').addClass('load-indicator loading');
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
include '../../common/view/header.html.php';
|
||||
$finalList = array_merge($categoryList, $lang->ai->miniPrograms->allCategories);
|
||||
$isNotOpen = $config->edition != 'open';
|
||||
?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="sidebarHeader">
|
||||
<div class="title" title="<?= $finalList[$category]; ?>">
|
||||
<?= $finalList[$category]; ?>
|
||||
<?php if($category) echo html::a($this->createLink('ai', 'miniPrograms'), "<i class='icon icon-sm icon-close'></i>", '', "class='text-muted'"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
foreach($this->lang->ai->miniPrograms->statuses as $statusKey => $statusName)
|
||||
{
|
||||
echo html::a($this->createLink('ai', 'miniPrograms', "category=$category&status=$statusKey"), "<span class='text'>{$this->lang->ai->miniPrograms->statuses[$statusKey]}" . ($status == $statusKey ? '<span class="label label-light label-badge" style="margin-left: 4px;">' . $pager->recTotal . '</span>' : '') . "</span>", '', "id='status-$statusKey' class='btn btn-link" . ($status == $statusKey ? ' btn-active-text' : '') . "'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('ai', 'importMiniProgram')): ?>
|
||||
<a class="btn btn-link" data-toggle="tooltip" data-placement="top" title="<?= $lang->ai->toZentaoStoreAIPage; ?>" href="https://www.zentao.net/extension-browse-1625.html" target="_blank">
|
||||
<i class="icon icon-help"></i>
|
||||
<?= $lang->help; ?>
|
||||
</a>
|
||||
<a class="btn btn-primary" data-toggle="modal" data-target="#import-miniprogram">
|
||||
<i class="icon icon-import"></i>
|
||||
<?= $lang->ai->import; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if($isNotOpen && common::hasPriv('ai', 'createMiniProgram')): ?>
|
||||
<?= html::a($this->createLink('ai', 'createMiniProgram'), "<i class='icon icon-plus'></i> " . $lang->ai->miniPrograms->create, '', "class='btn btn-primary'"); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="disable-miniprogram">
|
||||
<div class="modal-dialog" style="width: 480px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="border-bottom: none; padding-left: 12px; display: flex; align-items: center;">
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.0159" cy="12.0163" r="12" transform="rotate(0.0777774 12.0159 12.0163)" fill="#FFA34D" />
|
||||
<path d="M12.4516 14.621C12.8867 14.6215 13.3224 14.1498 13.3231 13.6775L13.6588 7.42006C13.6595 6.94777 13.661 6.00319 12.3559 6.0016C11.1595 6.00013 11.0495 6.8265 11.0486 7.41686L11.3655 13.6751C11.5823 14.1476 12.0166 14.6204 12.4516 14.621ZM12.4499 15.8017C11.7973 15.8009 11.1439 16.3905 11.1426 17.217C11.1416 17.9254 11.6843 18.6345 12.4456 18.6354C13.2069 18.6363 13.7516 18.0467 13.7528 17.2202C13.7541 16.3936 13.1024 15.8025 12.4499 15.8017Z" fill="white" />
|
||||
</svg>
|
||||
<span style="padding-left: 16px;"><?= $lang->ai->miniPrograms->disableTip; ?></span>
|
||||
</div>
|
||||
<div class="modal-footer" style="display: flex; justify-content: center; border-top: none; padding-top: 0;">
|
||||
<button type="button" class="btn btn-primary" onclick="unpublishMiniProgram()" data-dismiss="modal"><?= $lang->confirm; ?></button>
|
||||
<button type="button" class="btn" data-dismiss="modal"><?= $lang->cancel; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="delete-miniprogram">
|
||||
<div class="modal-dialog" style="width: 480px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="border-bottom: none; padding-left: 12px; display: flex; align-items: center;">
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.0159" cy="12.0163" r="12" transform="rotate(0.0777774 12.0159 12.0163)" fill="#FFA34D" />
|
||||
<path d="M12.4516 14.621C12.8867 14.6215 13.3224 14.1498 13.3231 13.6775L13.6588 7.42006C13.6595 6.94777 13.661 6.00319 12.3559 6.0016C11.1595 6.00013 11.0495 6.8265 11.0486 7.41686L11.3655 13.6751C11.5823 14.1476 12.0166 14.6204 12.4516 14.621ZM12.4499 15.8017C11.7973 15.8009 11.1439 16.3905 11.1426 17.217C11.1416 17.9254 11.6843 18.6345 12.4456 18.6354C13.2069 18.6363 13.7516 18.0467 13.7528 17.2202C13.7541 16.3936 13.1024 15.8025 12.4499 15.8017Z" fill="white" />
|
||||
</svg>
|
||||
<span style="padding-left: 16px;"><?= $lang->ai->miniPrograms->deleteTip; ?></span>
|
||||
</div>
|
||||
<div class="modal-footer" style="display: flex; justify-content: center; border-top: none; padding-top: 0;">
|
||||
<button type="button" class="btn btn-primary" onclick="deleteMiniProgram('1')" data-dismiss="modal"><?= $lang->confirm; ?></button>
|
||||
<button type="button" class="btn" data-dismiss="modal"><?= $lang->cancel; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="publish-miniprogram">
|
||||
<div class="modal-dialog" style="width: 480px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="border-bottom: none; padding-left: 12px; display: flex; align-items: center;">
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.0159" cy="12.0163" r="12" transform="rotate(0.0777774 12.0159 12.0163)" fill="#FFA34D" />
|
||||
<path d="M12.4516 14.621C12.8867 14.6215 13.3224 14.1498 13.3231 13.6775L13.6588 7.42006C13.6595 6.94777 13.661 6.00319 12.3559 6.0016C11.1595 6.00013 11.0495 6.8265 11.0486 7.41686L11.3655 13.6751C11.5823 14.1476 12.0166 14.6204 12.4516 14.621ZM12.4499 15.8017C11.7973 15.8009 11.1439 16.3905 11.1426 17.217C11.1416 17.9254 11.6843 18.6345 12.4456 18.6354C13.2069 18.6363 13.7516 18.0467 13.7528 17.2202C13.7541 16.3936 13.1024 15.8025 12.4499 15.8017Z" fill="white" />
|
||||
</svg>
|
||||
<span style="padding-left: 16px;"><?= $lang->ai->miniPrograms->publishTip; ?></span>
|
||||
</div>
|
||||
<div class="modal-footer" style="display: flex; justify-content: center; border-top: none; padding-top: 0;">
|
||||
<button type="button" class="btn btn-primary" onclick="publishMiniProgram()" data-dismiss="modal"><?= $lang->confirm; ?></button>
|
||||
<button type="button" class="btn" data-dismiss="modal"><?= $lang->cancel; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="import-miniprogram">
|
||||
<div class="modal-dialog" style="width: 600px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<strong style="font-size: 20px; color: #0B0F18;"><?= $lang->ai->import; ?></strong>
|
||||
<a data-dismiss="modal" class="close-import-dialog">
|
||||
<i class="icon-close"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-ajax" method="post" action="<?= $this->createLink('ai', 'importMiniProgram'); ?>" id="import-miniprogram-form">
|
||||
<table class="table table-form">
|
||||
<tr>
|
||||
<th><?= $lang->ai->installPackage; ?></th>
|
||||
<td>
|
||||
<?= html::file('file', "accept='.zip' class='form-control'"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= $lang->ai->miniPrograms->category; ?></th>
|
||||
<td>
|
||||
<?= html::select('category', array_merge($lang->ai->miniPrograms->categoryList, $categoryList), $category, "class='form-control chosen'"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= $lang->ai->toPublish; ?></th>
|
||||
<td>
|
||||
<div class="radio" style="display: flex; align-items: center; gap: 4px;">
|
||||
<label>
|
||||
<input type="radio" name="published" value="1"><?= $lang->ai->miniPrograms->field->requiredOptions[1]; ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="published" value="0" checked><?= $lang->ai->miniPrograms->field->requiredOptions[0]; ?>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="display: flex; justify-content: center; border-top: none; padding-top: 10px;">
|
||||
<button type="submit" class="btn btn-primary btn-wide"><?= $lang->save; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row fade">
|
||||
<div class="side-col" id="sidebar">
|
||||
<div class="cell">
|
||||
<ul id="modules" class="tree" data-ride="tree" data-name="tree-modules">
|
||||
<?php foreach($categoryList as $key => $value): ?>
|
||||
<li <?php if($category == $key) echo 'class="active"'; ?>>
|
||||
<a href="<?= $this->createLink('ai', 'miniPrograms', "category=$key"); ?>"><?= $value; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php if(common::hasPriv('ai', 'editMiniProgramCategory')): ?>
|
||||
<div class="text-center">
|
||||
<a class="btn btn-info btn-wide" href="<?= $this->createLink('ai', 'editMiniProgramCategory'); ?>"><?= $lang->ai->maintenanceGroup; ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-col">
|
||||
<?php if(empty($miniPrograms)): ?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->ai->miniPrograms->emptyList;?></span>
|
||||
<?php if($isNotOpen && common::hasPriv('ai', 'createMiniProgram')) echo html::a($this->createLink('ai', 'createMiniProgram'), "<i class='icon icon-plus'></i> " . $lang->ai->miniPrograms->create, '', "class='btn btn-info'");?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="main-table">
|
||||
<table class="main-table table has-sort-head table-fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $vars = "category=$category&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<th class="c-id" style="width: 70px;"><?php common::printOrderLink('id', $orderBy, $vars, 'ID'); ?></th>
|
||||
<th class="c-name" style="width: 30%;"><?= $lang->prompt->name; ?></th>
|
||||
<th class="c-status"><?= $lang->prompt->status; ?></th>
|
||||
<th class="c-category"><?= $lang->prompt->module; ?></th>
|
||||
<th class="c-createdby"><?= $lang->prompt->createdBy; ?></th>
|
||||
<th class="c-createddate w-130px"><?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->prompt->createdDate); ?></th>
|
||||
<th class="c-publisheddate w-130px"><?php common::printOrderLink('publishedDate', $orderBy, $vars, $lang->ai->miniPrograms->latestPublishedDate); ?></th>
|
||||
<th class="c-actions" style="width: 160px;"><?= $lang->actions; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($miniPrograms as $miniProgram) : ?>
|
||||
<tr>
|
||||
<td class="c-id"><?= $miniProgram->id; ?></td>
|
||||
<?php $link = $isNotOpen && common::hasPriv('ai', 'miniProgramView') ? $this->createLink('ai', 'miniProgramView', "id={$miniProgram->id}") : null; ?>
|
||||
<td class="c-name" title="<?= $miniProgram->name; ?>"><?= is_null($link) ? $miniProgram->name : "<a href='$link'>{$miniProgram->name}</a>" ?></td>
|
||||
<td class="c-status"><?= $miniProgram->publishedLabel; ?></td>
|
||||
<td class="c-category"><?= $miniProgram->categoryLabel; ?></td>
|
||||
<td class="c-createdby"><?= $miniProgram->createdByLabel; ?></td>
|
||||
<td class="c-createddate"><?= $miniProgram->createdDate; ?></td>
|
||||
<td class="c-publisheddate"><?= $miniProgram->publishedDate; ?></td>
|
||||
<td class="c-actions">
|
||||
<?php
|
||||
$isPublished = $miniProgram->published === '1';
|
||||
$isBuiltIn = $miniProgram->builtIn === '1';
|
||||
?>
|
||||
<?php
|
||||
if($isNotOpen && common::hasPriv('ai', 'editMiniProgram'))
|
||||
{
|
||||
echo $isPublished || $isBuiltIn
|
||||
? "<button class='btn' disabled title='{$lang->ai->prompts->action->edit}'><i class='icon icon-edit text-primary'></i></button>"
|
||||
: "<a class='btn' title='{$lang->ai->prompts->action->edit}' href='{$this->createLink('ai', 'editMiniProgram', "appID=$miniProgram->id")}'><i class='icon icon-edit text-primary'></i></a>";
|
||||
}
|
||||
?>
|
||||
<?php if($isNotOpen && common::hasPriv('ai', 'testMiniProgram')): ?>
|
||||
<button
|
||||
class="btn iframe"
|
||||
data-toggle="modal"
|
||||
data-width="800"
|
||||
data-height="500"<?= $isPublished || $isBuiltIn ? ' disabled' : ''; ?>
|
||||
title="<?= $lang->ai->prompts->action->test; ?>"
|
||||
data-iframe="<?= $this->createLink('ai', 'testMiniProgram', "appID={$miniProgram->id}&onlybody=yes"); ?>"
|
||||
>
|
||||
<i class="icon icon-menu-backend text-primary"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if(common::hasPriv('ai', 'publishMiniProgram')): ?>
|
||||
<button class="btn" onclick="openPublishDialog(event)" title="<?= $lang->ai->prompts->action->publish; ?>"<?= $miniProgram->canPublish ? '' : ' disabled'; ?>>
|
||||
<i class="icon icon-publish text-primary"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if(common::hasPriv('ai', 'unpublishMiniProgram')): ?>
|
||||
<button class="btn" onclick="openDisableDialog(event)" title="<?= $lang->ai->prompts->action->unpublish; ?>"<?= $isPublished ? '' : ' disabled'; ?>>
|
||||
<i class="icon icon-ban-circle text-primary"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if($isNotOpen && common::hasPriv('ai', 'exportMiniProgram')): ?>
|
||||
<button class="btn" onclick="exportMiniProgram(event)" title="<?= $lang->ai->export; ?>"<?= $isPublished && !$isBuiltIn ? '' : ' disabled'; ?>>
|
||||
<i class="icon icon-export text-primary"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<div class="table-statistic"><?= sprintf($lang->ai->miniPrograms->summary, count($miniPrograms)); ?></div>
|
||||
<?php $pager->show('right', 'pagerjs'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* The ai prompt menu view file of ai module of ZenTaoPMS.
|
||||
*
|
||||
* This view file is used to print the prompt menu, acts just like header php files.
|
||||
* Prompt menus are generated with php and injected with javascript. A lot of hacking
|
||||
* went into this, so please don't touch it unless you know what you are doing.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$this->loadModel('ai');
|
||||
if($this->ai->hasModelsAvailable() && commonModel::hasPriv('ai', 'promptExecute')):?>
|
||||
<?php
|
||||
$this->app->loadConfig('ai');
|
||||
$module = $this->app->getModuleName();
|
||||
$method = $this->app->getMethodName();
|
||||
if(isset($config->ai->menuPrint->locations[$module][$method])):
|
||||
?>
|
||||
<?php
|
||||
$menuOptions = $config->ai->menuPrint->locations[$module][$method];
|
||||
$prompts = $this->ai->getPromptsForUser($menuOptions->module);
|
||||
$prompts = $this->ai->filterPromptsForExecution($prompts, true);
|
||||
if(!empty($prompts)):
|
||||
?>
|
||||
<?php
|
||||
$html = '';
|
||||
$objectVarName = empty($menuOptions->objectVarName) ? $menuOptions->module : $menuOptions->objectVarName;
|
||||
$currentObjectId = !empty($this->view->$objectVarName) ? $this->view->$objectVarName->id : 0;
|
||||
if(count($prompts) > 1)
|
||||
{
|
||||
$html .= '<div class="prompts dropdown' . ((isset($menuOptions->class) ? ' ' . $menuOptions->class : '') . (isset($menuOptions->dropdownClass) ? ' ' . $menuOptions->dropdownClass : '')) . '"><button class="btn btn-link' . (isset($menuOptions->buttonClass) ? ' ' . $menuOptions->buttonClass : '') . '" type="button" data-toggle="dropdown">' . $lang->ai->promptMenu->dropdownTitle . ' <i class="icon-caret-down"></i></button><ul class="dropdown-menu pull-right">';
|
||||
foreach($prompts as $prompt) $html .= '<li>' . html::linkButton($prompt->name . ($prompt->status != 'active' ? '<span class="label label-info label-badge" style="margin-left: 4px;">' . $lang->ai->prompts->statuses[$prompt->status] . '</span>' : ''), helper::createLink('ai', 'promptExecute', "promptId=$prompt->id&objectId=$currentObjectId"), 'self', "style='width: 100%;'" . (empty($prompt->unauthorized) ? '' : ' disabled') . (empty($prompt->desc) ? '' : " data-toggle='popover' data-container='body' data-trigger='hover' data-content='$prompt->desc' data-title='$prompt->name' data-placement='left'"), 'btn btn-link text-left') . '</li>';
|
||||
$html .= '</ul></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$prompt = current($prompts);
|
||||
$html .= html::linkButton($prompt->name . ($prompt->status != 'active' ? '<span class="label label-info label-badge" style="margin-left: 4px;">' . $lang->ai->prompts->statuses[$prompt->status] . '</span>' : ''), helper::createLink('ai', 'promptExecute', "promptId=$prompt->id&objectId=$currentObjectId"), 'self', (empty($prompt->unauthorized) ? '' : 'disabled') . (empty($prompt->desc) ? '' : " data-toggle='popover' data-container='body' data-trigger='hover' data-content='$prompt->desc' data-title='$prompt->name' data-placement='bottom'"), 'prompt btn btn-link' . ((isset($menuOptions->class) ? ' ' . $menuOptions->class : '') . (isset($menuOptions->buttonClass) ? ' ' . $menuOptions->buttonClass : '')));
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if(isset($menuOptions->stylesheet)):?>
|
||||
<style><?php echo $menuOptions->stylesheet;?></style>
|
||||
<?php endif;?>
|
||||
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
if(window.location.search.includes('onlybody')) return;
|
||||
const container = window.frameElement?.closest('.load-indicator');
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
|
||||
$(`<?php echo $menuOptions->targetContainer;?>`).<?php echo isset($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append';?>(`<?php echo $html;?>`);
|
||||
$('[data-toggle="popover"]').popover({template: '<div class="popover"><h3 class="popover-title"></h3><div class="popover-content"></div></div>'});
|
||||
|
||||
$('<?php echo count($prompts) > 1 ? '.prompts.dropdown ul.dropdown-menu' : '.prompt';?>').on('click', <?php if(count($prompts) > 1) echo "'button',";?> function(e)
|
||||
{
|
||||
if(!container) return;
|
||||
container.dataset.loading = e.target.querySelector('.label') ? '<?php echo $lang->ai->execute->auditing;?>' : '<?php echo $lang->ai->execute->loading;?>';
|
||||
container.classList.add('loading');
|
||||
container.classList.add('no-delay');
|
||||
|
||||
/* Checks for session storage to cancel loading status (see inputinject.html.php). */
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
const loadCheckInterval = setInterval(function()
|
||||
{
|
||||
if(sessionStorage.getItem('ai-prompt-data-injected'))
|
||||
{
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
clearInterval(loadCheckInterval);
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php endif; endif; endif;?>
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
/**
|
||||
* The ai prompts view file of ai module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* Prompt action menu printer, based on prompt status and completion state.
|
||||
*
|
||||
* @param object $prompt prompt object
|
||||
* @return void
|
||||
*/
|
||||
$printPromptActionMenu = function($prompt) use($lang)
|
||||
{
|
||||
$html = '';
|
||||
$executable = $this->ai->isExecutable($prompt);
|
||||
$published = $prompt->status == 'active';
|
||||
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
/* Design button. */
|
||||
if(common::hasPriv('ai', 'promptassignrole')) $html .= html::a(helper::createLink('ai', 'promptassignrole', "prompt=$prompt->id"), '<i class="icon-design text-primary"></i>', '', "class='btn" . ($published ? ' disabled' : '') . "' title='{$lang->ai->prompts->action->design}'");
|
||||
|
||||
/* Test / audit button. */
|
||||
if(common::hasPriv('ai', 'promptaudit')) $html .= html::a($executable ? $this->ai->getTestingLocation($prompt) : '#', '<i class="icon-menu-backend text-primary"></i>', '', "id='prompt-audit-button-$prompt->id' class='prompt-audit-btn btn" . ($executable && !$published ? '' : ' disabled') . "' title='{$lang->ai->prompts->action->test}'" . ($executable ? '' : " data-toggle='modal' data-target='#designConfirmModal'"));
|
||||
|
||||
/* Edit button. */
|
||||
if(common::hasPriv('ai', 'promptedit')) $html .= html::a(helper::createLink('ai', 'promptedit', "prompt=$prompt->id"), '<i class="icon-edit text-primary"></i>', '', "class='btn' title='{$lang->ai->prompts->action->edit}'");
|
||||
|
||||
/* Divider. */
|
||||
if(common::hasPriv('ai', 'promptpublish') || common::hasPriv('ai', 'promptunpublish')) $html .= '<div class="dividing-line"></div>';
|
||||
}
|
||||
/* Publish button. */
|
||||
if(common::hasPriv('ai', 'promptpublish')) $html .= html::a(!$published && $executable ? "javascript:togglePromptStatus($prompt->id)" : '#', '<i class="icon-publish text-primary"></i>', '', "class='btn" . (!$published && $executable ? '' : ' disabled') . "' title='{$lang->ai->prompts->action->publish}'" . ($executable ? '' : " data-toggle='modal' data-target='#designConfirmModal'"));
|
||||
|
||||
/* Unpublish button. */
|
||||
if(common::hasPriv('ai', 'promptunpublish')) $html .= html::a('#', '<i class="icon-ban text-primary"></i>', '', "class='btn" . (!$published || !$executable ? ' disabled' : '') . "' title='{$lang->ai->prompts->action->unpublish}'" . (!$published ? '' : " data-toggle='modal' data-target='#draftConfirmModal'"));
|
||||
|
||||
echo $html;
|
||||
}
|
||||
?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="sidebarHeader">
|
||||
<div class="title" title="<?php echo $this->lang->ai->prompts->modules[$module];?>">
|
||||
<?php echo $this->lang->ai->prompts->modules[$module];?>
|
||||
<?php if($module) echo html::a($this->createLink('ai', 'prompts'), "<i class='icon icon-sm icon-close'></i>", '', "class='text-muted'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
foreach($this->lang->ai->prompts->statuses as $statusKey => $statusName)
|
||||
{
|
||||
echo html::a($this->createLink('ai', 'prompts', "module=$module&status=$statusKey"), "<span class='text'>{$this->lang->ai->prompts->statuses[$statusKey]}" . ($status == $statusKey ? '<span class="label label-light label-badge" style="margin-left: 4px;">' . $pager->recTotal . '</span>' : '') . "</span>", '' ,"id='status-$statusKey' class='btn btn-link" . ($status == $statusKey ? ' btn-active-text' : '') . "'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if($this->config->edition != 'open' && common::hasPriv('ai', 'createprompt')) echo html::a($this->createLink('ai', 'createprompt'), "<i class='icon icon-plus'></i> " . $lang->ai->prompts->create, '', "class='btn btn-primary iframe'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row fade">
|
||||
<div class="side-col" id="sidebar">
|
||||
<div class="cell">
|
||||
<ul id="modules" class="tree" data-ride="tree" data-name="tree-modules">
|
||||
<?php
|
||||
$moduleList = $this->config->edition != 'open'
|
||||
? $this->lang->ai->prompts->modules
|
||||
: array_filter($this->lang->ai->prompts->modules, function($v, $k) use ($promptModules)
|
||||
{
|
||||
return in_array($k, $promptModules);
|
||||
}, ARRAY_FILTER_USE_BOTH);
|
||||
?>
|
||||
<?php foreach($moduleList as $moduleKey => $moduleName): ?>
|
||||
<li <?php if($module == $moduleKey) echo 'class="active"'; ?>><a
|
||||
href="<?php echo $this->createLink('ai', 'prompts', "module=$moduleKey"); ?>"><?php echo $moduleName; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-col">
|
||||
<?php if(empty($prompts)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->ai->prompts->emptyList;?></span>
|
||||
<?php if($this->config->edition != 'open' && common::hasPriv('ai', 'createprompt')) echo html::a($this->createLink('ai', 'createprompt'), "<i class='icon icon-plus'></i> " . $lang->ai->prompts->create, '', "class='btn btn-info iframe'");?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='main-table'>
|
||||
<table class='main-table table has-sort-head table-fixed' id='promptList'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $vars = "module=$module&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='c-id text-left w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->ai->prompts->id);?></th>
|
||||
<th class='c-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->ai->prompts->name);?></th>
|
||||
<?php if(empty($status)):?>
|
||||
<th class='c-status w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->ai->prompts->stage);?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-createdby w-120px'><?php common::printOrderLink('createdby', $orderBy, $vars, $lang->ai->prompts->createdBy);?></th>
|
||||
<th class='c-createddate w-180px'><?php common::printOrderLink('createddate', $orderBy, $vars, $lang->ai->prompts->createdDate);?></th>
|
||||
<th class='c-targetform w-200px'><?php common::printOrderLink('targetform', $orderBy, $vars, $lang->ai->prompts->targetForm);?></th>
|
||||
<th class='text-center c-actions-5'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($prompts as $prompt):?>
|
||||
<tr>
|
||||
<td class='c-id'><?php echo $prompt->id;?></td>
|
||||
<td class='c-name'><?php echo html::a(helper::createLink('ai', 'promptview', "id=$prompt->id"), $prompt->name, '_self', "title='$prompt->name'");?></td>
|
||||
<?php if(empty($status)):?>
|
||||
<td class='c-status'><?php echo $lang->ai->prompts->statuses[$prompt->status];?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-createdby'><?php echo zget($users, $prompt->createdBy);?></td>
|
||||
<td class='c-createddate'><?php echo $prompt->createdDate;?></td>
|
||||
<td class='c-targetform'>
|
||||
<?php
|
||||
if($prompt->targetForm)
|
||||
{
|
||||
$targetFormPath = explode('.', $prompt->targetForm);
|
||||
if(count($targetFormPath) == 2) echo $lang->ai->targetForm[$targetFormPath[0]]['common'] . ' / ' . $lang->ai->targetForm[$targetFormPath[0]][$targetFormPath[1]];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class='text-center c-actions' data-prompt-id='<?php echo $prompt->id?>'>
|
||||
<?php $printPromptActionMenu($prompt);?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<div class="table-statistic"><?php echo sprintf($lang->ai->prompts->summary, count($prompts));?></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="designConfirmModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<p><?php echo $lang->ai->prompts->action->goDesignConfirm?></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="goDesignButton" type="button" class="btn btn-primary"><?php echo $lang->ai->prompts->action->goDesign?></button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang->cancel?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="draftConfirmModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<p><?php echo $lang->ai->prompts->action->draftConfirm?></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="draftPromptButton" type="button" class="btn btn-primary"><?php echo $lang->confirm?></button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang->cancel?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
const container = window.frameElement?.closest('.load-indicator');
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
/* Handle clicks from audit button without auditable objects. */
|
||||
$('.prompt-audit-btn[href=""]').click(function(e)
|
||||
{
|
||||
$.zui.messager.danger('<?php echo $lang->ai->prompts->goingTestingFail;?>');
|
||||
return false;
|
||||
});
|
||||
$('.prompt-audit-btn[href!=""][href!="#"]').click(function(e)
|
||||
{
|
||||
if(!container) return;
|
||||
container.dataset.loading = '<?php echo $lang->ai->execute->auditing;?>';
|
||||
container.classList.add('loading');
|
||||
container.classList.add('no-delay');
|
||||
|
||||
/* Checks for session storage to cancel loading status (see inputinject.html.php). */
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
const loadCheckInterval = setInterval(function()
|
||||
{
|
||||
if(sessionStorage.getItem('ai-prompt-data-injected'))
|
||||
{
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
clearInterval(loadCheckInterval);
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,222 @@
|
||||
<?php
|
||||
/**
|
||||
* The ai prompt details view file of ai module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php $this->app->tab = 'admin'; // Force tab to be `admin` so that feature menu will be printed correctly. ?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php echo html::a(helper::createLink('ai', 'prompts'), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
<div class="divider"></div>
|
||||
<div class="page-title">
|
||||
<span class="label label-id"><?php echo $prompt->id;?></span>
|
||||
<span class="text" title='<?php echo $prompt->name;?>'><?php echo $prompt->name;?></span>
|
||||
<?php if($prompt->deleted) echo "<span class='label label-danger'>{$lang->ai->prompts->deleted}</span>";?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($this->config->edition != 'open'): ?>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('ai', 'createprompt')) echo html::a(helper::createLink('ai', 'createprompt'), "<i class='icon icon-plus'></i> {$lang->ai->prompts->create}", '', "class='btn btn-primary iframe'"); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col col-8">
|
||||
<div class="cell prompt-details">
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->role;?></div>
|
||||
<div class="detail-content article-content"><?php echo $prompt->role;?></div>
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->characterization;?></div>
|
||||
<div class="detail-content article-content"><?php echo $prompt->characterization;?></div>
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->object;?></div>
|
||||
<div class="detail-content article-content"><?php echo $prompt->module ? $this->lang->ai->dataSource[$prompt->module]['common'] : ''; ?></div>
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->field;?></div>
|
||||
<div class="detail-content article-content"><?php echo $dataPreview;?></div>
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->setPurpose;?></div>
|
||||
<div class="detail-content article-content"><?php echo $prompt->purpose;?></div>
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->elaboration;?></div>
|
||||
<div class="detail-content article-content"><?php echo $prompt->elaboration;?></div>
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->ai->prompts->selectTargetForm;?></div>
|
||||
<div class="detail-content article-content">
|
||||
<?php
|
||||
if(empty($prompt->targetForm)) echo '';
|
||||
else
|
||||
{
|
||||
$targetForm = explode('.', $prompt->targetForm);
|
||||
echo $this->lang->ai->targetForm[$targetForm[0]][$targetForm[1]];
|
||||
}
|
||||
?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell"><?php include '../../common/view/action.html.php';?></div>
|
||||
<?php if($this->config->edition != 'open'): ?>
|
||||
<div class='main-actions'>
|
||||
<div class="btn-toolbar">
|
||||
<?php echo html::a(helper::createLink('ai', 'prompts'), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn'"); ?>
|
||||
<?php if(!$prompt->deleted): ?>
|
||||
<?php if(($prompt->status == 'draft' && (common::hasPriv('ai', 'promptassignrole') || common::hasPriv('ai', 'promptaudit') || common::hasPriv('ai', 'publish'))) || ($prompt->status != 'draft' && common::hasPriv('ai', 'unpublish'))): ?>
|
||||
<div class='divider'></div><?php endif; ?>
|
||||
<?php if(common::hasPriv('ai', 'promptassignrole') && $prompt->status == 'draft') echo html::a(helper::createLink('ai', 'promptassignrole', "prompt=$prompt->id"), '<i class="icon icon-design icon-sm"></i> ' . $lang->ai->prompts->action->design, '', "class='btn'"); ?>
|
||||
<?php if(common::hasPriv('ai', 'promptaudit') && $prompt->status == 'draft' && $this->ai->isExecutable($prompt)) echo html::a($this->ai->getTestingLocation($prompt), '<i class="icon icon-menu-backend icon-sm"></i> ' . $lang->ai->prompts->action->test, '', "class='btn prompt-audit-btn'"); ?>
|
||||
<?php if(common::hasPriv('ai', 'promptpublish') && $prompt->status == 'draft' && $this->ai->isExecutable($prompt)) echo html::a(helper::createLink('ai', 'promptpublish', "id={$prompt->id}"), '<i class="icon icon-publish icon-sm"></i> ' . $lang->ai->prompts->action->publish, '', "class='btn'"); ?>
|
||||
<?php if(common::hasPriv('ai', 'promptunpublish') && $prompt->status == 'active') echo html::a(helper::createLink('ai', 'promptunpublish', "id={$prompt->id}"), '<i class="icon icon-ban icon-sm"></i> ' . $lang->ai->prompts->action->unpublish, '', "class='btn' id='unpublish-btn'"); ?>
|
||||
<?php if(common::hasPriv('ai', 'promptedit') || common::hasPriv('ai', 'promptdelete')): ?>
|
||||
<div class='divider'></div><?php endif; ?>
|
||||
<?php if(common::hasPriv('ai', 'promptedit')) echo html::a(helper::createLink('ai', 'promptedit', "prompt=$prompt->id"), '<i class="icon icon-edit icon-sm"></i>', '', "class='btn' title='{$lang->ai->prompts->action->edit}'"); ?>
|
||||
<?php if(common::hasPriv('ai', 'promptdelete')) echo html::a(helper::createLink('ai', 'promptdelete', "prompt=$prompt->id"), '<i class="icon icon-trash icon-sm"></i>', '', "class='btn deleter' title='{$lang->ai->prompts->action->delete}'"); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="side-col col-4">
|
||||
<div class="cell">
|
||||
<div class='tabs'>
|
||||
<ul class='nav nav-tabs'>
|
||||
<li class='active'><a href='#promptBasicInfo' data-toggle='tab'><?php echo $lang->ai->prompts->basicInfo; ?></a></li>
|
||||
<li><a href='#promptEditInfo' data-toggle='tab'><?php echo $lang->ai->prompts->editInfo; ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='tab-content'>
|
||||
<div class='tab-pane active' id='promptBasicInfo'>
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->module; ?></th>
|
||||
<td><?php echo $prompt->module ? $this->lang->ai->dataSource[$prompt->module]['common'] : ''; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->desc; ?></th>
|
||||
<td><?php echo $prompt->desc; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->status; ?></th>
|
||||
<td><?php echo $lang->ai->prompts->statuses[$prompt->status]; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->model; ?></th>
|
||||
<td><?php echo $modelName; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='tab-pane' id='promptEditInfo'>
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->createdBy; ?></th>
|
||||
<td><?php echo zget($users, $prompt->createdBy) . $lang->at . $prompt->createdDate;?></td>
|
||||
</tr>
|
||||
<?php
|
||||
/* Search for last publish / unpublish action. */
|
||||
$lastPublishAction = null;
|
||||
foreach(array_reverse($actions) as $action)
|
||||
{
|
||||
if(in_array($action->action, array('published', 'unpublished'))) $lastPublishAction = $action;
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<?php if($prompt->status == 'active'):?>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->ai->prompts->publishedBy; ?></th>
|
||||
<td><?php echo zget($users, empty($lastPublishAction) ? $prompt->createdBy : $lastPublishAction->actor);?></td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo empty($lastPublishAction) ? $lang->ai->prompts->publishedBy : $lang->ai->prompts->draftedBy;?></th>
|
||||
<td><?php if(!empty($lastPublishAction)) echo zget($users, $lastPublishAction->actor);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th class="w-90px"><?php echo $lang->prompt->editedBy; ?></th>
|
||||
<td><?php echo $prompt->editedBy ? zget($users, $prompt->editedBy) . $lang->at . $prompt->editedDate : '';?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
const container = window.frameElement?.closest('.load-indicator');
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
|
||||
/* TODO: use new modal for these. */
|
||||
$('.deleter').click(function()
|
||||
{
|
||||
if(confirm('<?php echo $lang->ai->prompts->action->deleteConfirm;?>'))
|
||||
{
|
||||
$.getJSON($(this).data('href'), function(resp)
|
||||
{
|
||||
if(resp.result != 'success') $.zui.messager.danger(resp.message);
|
||||
return location.reload();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#unpublish-btn').click(function()
|
||||
{
|
||||
if(confirm('<?php echo $lang->ai->prompts->action->draftConfirm;?>'))
|
||||
{
|
||||
$.getJSON($(this).attr('href'), function(resp)
|
||||
{
|
||||
if(resp.result != 'success') $.zui.messager.danger(resp.message);
|
||||
return location.reload();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.prompt-audit-btn').click(function()
|
||||
{
|
||||
if(!container) return;
|
||||
container.dataset.loading = '<?php echo $lang->ai->execute->auditing;?>';
|
||||
container.classList.add('loading');
|
||||
container.classList.add('no-delay');
|
||||
|
||||
/* Checks for session storage to cancel loading status (see inputinject.html.php). */
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
const loadCheckInterval = setInterval(function()
|
||||
{
|
||||
if(sessionStorage.getItem('ai-prompt-data-injected'))
|
||||
{
|
||||
if(container && container.dataset.loading)
|
||||
{
|
||||
delete container.dataset.loading;
|
||||
container.classList.remove('loading');
|
||||
container.classList.remove('no-delay');
|
||||
}
|
||||
|
||||
sessionStorage.removeItem('ai-prompt-data-injected');
|
||||
clearInterval(loadCheckInterval);
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The control file of aiapp module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
class aiapp extends control
|
||||
{
|
||||
/**
|
||||
* aiapp model.
|
||||
*
|
||||
* @var aiappModel
|
||||
* @access public
|
||||
*/
|
||||
public $aiapp;
|
||||
|
||||
/**
|
||||
* ai model.
|
||||
*
|
||||
* @var aiModel
|
||||
* @access public
|
||||
*/
|
||||
public $ai;
|
||||
|
||||
public function __construct($module = '', $method = '')
|
||||
{
|
||||
parent::__construct($module, $method);
|
||||
$this->loadModel('ai');
|
||||
}
|
||||
|
||||
public function view($id)
|
||||
{
|
||||
echo $this->fetch('aiapp', 'browseMiniProgram', "id=$id");
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse mini program by id from square.
|
||||
*
|
||||
* @param string $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browseMiniProgram($id)
|
||||
{
|
||||
$miniProgram = $this->ai->getMiniProgramByID($id);
|
||||
if($miniProgram->model == 0) $miniProgram->model = 'default';
|
||||
if(empty($miniProgram)) return $this->sendError($this->lang->aiapp->noMiniProgram);
|
||||
|
||||
$this->view->miniProgram = $miniProgram;
|
||||
$this->view->models = $this->ai->getLanguageModelNamesWithDefault();
|
||||
$this->view->messages = $this->aiapp->getHistoryMessages($id);
|
||||
$this->view->fields = $this->ai->getMiniProgramFields($id);
|
||||
$this->view->collectedIDs = $this->aiapp->getCollectedMiniProgramIDs($this->app->user->id);
|
||||
$this->view->title = "{$this->lang->aiapp->title}#{$miniProgram->id} $miniProgram->name";
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini program chat.
|
||||
*
|
||||
* @param string $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function miniProgramChat($id)
|
||||
{
|
||||
if(empty($_POST)) return $this->locate($this->createLink('ai', 'browseMiniProgram', "id=$id"));
|
||||
|
||||
$miniProgram = $this->ai->getMiniProgramByID($id);
|
||||
if(empty($miniProgram)) return $this->sendError($this->lang->aiapp->noMiniProgram);
|
||||
if($miniProgram->published === '0' && $this->post->test !== '1') return $this->send(array('result' => 'fail', 'message' => $this->lang->aiapp->unpublishedTip, 'reason' => 'unpublished'));
|
||||
|
||||
$history = $this->post->history;
|
||||
$message = $this->post->message;
|
||||
$isRetry = $this->post->retry == 'true';
|
||||
|
||||
$messages = json_decode($history);
|
||||
if(!$isRetry)
|
||||
{
|
||||
$messages[] = (object)array('role' => 'user', 'content' => $message);
|
||||
if($this->post->test !== '1') $this->aiapp->saveMiniProgramMessage($id, 'req', $message);
|
||||
}
|
||||
if($this->ai->hasModelsAvailable())
|
||||
{
|
||||
if(!empty($miniProgram->model))
|
||||
{
|
||||
/* Check if model required by miniProgram is available, fallback to default (first enabled) model if not. */
|
||||
$model = $this->ai->getLanguageModel($miniProgram->model);
|
||||
if(empty($model) || !$model->enabled)
|
||||
{
|
||||
$defaultModel = $this->getDefaultLanguageModel();
|
||||
if(empty($defaultModel)) return $this->send(array('result' => 'fail', 'message' => $this->lang->aiapp->noModelError, 'reason' => 'no model'));
|
||||
|
||||
$miniProgram->model = $defaultModel->id;
|
||||
}
|
||||
}
|
||||
|
||||
$response = $this->ai->converse($miniProgram->model, $messages);
|
||||
if(empty($response)) return $this->send(array('result' => 'fail', 'message' => $this->lang->aiapp->chatNoResponse, 'reason' => 'no response'));
|
||||
|
||||
if($this->post->test !== '1') $this->aiapp->saveMiniProgramMessage($id, 'res', is_array($response) ? current($response) : $response);
|
||||
return $this->send(array('result' => 'success', 'message' => array('time' => date("Y/n/j G:i"), 'role' => 'assistant', 'content' => is_array($response) ? current($response) : $response)));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => $this->lang->aiapp->noModelError, 'reason' => 'no model'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini program square.
|
||||
*
|
||||
* @param string $category
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function square($category = '', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$collectedIDs = null;
|
||||
|
||||
if($category === '')
|
||||
{
|
||||
$collectedIDs = $this->aiapp->getCollectedMiniProgramIDs($this->app->user->id);
|
||||
$category = empty($collectedIDs) ? 'discovery' : 'collection';
|
||||
}
|
||||
|
||||
if($category === 'collection') $collectedIDs = $this->aiapp->getCollectedMiniProgramIDs($this->app->user->id, $pager);
|
||||
elseif($collectedIDs === null) $collectedIDs = $this->aiapp->getCollectedMiniProgramIDs($this->app->user->id);
|
||||
|
||||
if($category === 'collection') $miniPrograms = $this->ai->getMiniProgramsByID($collectedIDs, true);
|
||||
else if($category === 'discovery') $miniPrograms = $this->ai->getMiniPrograms('', 'active', 'createdDate_desc', $pager);
|
||||
else if($category === 'latest') $miniPrograms = $this->aiapp->getLatestMiniPrograms($pager);
|
||||
else $miniPrograms = $this->ai->getMiniPrograms($category, 'active', 'createdDate_desc', $pager);
|
||||
|
||||
if(empty($miniPrograms)) return $this->locate($this->createLink('aiapp', 'square', array('category' => 'discovery')));
|
||||
|
||||
$squareCategoryArray = $this->aiapp->getSquareCategoryArray();
|
||||
$usedCategoryArray = $this->aiapp->getUsedCategoryArray();
|
||||
|
||||
$this->view->collectedIDs = $collectedIDs;
|
||||
$this->view->category = $category;
|
||||
$this->view->categoryList = array_merge($squareCategoryArray, $usedCategoryArray);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->miniPrograms = $miniPrograms ?: array();
|
||||
$this->view->title = $this->lang->aiapp->title;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect mini program by appid.
|
||||
*
|
||||
* @param string $appID
|
||||
* @param string $delete
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function collectMiniProgram($appID, $delete = 'false')
|
||||
{
|
||||
$this->ai->collectMiniProgram($this->app->user->id, $appID, $delete);
|
||||
return $this->send(array('status' => ($delete === 'true' ? '0' : '1')));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
.mini-program {
|
||||
top: 66px;
|
||||
right: 16px;
|
||||
bottom: 16px;
|
||||
left: 16px;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.mini-program .detail {
|
||||
width: 390px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.mini-program .detail .header {
|
||||
padding: 24px 20px 20px 20px;
|
||||
gap: 20px;
|
||||
color: var(--color-slate-800);
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
}
|
||||
|
||||
.mini-program .detail .header .btn-star {
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.mini-program .detail .header .program-avatar {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
}
|
||||
|
||||
.mini-program .detail .header .content .title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
padding-right: 64px;
|
||||
}
|
||||
|
||||
.mini-program .detail .header .content .desc {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.mini-program .detail .body {
|
||||
padding-top: 20px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.mini-program .detail .body .language-model .btn {
|
||||
color: var(--color-slate-700);
|
||||
}
|
||||
|
||||
.mini-program .detail .body .language-model .btn:hover {
|
||||
background: var(--color-gray-300);
|
||||
}
|
||||
|
||||
.mini-program .detail .footer {
|
||||
padding: 20px 20px 24px 20px;
|
||||
}
|
||||
|
||||
.mini-program .chat {
|
||||
height: 100%;
|
||||
flex-basis: 67%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.mini-program .chat .chat-tip {
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--color-slate-600);
|
||||
}
|
||||
|
||||
.message-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
padding: 20px 20px 0 20px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.message {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.message-time {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #838A9D;
|
||||
line-height: 18px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.message-avatar {
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
flex: none !important;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
display: inline-flex;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
color: #313C52;
|
||||
padding: 10px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
pre.message-content {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.ai-message-content {
|
||||
background: #ECF4FF;
|
||||
}
|
||||
|
||||
.user-message-content {
|
||||
background: #F8F8F8;
|
||||
}
|
||||
|
||||
.chat-input-box {
|
||||
border: none;
|
||||
outline: none !important;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
resize: none;
|
||||
overflow: hidden;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.input-container {
|
||||
margin: 20px 20px 24px 20px;
|
||||
border: 1px solid;
|
||||
border-image: linear-gradient(225.97deg, #FF2070 -9.2%, #9670FF 43.41%, #258DFF 74%) 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 13px 1px 13px 16px;
|
||||
}
|
||||
|
||||
.chat-nomodel p {
|
||||
color: var(--color-slate-600);
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.chat-nomodel p + p {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.chat-nomodel a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.local-notification {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
color: #4089F7;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.local-notification::before,
|
||||
.local-notification::after {
|
||||
content: "";
|
||||
flex-grow: 1;
|
||||
height: 1px;
|
||||
background: #4089F7;
|
||||
}
|
||||
|
||||
.local-notification span {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.server-notification {
|
||||
padding-left: 48px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: var(--color-gray-500);
|
||||
}
|
||||
|
||||
#disabled-dialog .modal-dialog {
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
#disabled-dialog .modal-body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#disabled-dialog .modal-footer {
|
||||
padding-top: 0;
|
||||
padding-bottom: 32px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.chat {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
@keyframes -pulse {
|
||||
50% {
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
.animate-pulse {
|
||||
animation: -pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
|
||||
.loading-bar {
|
||||
background: #E4E4E4;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
#featureBar .text {
|
||||
max-width: 6em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.miniprogram-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 8px;
|
||||
background: #FCFDFE;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.miniprogram-card {
|
||||
position: relative;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #EEE;
|
||||
background-color: #FCFDFE;
|
||||
height: 140px;
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.program-content {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex: auto;
|
||||
overflow: hidden;
|
||||
gap: 16px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.program-text {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.program-text .title {
|
||||
margin-bottom: 16px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: var(--color-slate-800);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.program-text .desc {
|
||||
font-size: 12px;
|
||||
color: #838A9D;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.program-avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.program-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.program-actions .badge {
|
||||
font-size: 12px;
|
||||
color: #313C52;
|
||||
border: 1px solid #DEDEDE;
|
||||
padding: 4px;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 20px;
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pager-container {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
background: #fff;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.btn-star {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
}
|
||||
@@ -0,0 +1,470 @@
|
||||
if(!window.aiBrowseMiniProgram) window.aiBrowseMiniProgram = {};
|
||||
|
||||
let firstGenerate = true;
|
||||
let messageList = [];
|
||||
|
||||
/**
|
||||
* Format datetime.
|
||||
*
|
||||
* @param {Date?} date
|
||||
* @returns {string}
|
||||
*/
|
||||
function formatDateTime(date = new Date())
|
||||
{
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
const hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
|
||||
const formattedDate = `${year}/${month}/${day}`;
|
||||
const formattedTime = `${hours}:${minutes < 10 ? '0' + minutes : minutes}`;
|
||||
|
||||
return `${formattedDate} ${formattedTime}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get form value map.
|
||||
*
|
||||
* @returns {Map<string, string>}
|
||||
*/
|
||||
function getFormValue()
|
||||
{
|
||||
/**
|
||||
* @type {Map<string, string>}
|
||||
*/
|
||||
const fieldValueMap = new Map();
|
||||
fields.forEach(field =>
|
||||
{
|
||||
const {name} = field;
|
||||
const $field = $(`[data-name="${name}"]`);
|
||||
if(!$field.hasClass('picker-box')) fieldValueMap.set(name, $field.prop('value'));
|
||||
else fieldValueMap.set(name, $field.zui('picker').$.value);
|
||||
});
|
||||
return fieldValueMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get required fields.
|
||||
*
|
||||
* @returns {string[]}
|
||||
*/
|
||||
function getRequiredFields()
|
||||
{
|
||||
return fields
|
||||
.filter(field => field.required === '1')
|
||||
.map(field => field.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate prompt string.
|
||||
*
|
||||
* @param {Map<string, string>} fields
|
||||
* @returns {string}
|
||||
*/
|
||||
function generatePrompt(fields)
|
||||
{
|
||||
let promptStr = prompt;
|
||||
fields.forEach((value, key) =>
|
||||
{
|
||||
promptStr = promptStr.replace(new RegExp(`\\s<${key}>\\s`, 'g'), value);
|
||||
promptStr = promptStr.replace(new RegExp(`\\s<${key}>\\s`, 'g'), value);
|
||||
});
|
||||
return promptStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check required fields.
|
||||
*
|
||||
* @param {string[]} requiredFieldNames
|
||||
* @param {Map<string, string>} fields
|
||||
* @returns {true|string}
|
||||
*/
|
||||
function checkRequiredFields(requiredFieldNames, fields)
|
||||
{
|
||||
for(const name of requiredFieldNames)
|
||||
{
|
||||
if(!fields.has(name) || !fields.get(name)) return name;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear error tip.
|
||||
*/
|
||||
function clearErrorTip()
|
||||
{
|
||||
$('.form-container').find('.has-error').removeClass('has-error');
|
||||
$('.form-container').find('.form-tip').remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send message to ai.
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
function sendMessagesToAI(message)
|
||||
{
|
||||
const curMsgObj = {
|
||||
role: 'user',
|
||||
content: message,
|
||||
time: (new Date()).toLocaleString()
|
||||
};
|
||||
|
||||
const formData = new FormData();
|
||||
formData.set('message', message);
|
||||
if(messageList.length) formData.set('messages', messageList);
|
||||
|
||||
const $inputBox = $('.chat-input-box');
|
||||
const $sendBtn = $('.send-btn');
|
||||
const $messageList = $('.chat-history .message-list');
|
||||
const $generateBtn = $('.generate-btn');
|
||||
$inputBox.attr('readonly', 'readonly');
|
||||
$sendBtn.attr('disabled', 'disabled');
|
||||
$generateBtn.attr('disabled', 'disabled');
|
||||
$.post(
|
||||
postLink,
|
||||
formData,
|
||||
function (response)
|
||||
{
|
||||
$inputBox.removeAttr('readonly');
|
||||
$sendBtn.removeAttr('disabled');
|
||||
$generateBtn.removeAttr('disabled');
|
||||
response = JSON.parse(response);
|
||||
const {message, result, reason} = response;
|
||||
if(result === 'success')
|
||||
{
|
||||
const {content, time} = message;
|
||||
const $message = createMessage('ai', content, time);
|
||||
$messageList.find('.tmp-message').remove();
|
||||
$messageList.append($message);
|
||||
$messageList[0].scrollTo(0, $messageList[0].scrollHeight);
|
||||
|
||||
messageList.append(curMsgObj);
|
||||
messageList.append(message);
|
||||
return;
|
||||
}
|
||||
|
||||
if(reason === 'no model')
|
||||
{
|
||||
$('.chat').addClass('hidden');
|
||||
$('.chat-nomodel').removeClass('hidden');
|
||||
$('form .footer .btn.primary').attr('disabled', 'disabled');
|
||||
return;
|
||||
}
|
||||
if(reason === 'unpublished')
|
||||
{
|
||||
$('#open-dialog').trigger('click')
|
||||
return;
|
||||
}
|
||||
if(reason === 'no response')
|
||||
{
|
||||
const $message = createMessage('ai', message);
|
||||
$messageList.find('.tmp-message').remove();
|
||||
$messageList.append($message);
|
||||
$messageList[0].scrollTo(0, $messageList[0].scrollHeight);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const $message = createMessage('user', message);
|
||||
$messageList.append($message);
|
||||
$messageList.append(createTmpMessage());
|
||||
$messageList[0].scrollTo(0, $messageList[0].scrollHeight);
|
||||
}
|
||||
|
||||
window.aiBrowseMiniProgram.startAIChat = function()
|
||||
{
|
||||
clearErrorTip();
|
||||
const fields = getFormValue();
|
||||
const requiredFieldNames = getRequiredFields();
|
||||
const result = checkRequiredFields(requiredFieldNames, fields);
|
||||
if(typeof result === 'string')
|
||||
{
|
||||
const $container = $('.form-container').find(`[data-name="${result}"]`);
|
||||
const fid = $container.attr('data-fid');
|
||||
const $formGroup = $container.closest('.form-group');
|
||||
$formGroup
|
||||
.attr('name', `field-${fid}`)
|
||||
.addClass('has-error')
|
||||
.append(`<div class="form-tip" id="field-${fid}Tip">${emptyNameWarning.replace('%s', result)}</div>`);
|
||||
return;
|
||||
}
|
||||
|
||||
const promptStr = generatePrompt(fields);
|
||||
if(firstGenerate)
|
||||
{
|
||||
$(this).text(regenerateLang);
|
||||
firstGenerate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
const $messageList = $('.chat-history .message-list');
|
||||
$messageList.append(createLocalNotification(`${formatDateTime()} ${clearContextLang}`));
|
||||
messageList = [];
|
||||
}
|
||||
$('.chat').addClass('hidden');
|
||||
$('.chat-history').removeClass('hidden');
|
||||
$('.input-container').removeClass('hidden');
|
||||
sendMessagesToAI(promptStr);
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.handleStarBtnClick = function()
|
||||
{
|
||||
const $btn = $(this);
|
||||
const url = $btn.attr('data-url');
|
||||
$.get(url, function (response)
|
||||
{
|
||||
if(response.status == '1')
|
||||
{
|
||||
$btn.children('img').attr('src', 'static/svg/star.svg');
|
||||
$btn.attr('data-url', $btn.attr('data-url').replace('false', 'true'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$btn.children('img').attr('src', 'static/svg/star-empty.svg');
|
||||
$btn.attr('data-url', $btn.attr('data-url').replace('true', 'false'));
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.handleRestBtnClick = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
$('.form-container .picker-box').each(function()
|
||||
{
|
||||
$(this).zui('picker').$.clear();
|
||||
});
|
||||
$('.form-container .form-group > input[data-name]').val('');
|
||||
$('.form-container .form-group > textarea[data-name]').val('');
|
||||
}
|
||||
catch (error) {}
|
||||
};
|
||||
|
||||
let composing = false;
|
||||
|
||||
/**
|
||||
* Handle input box enter.
|
||||
*
|
||||
* @param {KeyboardEvent} event
|
||||
*/
|
||||
window.aiBrowseMiniProgram.handleInputEnter = function(event)
|
||||
{
|
||||
console.log(composing, 3);
|
||||
if(event.code === 'Enter' && !composing)
|
||||
{
|
||||
event.preventDefault();
|
||||
window.aiBrowseMiniProgram.clearInputAndChat();
|
||||
}
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.clearInputAndChat = function()
|
||||
{
|
||||
const $inputBox = $('.chat-input-box');
|
||||
const message = $inputBox.val()
|
||||
$inputBox.val('');
|
||||
if(!message) return;
|
||||
sendMessagesToAI(message);
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.handleInputCompositionStart = function()
|
||||
{
|
||||
composing = true;
|
||||
console.log(composing, 1);
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.handleInputCompositionEnd = function()
|
||||
{
|
||||
composing = false;
|
||||
console.log(composing, 2);
|
||||
};
|
||||
|
||||
/**
|
||||
* Rest input box height.
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
window.aiBrowseMiniProgram.resetInputHeight = function(event)
|
||||
{
|
||||
/**
|
||||
* @type {HTMLTextAreaElement}
|
||||
*/
|
||||
const inputBox = event.target;
|
||||
inputBox.style.height = 'auto';
|
||||
inputBox.style.height = `${(inputBox.scrollHeight + 2)}px`
|
||||
};
|
||||
|
||||
window.aiBrowseMiniProgram.backToSquare = function()
|
||||
{
|
||||
window.location.href = $.createLink('aiapp', 'square');
|
||||
};
|
||||
|
||||
/**
|
||||
* Create message avatar.
|
||||
*
|
||||
* @param {'ai'|'user'} role
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createAvatar(role)
|
||||
{
|
||||
const $avatar = role === 'user'
|
||||
? $('#userMenu-toggle > div.avatar').clone()
|
||||
: $('#program-avatar').clone().removeAttr('id');
|
||||
if(role === 'ai')
|
||||
{
|
||||
$avatar.find('svg')
|
||||
.attr('height', '14px')
|
||||
.attr('width', '14px')
|
||||
}
|
||||
$avatar.addClass('message-avatar');
|
||||
return $avatar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message time.
|
||||
*
|
||||
* @param {string} time
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createMessageTime(time)
|
||||
{
|
||||
return $(`<div class="message-time">${time}</div>`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message content.
|
||||
*
|
||||
* @param {'user'|'ai'} role
|
||||
* @param {string} content
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createMessageContent(role, content)
|
||||
{
|
||||
content = content.replace(/\n{2,}/g, '\n');
|
||||
return $(`<pre class="message-content ${role}-message-content">${content}</pre>`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message body.
|
||||
*
|
||||
* @param {'user'|'ai'} role
|
||||
* @param {string} content
|
||||
* @param {string} time
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createMessageBody(role, content, time)
|
||||
{
|
||||
const $time = createMessageTime(time);
|
||||
const $content = createMessageContent(role, content);
|
||||
return $(`<div class="message-body"></div>`)
|
||||
.append($time)
|
||||
.append($content);
|
||||
}
|
||||
|
||||
function createTmpMessage()
|
||||
{
|
||||
const $avatar = createAvatar('ai');
|
||||
const $body = $(`<div class="message-body flex-1">
|
||||
<div class="animate-pulse">
|
||||
<div class="h-3 w-24 loading-bar mb-1.5 rounded"></div>
|
||||
</div>
|
||||
<div class="message-content ai-message-content w-full">
|
||||
<div class="animate-pulse w-full">
|
||||
<div class="h-3 w-full loading-bar mb-2 rounded"></div>
|
||||
<div class="h-3 w-full loading-bar mb-2 rounded"></div>
|
||||
<div class="h-3 w-1/2 loading-bar rounded"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
return $(`<div class="message ai-message tmp-message"></div>`)
|
||||
.append($avatar)
|
||||
.append($body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message.
|
||||
*
|
||||
* @param {'user'|'ai'} role
|
||||
* @param {string} content
|
||||
* @param {string} time
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createMessage(role, content, time = formatDateTime())
|
||||
{
|
||||
const $avatar = createAvatar(role);
|
||||
const $body = createMessageBody(role, content, time);
|
||||
return $(`<div class="message ${role}-message"></div>`)
|
||||
.append($avatar)
|
||||
.append($body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create local notification.
|
||||
*
|
||||
* @param {string} content
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createLocalNotification(content)
|
||||
{
|
||||
return $(`<div class="local-notification"><span>${content}</span></div>`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create server notification.
|
||||
*
|
||||
* @param {string} content
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
function createServerNotification(content)
|
||||
{
|
||||
return $(`<div class="server-notification">${content}</div>`);
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('#to-language-model').prop('href', $.createLink('ai', 'models'));
|
||||
$('#reload-current').on('click', () =>
|
||||
{
|
||||
location.reload();
|
||||
});
|
||||
|
||||
if(messages && messages.length)
|
||||
{
|
||||
const $messageList = $('.chat-history .message-list');
|
||||
const messagesReverse = messages.reverse();
|
||||
for(let i = 0; i < messagesReverse.length; i++)
|
||||
{
|
||||
const message = messagesReverse[i];
|
||||
const {type, content, createdDate: time} = message;
|
||||
let role;
|
||||
if(type === 'req') role = 'user';
|
||||
else if(type === 'res') role = 'ai';
|
||||
const $message = (role === 'user' || role === 'ai')
|
||||
? createMessage(role, content, time)
|
||||
: createServerNotification(content);
|
||||
$messageList.append($message);
|
||||
}
|
||||
|
||||
$messageList.append(createLocalNotification(`${formatDateTime()} ${newChatTip}`));
|
||||
$messageList[0].scrollTo(0, $messageList[0].scrollHeight);
|
||||
}
|
||||
|
||||
if(isAppDisabled)
|
||||
{
|
||||
$('#open-dialog').trigger('click')
|
||||
}
|
||||
|
||||
const $inputBox = $('.chat-input-box');
|
||||
if(!$inputBox.attr('data-bind'))
|
||||
{
|
||||
$inputBox
|
||||
.on('input', window.aiBrowseMiniProgram.resetInputHeight)
|
||||
.on('keydown', window.aiBrowseMiniProgram.handleInputEnter)
|
||||
.on('compositionstart', window.aiBrowseMiniProgram.handleInputCompositionStart)
|
||||
.on('compositionend', window.aiBrowseMiniProgram.handleInputCompositionEnd);
|
||||
|
||||
$inputBox.attr('data-bind', 'true');
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
if(!window.aiSquare) window.aiSquare = {};
|
||||
|
||||
window.aiSquare.handleStarBtnClick = function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const $btn = $(this);
|
||||
const url = $btn.attr('data-url');
|
||||
$.get(url, function(response)
|
||||
{
|
||||
if(response.status == '1')
|
||||
{
|
||||
$btn.children('img').attr('src', 'static/svg/star.svg');
|
||||
$btn.attr('data-url', $btn.attr('data-url').replace('false', 'true'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$btn.children('img').attr('src', 'static/svg/star-empty.svg');
|
||||
$btn.attr('data-url', $btn.attr('data-url').replace('true', 'false'));
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->aiapp->common = 'AI Square';
|
||||
$lang->aiapp->squareCategories = array('collection' => 'My collection', 'discovery' => 'Discovery', 'latest' => 'Latest');
|
||||
$lang->aiapp->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->aiapp->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
$lang->aiapp->title = 'Mini Programs';
|
||||
$lang->aiapp->unpublishedTip = 'The mini program you are using is not published.';
|
||||
$lang->aiapp->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->aiapp->chatNoResponse = 'Something went wrong.';
|
||||
$lang->aiapp->more = 'More';
|
||||
$lang->aiapp->collect = 'Collect';
|
||||
$lang->aiapp->deleted = 'Deleted';
|
||||
$lang->aiapp->clear = 'Reset';
|
||||
$lang->aiapp->modelCurrent = 'Current Model';
|
||||
$lang->aiapp->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->aiapp->generate = 'Generate';
|
||||
$lang->aiapp->regenerate = 'Regenerate';
|
||||
$lang->aiapp->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->aiapp->chatTip = 'Please enter the field content on the left and try generating the results.';
|
||||
$lang->aiapp->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->aiapp->clearContext = 'The context content has been cleared.';
|
||||
$lang->aiapp->newChatTip = 'Please enter the fields on the left to start a new conversation.';
|
||||
$lang->aiapp->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->aiapp->continueasking = 'Continue asking';
|
||||
|
||||
$lang->aiapp->miniProgramSquare = 'Browse AI Mini Program List';
|
||||
$lang->aiapp->collectMiniProgram = 'Collect AI Mini Program';
|
||||
$lang->aiapp->miniProgramChat = 'Execute AI Mini Program';
|
||||
$lang->aiapp->view = 'View AI Mini Program Details';
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->aiapp->common = 'AI Square';
|
||||
$lang->aiapp->squareCategories = array('collection' => 'My collection', 'discovery' => 'Discovery', 'latest' => 'Latest');
|
||||
$lang->aiapp->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->aiapp->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
$lang->aiapp->title = 'Mini Programs';
|
||||
$lang->aiapp->unpublishedTip = 'The mini program you are using is not published.';
|
||||
$lang->aiapp->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->aiapp->chatNoResponse = 'Something went wrong.';
|
||||
$lang->aiapp->more = 'More';
|
||||
$lang->aiapp->collect = 'Collect';
|
||||
$lang->aiapp->deleted = 'Deleted';
|
||||
$lang->aiapp->clear = 'Reset';
|
||||
$lang->aiapp->modelCurrent = 'Current Model';
|
||||
$lang->aiapp->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->aiapp->generate = 'Generate';
|
||||
$lang->aiapp->regenerate = 'Regenerate';
|
||||
$lang->aiapp->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->aiapp->chatTip = 'Please enter the field content on the left and try generating the results.';
|
||||
$lang->aiapp->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->aiapp->clearContext = 'The context content has been cleared.';
|
||||
$lang->aiapp->newChatTip = 'Please enter the fields on the left to start a new conversation.';
|
||||
$lang->aiapp->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->aiapp->continueasking = 'Continue asking';
|
||||
|
||||
$lang->aiapp->miniProgramSquare = 'Browse AI Mini Program List';
|
||||
$lang->aiapp->collectMiniProgram = 'Collect AI Mini Program';
|
||||
$lang->aiapp->miniProgramChat = 'Execute AI Mini Program';
|
||||
$lang->aiapp->view = 'View AI Mini Program Details';
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module en lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->aiapp->common = 'AI Square';
|
||||
$lang->aiapp->squareCategories = array('collection' => 'My collection', 'discovery' => 'Discovery', 'latest' => 'Latest');
|
||||
$lang->aiapp->newVersionTip = 'The mini-program has been updated on %s. The above is the past record.';
|
||||
$lang->aiapp->noMiniProgram = 'The mini program you visited does not exist.';
|
||||
$lang->aiapp->title = 'Mini Programs';
|
||||
$lang->aiapp->unpublishedTip = 'The mini program you are using is not published.';
|
||||
$lang->aiapp->noModelError = 'No language model is configured, please contact the administrator.';
|
||||
$lang->aiapp->chatNoResponse = 'Something went wrong.';
|
||||
$lang->aiapp->more = 'More';
|
||||
$lang->aiapp->collect = 'Collect';
|
||||
$lang->aiapp->deleted = 'Deleted';
|
||||
$lang->aiapp->clear = 'Reset';
|
||||
$lang->aiapp->modelCurrent = 'Current Model';
|
||||
$lang->aiapp->categoryList = array('work' => 'Work', 'personal' => 'Personal', 'life' => 'Life', 'creative' => 'Creative', 'others' => 'Others');
|
||||
$lang->aiapp->generate = 'Generate';
|
||||
$lang->aiapp->regenerate = 'Regenerate';
|
||||
$lang->aiapp->emptyNameWarning = '「%s」 cannot be empty';
|
||||
$lang->aiapp->chatTip = 'Please enter the field content on the left and try generating the results.';
|
||||
$lang->aiapp->noModel = array('The language model has not been configured yet. Please contact the administrator or go to the backend to configure <a id="to-language-model"> the language model.</a>。', 'If the relevant configuration has been completed, please try <a id="reload-current">reloading</a> the page.');
|
||||
$lang->aiapp->clearContext = 'The context content has been cleared.';
|
||||
$lang->aiapp->newChatTip = 'Please enter the fields on the left to start a new conversation.';
|
||||
$lang->aiapp->disabledTip = 'The current mini program is disabled.';
|
||||
$lang->aiapp->continueasking = 'Continue asking';
|
||||
|
||||
$lang->aiapp->miniProgramSquare = 'Browse AI Mini Program List';
|
||||
$lang->aiapp->collectMiniProgram = 'Collect AI Mini Program';
|
||||
$lang->aiapp->miniProgramChat = 'Execute AI Mini Program';
|
||||
$lang->aiapp->view = 'View AI Mini Program Details';
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The ai module zh-cn lang file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
$lang->aiapp->common = 'AI广场';
|
||||
$lang->aiapp->squareCategories = array('collection' => '我的收藏', 'discovery' => '发现', 'latest' => '最新');
|
||||
$lang->aiapp->newVersionTip = '小程序已于 %s 更新,以上为过往记录';
|
||||
$lang->aiapp->noMiniProgram = '您访问的小程序不存在';
|
||||
$lang->aiapp->title = '小程序';
|
||||
$lang->aiapp->unpublishedTip = '您使用的小程序没有发布';
|
||||
$lang->aiapp->noModelError = '暂无可用的语言模型,请联系管理员配置。';
|
||||
$lang->aiapp->chatNoResponse = '会话发生了错误';
|
||||
$lang->aiapp->more = '更多';
|
||||
$lang->aiapp->collect = '收藏';
|
||||
$lang->aiapp->deleted = '已删除';
|
||||
$lang->aiapp->clear = '清空';
|
||||
$lang->aiapp->modelCurrent = '当前语言模型';
|
||||
$lang->aiapp->categoryList = array('work' => '工作', 'personal' => '个人', 'life' => '生活', 'creative' => '创意', 'others' => '其它');
|
||||
$lang->aiapp->regenerate = '重新生成';
|
||||
$lang->aiapp->emptyNameWarning = '「%s」不能为空';
|
||||
$lang->aiapp->clearContext = '上下文内容已清除';
|
||||
$lang->aiapp->newChatTip = '请在左侧输入字段内容,开启新对话。';
|
||||
$lang->aiapp->disabledTip = '当前小程序已被禁用。';
|
||||
$lang->aiapp->generate = '生成';
|
||||
$lang->aiapp->chatTip = '请在左侧输入字段内容,生成结果试试吧。';
|
||||
$lang->aiapp->noModel = array('尚未配置语言模型,请联系管理员或跳转至后台配置<a id="to-language-model">语言模型</a>。', '若已完成相关配置,请尝试<a id="reload-current">重新加载</a>页面。');
|
||||
$lang->aiapp->continueasking = '继续追问';
|
||||
|
||||
$lang->aiapp->miniProgramSquare = '查看AI小程序列表';
|
||||
$lang->aiapp->view = '查看AI小程序详情';
|
||||
$lang->aiapp->miniProgramChat = '执行AI小程序';
|
||||
$lang->aiapp->collectMiniProgram = '收藏AI小程序';
|
||||
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The model file of aiapp module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package ai
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
class aiappModel extends model
|
||||
{
|
||||
|
||||
/**
|
||||
* ai model.
|
||||
*
|
||||
* @var aiModel
|
||||
* @access public
|
||||
*/
|
||||
public $ai;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('ai');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get latest mini programs.
|
||||
*
|
||||
* @param pager $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLatestMiniPrograms($pager = null, $order = 'publishedDate_desc')
|
||||
{
|
||||
return $this->dao->select('*')
|
||||
->from(TABLE_AI_MINIPROGRAM)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('published')->eq('1')
|
||||
->andWhere('publishedDate')->ge(date('Y-m-d H:i:s', strtotime('-1 months')))
|
||||
->orderBy($order)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Count latest mini programs.
|
||||
*
|
||||
* @access private
|
||||
* @return int
|
||||
*/
|
||||
private function countLatestMiniPrograms()
|
||||
{
|
||||
return (int)$this->dao->select('COUNT(*) as count')
|
||||
->from(TABLE_AI_MINIPROGRAM)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('published')->eq('1')
|
||||
->andWhere('createdDate')->ge(date('Y-m-d H:i:s', strtotime('-1 months')))
|
||||
->fetch('count');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save mini program message.
|
||||
*
|
||||
* @param string $appID
|
||||
* @param string $type
|
||||
* @param string $content
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function saveMiniProgramMessage($appID, $type, $content)
|
||||
{
|
||||
$message = new stdClass();
|
||||
$message->appID = $appID;
|
||||
$message->user = $this->app->user->id;
|
||||
$message->type = $type;
|
||||
$message->content = $content;
|
||||
$message->createdDate = helper::now();
|
||||
|
||||
$this->dao->insert(TABLE_AI_MESSAGE)
|
||||
->data($message)
|
||||
->exec();
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete history messages by id.
|
||||
*
|
||||
* @param string $appID
|
||||
* @param string $userID
|
||||
* @param array $messageIDs
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function deleteHistoryMessagesByID($appID, $userID, $messageIDs)
|
||||
{
|
||||
$this->dao->delete()
|
||||
->from(TABLE_AI_MESSAGE)
|
||||
->where('appID')->eq($appID)
|
||||
->andWhere('user')->eq($userID)
|
||||
->andWhere('id')->notin($messageIDs)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get history messages.
|
||||
*
|
||||
* @param string $appID
|
||||
* @param int $limit
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getHistoryMessages($appID, $limit = 20)
|
||||
{
|
||||
$messages = $this->dao->select('*')
|
||||
->from(TABLE_AI_MESSAGE)
|
||||
->where('appID')->eq($appID)
|
||||
->andWhere('user')->eq($this->app->user->id)
|
||||
->orderBy('createdDate_desc')
|
||||
->limit($limit)
|
||||
->fetchAll();
|
||||
|
||||
$messageIDs = array();
|
||||
foreach($messages as $message)
|
||||
{
|
||||
$message->createdDate = date('Y/n/j G:i', strtotime($message->createdDate));
|
||||
$messageIDs[] = $message->id;
|
||||
}
|
||||
$this->deleteHistoryMessagesByID($appID, $this->app->user->id, $messageIDs);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get collected mini programIDs
|
||||
*
|
||||
* @param string $userID
|
||||
* @param pager $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCollectedMiniProgramIDs($userID, $pager = null)
|
||||
{
|
||||
$programs = $this->dao->select('*')
|
||||
->from(TABLE_AI_MINIPROGRAMSTAR)
|
||||
->where('userID')->eq($userID)
|
||||
->orderBy('createdDate_desc')
|
||||
->page($pager)
|
||||
->fetchAll('appID');
|
||||
return array_keys($programs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get square category array.
|
||||
*
|
||||
* @param array $collectedIDs
|
||||
* @param int $latestSum
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSquareCategoryArray($collectedIDs = null, $latestSum = null)
|
||||
{
|
||||
$squareCategoryArray = $this->lang->aiapp->squareCategories;
|
||||
|
||||
if($collectedIDs === null) $collectedIDs = $this->getCollectedMiniProgramIDs($this->app->user->id);
|
||||
if($latestSum === null) $latestSum = $this->countLatestMiniPrograms();
|
||||
|
||||
if(empty($collectedIDs)) unset($squareCategoryArray['collection']);
|
||||
if($latestSum == 0) unset($squareCategoryArray['latest']);
|
||||
return $squareCategoryArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get used category array.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUsedCategoryArray()
|
||||
{
|
||||
$publishedCustomCategories = $this->ai->getPublishedCustomCategories();
|
||||
$categoryArray = array_merge($this->lang->aiapp->categoryList, $this->ai->getCustomCategories());
|
||||
|
||||
$usedCategoryArray = array();
|
||||
foreach($categoryArray as $key => $value)
|
||||
{
|
||||
if(in_array($key, $publishedCustomCategories)) $usedCategoryArray[$key] = $value;
|
||||
}
|
||||
return $usedCategoryArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('regenerateLang', $lang->aiapp->regenerate);
|
||||
jsVar('emptyNameWarning', $lang->aiapp->emptyNameWarning);
|
||||
jsVar('clearContextLang', $lang->aiapp->clearContext);
|
||||
jsVar('newChatTip', $lang->aiapp->newChatTip);
|
||||
jsVar('newVersionTip', $lang->aiapp->newVersionTip);
|
||||
|
||||
jsVar('prompt', $miniProgram->prompt);
|
||||
jsVar('postLink', createLink('aiapp', 'miniProgramChat', "id={$miniProgram->id}"));
|
||||
jsVar('messages', $messages);
|
||||
jsVar('isAppDisabled', $miniProgram->published === '0');
|
||||
|
||||
$app->loadLang('ai');
|
||||
|
||||
$isDeleted = $miniProgram->deleted === '1';
|
||||
|
||||
$formGroups = array();
|
||||
if(count($fields) !== 0)
|
||||
{
|
||||
foreach($fields as $field)
|
||||
{
|
||||
if($field->type === 'textarea')
|
||||
{
|
||||
$control = textarea(
|
||||
set::rows(1),
|
||||
set::name("field-{$field->id}"),
|
||||
set::placeholder($field->placeholder),
|
||||
set::disabled($isDeleted),
|
||||
setData('name', $field->name),
|
||||
setData('fid', $field->id)
|
||||
);
|
||||
}
|
||||
elseif($field->type === 'radio')
|
||||
{
|
||||
$options = explode(',', $field->options);
|
||||
$control = picker(
|
||||
set::name("field-{$field->id}"),
|
||||
set::items(array_combine($options, $options)),
|
||||
set::disabled($isDeleted),
|
||||
setData('name', $field->name),
|
||||
setData('fid', $field->id)
|
||||
);
|
||||
}
|
||||
elseif($field->type === 'checkbox')
|
||||
{
|
||||
$options = explode(',', $field->options);
|
||||
$control = picker(
|
||||
set::name("field-{$field->id}"),
|
||||
set::items(array_combine($options, $options)),
|
||||
set::multiple(true),
|
||||
set::disabled($isDeleted),
|
||||
setData('name', $field->name),
|
||||
setData('fid', $field->id)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$control = input(
|
||||
set::name("field-{$field->id}"),
|
||||
set::placeholder($field->placeholder),
|
||||
set::disabled($isDeleted),
|
||||
setData('name', $field->name),
|
||||
setData('fid', $field->id)
|
||||
);
|
||||
}
|
||||
|
||||
$formGroups[] = formGroup(
|
||||
set::label($field->name),
|
||||
set::required($field->required === '1'),
|
||||
$control
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
jsVar('fields', $fields);
|
||||
|
||||
list($iconName, $iconTheme) = explode('-', $miniProgram->icon);
|
||||
$star = in_array($miniProgram->id, $collectedIDs) ? 'star' : 'star-empty';
|
||||
$delete = $star === 'star' ? 'true' : 'false';
|
||||
|
||||
btn(
|
||||
setClass('hidden'),
|
||||
setID('open-dialog'),
|
||||
setData('toggle', 'modal'),
|
||||
setData('target', '#disabled-dialog')
|
||||
);
|
||||
|
||||
div(
|
||||
setClass('modal'),
|
||||
setData('backdrop', 'static'),
|
||||
setID('disabled-dialog'),
|
||||
div(
|
||||
setClass('modal-dialog shadow size-sm bd-none'),
|
||||
div(
|
||||
setClass('modal-content'),
|
||||
div(
|
||||
setClass('modal-body'),
|
||||
html('<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.013" cy="12.0163" r="12" transform="rotate(0.0777774 12.013 12.0163)" fill="#FFA34D"/>
|
||||
<path d="M11.5573 14.7861C12.0809 14.7867 12.6054 14.2164 12.6063 13.6455L13.0103 6.08095C13.0112 5.51 13.0129 4.36812 11.442 4.36619C10.002 4.36442 9.8696 5.36341 9.86853 6.07709L10.2499 13.6426C10.5109 14.2138 11.0337 14.7854 11.5573 14.7861ZM11.5551 16.2134C10.7697 16.2124 9.98317 16.9252 9.98167 17.9243C9.98039 18.7807 10.6336 19.6379 11.55 19.6391C12.4664 19.6402 13.122 18.9273 13.1235 17.9282C13.125 16.929 12.3406 16.2144 11.5551 16.2134Z" fill="white"/>
|
||||
</svg>'),
|
||||
$lang->aiapp->disabledTip
|
||||
),
|
||||
div(
|
||||
setClass('modal-footer'),
|
||||
btn(
|
||||
setClass('primary'),
|
||||
setData('dismiss', 'modal'),
|
||||
on::click('window.aiBrowseMiniProgram.backToSquare'),
|
||||
$lang->confirm
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$starBtn = common::hasPriv('aiapp', 'collectMiniProgram')
|
||||
? btn(
|
||||
setClass('ghost btn-star absolute'),
|
||||
set::size('md'),
|
||||
setData('url', createLink('aiapp', 'collectMiniProgram', "appID={$miniProgram->id}&delete={$delete}")),
|
||||
on::click('window.aiBrowseMiniProgram.handleStarBtnClick'),
|
||||
html(html::image("static/svg/{$star}.svg", "class='$star'")),
|
||||
$lang->aiapp->collect
|
||||
)
|
||||
: null;
|
||||
|
||||
$generateBtn = common::hasPriv('aiapp', 'miniProgramChat')
|
||||
? btn(
|
||||
setClass('primary block w-full generate-btn'),
|
||||
set::disabled($isDeleted),
|
||||
$lang->aiapp->generate,
|
||||
on::click('window.aiBrowseMiniProgram.startAIChat')
|
||||
)
|
||||
: null;
|
||||
|
||||
$inputContainer = common::hasPriv('aiapp', 'miniProgramChat')
|
||||
? div(
|
||||
setClass('input-container'),
|
||||
setClass(array('hidden' => !empty($messages))),
|
||||
html(<<<END
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.6037 4.22186C23.6037 3.95812 23.5162 3.73818 23.3401 3.56236L20.4372 0.659451C20.2614 0.483472 20.0415 0.395508 19.7775 0.395508C19.5134 0.395508 19.2938 0.483472 19.1178 0.659451L0.263943 19.5132C0.0877584 19.6893 0 19.9094 0 20.1732C0 20.4372 0.0877584 20.6569 0.263943 20.8329L3.16675 23.7356C3.34293 23.9117 3.56256 23.9996 3.82661 23.9996C4.09039 23.9996 4.31028 23.9121 4.48631 23.7356L23.3404 4.88171C23.5162 4.70558 23.6037 4.4859 23.6037 4.22186ZM17.0504 8.5176L15.4818 6.94884L19.7774 2.65314L21.3459 4.22186L17.0504 8.5176Z" fill="url(#paint0_linear_2090_3242)"/>
|
||||
<path d="M3.16577 3.12833C3.22352 3.31694 3.49052 3.31693 3.54825 3.12832L3.7657 2.41793C3.78514 2.3544 3.83487 2.30468 3.8984 2.28523L4.60876 2.06778C4.79737 2.01005 4.79738 1.74305 4.60878 1.6853L3.89839 1.4678C3.83487 1.44835 3.78515 1.39862 3.7657 1.3351L3.54825 0.624699C3.49052 0.43609 3.22352 0.436082 3.16577 0.624687L2.94826 1.33511C2.92881 1.39863 2.8791 1.44835 2.81558 1.46779L2.10516 1.6853C1.91655 1.74305 1.91656 2.01005 2.10517 2.06778L2.81557 2.28523C2.87909 2.30468 2.92882 2.3544 2.94826 2.41792L3.16577 3.12833Z" fill="url(#paint1_linear_2090_3242)"/>
|
||||
<path d="M6.96529 5.5089C7.09233 5.5478 7.19177 5.64724 7.23066 5.77428L7.66577 7.19548C7.78126 7.57268 8.31524 7.57268 8.43073 7.19548L8.86584 5.77428C8.90473 5.64724 9.00417 5.5478 9.13121 5.5089L10.5523 5.07381C10.9295 4.95833 10.9295 4.42434 10.5523 4.30886L9.13122 3.87383C9.00418 3.83493 8.90473 3.73549 8.86584 3.60845L8.43073 2.18726C8.31524 1.81006 7.78126 1.81006 7.66577 2.18726L7.23066 3.60845C7.19177 3.73549 7.09232 3.83493 6.96528 3.87383L5.54423 4.30886C5.16702 4.42434 5.16701 4.95833 5.54422 5.07381L6.96529 5.5089Z" fill="url(#paint2_linear_2090_3242)"/>
|
||||
<path d="M22.6639 10.8506C22.6003 10.8311 22.5506 10.7814 22.5312 10.7178L22.3138 10.0077C22.2561 9.81905 21.989 9.81906 21.9313 10.0077L21.714 10.7178C21.6945 10.7814 21.6448 10.8311 21.5813 10.8506L20.8708 11.068C20.6822 11.1258 20.6822 11.3928 20.8708 11.4505L21.5813 11.668C21.6448 11.6874 21.6945 11.7372 21.714 11.8007L21.9313 12.5108C21.9891 12.6994 22.2561 12.6994 22.3138 12.5108L22.5312 11.8007C22.5506 11.7372 22.6003 11.6874 22.6639 11.668L23.3744 11.4505C23.563 11.3928 23.563 11.1258 23.3744 11.068L22.6639 10.8506Z" fill="url(#paint3_linear_2090_3242)"/>
|
||||
<path d="M12.5485 3.12824C12.6063 3.31685 12.8733 3.31687 12.931 3.12826L13.1485 2.41792C13.168 2.3544 13.2177 2.30468 13.2812 2.28523L13.9915 2.06778C14.1802 2.01004 14.1802 1.74305 13.9916 1.6853L13.2812 1.46779C13.2177 1.44835 13.168 1.39863 13.1485 1.33511L12.931 0.62476C12.8733 0.436148 12.6063 0.436166 12.5485 0.624785L12.3312 1.33508C12.3117 1.39862 12.262 1.44835 12.1985 1.4678L11.488 1.6853C11.2994 1.74304 11.2994 2.01005 11.488 2.06778L12.1985 2.28523C12.262 2.30467 12.3117 2.35441 12.3312 2.41794L12.5485 3.12824Z" fill="url(#paint4_linear_2090_3242)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_2090_3242" x1="26.2016" y1="-1.33315" x2="-0.000437567" y2="23.9992" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF2070"/>
|
||||
<stop offset="0.481728" stop-color="#9670FF"/>
|
||||
<stop offset="0.761875" stop-color="#258DFF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_2090_3242" x1="5.6465" y1="-0.274854" x2="1.48041" y2="3.75296" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF2070"/>
|
||||
<stop offset="0.481728" stop-color="#9670FF"/>
|
||||
<stop offset="0.761875" stop-color="#258DFF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_2090_3242" x1="12.6278" y1="0.388227" x2="4.29481" y2="8.44463" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF2070"/>
|
||||
<stop offset="0.481728" stop-color="#9670FF"/>
|
||||
<stop offset="0.761875" stop-color="#258DFF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_2090_3242" x1="24.4122" y1="9.10797" x2="20.2464" y2="13.1359" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF2070"/>
|
||||
<stop offset="0.481728" stop-color="#9670FF"/>
|
||||
<stop offset="0.761875" stop-color="#258DFF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_2090_3242" x1="15.0293" y1="-0.274854" x2="10.8632" y2="3.75291" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF2070"/>
|
||||
<stop offset="0.481728" stop-color="#9670FF"/>
|
||||
<stop offset="0.761875" stop-color="#258DFF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
END),
|
||||
html("<textarea placeholder='{$lang->aiapp->continueasking}' rows='1' class='chat-input-box'></textarea>"),
|
||||
btn(
|
||||
setClass('ghost send-btn'),
|
||||
on::click('window.aiBrowseMiniProgram.clearInputAndChat'),
|
||||
html(<<<END
|
||||
<svg width="17" height="20" viewBox="0 0 17 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.9398 4C14.1118 4.00003 14.2778 4.07496 14.4063 4.2106C14.5348 4.34623 14.6169 4.53312 14.6371 4.73583L14.642 4.83333V10.1908C14.642 11.7392 13.8036 13.0717 12.659 13.1617L12.5354 13.1667H5.10287L6.71226 15.0775C6.8382 15.2275 6.91131 15.4287 6.91676 15.6403C6.9222 15.8519 6.85957 16.0581 6.74158 16.2169C6.62359 16.3757 6.45909 16.4753 6.2815 16.4953C6.1039 16.5154 5.92652 16.4545 5.78539 16.325L5.71938 16.2558L2.91067 12.9225C2.77903 12.7662 2.70508 12.5543 2.70508 12.3333C2.70508 12.1124 2.77903 11.9004 2.91067 11.7442L5.71938 8.41083C5.84575 8.26138 6.01531 8.17461 6.19362 8.16814C6.37194 8.16168 6.54565 8.23601 6.67946 8.37604C6.81327 8.51607 6.89715 8.71129 6.91407 8.92206C6.93099 9.13283 6.87967 9.34334 6.77055 9.51083L6.71226 9.58917L5.10287 11.5H12.5354C12.8577 11.5 13.1927 11.0192 13.2334 10.3308L13.2376 10.1908V4.83333C13.2376 4.61232 13.3116 4.40036 13.4433 4.24408C13.575 4.0878 13.7536 4 13.9398 4Z" fill="#D8DBDE"/>
|
||||
</svg>
|
||||
END)
|
||||
)
|
||||
)
|
||||
: null;
|
||||
|
||||
div(
|
||||
setClass('mini-program fixed flex'),
|
||||
div(
|
||||
setClass('detail col shadow-md h-full flex-none'),
|
||||
div(
|
||||
setClass('header relative flex flex-none'),
|
||||
div(
|
||||
setID('program-avatar'),
|
||||
setClass('program-avatar center flex-none'),
|
||||
setStyle(array('border' => "1px solid {$config->ai->miniPrograms->themeList[$iconTheme][1]}", 'background-color' => $config->ai->miniPrograms->themeList[$iconTheme][0])),
|
||||
html($config->ai->miniPrograms->iconList[$iconName])
|
||||
),
|
||||
div(
|
||||
setClass('content flex-1 overflow-hidden'),
|
||||
div(
|
||||
setClass('title pb-2 ellipsis'),
|
||||
set::title($miniProgram->name),
|
||||
$miniProgram->name
|
||||
),
|
||||
div(
|
||||
setClass('desc'),
|
||||
set::title($miniProgram->desc),
|
||||
$miniProgram->desc
|
||||
)
|
||||
),
|
||||
$isDeleted
|
||||
? label(
|
||||
setClass('danger'),
|
||||
$lang->aiapp->deleted
|
||||
)
|
||||
: $starBtn
|
||||
),
|
||||
div(
|
||||
setClass('body col overflow-hidden', empty($formGroups) ? 'flex-none' : 'flex-1'),
|
||||
div(
|
||||
setClass('language-model flex flex-none justify-between items-center'),
|
||||
div(
|
||||
setClass('content flex gap-2.5'),
|
||||
span(
|
||||
setStyle(array('color' => 'var(--color-slate-700)')),
|
||||
$lang->aiapp->modelCurrent
|
||||
),
|
||||
span($models[$miniProgram->model]),
|
||||
),
|
||||
empty($formGroups)
|
||||
? null
|
||||
: btn(
|
||||
setClass('ghost'),
|
||||
set::size('md'),
|
||||
set::disabled($isDeleted),
|
||||
set::icon('trash'),
|
||||
$lang->aiapp->clear,
|
||||
on::click('window.aiBrowseMiniProgram.handleRestBtnClick')
|
||||
)
|
||||
),
|
||||
empty($formGroups)
|
||||
? null
|
||||
: div(
|
||||
setClass('form-container p-1 flex-1 overflow-y-auto'),
|
||||
form(
|
||||
set::grid(false),
|
||||
set::actions(array()),
|
||||
$formGroups
|
||||
)
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('footer flex-none'),
|
||||
$generateBtn
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('chat chat-nohistory shadow-md flex-1 center'),
|
||||
setClass(array('hidden' => !empty($messages))),
|
||||
div(
|
||||
setClass('chat-tip flex'),
|
||||
html(<<<END
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.3334 6.66665C13.3334 8.93588 11.9162 10.8741 9.91858 11.6445H8.00008H6.08158C4.08395 10.8741 2.66675 8.93588 2.66675 6.66665C2.66675 3.72111 5.05455 1.33331 8.00008 1.33331C10.9456 1.33331 13.3334 3.72111 13.3334 6.66665Z" stroke="#FF9F46" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.91858 11.6445L9.69221 14.361C9.67781 14.5338 9.53338 14.6667 9.36001 14.6667H6.64011C6.46674 14.6667 6.32231 14.5338 6.30794 14.361L6.08154 11.6445" stroke="#FF9F46" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.47095 4.78107L7.05673 6.19528L9.17805 6.90239L7.52814 8.5523" stroke="#FF9F46" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
END),
|
||||
$lang->aiapp->chatTip
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('chat chat-nomodel shadow-md flex-1 center hidden'),
|
||||
div(
|
||||
p(
|
||||
icon(set::name('exclamation'), setClass('mr-2'), setStyle(array('color' => 'rgb(255, 159, 70)'))),
|
||||
html($lang->aiapp->noModel[0])
|
||||
),
|
||||
p(html($lang->aiapp->noModel[1]), setStyle('padding-left', '22px'))
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('chat chat-history shadow-md flex-1 col'),
|
||||
setClass(array('hidden' => empty($messages))),
|
||||
div(
|
||||
setClass('flex-1 message-list'),
|
||||
),
|
||||
$inputContainer
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
$navItems = array();
|
||||
$showTag = in_array($category, array('collection', 'discovery', 'latest'));
|
||||
|
||||
if(count($categoryList) <= 9)
|
||||
{
|
||||
foreach($categoryList as $key => $value)
|
||||
{
|
||||
$isActive = $category === $key;
|
||||
$navItems[] = array(
|
||||
'text' => $value,
|
||||
'active' => $isActive,
|
||||
'url' => createLink('aiapp', 'square', "category=$key"),
|
||||
'badge' => $isActive ? array('text' => $pager->recTotal, 'class' => 'size-sm rounded-full white') : null,
|
||||
'props' => array('data-id' => $key)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach(array_slice($categoryList, 0, 8) as $key => $value)
|
||||
{
|
||||
$isActive = $category === $key;
|
||||
$navItems[] = array(
|
||||
'text' => $value,
|
||||
'active' => $isActive,
|
||||
'url' => createLink('aiapp', 'square', "category=$key"),
|
||||
'badge' => $isActive ? array('text' => $pager->recTotal, 'class' => 'size-sm rounded-full white') : null,
|
||||
'props' => array('data-id' => $key)
|
||||
);
|
||||
}
|
||||
|
||||
$moreCategoryList = array_slice($categoryList, 8);
|
||||
$subItems = array();
|
||||
foreach($moreCategoryList as $key => $value)
|
||||
{
|
||||
$subItems[] = array(
|
||||
'text' => $value,
|
||||
'active' => $key === $category,
|
||||
'url' => createLink('aiapp', 'square', "category=$key"),
|
||||
'attrs' => array('data-id' => $key)
|
||||
);
|
||||
}
|
||||
$isActive = array_key_exists($category, $moreCategoryList);
|
||||
$navItems[] = array(
|
||||
'text' => $isActive ? $moreCategoryList[$category] : $lang->aiapp->more,
|
||||
'active' => $isActive,
|
||||
'type' => 'dropdown',
|
||||
'caret' => 'down',
|
||||
'badge' => $isActive ? array('text' => $pager->recTotal, 'class' => 'size-sm rounded-full white') : null,
|
||||
'props' => array('data-id' => $key),
|
||||
'items' => $subItems,
|
||||
);
|
||||
}
|
||||
|
||||
featureBar(set::items($navItems));
|
||||
|
||||
$miniProgramCard = function($miniProgram) use ($categoryList, $collectedIDs, $showTag)
|
||||
{
|
||||
global $config, $lang;
|
||||
|
||||
list($iconName, $iconTheme) = explode('-', $miniProgram->icon);
|
||||
$star = in_array($miniProgram->id, $collectedIDs) ? 'star' : 'star-empty';
|
||||
$delete = $star === 'star' ? 'true' : 'false';
|
||||
|
||||
$starBtn = common::hasPriv('aiapp', 'collectMiniProgram')
|
||||
? btn(
|
||||
set::size('md'),
|
||||
setClass('ghost btn-star'),
|
||||
setData('url', createLink('aiapp', 'collectMiniProgram', "appID={$miniProgram->id}&delete={$delete}")),
|
||||
on::click('window.aiSquare.handleStarBtnClick'),
|
||||
html(html::image("static/svg/{$star}.svg", "class='$star'")),
|
||||
$lang->aiapp->collect
|
||||
)
|
||||
: null;
|
||||
|
||||
return a(
|
||||
common::hasPriv('aiapp', 'view') ? set::href(createLink('aiapp', 'view', "id={$miniProgram->id}")) : null,
|
||||
setClass('miniprogram-card'),
|
||||
div(
|
||||
setClass('program-content'),
|
||||
div(
|
||||
setClass('program-text'),
|
||||
div(
|
||||
setClass('title'),
|
||||
set::title($miniProgram->name),
|
||||
$miniProgram->name
|
||||
),
|
||||
div(
|
||||
setClass('desc'),
|
||||
set::title($miniProgram->desc),
|
||||
$miniProgram->desc
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('program-avatar'),
|
||||
btn(
|
||||
setClass('btn-avatar'),
|
||||
setStyle(array(
|
||||
'width' => '46px',
|
||||
'height' => '46px',
|
||||
'border-radius' => '50%',
|
||||
'display' => 'flex',
|
||||
'justify-content' => 'center',
|
||||
'align-items' => 'center',
|
||||
'border' => "1px solid {$config->ai->miniPrograms->themeList[$iconTheme][1]}",
|
||||
'background-color' => "{$config->ai->miniPrograms->themeList[$iconTheme][0]}"
|
||||
)),
|
||||
html($config->ai->miniPrograms->iconList[$iconName]),
|
||||
)
|
||||
)
|
||||
),
|
||||
div(
|
||||
setClass('program-actions'),
|
||||
div(
|
||||
setClass('badge'),
|
||||
setClass(array('invisible' => !$showTag)),
|
||||
$categoryList[$miniProgram->category]
|
||||
),
|
||||
$starBtn
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
div(
|
||||
setClass('miniprogram-container'),
|
||||
array_map($miniProgramCard, $miniPrograms),
|
||||
);
|
||||
|
||||
div(
|
||||
setClass('pager-container'),
|
||||
pager()
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -104,6 +104,9 @@ $lang->service = new stdclass();
|
||||
$lang->deploy = new stdclass();
|
||||
$lang->metric = new stdclass();
|
||||
|
||||
$lang->ai = new stdclass();
|
||||
$lang->aiapp = new stdclass();
|
||||
|
||||
$lang->serverroom = new stdclass();
|
||||
$lang->programstakeholder = new stdclass();
|
||||
$lang->researchplan = new stdclass();
|
||||
|
||||
@@ -260,6 +260,8 @@ $lang->contact->common = 'Contacts';
|
||||
$lang->space->common = 'Service';
|
||||
$lang->store->common = 'Store';
|
||||
$lang->instance->common = 'Instance';
|
||||
$lang->ai->common = 'AI';
|
||||
$lang->aiapp->common = 'AI';
|
||||
|
||||
$lang->programstakeholder->common = 'Stakeholder';
|
||||
$lang->featureswitch->common = 'Features On/Off';
|
||||
@@ -447,6 +449,7 @@ $lang->searchObjects['program'] = 'Program';
|
||||
$lang->searchObjects['project'] = $lang->projectCommon;
|
||||
$lang->searchObjects['execution'] = $lang->execution->common;
|
||||
$lang->searchObjects['user'] = 'User';
|
||||
$lang->searchObjects['aiapp'] = 'AI';
|
||||
$lang->searchTips = '';
|
||||
|
||||
/* Code formats for import. */
|
||||
|
||||
@@ -256,6 +256,8 @@ $lang->contact->common = 'Contacts';
|
||||
$lang->space->common = 'Service';
|
||||
$lang->store->common = 'Store';
|
||||
$lang->instance->common = 'Instance';
|
||||
$lang->ai->common = 'AI';
|
||||
$lang->aiapp->common = 'AI';
|
||||
|
||||
$lang->programstakeholder->common = 'Stakeholder';
|
||||
$lang->featureswitch->common = 'Features On/Off';
|
||||
@@ -443,6 +445,7 @@ $lang->searchObjects['program'] = 'Program';
|
||||
$lang->searchObjects['project'] = $lang->projectCommon;
|
||||
$lang->searchObjects['execution'] = $lang->execution->common;
|
||||
$lang->searchObjects['user'] = 'User';
|
||||
$lang->searchObjects['aiapp'] = 'AI';
|
||||
$lang->searchTips = 'ID (ctrl+g)';
|
||||
|
||||
/* Code formats for import. */
|
||||
|
||||
@@ -260,6 +260,8 @@ $lang->contact->common = 'Contacts';
|
||||
$lang->space->common = 'Service';
|
||||
$lang->store->common = 'Store';
|
||||
$lang->instance->common = 'Instance';
|
||||
$lang->ai->common = 'AI';
|
||||
$lang->aiapp->common = 'AI';
|
||||
|
||||
$lang->programstakeholder->common = 'Stakeholder';
|
||||
$lang->featureswitch->common = 'Features On/Off';
|
||||
@@ -447,6 +449,7 @@ $lang->searchObjects['program'] = 'Program';
|
||||
$lang->searchObjects['project'] = $lang->projectCommon;
|
||||
$lang->searchObjects['execution'] = $lang->execution->common;
|
||||
$lang->searchObjects['user'] = 'User';
|
||||
$lang->searchObjects['aiapp'] = 'AI';
|
||||
$lang->searchTips = '';
|
||||
|
||||
/* Code formats for import. */
|
||||
|
||||
@@ -9,6 +9,7 @@ $lang->navIcons['qa'] = "<i class='icon icon-test'></i>";
|
||||
$lang->navIcons['devops'] = "<i class='icon icon-devops'></i>";
|
||||
$lang->navIcons['kanban'] = "<i class='icon icon-kanban'></i>";
|
||||
$lang->navIcons['doc'] = "<i class='icon icon-doc'></i>";
|
||||
$lang->navIcons['aiapp'] = "<i class='icon icon-ai'></i>";
|
||||
$lang->navIcons['bi'] = "<i class='icon icon-statistic'></i>";
|
||||
$lang->navIcons['system'] = "<i class='icon icon-group'></i>";
|
||||
$lang->navIcons['admin'] = "<i class='icon icon-cog-outline'></i>";
|
||||
@@ -21,6 +22,7 @@ $lang->navIconNames['project'] = 'project';
|
||||
$lang->navIconNames['execution'] = 'run';
|
||||
$lang->navIconNames['qa'] = 'test';
|
||||
$lang->navIconNames['devops'] = 'devops';
|
||||
$lang->navIconNames['aiapp'] = 'ai';
|
||||
$lang->navIconNames['kanban'] = 'kanban';
|
||||
$lang->navIconNames['doc'] = 'doc';
|
||||
$lang->navIconNames['bi'] = 'statistic';
|
||||
@@ -54,13 +56,14 @@ $lang->mainNav->project = "{$lang->navIcons['project']} {$lang->projectCommon}
|
||||
$lang->mainNav->execution = "{$lang->navIcons['execution']} {$lang->execution->common}|$executionModule|$executionMethod|";
|
||||
$lang->mainNav->qa = "{$lang->navIcons['qa']} {$lang->qa->common}|qa|index|";
|
||||
$lang->mainNav->devops = "{$lang->navIcons['devops']} DevOps|repo|maintain|";
|
||||
$lang->mainNav->aiapp = "{$lang->navIcons['aiapp']} {$lang->aiapp->common}|aiapp|square|";
|
||||
$lang->mainNav->kanban = "{$lang->navIcons['kanban']} {$lang->kanban->common}|kanban|space|";
|
||||
$lang->mainNav->doc = "{$lang->navIcons['doc']} {$lang->doc->common}|doc|index|";
|
||||
$lang->mainNav->bi = "{$lang->navIcons['bi']} {$lang->bi->common}|screen|browse|";
|
||||
$lang->mainNav->system = "{$lang->navIcons['system']} {$lang->system->common}|my|team|";
|
||||
$lang->mainNav->admin = "{$lang->navIcons['admin']} {$lang->admin->common}|admin|index|";
|
||||
|
||||
$lang->dividerMenu = ',bi,kanban,system,';
|
||||
$lang->dividerMenu = ',aiapp,bi,kanban,system,';
|
||||
|
||||
$lang->mainNav->menuOrder[5] = 'my';
|
||||
$lang->mainNav->menuOrder[10] = 'program';
|
||||
@@ -69,11 +72,12 @@ $lang->mainNav->menuOrder[20] = 'project';
|
||||
$lang->mainNav->menuOrder[25] = 'execution';
|
||||
$lang->mainNav->menuOrder[30] = 'qa';
|
||||
$lang->mainNav->menuOrder[35] = 'devops';
|
||||
$lang->mainNav->menuOrder[40] = 'bi';
|
||||
$lang->mainNav->menuOrder[45] = 'kanban';
|
||||
$lang->mainNav->menuOrder[50] = 'doc';
|
||||
$lang->mainNav->menuOrder[55] = 'system';
|
||||
$lang->mainNav->menuOrder[60] = 'admin';
|
||||
$lang->mainNav->menuOrder[40] = 'aiapp';
|
||||
$lang->mainNav->menuOrder[45] = 'bi';
|
||||
$lang->mainNav->menuOrder[50] = 'kanban';
|
||||
$lang->mainNav->menuOrder[55] = 'doc';
|
||||
$lang->mainNav->menuOrder[60] = 'system';
|
||||
$lang->mainNav->menuOrder[65] = 'admin';
|
||||
|
||||
if($config->systemMode == 'light') unset($lang->mainNav->program, $lang->mainNav->menuOrder[10]);
|
||||
|
||||
@@ -738,6 +742,8 @@ $lang->navGroup->ops = 'admin';
|
||||
$lang->navGroup->service = 'admin';
|
||||
$lang->navGroup->domain = 'admin';
|
||||
|
||||
$lang->navGroup->aiapp = 'aiapp';
|
||||
|
||||
$lang->navGroup->index = 'index';
|
||||
$lang->navGroup->misc = 'misc';
|
||||
$lang->navGroup->upgrade = 'upgrade';
|
||||
|
||||
@@ -257,6 +257,8 @@ $lang->contact->common = '联系人';
|
||||
$lang->space->common = '服务管理';
|
||||
$lang->store->common = '应用市场';
|
||||
$lang->instance->common = '应用';
|
||||
$lang->ai->common = 'AI';
|
||||
$lang->aiapp->common = 'AI';
|
||||
|
||||
$lang->programstakeholder->common = '干系人';
|
||||
$lang->featureswitch->common = '功能开关';
|
||||
@@ -444,6 +446,7 @@ $lang->searchObjects['program'] = '项目集';
|
||||
$lang->searchObjects['project'] = $lang->projectCommon;
|
||||
$lang->searchObjects['execution'] = $lang->execution->common;
|
||||
$lang->searchObjects['user'] = '用户';
|
||||
$lang->searchObjects['aiapp'] = 'AI';
|
||||
$lang->searchTips = '编号(ctrl+g)';
|
||||
|
||||
/* 导入支持的编码格式。*/
|
||||
|
||||
@@ -1209,7 +1209,7 @@ class commonModel extends model
|
||||
* The following pages can be allowed to open in non-iframe, so ignore these pages.
|
||||
*/
|
||||
$module = $this->app->getModuleName();
|
||||
$whitelist = '|index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-preview|file-uploadimages|file-ajaxwopifiles|report-annualdata|misc-captcha|execution-printkanban|traincourse-ajaxuploadlargefile|traincourse-playvideo|screen-view|zanode-create|screen-ajaxgetchart|';
|
||||
$whitelist = '|index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-preview|file-uploadimages|file-ajaxwopifiles|report-annualdata|misc-captcha|execution-printkanban|traincourse-ajaxuploadlargefile|traincourse-playvideo|screen-view|zanode-create|screen-ajaxgetchart|ai-chat|';
|
||||
|
||||
if(strpos($whitelist, "|{$module}|") !== false || strpos($whitelist, "|{$module}-{$method}|") !== false) return true;
|
||||
|
||||
|
||||
@@ -563,6 +563,12 @@ $lang->group->package->browsePrompt = 'Browse Prompts';
|
||||
$lang->group->package->managePrompt = 'Manage and Design Prompts';
|
||||
$lang->group->package->publishPrompt = 'Publish and Unpublish Prompts';
|
||||
$lang->group->package->deletePrompt = 'Delete Prompts';
|
||||
$lang->group->package->manageMiniProgram = 'Manage and Design Mini Programs';
|
||||
$lang->group->package->browseMiniProgram = 'Browse Mini Programs';
|
||||
$lang->group->package->miniProgramSquare = 'AI Mini Program Square';
|
||||
$lang->group->package->publishMiniProgram = 'Publish and Unpublish AI Mini Programs';
|
||||
$lang->group->package->deleteMiniProgram = 'Delete AI Mini Programs';
|
||||
$lang->group->package->impAndExpMiniProgram = 'Import and Export Mini Programs';
|
||||
$lang->group->package->dashboard = 'Dashboard';
|
||||
$lang->group->package->resource = 'Resource';
|
||||
$lang->group->package->manageServiceProvider = 'Provider';
|
||||
|
||||
@@ -563,6 +563,12 @@ $lang->group->package->browsePrompt = 'Browse Prompts';
|
||||
$lang->group->package->managePrompt = 'Manage and Design Prompts';
|
||||
$lang->group->package->publishPrompt = 'Publish and Unpublish Prompts';
|
||||
$lang->group->package->deletePrompt = 'Delete Prompts';
|
||||
$lang->group->package->manageMiniProgram = 'Manage and Design Mini Programs';
|
||||
$lang->group->package->browseMiniProgram = 'Browse Mini Programs';
|
||||
$lang->group->package->miniProgramSquare = 'AI Mini Program Square';
|
||||
$lang->group->package->publishMiniProgram = 'Publish and Unpublish AI Mini Programs';
|
||||
$lang->group->package->deleteMiniProgram = 'Delete AI Mini Programs';
|
||||
$lang->group->package->impAndExpMiniProgram = 'Import and Export Mini Programs';
|
||||
$lang->group->package->dashboard = 'Dashboard';
|
||||
$lang->group->package->resource = 'Resource';
|
||||
$lang->group->package->manageServiceProvider = 'Provider';
|
||||
|
||||
@@ -563,6 +563,12 @@ $lang->group->package->browsePrompt = 'Browse Prompts';
|
||||
$lang->group->package->managePrompt = 'Manage and Design Prompts';
|
||||
$lang->group->package->publishPrompt = 'Publish and Unpublish Prompts';
|
||||
$lang->group->package->deletePrompt = 'Delete Prompts';
|
||||
$lang->group->package->manageMiniProgram = 'Manage and Design Mini Programs';
|
||||
$lang->group->package->browseMiniProgram = 'Browse Mini Programs';
|
||||
$lang->group->package->miniProgramSquare = 'AI Mini Program Square';
|
||||
$lang->group->package->publishMiniProgram = 'Publish and Unpublish AI Mini Programs';
|
||||
$lang->group->package->deleteMiniProgram = 'Delete AI Mini Programs';
|
||||
$lang->group->package->impAndExpMiniProgram = 'Import and Export Mini Programs';
|
||||
$lang->group->package->dashboard = 'Dashboard';
|
||||
$lang->group->package->resource = 'Resource';
|
||||
$lang->group->package->manageServiceProvider = 'Provider';
|
||||
|
||||
@@ -1872,18 +1872,40 @@ $lang->resource->api->getModel = 'getModel';
|
||||
$lang->resource->api->debug = 'debug';
|
||||
$lang->resource->api->sql = 'sql';
|
||||
|
||||
/* AI methods. TODO(@Wenrui LI): resurrect AI-related features later. */
|
||||
/* AI methods. */
|
||||
$lang->resource->ai = new stdclass();
|
||||
$lang->resource->ai->models = 'modelBrowse';
|
||||
$lang->resource->ai->editModel = 'modelEdit';
|
||||
$lang->resource->ai->testConnection = 'modelTestConnection';
|
||||
$lang->resource->ai->promptPublish = 'promptPublish';
|
||||
$lang->resource->ai->promptUnpublish = 'promptUnpublish';
|
||||
$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->resource->ai->models = 'modelBrowse';
|
||||
$lang->resource->ai->modelView = 'modelView';
|
||||
$lang->resource->ai->modelCreate = 'modelCreate';
|
||||
$lang->resource->ai->modelEdit = 'modelEdit';
|
||||
$lang->resource->ai->modelEnable = 'modelEnable';
|
||||
$lang->resource->ai->modelDisable = 'modelDisable';
|
||||
$lang->resource->ai->modelDelete = 'modelDelete';
|
||||
$lang->resource->ai->modelTestConnection = 'modelTestConnection';
|
||||
$lang->resource->ai->promptPublish = 'promptPublish';
|
||||
$lang->resource->ai->promptUnpublish = 'promptUnpublish';
|
||||
$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->resource->ai->createMiniProgram = 'createMiniProgram';
|
||||
$lang->resource->ai->editMiniProgram = 'editMiniProgram';
|
||||
$lang->resource->ai->testMiniProgram = 'testMiniProgram';
|
||||
$lang->resource->ai->miniPrograms = 'miniProgramList';
|
||||
$lang->resource->ai->miniProgramView = 'miniProgramView';
|
||||
$lang->resource->ai->publishMiniProgram = 'publishMiniProgram';
|
||||
$lang->resource->ai->unpublishMiniProgram = 'unpublishMiniProgram';
|
||||
$lang->resource->ai->deleteMiniProgram = 'deleteMiniProgram';
|
||||
$lang->resource->ai->exportMiniProgram = 'exportMiniProgram';
|
||||
$lang->resource->ai->importMiniProgram = 'importMiniProgram';
|
||||
$lang->resource->ai->editMiniProgramCategory = 'editMiniProgramCategory';
|
||||
|
||||
$lang->resource->aiapp = new stdclass();
|
||||
$lang->resource->aiapp->square = 'miniProgramSquare';
|
||||
$lang->resource->aiapp->view = 'view';
|
||||
$lang->resource->aiapp->miniProgramChat = 'miniProgramChat';
|
||||
$lang->resource->aiapp->collectMiniProgram = 'collectMiniProgram';
|
||||
|
||||
$lang->api->methodOrder[0] = 'index';
|
||||
$lang->api->methodOrder[5] = 'createLib';
|
||||
|
||||
@@ -563,6 +563,12 @@ $lang->group->package->browsePrompt = '浏览提词';
|
||||
$lang->group->package->managePrompt = '维护和设计提词';
|
||||
$lang->group->package->publishPrompt = '提词上下架';
|
||||
$lang->group->package->deletePrompt = '删除提词';
|
||||
$lang->group->package->manageMiniProgram = '维护和设计小程序';
|
||||
$lang->group->package->browseMiniProgram = '浏览小程序';
|
||||
$lang->group->package->miniProgramSquare = 'AI小程序广场';
|
||||
$lang->group->package->publishMiniProgram = 'AI小程序上下架';
|
||||
$lang->group->package->deleteMiniProgram = '删除AI小程序';
|
||||
$lang->group->package->impAndExpMiniProgram = '导入导出AI小程序';
|
||||
$lang->group->package->dashboard = '仪表盘';
|
||||
$lang->group->package->resource = '资源';
|
||||
$lang->group->package->manageServiceProvider = '服务商管理';
|
||||
|
||||
@@ -477,11 +477,13 @@ $config->group->subset->roadmap = new stdclass();
|
||||
$config->group->subset->roadmap->order = 125;
|
||||
$config->group->subset->roadmap->nav = 'product';
|
||||
|
||||
/* TODO(@Wenrui LI): resurrect AI-related features later. *//*
|
||||
$config->group->subset->ai = new stdclass();
|
||||
$config->group->subset->ai->order = 2020;
|
||||
$config->group->subset->ai->nav = 'admin';
|
||||
*/
|
||||
|
||||
$config->group->subset->aiapp = new stdclass();
|
||||
$config->group->subset->aiapp->order = 2030;
|
||||
$config->group->subset->aiapp->nav = 'aiapp';
|
||||
|
||||
$config->group->subset->codereview = new stdclass();
|
||||
$config->group->subset->codereview->order = 2580;
|
||||
@@ -3712,7 +3714,6 @@ $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());
|
||||
|
||||
/* TODO(@Wenrui LI): resurrect AI-related features later. *//*
|
||||
$config->group->package->aiChatting = new stdclass();
|
||||
$config->group->package->aiChatting->order = 2020;
|
||||
$config->group->package->aiChatting->subset = 'ai';
|
||||
@@ -3730,9 +3731,14 @@ $config->group->package->manageLLM = new stdclass();
|
||||
$config->group->package->manageLLM->order = 2060;
|
||||
$config->group->package->manageLLM->subset = 'ai';
|
||||
$config->group->package->manageLLM->privs = array();
|
||||
$config->group->package->manageLLM->privs['ai-models'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 5, 'depend' => array('admin-index'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-editModel'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 10, 'depend' => array('admin-index', 'ai-models', 'ai-testConnection'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-testConnection'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 15, 'depend' => array('admin-index', 'ai-editModel', 'ai-models'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-models'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 5, 'depend' => array('admin-index'), 'recommend' => array('ai-modelView'));
|
||||
$config->group->package->manageLLM->privs['ai-modelView'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 10, 'depend' => array('admin-index', 'ai-models'), 'recommend' => array('ai-modelTestConnection'));
|
||||
$config->group->package->manageLLM->privs['ai-modelCreate'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 15, 'depend' => array('admin-index', 'ai-models', 'ai-modelView', 'ai-modelTestConnection'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-modelEdit'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 20, 'depend' => array('admin-index', 'ai-models', 'ai-modelView', 'ai-modelTestConnection'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-modelEnable'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 25, 'depend' => array('admin-index', 'ai-models', 'ai-modelView', 'ai-modelDisable'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-modelDisable'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 40, 'depend' => array('admin-index', 'ai-models', 'ai-modelView', 'ai-modelEnable'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-modelDelete'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 35, 'depend' => array('admin-index', 'ai-models', 'ai-modelView'), 'recommend' => array());
|
||||
$config->group->package->manageLLM->privs['ai-modelTestConnection'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 40, 'depend' => array('admin-index', 'ai-models', 'ai-modelView'), 'recommend' => array());
|
||||
|
||||
$config->group->package->browsePrompt = new stdclass();
|
||||
$config->group->package->browsePrompt->order = 2080;
|
||||
@@ -3767,7 +3773,51 @@ $config->group->package->deletePrompt->order = 2140;
|
||||
$config->group->package->deletePrompt->subset = 'ai';
|
||||
$config->group->package->deletePrompt->privs = array();
|
||||
$config->group->package->deletePrompt->privs['ai-promptDelete'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 30, 'depend' => array('admin-index', 'ai-prompts', 'ai-promptView'), 'recommend' => array());
|
||||
*/
|
||||
|
||||
$config->group->package->manageMiniProgram = new stdclass();
|
||||
$config->group->package->manageMiniProgram->order = 2150;
|
||||
$config->group->package->manageMiniProgram->subset = 'ai';
|
||||
$config->group->package->manageMiniProgram->privs = array();
|
||||
$config->group->package->manageMiniProgram->privs['ai-createMiniProgram'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-editMiniProgram', 'ai-testMiniProgram'));
|
||||
$config->group->package->manageMiniProgram->privs['ai-editMiniProgram'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 30, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-createMiniProgram', 'ai-publishMiniProgram'));
|
||||
$config->group->package->manageMiniProgram->privs['ai-testMiniProgram'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 40, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView', 'aiapp-miniProgramChat'), 'recommend' => array('ai-createMiniProgram', 'ai-editMiniProgram', 'ai-publishMiniProgram'));
|
||||
$config->group->package->manageMiniProgram->privs['ai-editMiniProgramCategory'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 50, 'depend' => array('admin-index', 'ai-miniPrograms'), 'recommend' => array());
|
||||
|
||||
$config->group->package->browseMiniProgram = new stdclass();
|
||||
$config->group->package->browseMiniProgram->order = 2160;
|
||||
$config->group->package->browseMiniProgram->subset = 'ai';
|
||||
$config->group->package->browseMiniProgram->privs = array();
|
||||
$config->group->package->browseMiniProgram->privs['ai-miniPrograms'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array('admin-index'), 'recommend' => array());
|
||||
$config->group->package->browseMiniProgram->privs['ai-miniProgramView'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms'), 'recommend' => array());
|
||||
|
||||
$config->group->package->miniProgramSquare = new stdclass();
|
||||
$config->group->package->miniProgramSquare->order = 2170;
|
||||
$config->group->package->miniProgramSquare->subset = 'aiapp';
|
||||
$config->group->package->miniProgramSquare->privs = array();
|
||||
$config->group->package->miniProgramSquare->privs['aiapp-square'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array(), 'recommend' => array('aiapp-view', 'aiapp-miniProgramChat', 'aiapp-collectMiniProgram'));
|
||||
$config->group->package->miniProgramSquare->privs['aiapp-collectMiniProgram'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('aiapp-square', 'aiapp-view'), 'recommend' => array('aiapp-miniProgramChat'));
|
||||
$config->group->package->miniProgramSquare->privs['aiapp-miniProgramChat'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 30, 'depend' => array('aiapp-view'), 'recommend' => array('aiapp-collectMiniProgram'));
|
||||
$config->group->package->miniProgramSquare->privs['aiapp-view'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 40, 'depend' => array('aiapp-square'), 'recommend' => array('aiapp-miniProgramChat', 'aiapp-collectMiniProgram'));
|
||||
|
||||
$config->group->package->publishMiniProgram = new stdclass();
|
||||
$config->group->package->publishMiniProgram->order = 2180;
|
||||
$config->group->package->publishMiniProgram->subset = 'ai';
|
||||
$config->group->package->publishMiniProgram->privs = array();
|
||||
$config->group->package->publishMiniProgram->privs['ai-publishMiniProgram'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-createMiniProgram', 'ai-deleteMiniProgram', 'ai-unpublishMiniProgram', 'ai-testMiniProgram'));
|
||||
$config->group->package->publishMiniProgram->privs['ai-unpublishMiniProgram'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-createMiniProgram', 'ai-editMiniProgram', 'ai-testMiniProgram'));
|
||||
|
||||
$config->group->package->deleteMiniProgram = new stdclass();
|
||||
$config->group->package->deleteMiniProgram->order = 2190;
|
||||
$config->group->package->deleteMiniProgram->subset = 'ai';
|
||||
$config->group->package->deleteMiniProgram->privs = array();
|
||||
$config->group->package->deleteMiniProgram->privs['ai-deleteMiniProgram'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-createMiniProgram', 'ai-publishMiniProgram', 'ai-testMiniProgram', 'ai-editMiniProgram'));
|
||||
|
||||
$config->group->package->impAndExpMiniProgram = new stdclass();
|
||||
$config->group->package->impAndExpMiniProgram->order = 2191;
|
||||
$config->group->package->impAndExpMiniProgram->subset = 'ai';
|
||||
$config->group->package->impAndExpMiniProgram->privs = array();
|
||||
$config->group->package->impAndExpMiniProgram->privs['ai-exportMiniProgram'] = array('edition' => 'biz,max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array('admin-index', 'ai-miniPrograms', 'ai-miniProgramView'), 'recommend' => array('ai-importMiniProgram'));
|
||||
$config->group->package->impAndExpMiniProgram->privs['ai-importMiniProgram'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('admin-index', 'ai-miniPrograms'), 'recommend' => array('ai-exportMiniProgram'));
|
||||
|
||||
$config->group->package->resource = new stdclass();
|
||||
$config->group->package->resource->order = 2200;
|
||||
|
||||
@@ -26,3 +26,8 @@ $config->index->oldPages = array();
|
||||
$config->index->oldPages[] = 'screen-view';
|
||||
$config->index->oldPages[] = 'screen-burn';
|
||||
$config->index->oldPages[] = 'report-annualdata';
|
||||
$config->index->oldPages[] = 'ai-adminindex';
|
||||
$config->index->oldPages[] = 'ai-chat';
|
||||
$config->index->oldPages[] = 'ai-miniprograms';
|
||||
$config->index->oldPages[] = 'ai-prompts';
|
||||
$config->index->oldPages[] = 'ai-promptview';
|
||||
|
||||
@@ -363,7 +363,10 @@ function getAppCode(urlOrModuleName)
|
||||
var moduleName = link.moduleName;
|
||||
var methodName = link.methodName;
|
||||
var moduleMethodLower = (moduleName + '-' + methodName).toLowerCase();
|
||||
if (moduleMethodLower === 'index-index') return 'my';
|
||||
|
||||
if(moduleMethodLower === 'index-index') return 'my';
|
||||
if(moduleMethodLower === 'search-buildindex') return 'admin';
|
||||
|
||||
if(moduleName === 'tutorial' && methodName === 'wizard')
|
||||
{
|
||||
moduleName = link.vars[0][1];
|
||||
@@ -445,7 +448,11 @@ function getAppCode(urlOrModuleName)
|
||||
return 'execution';
|
||||
}
|
||||
}
|
||||
if(['search-buildindex', 'ai-adminindex'].includes(moduleMethodLower)) return 'admin';
|
||||
if(moduleName === 'ai')
|
||||
{
|
||||
/* Match admin ai pages. */
|
||||
if(['adminindex', 'prompts', 'promptview', 'conversations', 'models', 'modelcreate', 'modelview', 'modeledit', 'editmodel', 'promptassignrole', 'promptselectdatasource', 'promptsetpurpose', 'promptsettargetform', 'promptfinalize', 'promptedit', 'miniprograms', 'createminiprogram', 'editminiprogram', 'configuredminiprogram', 'editminiprogramcategory', 'miniprogramview'].includes(methodLowerCase)) return 'admin';
|
||||
}
|
||||
|
||||
code = navGroup[moduleName] || moduleName || urlOrModuleName;
|
||||
return apps.map[code] ? code : '';
|
||||
|
||||
@@ -145,6 +145,13 @@ $config->search->fields->execution->content = 'code,desc';
|
||||
$config->search->fields->execution->addedDate = 'openedDate';
|
||||
$config->search->fields->execution->editedDate = 'lastEditedDate';
|
||||
|
||||
$config->search->fields->aiapp = new stdclass();
|
||||
$config->search->fields->aiapp->id = 'id';
|
||||
$config->search->fields->aiapp->title = 'name';
|
||||
$config->search->fields->aiapp->content = 'desc';
|
||||
$config->search->fields->aiapp->addedDate = 'createdBy';
|
||||
$config->search->fields->aiapp->editedDate = 'editedDate';
|
||||
|
||||
/* Set the recPerPage of search. */
|
||||
$config->search->recPerPage = 10;
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ $lang->search->modules['project'] = $lang->projectCommon;
|
||||
$lang->search->modules['execution'] = $lang->execution->common;
|
||||
$lang->search->modules['story'] = $lang->SRCommon;
|
||||
$lang->search->modules['requirement'] = $lang->URCommon;
|
||||
$lang->search->modules['aiapp'] = 'AI';
|
||||
|
||||
$lang->search->objectTypeList['story'] = $lang->SRCommon;
|
||||
$lang->search->objectTypeList['requirement'] = $lang->URCommon;
|
||||
|
||||
@@ -101,6 +101,7 @@ $lang->search->modules['project'] = $lang->projectCommon;
|
||||
$lang->search->modules['execution'] = $lang->execution->common;
|
||||
$lang->search->modules['story'] = $lang->SRCommon;
|
||||
$lang->search->modules['requirement'] = $lang->URCommon;
|
||||
$lang->search->modules['aiapp'] = 'AI';
|
||||
|
||||
$lang->search->objectTypeList['story'] = $lang->SRCommon;
|
||||
$lang->search->objectTypeList['requirement'] = $lang->URCommon;
|
||||
|
||||
@@ -101,6 +101,7 @@ $lang->search->modules['project'] = $lang->projectCommon;
|
||||
$lang->search->modules['execution'] = $lang->execution->common;
|
||||
$lang->search->modules['story'] = $lang->SRCommon;
|
||||
$lang->search->modules['requirement'] = $lang->URCommon;
|
||||
$lang->search->modules['aiapp'] = 'AI';
|
||||
|
||||
$lang->search->objectTypeList['story'] = $lang->SRCommon;
|
||||
$lang->search->objectTypeList['requirement'] = $lang->URCommon;
|
||||
|
||||
@@ -101,6 +101,7 @@ $lang->search->modules['project'] = $lang->projectCommon;
|
||||
$lang->search->modules['execution'] = $lang->execution->common;
|
||||
$lang->search->modules['story'] = $lang->SRCommon;
|
||||
$lang->search->modules['requirement'] = $lang->URCommon;
|
||||
$lang->search->modules['aiapp'] = 'AI';
|
||||
|
||||
$lang->search->objectTypeList['story'] = $lang->SRCommon;
|
||||
$lang->search->objectTypeList['requirement'] = $lang->URCommon;
|
||||
|
||||
@@ -945,7 +945,7 @@ $config->delete['20.0.beta1'][] = 'extension/max/bug/ext/control/export.php';
|
||||
$config->delete['20.0.beta1'][] = 'extension/biz/story/ext/control/export.php';
|
||||
$config->delete['20.0.beta1'][] = 'extension/max/story/ext/control/export.php';
|
||||
|
||||
$config->upgrade->openModules = array('action', 'admin', 'ai', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'chart', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dataview', 'dept', 'design', 'dev', 'dimension', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'metric', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'pivot', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'screen', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'transfer', 'zahost', 'zanode', 'editor', 'charter', 'roadmap', 'account', 'artifactrepo', 'cne', 'host', 'instance', 'ops', 'serverroom', 'space', 'store', 'system', 'solution');
|
||||
$config->upgrade->openModules = array('action', 'admin', 'ai', 'aiapp', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'chart', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dataview', 'dept', 'design', 'dev', 'dimension', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'metric', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'pivot', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'screen', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'transfer', 'zahost', 'zanode', 'editor', 'charter', 'roadmap', 'account', 'artifactrepo', 'cne', 'host', 'instance', 'ops', 'serverroom', 'space', 'store', 'system', 'solution');
|
||||
|
||||
$config->upgrade->unsetModules = array('design', 'program', 'programplan', 'projectbuild', 'projectrelease', 'stage', 'stakeholder', 'product', 'branch', 'productplan', 'release', 'build', 'qa', 'bug', 'testcase', 'testtask', 'testreport', 'testsuite', 'caselib', 'automation', 'repo', 'ci', 'compile', 'jenkins', 'job', 'svn', 'gitlab', 'sonarqube', 'mr', 'git', 'report', 'sqlbuilder', 'feedback', 'faq', 'attend', 'holiday', 'leave', 'makeup', 'overtime', 'lieu', 'ops', 'host', 'serverroom', 'account', 'domain', 'service', 'deploy', 'conference', 'traincourse', 'pssp', 'baseline', 'classify', 'cm', 'cmcl', 'auditcl', 'reviewcl', 'process', 'activity', 'zoutput', 'auditplan', 'nc', 'subject', 'weekly', 'workestimation', 'issue', 'durationestimation', 'risk', 'opportunity', 'trainplan', 'gapanalysis', 'researchplan', 'researchreport', 'meeting', 'meetingroom', 'budget', 'reviewissue', 'reviewsetting', 'review', 'milestone', 'assetlib', 'setting', 'im', 'client', 'ldap', 'dev', 'api', 'gitea', 'gogs', 'zanode', 'zahost');
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="23">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<rect width="22.769" height="22" x=".6" y=".5" fill="#2E7FFF" fill-rule="nonzero" rx="4" />
|
||||
<g stroke="#FFF" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="m6.346 16.179 3.03-9.136h.98l2.96 9.136" />
|
||||
<path d="M7.385 13.029h4.904" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M16.386 7.043v9.136" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 541 B |
Reference in New Issue
Block a user