优化样式
This commit is contained in:
87
README.md
87
README.md
@@ -159,6 +159,93 @@ npm i
|
|||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 与人工智能集成
|
||||||
|
|
||||||
|
如果要在 UAI Editor 中使用 AI 功能,需要在初始化 UAIEditor 的时候配置相关的配置项:
|
||||||
|
|
||||||
|
```js
|
||||||
|
new UAIEditor({
|
||||||
|
element: "#uai-editor",
|
||||||
|
content: 'UAI Editor 是一个面向 AI 的、现代 UI 风格的下一代富文本编辑器。开箱即用、支持所有前端框架。',
|
||||||
|
ai: { // AI 配置项
|
||||||
|
chat: { // 聊天配置项
|
||||||
|
models: { // 模型配置项
|
||||||
|
"default": {
|
||||||
|
modelType: 'openai',
|
||||||
|
baseUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
||||||
|
apiKey: process.env.CHATGLM_APIKEY,
|
||||||
|
model: 'glm-4-flash'
|
||||||
|
},
|
||||||
|
"GLM-4": { // 聊天功能选择使用的模型,配置智谱AI的GLM-4-Flash模型
|
||||||
|
modelType: 'openai',
|
||||||
|
baseUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
||||||
|
apiKey: process.env.CHATGLM_APIKEY, // 此处填写您智谱AI的 API Key
|
||||||
|
model: 'glm-4-flash'
|
||||||
|
},
|
||||||
|
"InternLM2.5": { // 聊天功能选择使用的模型,配置上海人工智能实验室的InternLM2.5模型
|
||||||
|
modelType: 'openai',
|
||||||
|
baseUrl: 'https://internlm-chat.intern-ai.org.cn/puyu/api/v1',
|
||||||
|
apiKey: process.env.INTERNLM_TOKEN, // 此处填写您上海人工智能实验室的 API Key
|
||||||
|
model: 'internlm2.5-latest'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
image: { // 图像配置项
|
||||||
|
models: { // 模型配置项
|
||||||
|
text2image: { // 文本生成图像模型配置项
|
||||||
|
"default": {
|
||||||
|
modelType: 'openai',
|
||||||
|
baseUrl: 'https://open.bigmodel.cn/api/paas/v4', // images/generations
|
||||||
|
apiKey: process.env.CHATGLM_APIKEY,
|
||||||
|
model: 'cogview-3-flash'
|
||||||
|
},
|
||||||
|
"CogView-3": { // 绘图功能选择使用的模型,配置智谱AI的CogView-3-Flash模型
|
||||||
|
modelType: 'openai',
|
||||||
|
baseUrl: 'https://open.bigmodel.cn/api/paas/v4', // images/generations
|
||||||
|
apiKey: process.env.CHATGLM_APIKEY, // 此处填写您智谱AI的 API Key
|
||||||
|
model: 'cogview-3-flash'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## 帮助文档
|
||||||
|
|
||||||
|
UAI Editor 提供了一份使用文档,您可以通过以下方式访问:
|
||||||
|
|
||||||
|
安装必要的软件`docsify`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm i docsify -g
|
||||||
|
```
|
||||||
|
|
||||||
|
### 用户文档
|
||||||
|
|
||||||
|
启动文档服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docsify serve docs/user --port 3010
|
||||||
|
```
|
||||||
|
|
||||||
|
访问文档:
|
||||||
|
|
||||||
|
[http://localhost:3010](http://localhost:3010)。
|
||||||
|
|
||||||
|
### 开发者文档
|
||||||
|
|
||||||
|
启动文档服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docsify serve docs/developer --port 3020
|
||||||
|
```
|
||||||
|
|
||||||
|
访问文档:
|
||||||
|
|
||||||
|
[http://localhost:3020](http://localhost:3020)。
|
||||||
|
|
||||||
## 开源优势
|
## 开源优势
|
||||||
|
|
||||||
* **免费使用:** 作为开源项目,UAI Editor 采用 [MIT 许可证](LICENSE) 对所有用户免费开放,无需担心版权问题。
|
* **免费使用:** 作为开源项目,UAI Editor 采用 [MIT 许可证](LICENSE) 对所有用户免费开放,无需担心版权问题。
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="uai-editor" style="height: 100vh; overflow: hidden; border: solid 1px var(--uai-border-color)"></div>
|
<div id="uai-editor" style="height: 100vh; border: solid 1px var(--uai-border-color)"></div>
|
||||||
<!-- <div id="uai-editor" style="height: 90vh; width: 90vw; overflow: hidden; border: solid 1px var(--uai-border-color)"></div> -->
|
<!-- <div id="uai-editor" style="height: 90vh; width: 90vw; overflow: hidden; border: solid 1px var(--uai-border-color)"></div> -->
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export class Feedback extends HTMLElement implements UAIEditorEventListener {
|
|||||||
this.addEventListener("click", () => {
|
this.addEventListener("click", () => {
|
||||||
if (this.menuButtonOptions.enable) {
|
if (this.menuButtonOptions.enable) {
|
||||||
const anchor = document.createElement('a');
|
const anchor = document.createElement('a');
|
||||||
anchor.href = "https://gitee.com/AI-Labs/uai-editor/issues";
|
anchor.href = "https://gitee.com/uai-team/uai-editor/issues";
|
||||||
anchor.target = '_blank';
|
anchor.target = '_blank';
|
||||||
anchor.click();
|
anchor.click();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export class PoweredBy extends HTMLElement implements UAIEditorEventListener {
|
|||||||
this.addEventListener("click", () => {
|
this.addEventListener("click", () => {
|
||||||
if (this.menuButtonOptions.enable) {
|
if (this.menuButtonOptions.enable) {
|
||||||
const anchor = document.createElement('a');
|
const anchor = document.createElement('a');
|
||||||
anchor.href = "https://wux-labs.github.io/UAI-Editor";
|
anchor.href = "https://gitee.com/uai-team/uai-editor";
|
||||||
anchor.target = '_blank';
|
anchor.target = '_blank';
|
||||||
anchor.click();
|
anchor.click();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
--td-text-color-disabled: var(--uai-text-color-disabled);
|
--td-text-color-disabled: var(--uai-text-color-disabled);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: var(--uai-text-color);
|
color: var(--uai-text-color);
|
||||||
|
|||||||
Reference in New Issue
Block a user