From dfe5009e5d39c90586556376c2432f5e7ec2eb86 Mon Sep 17 00:00:00 2001 From: 622aa39c1f9b166ab1a38c05 <622aa39c1f9b166ab1a38c05@devide> Date: Fri, 7 Jul 2023 08:01:01 +0000 Subject: [PATCH] Fri Jul 7 08:01:01 UTC 2023 inscode --- src/App.vue | 26 ++++++++++++++++++-------- src/js/config.js | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3bdc0cf..f39fe72 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,14 +23,14 @@ - + {{ item.label }} - + @@ -192,7 +192,7 @@ export default { { label: '公共服务器', value: 'common' }, { label: '私有服务器', value: 'private' }, ], - sdServerUrl: 'https://gpu-pod64a4ff02b54fe048c07abc40-6006.node.inscode.run/sdapi/v1/txt2img', + sdServerUrl: '', loading: false, maxHistory: 200, speaking: false, // 是否正在输出语音 @@ -313,7 +313,11 @@ export default { const negative_prompt = this.negative_prompt const _this = this const messages = this.message - messages.push({ "user": "User", "message": 'prompt:
' + this.prompt + (negative_prompt ? '
' + 'negative_prompt:
' + negative_prompt : '') }) + const content = 'prompt:
' + + this.prompt + + (negative_prompt ? '

' + 'negative_prompt:
' + negative_prompt : '') + '

' + + 'width: ' + this.width + ' height: ' + this.height + '
steps: ' + this.steps +'
sampler: ' + this.sampler + messages.push({ "user": "User", "message": content }) messages.push(currentMsg) @@ -473,13 +477,12 @@ export default { copyAsPrompt (message) { this.prompt = message }, - handleServerTypeChange (type) { + handleSDServerTypeChange (type) { if (type === 'common') { this.sdServerUrl = this.config.common_sd_api } - - console.info(123) + this.saveConfig() }, recoverConfig () { const config = localStorage.getItem('ai-config') @@ -488,18 +491,25 @@ export default { this.config = configJSON this.sdServerType = configJSON.sdServerType this.sdServerUrl = configJSON.sdServerUrl + this.sdServerType = configJSON.sdServerType??'common' + + const data = Config.getData().data + this.name = data.name + document.title = this.name } else { this.getAppInfo() this.sdServerUrl = this.config.common_sd_api + this.sdServerType = 'common' } }, saveConfig () { - + const config = JSON.parse(JSON.stringify(this.config)) config.sdServerType = this.sdServerType config.sdServerUrl = this.sdServerUrl + config.sdServerType = this.sdServerType localStorage.setItem('ai-config', JSON.stringify(config)) } }, diff --git a/src/js/config.js b/src/js/config.js index 0127adb..440f40c 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -4,7 +4,7 @@ export default { "code": 200, "data": { "id": 128897, - "name": "小羊驼", + "name": "AI绘图", "create_time": 1684920670901, "app": "llm_rep", "resource_type": "app", -- GitLab