Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
JavaReleaseMenu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
朱鹏程
JavaReleaseMenu
Commits
1d312d6e
Commit
1d312d6e
authored
Nov 18, 2026
by
zpc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rebuild release workspace with compact summaries and full-height consoles
parent
94f84cae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
362 additions
and
264 deletions
+362
-264
Info.plist
Info.plist
+2
-2
LogTextView.swift
Sources/JavaReleaseMenu/LogTextView.swift
+2
-1
SplitReleasePanel.swift
Sources/JavaReleaseMenu/SplitReleasePanel.swift
+358
-261
No files found.
Info.plist
View file @
1d312d6e
...
...
@@ -19,9 +19,9 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.3.
1
<
/string
>
<
string
>
1.3.
2
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
8
<
/string
>
<
string
>
9
<
/string
>
<
k
e
y
>
LSMinimumSystemVersion
<
/k
e
y
>
<
string
>
14.0
<
/string
>
<
k
e
y
>
LSUIElement
<
/k
e
y
>
...
...
Sources/JavaReleaseMenu/LogTextView.swift
View file @
1d312d6e
...
...
@@ -6,6 +6,7 @@ struct LogTextView: NSViewRepresentable {
let
errorLine
:
Int
?
let
jumpRequest
:
Int
var
followsOutput
=
false
var
fontSize
:
CGFloat
=
11
final
class
Coordinator
{
var
text
:
String
?
...
...
@@ -41,7 +42,7 @@ struct LogTextView: NSViewRepresentable {
coordinator
.
text
=
text
coordinator
.
errorRange
=
nil
let
styled
=
NSMutableAttributedString
(
string
:
text
,
attributes
:
[
.
font
:
NSFont
.
monospacedSystemFont
(
ofSize
:
11
,
weight
:
.
regular
),
.
font
:
NSFont
.
monospacedSystemFont
(
ofSize
:
fontSize
,
weight
:
.
regular
),
.
foregroundColor
:
NSColor
(
srgbRed
:
0.78
,
green
:
0.83
,
blue
:
0.90
,
alpha
:
1
)
])
if
let
errorLine
,
let
range
=
lineRange
(
at
:
errorLine
)
{
...
...
Sources/JavaReleaseMenu/SplitReleasePanel.swift
View file @
1d312d6e
...
...
@@ -10,16 +10,24 @@ struct SplitReleasePanel: View {
private
var
columnWidth
:
CGFloat
{
let
available
=
(
NSScreen
.
main
?
.
visibleFrame
.
width
??
1440
)
-
32
return
min
(
383
,
max
(
310
,
floor
((
available
-
2
)
/
CGFloat
(
max
(
1
,
model
.
panes
.
count
)))))
return
min
(
383
,
max
(
310
,
floor
(
(
available
-
CGFloat
(
max
(
1
,
model
.
panes
.
count
)))
/
CGFloat
(
max
(
1
,
model
.
panes
.
count
)))))
}
private
var
width
:
CGFloat
{
let
desired
=
CGFloat
(
max
(
1
,
model
.
panes
.
count
))
*
columnWidth
+
2
let
desired
=
CGFloat
(
max
(
1
,
model
.
panes
.
count
))
*
columnWidth
+
CGFloat
(
max
(
0
,
model
.
panes
.
count
-
1
))
return
min
(
desired
,
(
NSScreen
.
main
?
.
visibleFrame
.
width
??
1440
)
-
32
)
}
private
var
columnHeight
:
CGFloat
{
min
(
700
,
max
(
470
,
(
NSScreen
.
main
?
.
visibleFrame
.
height
??
900
)
-
145
))
min
(
650
,
max
(
380
,
(
NSScreen
.
main
?
.
visibleFrame
.
height
??
900
)
-
160
))
}
var
body
:
some
View
{
...
...
@@ -33,14 +41,14 @@ struct SplitReleasePanel: View {
)
.
rotationEffect
(
.
degrees
(
-
90
))
}
.
frame
(
width
:
26
,
height
:
26
)
Text
(
"Java 发布"
)
.
font
(
.
system
(
size
:
18
,
weight
:
.
semibold
))
.
frame
(
width
:
32
,
height
:
32
)
Text
(
"Java 发布"
)
.
font
(
.
system
(
size
:
23
,
weight
:
.
semibold
))
Spacer
()
Button
(
action
:
model
.
add
)
{
Label
(
"增加窗口"
,
systemImage
:
"plus"
)
.
font
(
ReleaseTypography
.
action
)
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
29
)
.
frame
(
height
:
35
)
}
.
disabled
(
model
.
isRunning
||
model
.
panes
.
count
>=
4
...
...
@@ -64,7 +72,7 @@ struct SplitReleasePanel: View {
.
accessibilityLabel
(
"项目设置"
)
}
.
padding
(
.
horizontal
,
18
)
.
frame
(
height
:
58
)
.
frame
(
height
:
70
)
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
.
frame
(
height
:
1
)
...
...
@@ -87,7 +95,8 @@ struct SplitReleasePanel: View {
}
}
}
.
scrollIndicators
(
.
automatic
)
.
frame
(
height
:
columnHeight
)
.
scrollIndicators
(
.
hidden
)
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
.
frame
(
height
:
1
)
HStack
{
if
model
.
isRunning
{
...
...
@@ -100,18 +109,18 @@ struct SplitReleasePanel: View {
Spacer
()
Button
(
action
:
model
.
publishAll
)
{
Text
(
"一起发布
\(
model
.
panes
.
count
)
个项目"
)
.
font
(
.
system
(
size
:
1
4
,
weight
:
.
semibold
))
.
font
(
.
system
(
size
:
1
8
,
weight
:
.
semibold
))
.
foregroundStyle
(
.
white
)
.
padding
(
.
horizontal
,
23
)
.
frame
(
height
:
4
0
)
.
padding
(
.
horizontal
,
36
)
.
frame
(
height
:
4
6
)
}
.
disabled
(
model
.
isRunning
||
model
.
panes
.
count
<
2
)
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
ReleaseColors
.
action
,
prominent
:
true
))
}
.
font
(
ReleaseTypography
.
detail
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
font
(
.
system
(
size
:
16
)
)
.
foregroundStyle
(
.
white
.
opacity
(
0.9
)
)
.
padding
(
.
horizontal
,
18
)
.
frame
(
height
:
66
)
.
frame
(
height
:
78
)
}
if
let
error
=
model
.
error
{
Text
(
error
)
.
font
(
.
caption
)
.
foregroundStyle
(
.
red
)
...
...
@@ -119,7 +128,17 @@ struct SplitReleasePanel: View {
}
}
.
frame
(
width
:
width
)
.
background
(
ReleaseColors
.
panel
)
.
background
{
LinearGradient
(
colors
:
[
Color
(
red
:
0.15
,
green
:
0.16
,
blue
:
0.18
),
Color
(
red
:
0.105
,
green
:
0.115
,
blue
:
0.135
),
],
startPoint
:
.
topLeading
,
endPoint
:
.
bottomTrailing
)
}
.
overlay
{
RoundedRectangle
(
cornerRadius
:
14
)
.
strokeBorder
(
Color
.
white
.
opacity
(
0.18
))
.
allowsHitTesting
(
false
)
}
.
environment
(\
.
colorScheme
,
.
dark
)
.
tint
(
ReleaseColors
.
blue
)
}
...
...
@@ -131,6 +150,9 @@ private struct ProjectReleaseColumn: View {
let
height
:
CGFloat
@State
private
var
configurationDraft
:
DeployProfile
?
@State
private
var
showsModules
=
false
@State
private
var
showsConfiguration
=
false
@State
private
var
showsProjects
=
false
@FocusState
private
var
moduleSearchFocused
:
Bool
private
var
project
:
ReleaseProject
?
{
model
.
project
(
for
:
pane
)
}
private
var
profile
:
DeployProfile
?
{
project
?
.
profiles
.
first
{
$0
.
id
==
pane
.
profileID
}
}
...
...
@@ -145,284 +167,221 @@ private struct ProjectReleaseColumn: View {
}
var
body
:
some
View
{
VStack
(
spacing
:
0
)
{
ScrollView
(
.
vertical
)
{
VStack
(
alignment
:
.
leading
,
spacing
:
12
)
{
HStack
(
spacing
:
8
)
{
Image
(
systemName
:
"folder"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
Menu
{
ForEach
(
model
.
settings
.
projects
.
filter
{
candidate
in
!
model
.
panes
.
contains
{
$0
.
id
!=
pane
.
id
&&
$0
.
projectID
==
candidate
.
id
}
VStack
(
alignment
:
.
leading
,
spacing
:
18
)
{
HStack
(
spacing
:
8
)
{
Button
{
showsProjects
.
toggle
()
}
label
:
{
Text
(
project
?
.
name
??
"选择项目"
)
.
font
(
.
system
(
size
:
20
,
weight
:
.
semibold
))
.
foregroundStyle
(
.
white
)
.
lineLimit
(
1
)
.
minimumScaleFactor
(
0.75
)
.
frame
(
maxWidth
:
.
infinity
,
alignment
:
.
leading
)
.
contentShape
(
Rectangle
())
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
disabled
(
!
editable
)
.
popover
(
isPresented
:
$
showsProjects
)
{
VStack
(
alignment
:
.
leading
,
spacing
:
8
)
{
Text
(
"选择项目"
)
.
font
(
.
headline
)
.
padding
(
.
bottom
,
4
)
ForEach
(
model
.
settings
.
projects
.
filter
{
candidate
in
!
model
.
panes
.
contains
{
$0
.
id
!=
pane
.
id
&&
$0
.
projectID
==
candidate
.
id
}
)
{
candidate
in
Button
(
candidate
.
name
)
{
model
.
replace
(
pane
,
with
:
candidate
)
}
}
}
label
:
{
HStack
{
Text
(
project
?
.
name
??
"选择项目"
)
.
lineLimit
(
1
)
.
frame
(
maxWidth
:
.
infinity
,
alignment
:
.
leading
)
Image
(
systemName
:
"chevron.down"
)
.
font
(
.
system
(
size
:
10
,
weight
:
.
semibold
))
)
{
candidate
in
Button
(
candidate
.
name
)
{
showsProjects
=
false
model
.
replace
(
pane
,
with
:
candidate
)
}
.
font
(
.
system
(
size
:
16
,
weight
:
.
semibold
))
}
.
menuStyle
(
.
borderlessButton
)
.
menuIndicator
(
.
hidden
)
.
disabled
(
!
editable
)
Button
{
model
.
remove
(
pane
)
}
label
:
{
Image
(
systemName
:
"xmark"
)
.
font
(
.
system
(
size
:
11
,
weight
:
.
semibold
))
.
frame
(
width
:
24
,
height
:
24
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
overlay
{
Circle
()
.
strokeBorder
(
ReleaseColors
.
border
)
}
.
disabled
(
!
editable
)
.
help
(
"减少窗口"
)
}
.
frame
(
height
:
28
)
.
padding
(
16
)
.
frame
(
minWidth
:
220
,
alignment
:
.
leading
)
.
environment
(\
.
colorScheme
,
.
dark
)
}
Button
{
model
.
remove
(
pane
)
}
label
:
{
Label
(
"减少窗口"
,
systemImage
:
"xmark"
)
.
font
(
.
system
(
size
:
11
))
.
padding
(
.
horizontal
,
8
)
.
frame
(
height
:
26
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
Color
.
white
.
opacity
(
0.35
))
}
.
disabled
(
!
editable
)
.
help
(
"减少窗口"
)
}
.
frame
(
height
:
28
)
if
let
project
{
if
project
.
type
==
.
cityKeeper
{
menuRow
(
"发布配置"
,
value
:
profile
?
.
title
??
"选择配置文件"
)
{
let
files
=
(
try
?
project
.
configurationFiles
())
??
project
.
profiles
.
map
(\
.
file
)
ForEach
(
files
,
id
:
\
.
self
)
{
file
in
Button
(
project
.
profiles
.
first
(
where
:
{
$0
.
file
==
file
})?
.
title
??
file
)
{
selectConfiguration
(
file
,
in
:
project
)
}
}
Divider
()
Button
(
"浏览其他 YAML…"
)
{
browseConfiguration
(
in
:
project
)
}
}
menuRow
(
"服务器"
,
value
:
pane
.
servers
.
first
(
where
:
{
$0
.
name
==
pane
.
server
})?
.
displayName
??
"选择服务器"
)
{
ForEach
(
pane
.
servers
,
id
:
\
.
name
)
{
target
in
Button
(
target
.
displayName
)
{
pane
.
server
=
target
.
name
model
.
save
()
}
}
}
menuRow
(
"Maven"
,
value
:
pane
.
mavenCommand
.
title
)
{
ForEach
(
MavenCommand
.
allCases
)
{
command
in
Button
(
command
.
title
)
{
pane
.
mavenCommand
=
command
model
.
save
()
}
}
}
HStack
(
spacing
:
12
)
{
Toggle
(
"VPC"
,
isOn
:
$
pane
.
useVPC
)
if
project
.
supportsVerifiedRelease
(
profile
)
{
Toggle
(
"验证发布"
,
isOn
:
$
pane
.
verified
)
Spacer
(
minLength
:
0
)
Button
(
"预检"
)
{
model
.
publish
(
pane
,
action
:
.
preflight
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
disabled
(
!
editable
||
pane
.
modules
.
isEmpty
)
}
else
{
Spacer
(
minLength
:
0
)
}
if
let
profile
{
Button
{
configurationDraft
=
profile
}
label
:
{
Image
(
systemName
:
"slider.horizontal.3"
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
help
(
"编辑配置别名和 SSH 目标"
)
.
disabled
(
!
editable
)
}
}
.
toggleStyle
(
.
checkbox
)
.
font
(
ReleaseTypography
.
detail
)
.
disabled
(
!
editable
)
.
onChange
(
of
:
pane
.
useVPC
)
{
model
.
save
()
}
.
onChange
(
of
:
pane
.
verified
)
{
model
.
save
()
}
}
if
project
!=
nil
{
Button
{
showsConfiguration
.
toggle
()
}
label
:
{
HStack
(
spacing
:
4
)
{
Text
(
configurationSummary
)
.
lineLimit
(
1
)
.
truncationMode
(
.
middle
)
Image
(
systemName
:
"chevron.down"
)
.
font
(
.
system
(
size
:
9
))
}
.
foregroundStyle
(
Color
.
white
.
opacity
(
0.85
))
.
frame
(
maxWidth
:
.
infinity
,
alignment
:
.
leading
)
.
contentShape
(
Rectangle
())
}
.
buttonStyle
(
.
plain
)
.
disabled
(
!
editable
)
.
help
(
"选择发布配置、服务器和 Maven"
)
.
popover
(
isPresented
:
$
showsConfiguration
)
{
configurationControls
}
HStack
{
Text
(
"模块"
)
.
font
(
.
system
(
size
:
13
,
weight
:
.
medium
))
Spacer
()
Text
(
"已选
\(
pane
.
selectedCount
)
个"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
HStack
(
spacing
:
7
)
{
Image
(
systemName
:
"magnifyingglass"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
TextField
(
"搜索模块…"
,
text
:
$
pane
.
search
)
.
textFieldStyle
(
.
plain
)
.
onChange
(
of
:
pane
.
search
)
{
showsModules
=
true
}
if
!
pane
.
search
.
isEmpty
{
Button
{
pane
.
search
=
""
}
label
:
{
Image
(
systemName
:
"xmark.circle.fill"
)
}
.
font
(
ReleaseTypography
.
detail
)
.
padding
(
.
top
,
4
)
.
buttonStyle
(
.
plain
)
}
Button
{
showsModules
.
toggle
()
}
label
:
{
Image
(
systemName
:
showsModules
?
"chevron.up"
:
"chevron.down"
)
}
.
buttonStyle
(
.
plain
)
.
help
(
"选择模块"
)
}
.
font
(
ReleaseTypography
.
body
)
.
padding
(
.
horizontal
,
11
)
.
frame
(
height
:
34
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
Color
.
white
.
opacity
(
0.32
))
}
.
disabled
(
!
editable
)
.
popover
(
isPresented
:
$
showsModules
,
arrowEdge
:
.
bottom
)
{
modulePicker
}
HStack
(
spacing
:
7
)
{
Image
(
systemName
:
"magnifyingglass"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
TextField
(
"搜索模块…"
,
text
:
$
pane
.
search
)
.
textFieldStyle
(
.
plain
)
.
onChange
(
of
:
pane
.
search
)
{
showsModules
=
true
}
if
!
pane
.
search
.
isEmpty
{
if
!
pane
.
modules
.
isEmpty
{
ScrollView
(
.
horizontal
)
{
HStack
(
spacing
:
6
)
{
ForEach
(
pane
.
modules
,
id
:
\
.
self
)
{
module
in
Button
{
pane
.
search
=
""
pane
.
toggle
(
module
)
}
label
:
{
Image
(
systemName
:
"xmark.circle.fill"
)
}
.
buttonStyle
(
.
plain
)
}
Button
{
showsModules
.
toggle
()
}
label
:
{
Image
(
systemName
:
showsModules
?
"chevron.up"
:
"chevron.down"
)
}
.
buttonStyle
(
.
plain
)
.
help
(
"选择模块"
)
}
.
font
(
ReleaseTypography
.
body
)
.
padding
(
.
horizontal
,
11
)
.
frame
(
height
:
35
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
.
disabled
(
!
editable
)
if
showsModules
{
ScrollView
{
LazyVStack
(
spacing
:
2
)
{
ForEach
(
matches
,
id
:
\
.
self
)
{
module
in
Button
{
pane
.
toggle
(
module
)
}
label
:
{
HStack
(
spacing
:
8
)
{
Image
(
systemName
:
pane
.
modules
.
contains
(
module
)
?
"checkmark.square.fill"
:
"square"
)
.
foregroundStyle
(
pane
.
modules
.
contains
(
module
)
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
Text
(
module
)
.
lineLimit
(
1
)
Spacer
()
}
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
29
)
}
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
pane
.
modules
.
contains
(
module
)
?
ReleaseColors
.
blue
.
opacity
(
0.12
)
:
.
clear
))
}
if
matches
.
isEmpty
{
Text
(
"没有匹配的模块"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
padding
(
8
)
}
}
.
padding
(
4
)
}
.
frame
(
height
:
min
(
112
,
CGFloat
(
matches
.
count
)
*
31
+
8
))
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
}
if
!
pane
.
modules
.
isEmpty
{
ScrollView
(
.
horizontal
)
{
HStack
(
spacing
:
6
)
{
ForEach
(
pane
.
modules
,
id
:
\
.
self
)
{
module
in
Button
{
pane
.
toggle
(
module
)
}
label
:
{
HStack
(
spacing
:
5
)
{
Text
(
module
)
.
lineLimit
(
1
)
Image
(
systemName
:
"xmark"
)
.
font
(
.
system
(
size
:
9
,
weight
:
.
semibold
))
}
.
font
(
ReleaseTypography
.
detail
)
.
foregroundStyle
(
ReleaseColors
.
blue
)
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
27
)
.
background
(
ReleaseColors
.
blue
.
opacity
(
0.15
),
in
:
Capsule
())
}
.
buttonStyle
(
.
plain
)
.
disabled
(
!
editable
)
HStack
(
spacing
:
5
)
{
Text
(
module
)
.
lineLimit
(
1
)
Image
(
systemName
:
"xmark"
)
.
font
(
.
system
(
size
:
9
,
weight
:
.
semibold
))
}
.
font
(
ReleaseTypography
.
detail
)
.
foregroundStyle
(
.
white
)
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
30
)
.
background
(
ReleaseColors
.
action
,
in
:
Capsule
())
}
.
buttonStyle
(
.
plain
)
.
disabled
(
!
editable
)
}
.
scrollIndicators
(
.
hidden
)
.
frame
(
height
:
30
)
}
}
.
scrollIndicators
(
.
hidden
)
.
frame
(
height
:
32
)
}
else
{
Text
(
"请选择模块"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
frame
(
height
:
32
)
}
VStack
(
spacing
:
0
)
{
HStack
{
Text
(
"实时输出 ·
\(
paneTitle
)
"
)
.
font
(
.
system
(
size
:
12
,
weight
:
.
medium
))
Spacer
()
if
pane
.
state
==
.
running
{
Button
(
pane
.
paused
?
"继续"
:
"暂停"
)
{
model
.
togglePause
(
pane
)
}
.
disabled
(
pane
.
stopping
)
Button
(
"停止"
)
{
model
.
stop
(
pane
)
}
.
disabled
(
pane
.
stopping
)
}
}
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
padding
(
.
horizontal
,
11
)
.
frame
(
height
:
34
)
.
background
(
ReleaseColors
.
surface
)
LogTextView
(
text
:
pane
.
log
.
isEmpty
?
(
pane
.
state
==
.
queued
?
"等待构建资源…"
:
"等待发布,命令和输出将在这里显示。"
)
:
pane
.
log
,
errorLine
:
nil
,
jumpRequest
:
0
,
followsOutput
:
pane
.
state
==
.
running
)
.
frame
(
height
:
195
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
8
))
.
clipShape
(
RoundedRectangle
(
cornerRadius
:
8
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
8
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
if
let
result
=
pane
.
result
{
Button
(
"打开完整日志"
)
{
NSWorkspace
.
shared
.
open
(
model
.
logURL
(
for
:
result
))
}
.
font
(
ReleaseTypography
.
detail
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
if
let
issue
=
pane
.
error
??
pane
.
result
?
.
message
,
!
issue
.
isEmpty
{
Text
(
issue
)
.
font
(
.
caption
)
.
foregroundStyle
(
.
red
)
.
lineLimit
(
2
)
VStack
(
spacing
:
0
)
{
HStack
{
Text
(
"实时输出 ·
\(
paneTitle
)
"
)
.
font
(
.
system
(
size
:
14
,
weight
:
.
medium
))
.
lineLimit
(
1
)
Spacer
()
if
pane
.
state
==
.
running
{
Button
(
pane
.
paused
?
"继续"
:
"暂停"
)
{
model
.
togglePause
(
pane
)
}
.
disabled
(
pane
.
stopping
)
Button
(
"停止"
)
{
model
.
stop
(
pane
)
}
.
disabled
(
pane
.
stopping
)
}
}
.
foregroundStyle
(
.
white
.
opacity
(
0.9
))
.
padding
(
.
horizontal
,
11
)
.
frame
(
height
:
34
)
.
background
(
ReleaseColors
.
surface
)
LogTextView
(
text
:
pane
.
log
.
isEmpty
?
(
pane
.
state
==
.
queued
?
"等待构建资源…"
:
"等待发布,命令和输出将在这里显示。"
)
:
pane
.
log
,
errorLine
:
nil
,
jumpRequest
:
0
,
followsOutput
:
pane
.
state
==
.
running
,
fontSize
:
13
)
.
frame
(
maxWidth
:
.
infinity
,
maxHeight
:
.
infinity
)
.
layoutPriority
(
1
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
frame
(
maxHeight
:
.
infinity
)
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
8
))
.
clipShape
(
RoundedRectangle
(
cornerRadius
:
8
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
8
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
if
let
result
=
pane
.
result
{
Button
(
"打开完整日志"
)
{
NSWorkspace
.
shared
.
open
(
model
.
logURL
(
for
:
result
))
}
.
font
(
ReleaseTypography
.
detail
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
if
let
issue
=
pane
.
error
??
pane
.
result
?
.
message
,
!
issue
.
isEmpty
{
Text
(
issue
)
.
font
(
.
caption
)
.
foregroundStyle
(
.
red
)
.
lineLimit
(
2
)
}
.
padding
(
18
)
}
Button
(
action
:
{
model
.
publish
(
pane
)
})
{
Text
(
"发布此项目"
)
.
font
(
.
system
(
size
:
13
,
weight
:
.
semibold
))
.
foregroundStyle
(
editable
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
.
font
(
.
system
(
size
:
15
,
weight
:
.
medium
))
.
foregroundStyle
(
editable
&&
!
pane
.
modules
.
isEmpty
?
.
white
:
ReleaseColors
.
muted
)
.
frame
(
maxWidth
:
.
infinity
)
.
frame
(
height
:
39
)
.
frame
(
height
:
40
)
}
.
disabled
(
model
.
isRunning
||
pane
.
modules
.
isEmpty
)
.
buttonStyle
(
ReleaseButtonStyle
())
.
overlay
{
RoundedRectangle
(
cornerRadius
:
8
)
.
strokeBorder
(
editable
?
ReleaseColors
.
blue
:
ReleaseColors
.
border
)
.
strokeBorder
(
Color
.
white
.
opacity
(
0.4
)
)
.
allowsHitTesting
(
false
)
}
.
padding
(
.
horizontal
,
18
)
.
padding
(
.
bottom
,
18
)
}
.
padding
(
18
)
.
frame
(
height
:
height
)
.
background
{
if
pane
.
state
==
.
running
{
LinearGradient
(
colors
:
[
ReleaseColors
.
blue
.
opacity
(
0.18
),
ReleaseColors
.
blue
.
opacity
(
0.07
)],
startPoint
:
.
top
,
endPoint
:
.
bottom
)
}
}
.
overlay
{
if
pane
.
state
==
.
running
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
ReleaseColors
.
blue
.
opacity
(
0.45
))
.
allowsHitTesting
(
false
)
}
}
.
font
(
ReleaseTypography
.
body
)
.
popover
(
item
:
$
configurationDraft
)
{
draft
in
ConfigurationEditor
(
profile
:
draft
)
{
updated
in
...
...
@@ -432,6 +391,144 @@ private struct ProjectReleaseColumn: View {
}
}
private
var
modulePicker
:
some
View
{
VStack
(
alignment
:
.
leading
,
spacing
:
10
)
{
HStack
{
Text
(
"选择模块"
)
.
font
(
.
headline
)
Spacer
()
Button
(
"完成"
)
{
showsModules
=
false
}
}
ScrollView
{
LazyVStack
(
spacing
:
2
)
{
ForEach
(
matches
,
id
:
\
.
self
)
{
module
in
Button
{
pane
.
toggle
(
module
)
}
label
:
{
HStack
(
spacing
:
8
)
{
Image
(
systemName
:
pane
.
modules
.
contains
(
module
)
?
"checkmark.square.fill"
:
"square"
)
.
foregroundStyle
(
pane
.
modules
.
contains
(
module
)
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
Text
(
module
)
.
lineLimit
(
1
)
Spacer
()
}
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
29
)
}
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
pane
.
modules
.
contains
(
module
)
?
ReleaseColors
.
blue
.
opacity
(
0.12
)
:
.
clear
))
}
if
matches
.
isEmpty
{
Text
(
"没有匹配的模块"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
padding
(
8
)
}
}
.
padding
(
4
)
}
.
frame
(
height
:
max
(
44
,
min
(
220
,
CGFloat
(
matches
.
count
)
*
31
+
8
)))
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
}
.
padding
(
12
)
.
frame
(
width
:
310
)
.
environment
(\
.
colorScheme
,
.
dark
)
}
private
var
configurationSummary
:
String
{
let
destination
=
pane
.
servers
.
first
(
where
:
{
$0
.
name
==
pane
.
server
})?
.
displayName
??
"选择服务器"
let
configuration
=
profile
?
.
title
??
"选择配置"
return
"
\(
configuration
)
·
\(
destination
)
·
\(
pane
.
selectedCount
)
个模块"
}
private
var
configurationControls
:
some
View
{
VStack
(
alignment
:
.
leading
,
spacing
:
14
)
{
Text
(
"发布选项"
)
.
font
(
.
headline
)
if
let
project
{
if
project
.
type
==
.
cityKeeper
{
menuRow
(
"发布配置"
,
value
:
profile
?
.
title
??
"选择配置文件"
)
{
let
files
=
(
try
?
project
.
configurationFiles
())
??
project
.
profiles
.
map
(\
.
file
)
ForEach
(
files
,
id
:
\
.
self
)
{
file
in
Button
(
project
.
profiles
.
first
(
where
:
{
$0
.
file
==
file
})?
.
title
??
file
)
{
selectConfiguration
(
file
,
in
:
project
)
}
}
Divider
()
Button
(
"浏览其他 YAML…"
)
{
browseConfiguration
(
in
:
project
)
}
}
menuRow
(
"服务器"
,
value
:
pane
.
servers
.
first
(
where
:
{
$0
.
name
==
pane
.
server
})?
.
displayName
??
"选择服务器"
)
{
ForEach
(
pane
.
servers
,
id
:
\
.
name
)
{
target
in
Button
(
target
.
displayName
)
{
pane
.
server
=
target
.
name
model
.
save
()
}
}
}
menuRow
(
"Maven"
,
value
:
pane
.
mavenCommand
.
title
)
{
ForEach
(
MavenCommand
.
allCases
)
{
command
in
Button
(
command
.
title
)
{
pane
.
mavenCommand
=
command
model
.
save
()
}
}
}
HStack
(
spacing
:
12
)
{
Toggle
(
"VPC"
,
isOn
:
$
pane
.
useVPC
)
if
project
.
supportsVerifiedRelease
(
profile
)
{
Toggle
(
"验证发布"
,
isOn
:
$
pane
.
verified
)
Spacer
(
minLength
:
0
)
Button
(
"预检"
)
{
model
.
publish
(
pane
,
action
:
.
preflight
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
disabled
(
!
editable
||
pane
.
modules
.
isEmpty
)
}
else
{
Spacer
(
minLength
:
0
)
}
if
let
profile
{
Button
{
configurationDraft
=
profile
}
label
:
{
Image
(
systemName
:
"slider.horizontal.3"
)
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
help
(
"编辑配置别名和 SSH 目标"
)
.
disabled
(
!
editable
)
}
}
.
toggleStyle
(
.
checkbox
)
.
font
(
ReleaseTypography
.
detail
)
.
disabled
(
!
editable
)
.
onChange
(
of
:
pane
.
useVPC
)
{
model
.
save
()
}
.
onChange
(
of
:
pane
.
verified
)
{
model
.
save
()
}
}
if
project
.
type
!=
.
cityKeeper
{
Text
(
"自定义项目使用项目设置中的发布脚本。"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
}
}
Button
(
"完成"
)
{
showsConfiguration
=
false
}
.
frame
(
maxWidth
:
.
infinity
,
alignment
:
.
trailing
)
}
.
padding
(
18
)
.
frame
(
width
:
360
)
.
environment
(\
.
colorScheme
,
.
dark
)
}
private
var
paneTitle
:
String
{
switch
pane
.
state
{
case
.
idle
:
"等待发布"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment