Skip to content

Commit 127a2b8

Browse files
committed
Merge branch 'main' of https://github.com/dataease/SQLBot
2 parents 50f7c5c + b1f7eeb commit 127a2b8

File tree

5 files changed

+21
-36
lines changed

5 files changed

+21
-36
lines changed

backend/apps/system/api/user.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ async def query(session: SessionDep, trans: Trans, id: int) -> UserEditor:
120120
@router.post("")
121121
async def create(session: SessionDep, creator: UserCreator, trans: Trans):
122122
if check_account_exists(session=session, account=creator.account):
123-
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.account') [{creator.account}]}"))
123+
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.account')} [{creator.account}]"))
124124
if check_email_exists(session=session, email=creator.email):
125-
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email') [{creator.email}]}"))
125+
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{creator.email}]"))
126126
if not check_email_format(creator.email):
127-
raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email') [{creator.email}]}"))
127+
raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{creator.email}]"))
128128
data = creator.model_dump(exclude_unset=True)
129129
user_model = UserModel.model_validate(data)
130130
#user_model.create_time = get_timestamp()
@@ -154,9 +154,9 @@ async def update(session: SessionDep, editor: UserEditor, trans: Trans):
154154
if editor.account != user_model.account:
155155
raise Exception(f"account cannot be changed!")
156156
if editor.email != user_model.email and check_email_exists(session=session, account=editor.email):
157-
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email') [{editor.email}]}"))
157+
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]"))
158158
if not check_email_format(editor.email):
159-
raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email') [{editor.email}]}"))
159+
raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{editor.email}]"))
160160
origin_oid: int = user_model.oid
161161
del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == editor.id)
162162
session.exec(del_stmt)

backend/common/utils/locale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def _get_nested_translation(self, data: Dict[str, Any], key_path: str) -> str:
4545

4646
return current if isinstance(current, str) else key_path
4747

48-
def __call__(self, key: str, **kwargs) -> str:
48+
def __call__(self, arg_key: str, **kwargs) -> str:
4949
lang_data = self.i18n.translations.get(self.lang, {})
50-
text = self._get_nested_translation(lang_data, key)
50+
text = self._get_nested_translation(lang_data, arg_key)
5151

5252
if kwargs:
5353
try:

frontend/src/router/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const watchRouter = (router: any) => {
1919
return
2020
}
2121
if (!token) {
22-
ElMessage.error('Please login first')
22+
// ElMessage.error('Please login first')
2323
next('/login')
2424
return
2525
}

frontend/src/views/dashboard/canvas/CanvasCore.vue

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -921,25 +921,10 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
921921
//If the current canvas is locked, no component movement will be performed
922922
if (canvasLocked.value) return
923923
// Adjust the accuracy of moving coordinate changes
924-
const newX = Math.max(
925-
Math.floor(
926-
(nowCloneItemX - 20 + infoBox.value.cloneItem.offsetWidth / 96 - baseMarginLeft.value) /
927-
cellWidth.value +
928-
1
929-
),
930-
1
931-
)
932-
// temp adjust board
933-
934-
// Adjust the accuracy of moving coordinate changes
935-
const newY = Math.max(
936-
Math.floor(
937-
(nowCloneItemY + infoBox.value.cloneItem.offsetHeight / 96 - baseMarginTop.value) /
938-
cellHeight.value +
939-
1
940-
),
941-
1
942-
)
924+
let newX = Math.floor(nowCloneItemX / cellWidth.value)
925+
let newY = Math.floor(nowCloneItemY / cellHeight.value)
926+
newX = newX > 0 ? newX : 1
927+
newY = newY > 0 ? newY : 1
943928
debounce(() => {
944929
if (newX !== infoBox.value.oldX || newY !== infoBox.value.oldY) {
945930
movePlayer(moveItem, { x: newX, y: newY })

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ const save = async (formEl: FormInstance | undefined) => {
274274
}
275275
} else {
276276
requestObj.tables = list
277-
const a = datasourceApi
278-
.add(requestObj)
279-
.then(() => {
280-
close()
281-
emit('refresh')
282-
})
283-
.finally(() => {
284-
saveLoading.value = false
285-
})
277+
// const a = datasourceApi
278+
// .add(requestObj)
279+
// .then(() => {
280+
// close()
281+
// emit('refresh')
282+
// })
283+
// .finally(() => {
284+
// saveLoading.value = false
285+
// })
286286
}
287287
}
288288
})

0 commit comments

Comments
 (0)