Skip to content

Commit c50815f

Browse files
style: Assistant Embedded Appearance Configuration - Restore Default Function Style Error
1 parent 67d1899 commit c50815f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

backend/apps/system/api/assistant.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] =
115115
ui_schema_dict[flag_name] = file_id
116116
else:
117117
raise ValueError(f"Unsupported file flag: {flag_name}")
118-
118+
119+
for flag_name in ['logo', 'float_icon']:
120+
file_val = config_obj.get(flag_name)
121+
if file_val and not ui_schema_dict.get(flag_name):
122+
config_obj[flag_name] = None
123+
SQLBotFileUtils.detete_file(file_val)
124+
119125
for attr, value in ui_schema_dict.items():
120126
if attr != 'id' and not attr.startswith("__"):
121127
config_obj[attr] = value

frontend/src/views/system/embedded/SetUi.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ const currentId = ref()
1414
interface SqlBotForm {
1515
theme: string
1616
header_font_color: string
17-
// logo?: string
17+
logo?: string
1818
x_type: string
1919
y_type: string
2020
welcome_desc: string
21-
// float_icon?: string
21+
float_icon?: string
2222
welcome: string
2323
float_icon_drag: boolean
2424
x_val: number
2525
y_val: number
26-
restoreDefaults: boolean
2726
}
2827
2928
const optionsY = [
@@ -74,9 +73,8 @@ const defaultSqlBotForm = reactive<SqlBotForm>({
7473
welcome_desc: t('embedded.data_analysis_now'),
7574
theme: '#1CBA90',
7675
header_font_color: '#1F2329',
77-
restoreDefaults: false,
78-
// logo: '',
79-
// float_icon: '',
76+
logo: '',
77+
float_icon: '',
8078
})
8179
const sqlBotForm = reactive<SqlBotForm>(cloneDeep(defaultSqlBotForm)) as { [key: string]: any }
8280
let rawData = {} as { [key: string]: any }

0 commit comments

Comments
 (0)