Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
柴进
/
GoogleNanoBananaApp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
15a2dba1
authored
2025-12-02 22:00:17 +0800
by
柴进
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加登陆日志留存模块
1 parent
0e152f5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
2 deletions
ZB100ImageGenerator.spec
image_generator.py
ZB100ImageGenerator.spec
View file @
15a2dba
...
...
@@ -5,7 +5,11 @@ a = Analysis(
[
'image_generator.py'
],
pathex
=
[],
binaries
=
[],
datas
=
[(
'config.json'
,
'.'
)],
datas
=
[
(
'config.json'
,
'.'
),
(
'zb100_windows.ico'
,
'.'
),
(
'zb100_mac.icns'
,
'.'
)
],
hiddenimports
=
[],
hookspath
=
[],
hooksconfig
=
{},
...
...
image_generator.py
View file @
15a2dba
...
...
@@ -95,9 +95,32 @@ class LoginDialog(QDialog):
self
.
password_changed
=
False
self
.
current_password_hash
=
""
self
.
set_window_icon
()
self
.
setup_ui
()
self
.
apply_styles
()
def
set_window_icon
(
self
):
"""Set window icon based on platform"""
if
getattr
(
sys
,
'frozen'
,
False
):
# Running as compiled executable
if
platform
.
system
()
==
'Windows'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_windows.ico'
)
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_mac.icns'
)
else
:
icon_path
=
None
else
:
# Running as script
if
platform
.
system
()
==
'Windows'
:
icon_path
=
'zb100_windows.ico'
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
'zb100_mac.icns'
else
:
icon_path
=
None
if
icon_path
and
os
.
path
.
exists
(
icon_path
):
self
.
setWindowIcon
(
QIcon
(
icon_path
))
def
setup_ui
(
self
):
"""Build login dialog UI"""
self
.
setWindowTitle
(
"登录 - AI 图像生成器"
)
...
...
@@ -434,9 +457,32 @@ class ImageGeneratorWindow(QMainWindow):
self
.
saved_password_hash
=
""
self
.
load_config
()
self
.
set_window_icon
()
self
.
setup_ui
()
self
.
apply_styles
()
def
set_window_icon
(
self
):
"""Set window icon based on platform"""
if
getattr
(
sys
,
'frozen'
,
False
):
# Running as compiled executable
if
platform
.
system
()
==
'Windows'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_windows.ico'
)
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_mac.icns'
)
else
:
icon_path
=
None
else
:
# Running as script
if
platform
.
system
()
==
'Windows'
:
icon_path
=
'zb100_windows.ico'
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
'zb100_mac.icns'
else
:
icon_path
=
None
if
icon_path
and
os
.
path
.
exists
(
icon_path
):
self
.
setWindowIcon
(
QIcon
(
icon_path
))
def
get_config_dir
(
self
):
"""Get the appropriate directory for config files based on platform and mode"""
if
getattr
(
sys
,
'frozen'
,
False
):
...
...
@@ -555,7 +601,7 @@ class ImageGeneratorWindow(QMainWindow):
self
.
img_scroll
.
setWidgetResizable
(
True
)
self
.
img_scroll
.
setHorizontalScrollBarPolicy
(
Qt
.
ScrollBarAlwaysOn
)
self
.
img_scroll
.
setVerticalScrollBarPolicy
(
Qt
.
ScrollBarAlwaysOff
)
self
.
img_scroll
.
setFixedHeight
(
1
4
0
)
self
.
img_scroll
.
setFixedHeight
(
1
6
0
)
self
.
img_container
=
QWidget
()
self
.
img_layout
=
QHBoxLayout
()
...
...
@@ -1118,6 +1164,28 @@ def main():
# Create QApplication
app
=
QApplication
(
sys
.
argv
)
# Set application icon
if
getattr
(
sys
,
'frozen'
,
False
):
# Running as compiled executable
if
platform
.
system
()
==
'Windows'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_windows.ico'
)
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'zb100_mac.icns'
)
else
:
icon_path
=
None
else
:
# Running as script
if
platform
.
system
()
==
'Windows'
:
icon_path
=
'zb100_windows.ico'
elif
platform
.
system
()
==
'Darwin'
:
icon_path
=
'zb100_mac.icns'
else
:
icon_path
=
None
if
icon_path
and
os
.
path
.
exists
(
icon_path
):
app_icon
=
QIcon
(
icon_path
)
app
.
setWindowIcon
(
app_icon
)
# Check database config
if
not
db_config
:
QMessageBox
.
critical
(
None
,
"配置错误"
,
...
...
Please
register
or
sign in
to post a comment