Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix variable typo #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
</style>
<script>
import { getDictData } from "./getDictData"
import vPromptItem from "../../Compoents/PromptEditor/Components/PromptItem/PromptItem.vue"
import vPromptItem from "../../Components/PromptEditor/Components/PromptItem/PromptItem.vue"
import { useDatabaseServer } from "../PromptEditor/Lib/DatabaseServer/DatabaseServer"
import { useStorage } from "@vueuse/core"
import { debounce } from "lodash"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default Vue.extend({
},
"item.state.isEdit": {
handler(val) {
if (val) setTimeout(() => this.doFoucs(), 100)
if (val) setTimeout(() => this.doFocus(), 100)
},
immediate: true,
},
Expand All @@ -271,7 +271,7 @@ export default Vue.extend({
doOpenUrl(url: string) {
window.open(url)
},
doFoucs() {
doFocus() {
setTimeout(() => {
if (this.item.state.isEdit == "text") {
;(this.$refs.input as any)?.focus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export default {
doEdit() {
this.close()
this.item.state.isEdit = "text"
this.bindEl.__vue__.doFoucs()
this.bindEl.__vue__.doFocus()
},
doEditLang() {
this.close()
this.item.state.isEdit = "lang"
this.bindEl.__vue__.doFoucs()
this.bindEl.__vue__.doFocus()
},
doDelete() {
this.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ export class DatabaseServer {
}
async queryPromptsDefine(prompts: string[]): Promise<IPromptDefineItem[]> {
await this.ready()
let reuslt = []
let result = []
for (let prompt of prompts) {
let re = this.localPromptDefineMap[prompt?.toLowerCase()]
if (re) {
reuslt.push(re)
result.push(re)
} else {
reuslt.push(null)
result.push(null)
}
}
return <any>reuslt
return <any>result
}

async getPromptsDefine(options?: { onlyMyNotion?: boolean }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function parsePrompts(
throw new Error(`err ParsePrompts not support this parser:${options.parser}`)
}
if (options.minify) {
words = wordsDeduplicat(words)
words = wordsDeduplicate(words)
}

let dataserver = useDatabaseServer()
Expand Down Expand Up @@ -85,7 +85,7 @@ export function stringifyPrompts(groups: IPromptGroup[] = [], options: { parser:
return prompts
}

function wordsDeduplicat(words: IPromptWord[]): IPromptWord[] {
function wordsDeduplicate(words: IPromptWord[]): IPromptWord[] {
let map: any = {}
words.forEach((word) => (map[word.rawText] = word))
return Object.values(map)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function paresWord(text: string) {

let re: any
// [from:to:when] https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing
if (mactch(Editing_from_to_when.test(text))) {
if (match(Editing_from_to_when.test(text))) {
displayText = text
word = {
text: displayText,
Expand All @@ -49,7 +49,7 @@ function paresWord(text: string) {
}
}
// [from:when]
else if (mactch(Editing_to_when.test(text))) {
else if (match(Editing_to_when.test(text))) {
displayText = text
word = {
text: displayText,
Expand All @@ -59,27 +59,27 @@ function paresWord(text: string) {
}
}
// (xxx:2)
else if (mactch(REG_Attention_number.exec(text))) {
else if (match(REG_Attention_number.exec(text))) {
displayText = re[1]
lv = re[2]
word = { text: displayText, lv, type: PromptWordType.Word, rawText: text }
}
// ((((xxx)))
else if (mactch(REG_Attention_adds.exec(text))) {
else if (match(REG_Attention_adds.exec(text))) {
displayText = re[2]
alv = re[1].length
lv = round(Math.pow(1.1, alv), 2)
word = { text: displayText, lv, alv, type: PromptWordType.Word, rawText: text }
}
// [[[xxx]]]
else if (mactch(REG_Attention_subs.exec(text))) {
else if (match(REG_Attention_subs.exec(text))) {
displayText = re[2]
alv = -re[1].length
lv = round(1 / Math.pow(1.1, Math.abs(alv)), 2)
word = { text: displayText, lv, alv, type: PromptWordType.Word, rawText: text }
}
// <lora:filename:multiplier>
else if (mactch(REG_ExtraNetworks.exec(text))) {
else if (match(REG_ExtraNetworks.exec(text))) {
word = {
text: text,
type: PromptWordType.Word,
Expand All @@ -96,7 +96,7 @@ function paresWord(text: string) {
// console.log("[paresWordInfo]", word)
return { displayText, lv, word }

function mactch(v: any) {
function match(v: any) {
re = v
return v
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface IMoveableOptions {
callback_move?: (e: IMoveInfo) => boolean
/** 开始回调,关闭*/
callback_end?: (e: IMoveInfo) => void
/** 传递 passive 参数给 move 事件, 默认为 ture */
/** 传递 passive 参数给 move 事件, 默认为 true */
passive?: boolean
/** 元素移动 */
setMove?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class="server-select"
v-tooltip="
`调用翻译接口会有不小的成本开销,我们做了适当限制\n当同时使用用户过多时会不稳定,请见谅\n想要更好的翻译体验可以在本项目 Github 页获得本地部署的方法\n\n${
promptEditor.data.server === LocalTrasnslateServer ? promptEditor.data.server : ''
promptEditor.data.server === LocalTranslateServer ? promptEditor.data.server : ''
}`
"
>
Expand All @@ -35,7 +35,7 @@
{{ t("翻译服务:") }}
</div>
<select v-model="promptEditor.data.server">
<option :value="LocalTrasnslateServer" :title="LocalTrasnslateServer">本地翻译接口</option>
<option :value="LocalTranslateServer" :title="LocalTranslateServer">本地翻译接口</option>
<option value="https://indexfs.moonvy.com:19213/prompt-studio">腾讯翻译</option>
<option value="https://indexfs.moonvy.com:19213/prompt-studio2">腾讯翻译 2</option>
<option value="https://indexfs.moonvy.com:19213/prompt-studio/ai" disabled>
Expand Down Expand Up @@ -200,7 +200,7 @@ export default {
dndInit()
let promptEditor = new PromptEditorClass({ initPrompts: this.initPrompts })
return {
LocalTrasnslateServer: LOCAL_TRANSLATE_SERVER,
LocalTranslateServer: LOCAL_TRANSLATE_SERVER,
promptEditor,
adDelay: false,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class PromptWork {
// 未分组
if (noGroup.length > 0) {
finGroups.push({
id: `group-noGoutp`,
id: `group-noGroup`,
lists: sortPromptMap(createListMap(noGroup)),
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/Index/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@
</style>
<script lang="ts">
import Vue, { PropType } from "vue"
import vPromptEditor from "../../Compoents/PromptEditor/PromptEditor.vue"
import vPromptDict from "../../Compoents/PromptDict/PromptDict.vue"
import vPromptEditor from "../../Components/PromptEditor/PromptEditor.vue"
import vPromptDict from "../../Components/PromptDict/PromptDict.vue"

import pkg from "../../../package.json"
export default Vue.extend({
Expand Down