Skip to content

Commit

Permalink
2.13.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooy committed Dec 30, 2023
1 parent e9aa558 commit 857b557
Show file tree
Hide file tree
Showing 30 changed files with 779 additions and 139 deletions.
5 changes: 5 additions & 0 deletions changlog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 功能升级日志

# 2.13.6
- 🔨 优化: UI服务端保存
- 😄 新增: 国际化语言包

## 2.13.5
- 🐞 修复: 历史记录未带附件链接
- 😄 新增: 系统通知 #47
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chatgpt-web-midjourney-proxy",
"version": "2.13.5",
"version": "2.13.6",
"private": false,
"description": "ChatGPT Web Midjourney Proxy",
"author": "Dooy <[email protected]>",
Expand Down
16 changes: 13 additions & 3 deletions src/api/mjapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { gptConfigStore, gptServerStore, homeStore } from "@/store";
import { copyToClip } from "@/utils/copy";
import { isNumber } from "@/utils/is";
import { localGet, localSaveAny } from "./mjsave";
import { t } from "@/locales";
//import { useMessage } from "naive-ui";
export interface gptsType{
gid:string
Expand All @@ -22,14 +23,15 @@ export function upImg(file:any ):Promise<any>
//console.log('selectFile', file )
if(file.size>(1024*1024)){
//msgRef.value.showError('图片大小不能超过1M');
r('图片大小不能超过1M')
r(t('mjchat.no1m'))
return ;
}
if (! (filename.endsWith('.jpg') ||
filename.endsWith('.gif') ||
filename.endsWith('.png') ||
filename.endsWith('.jpeg') )) {
r('图片仅支持jpg,gif,png,jpeg格式');
//r('图片仅支持jpg,gif,png,jpeg格式');
r(t('mjchat.imgExt') );
return ;
}
const reader = new FileReader();
Expand Down Expand Up @@ -89,7 +91,7 @@ export async function train( text:string){


if( text.trim() =='') {
reject('请填写提示词!');
reject( t('mjchat.placeInput'));
return ;
}

Expand Down Expand Up @@ -120,6 +122,14 @@ export const mlog = (msg: string, ...args: unknown[]) => {
console.log(`%c[mjgpt]`, style, msg , ...args)
}

export const myTrim = (str: string, delimiter: string)=>{
// 构建正则表达式,使用动态的定界符
const regex = new RegExp(`^${delimiter}+|${delimiter}+$`, 'g');

// 使用正则表达式去除字符串两端的定界符
return str.replace(regex, '');
}

function getHeaderApiSecret(){
if(!gptServerStore.myData.MJ_API_SECRET){
return {}
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/Setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const show = computed({
<template #tab>
<SvgIcon class="text-lg" icon="ri:equalizer-line" />
<!-- <span class="ml-2">{{ $t('setting.advanced') }}</span> -->
<span class="ml-2">模型</span>
<span class="ml-2">{{ $t('mjset.model') }}</span>
</template>
<div class="min-h-[100px]">
<!-- <Advanced /> -->
Expand All @@ -65,15 +65,15 @@ const show = computed({
<NTabPane name="server" tab="server" v-if=" ! homeStore.myData.session.isHideServer">
<template #tab>
<SvgIcon class="text-lg" icon="mingcute:server-line" />
<span class="ml-2">服务端</span>
<span class="ml-2">{{ $t('mjset.server') }}</span>
</template>
<aiSetServer />
</NTabPane>
<NTabPane name="Config" tab="Config">
<template #tab>
<SvgIcon class="text-lg" icon="ri:list-settings-line" />
<!-- <span class="ml-2">{{ $t('setting.config') }}</span> -->
<span class="ml-2">关于</span>
<span class="ml-2">{{ $t('mjset.about') }}</span>
</template>
<About />
</NTabPane>
Expand Down
106 changes: 106 additions & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,110 @@ export default {
onlineImportWarning: 'Note: Please check the JSON file source!',
downloadError: 'Please check the network status and JSON file validity',
},


"mj": {
"setOpen": "OpenAI Related",
"setOpenPlaceholder": "Must include http(s)://",
"setOpenUrl": "OpenAI API Address",
"setOpenKeyPlaceholder": "Use custom OpenAI Key to bypass password access restrictions",
"setMj": "Midjourney Related",
"setMjUrl": "Midjourney API Address:",
"setMjKeyPlaceholder": "Use custom Api Secret to bypass password access restrictions",
"setUploader": "Upload Related",
"setUploaderUrl": "Upload Address:",
"setBtSave": "Save",
"setBtBack": "Restore Default"
},
"mjset": {
"server": "Server",
"about": "About",
"model": "Model",
"sysname": "AI Drawing"
},
"mjtab": {
"chat": "Chat",
"draw": "Drawing",
"drawinfo": "AI Drawing with Midjourney Engine",
"gallery": "Gallery",
"galleryInfo": "My Gallery"
},
"mjchat": {
"loading": "Loading Image",
"openurl": "Open Link Directly",
"failReason": "Failure Reason:",
"reload": "Reload",
"progress": "Progress:",
"wait": "Task has been submitted, please wait...",
"reroll": "Redraw",
"wait2": "Task {id} has been submitted, please wait",
"redrawEditing": "Partial Redraw Editing",
"face": "Change Face",
"blend": "Blend Images",
"draw": "Drawing",
"submiting": "Submitting",
"submit": "Submit",
"wait3": "Please do not close! Image is being generated...",
"success": "Save Successful",
"successTitle": "Success",
"modlePlaceholder": "Custom models, separated by spaces (optional)",
"myModle": "Custom Models",
"historyCnt": "Context Count",
"historyToken": "More context improves accuracy but consumes more credits",
"historyTCnt": "Reply Count",
"historyTCntInfo": "Higher reply count may consume more credits",
"role": "Role Setting",
"rolePlaceholder": "Set an exclusive role for your conversation (optional)",
"loading2": "Loading...",
"loadmore": "Load More",
"nofind": "Unable to find",
"nofind2": "related content. You can try the following:",
"success2": "Switch Successful!",
"modelChange": "Model Change",
"search": "Search",
"searchPlaceholder": "GPT names, descriptions",
"attr": "Attachments",
"noproduct": "Gallery has no entries yet",
"myGallery": "My Gallery",
"yourHead": "Your Avatar",
"your2Head": "Celebrity Image",
"tipInfo": "Note:<li>1. Images must include faces for proper rendering</li><li>2. 'Celebrity Image' can be created using MJ drawing</li><li>3. 'Celebrity Image' can also include anime characters</li><li>4. 'Your Avatar' is recommended to be a passport-sized personal photo</li>",
"placeInput": "Please fill in the prompt!",
"more5sb": "Upload up to 5 images at most",
"exSuccess": "Export successful... Please check the download folder",
"downloadSave": "ai_drawing.txt",
"noproducet": "No mature works for now",
"imgBili": "Image Ratio",
"imagEx": "Export Artwork Image Links",
"prompt": "Prompts",
"imgCYes": "Contains Base Image",
"imgCUpload": "Upload Base Image",
"imgCInfo": "Base Image Info:<br/>1. Use your own images as a base for MJ drawing<br/>2. You can use multiple base images, up to 5, each not exceeding 1M in size",
"imgCadd": "+Add",
"del": "Delete",
"img2text": "Image-to-Text",
"img2textinfo": "Not sure what prompts to use? Try Image-to-Text! Submit an image to get prompts",
"traning": "Translating...",
"imgcreate": "Generate Image",
"imginfo": "Other parameters:<li>1 --no: Ignore --no car to exclude cars from the image</li><li>2 --seed: Obtain a seed first with --seed 123456</li><li>3 --chaos 10: Mix (range: 0-100)</li><li>4 --tile: Fragmentation</li>",
"tStyle": "Style",
"tView": "View",
"tShot": "Character Shot",
"tLight": "Lighting",
"tQuality": "Image Quality",
"tStyles": "Artistic Level",
"tVersion": "Model Version",
"dalleInfo": "Note:<li>1. DALL-E is an image generation model provided by OpenAI</li><li>2. OpenAI images have an expiration date, so make backups</li><li>3. Note: The price of 1790px images is double</li>",
"version": "Version",
"size": "Size",
"blendInfo": "Note:<li>1. Blend at least 2 images</li><li>2. Up to 6 images can be used for blending</li>",
"blendStart": "Start Blending",
"no2add": "Do not add duplicate images",
"add2more": "Please add two or more images",
"no1m": "Image size cannot exceed 1M",
"imgExt": "Images support only jpg, gif, png, jpeg formats"
}



}
102 changes: 102 additions & 0 deletions src/locales/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,106 @@ export default {
importRepeatContent: '내용이 반복되어 건너뜀: {msg}',
onlineImportWarning: '참고: JSON 파일 소스를 확인하십시오!',
},

"mj": {
"setOpen": "OpenAI 관련",
"setOpenPlaceholder": "http(s)://를 포함해야 함"
,"setOpenUrl": "OpenAI 인터페이스 주소"
,"setOpenKeyPlaceholder": "비밀번호 액세스 제한을 우회하기 위해 사용자 지정 OpenAI 키 사용"
,"setMj": "Midjourney 관련"
,"setMjUrl": "Midjourney 인터페이스 주소:"
,"setMjKeyPlaceholder": "비밀번호 액세스 제한을 우회하기 위해 사용자 지정 Api Secret 사용"
,"setUploader": "업로드 관련"
,"setUploaderUrl": "업로드 주소:"
,"setBtSave": "저장"
,"setBtBack": "기본으로 복원"
},
"mjset": {
"server": "서버"
,"about": "소개"
,"model": "모델"
,"sysname": "AI 그림"
},
"mjtab": {
"chat": "대화"
,"draw": "그림"
,"drawinfo": "AI 그림 Midjourney 엔진"
,"gallery": "갤러리"
,"galleryInfo": "내 갤러리"
},
"mjchat": {
"loading": "이미지 로드 중"
,"openurl": "직접 링크 열기"
,"failReason": "실패 이유:"
,"reload": "재로드"
,"progress": "진행:"
,"wait": "작업이 제출되었습니다. 기다려주세요..."
,"reroll": "재그림"
,"wait2": "작업 {id}이(가) 제출되었습니다. 기다려주세요"
,"redrawEditing": "일부 재그림 편집"
,"face": "얼굴 바꾸기"
,"blend": "혼합"
,"draw": "그림 그리기"
,"submiting": "제출 중"
,"submit": "제출"
,"wait3": "닫지 마세요! 이미지 생성 중..."
,"success": "저장 성공"
,"successTitle": "성공"
,"modlePlaceholder": "여러 개의 사용자 정의 모델은 띄어쓰기로 구분됩니다. 필수 사항은 아닙니다."
,"myModle": "내 모델"
,"historyCnt": "컨텍스트 수"
,"historyToken": "더 많은 컨텍스트는 기억을 더 정확하게 만들지만 더 많은 크레딧을 소비할 수 있습니다."
,"historyTCnt": "답장 수"
,"historyTCntInfo": "답장 수가 많을수록 더 많은 크레딧이 소비될 수 있습니다."
,"role": "역할 설정"
,"rolePlaceholder": "대화에 고유한 역할을 설정하십시오. 필수는 아닙니다."
,"loading2": "로딩 중..."
,"loadmore": "더 보기"
,"nofind": "찾을 수 없음"
,"nofind2": "관련 내용을 찾을 수 없습니다. 다음을 시도해 보십시오."
,"success2": "전환 성공!"
,"modelChange": "모델 변경"
,"search": "검색"
,"searchPlaceholder": "GPTs 이름, 소개"
,"attr": "첨부 파일"
,"noproduct": "갤러리에 작품이 없습니다."
,"myGallery": "내 갤러리"
,"yourHead": "당신의 프로필 사진"
,"your2Head": "스타 이미지"
,"tipInfo": "설명:<li>1. 이미지에는 얼굴이 반드시 포함되어야 합니다. 그렇지 않으면 이미지가 생성되지 않습니다.</li> <li>2. '스타 이미지'는 먼저 MJ 그림으로 만들 수 있습니다.</li> <li>3. '스타 이미지'는 애니메이션 이미지로도 괜찮습니다.</li> <li>4. '당신의 프로필 사진'은 1인치 개인 사진을 사용하는 것이 좋습니다.</li>"
,"placeInput": "힌트를 입력하세요!"
,"more5sb": "최대 5장의 이미지를 업로드할 수 있습니다."
,"exSuccess": "내보내기 성공... 다운로드 창을 확인하세요."
,"downloadSave": "ai그림.txt"
,"noproducet": "아직 미완성 작품이 없습니다."
,"imgBili": "이미지 비율"
,"imagEx": "작품 이미지 링크 내보내기"
,"prompt": "힌트"
,"imgCYes": "쿠션 이미지 포함"
,"imgCUpload": "자체 쿠션 이미지 업로드"
,"imgCInfo": "쿠션 이미지 안내:<br/> 1. 쿠션 이미지는 자체 이미지를 기본으로 사용하여 MJ로 그림을 그릴 수 있습니다.<br/> 2. 최대 5 장의 쿠션 이미지를 사용할 수 있으며 각 이미지의 크기는 1M를 초과하지 않아야 합니다.<br/>"
,"imgCadd": "+추가"
,"del": "삭제"
,"img2text": "이미지에서 텍스트 생성"
,"img2textinfo": "힌트가 어떻게 쓰여야 할지 모르겠나요? 이미지에서 텍스트를 생성해 보세요! <br/>이미지를 제출하면 힌트가 생성됩니다."
,"traning": "번역 중..."
,"imgcreate": "이미지 생성"
,"imginfo": "기타 매개변수:<li>1 --no를 무시하면 --no car가 이미지에 표시되지 않습니다.</li><li>2 --seed는 먼저 시드를 얻을 수 있습니다. --seed 123456</li> <li>3 --chaos 10은 혼합(범위: 0-100)</li> <li>4 --tile 조각화</li>"
,"tStyle": "스타일"
,"tView": "시점"
,"tShot": "캐릭터 샷"
,"tLight": "조명"
,"tQuality": "화질"
,"tStyles": "아트 정도"
,"tVersion": "모델 버전"
,"dalleInfo": "설명:<li>1. DALL-E는 OpenAI에서 제공하는 그림 모델입니다.</li> <li>2. OpenAI의 이미지는 일시적입니다. 백업을 잘 해 두세요.</li> <li>3. 주의: 1790px 이미지의 가격은 두 배입니다.</li> "
,"version": "버전"
,"size": "크기"
,"blendInfo": "설명:<li>1. 최소 2 장의 이미지를 합성하십시오.</li> <li>2. 최대 6 장의 이미지를 업로드할 수 있습니다.</li> "
,"blendStart": "합성 시작"
,"no2add": "이미지를 중복해서 추가하지 마십시오."
,"add2more": "두 장 이상의 이미지를 추가하십시오."
,"no1m": "이미지 크기는 1M를 초과할 수 없습니다."
,"imgExt": "이미지는 jpg, gif, png, jpeg 형식만 지원됩니다."
}
}
Loading

0 comments on commit 857b557

Please sign in to comment.