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
94f84cae
Commit
94f84cae
authored
Nov 18, 2026
by
zpc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Match split release panel to approved design
parent
94e79115
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
317 additions
and
218 deletions
+317
-218
Info.plist
Info.plist
+2
-2
SplitReleasePanel.swift
Sources/JavaReleaseMenu/SplitReleasePanel.swift
+315
-216
No files found.
Info.plist
View file @
94f84cae
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.3.
0
<
/string
>
<
string
>
1.3.
1
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
7
<
/string
>
<
string
>
8
<
/string
>
<
k
e
y
>
LSMinimumSystemVersion
<
/k
e
y
>
<
k
e
y
>
LSMinimumSystemVersion
<
/k
e
y
>
<
string
>
14.0
<
/string
>
<
string
>
14.0
<
/string
>
<
k
e
y
>
LSUIElement
<
/k
e
y
>
<
k
e
y
>
LSUIElement
<
/k
e
y
>
...
...
Sources/JavaReleaseMenu/SplitReleasePanel.swift
View file @
94f84cae
...
@@ -8,63 +8,81 @@ struct SplitReleasePanel: View {
...
@@ -8,63 +8,81 @@ struct SplitReleasePanel: View {
let
settings
:
()
->
Void
let
settings
:
()
->
Void
let
quit
:
()
->
Void
let
quit
:
()
->
Void
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
)))))
}
private
var
width
:
CGFloat
{
private
var
width
:
CGFloat
{
let
desired
=
CGFloat
(
max
(
1
,
model
.
panes
.
count
))
*
346
+
30
let
desired
=
CGFloat
(
max
(
1
,
model
.
panes
.
count
))
*
columnWidth
+
2
return
min
(
desired
,
(
NSScreen
.
main
?
.
visibleFrame
.
width
??
1440
)
-
3
6
)
return
min
(
desired
,
(
NSScreen
.
main
?
.
visibleFrame
.
width
??
1440
)
-
3
2
)
}
}
private
var
columnHeight
:
CGFloat
{
private
var
columnHeight
:
CGFloat
{
min
(
630
,
max
(
420
,
(
NSScreen
.
main
?
.
visibleFrame
.
height
??
900
)
-
160
))
min
(
700
,
max
(
470
,
(
NSScreen
.
main
?
.
visibleFrame
.
height
??
900
)
-
145
))
}
}
var
body
:
some
View
{
var
body
:
some
View
{
VStack
(
spacing
:
0
)
{
VStack
(
spacing
:
0
)
{
HStack
{
HStack
(
spacing
:
12
)
{
Label
(
"Java 发布"
,
systemImage
:
"circle.dotted.circle"
)
ZStack
{
.
font
(
ReleaseTypography
.
heading
)
Circle
()
.
stroke
(
ReleaseColors
.
blue
.
opacity
(
0.25
),
lineWidth
:
3
)
Circle
()
.
trim
(
from
:
0
,
to
:
0.76
)
.
stroke
(
ReleaseColors
.
blue
,
style
:
StrokeStyle
(
lineWidth
:
3
,
lineCap
:
.
round
)
)
.
rotationEffect
(
.
degrees
(
-
90
))
}
.
frame
(
width
:
26
,
height
:
26
)
Text
(
"Java 发布"
)
.
font
(
.
system
(
size
:
18
,
weight
:
.
semibold
))
Spacer
()
Spacer
()
Button
{
Button
(
action
:
model
.
add
)
{
model
.
add
()
}
label
:
{
Label
(
"增加窗口"
,
systemImage
:
"plus"
)
Label
(
"增加窗口"
,
systemImage
:
"plus"
)
.
font
(
ReleaseTypography
.
action
)
.
padding
(
.
horizontal
,
10
)
.
frame
(
height
:
29
)
}
}
.
disabled
(
.
disabled
(
model
.
isRunning
||
model
.
panes
.
count
>=
4
model
.
isRunning
||
model
.
panes
.
count
>=
4
||
model
.
panes
.
count
>=
model
.
settings
.
projects
.
count
||
model
.
panes
.
count
>=
model
.
settings
.
projects
.
count
)
)
.
buttonStyle
(
ReleaseButtonStyle
())
.
buttonStyle
(
ReleaseButtonStyle
())
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
Menu
{
Menu
{
Button
(
"项目设置…"
,
action
:
settings
)
Button
(
"项目设置…"
,
action
:
settings
)
Divider
()
Divider
()
Button
(
"退出 Java 发布"
,
action
:
quit
)
Button
(
"退出 Java 发布"
,
action
:
quit
)
}
label
:
{
}
label
:
{
Image
(
systemName
:
"gearshape"
)
Image
(
systemName
:
"gearshape"
)
.
frame
(
width
:
28
,
height
:
28
)
.
font
(
.
system
(
size
:
17
))
.
frame
(
width
:
30
,
height
:
29
)
}
}
.
menuStyle
(
.
borderlessButton
)
.
menuStyle
(
.
borderlessButton
)
.
menuIndicator
(
.
hidden
)
.
menuIndicator
(
.
hidden
)
.
fixedSize
()
.
fixedSize
()
.
disabled
(
model
.
isRunning
)
.
disabled
(
model
.
isRunning
)
.
accessibilityLabel
(
"项目设置"
)
}
}
.
padding
(
15
)
.
padding
(
.
horizontal
,
18
)
.
frame
(
height
:
58
)
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
.
frame
(
height
:
1
)
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
.
frame
(
height
:
1
)
if
model
.
panes
.
isEmpty
{
if
model
.
panes
.
isEmpty
{
VStack
(
spacing
:
14
)
{
VStack
(
spacing
:
12
)
{
Text
(
"先在项目设置中添加项目,再增加发布窗口。"
)
Text
(
"添加项目后即可创建发布窗口。"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
Button
(
"项目设置…"
,
action
:
settings
)
Button
(
"项目设置…"
,
action
:
settings
)
}
}
.
frame
(
maxWidth
:
.
infinity
,
minHeight
:
2
4
0
)
.
frame
(
maxWidth
:
.
infinity
,
minHeight
:
2
2
0
)
}
else
{
}
else
{
ScrollView
(
.
horizontal
)
{
ScrollView
(
.
horizontal
)
{
HStack
(
alignment
:
.
top
,
spacing
:
0
)
{
HStack
(
alignment
:
.
top
,
spacing
:
0
)
{
ForEach
(
model
.
panes
)
{
pane
in
ForEach
(
model
.
panes
)
{
pane
in
ProjectReleaseColumn
(
model
:
model
,
pane
:
pane
)
ProjectReleaseColumn
(
model
:
model
,
pane
:
pane
,
height
:
columnHeight
)
.
frame
(
width
:
345
)
.
frame
(
width
:
columnWidth
)
if
pane
.
id
!=
model
.
panes
.
last
?
.
id
{
if
pane
.
id
!=
model
.
panes
.
last
?
.
id
{
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
.
frame
(
Rectangle
()
.
fill
(
ReleaseColors
.
border
)
width
:
1
,
height
:
columnHeight
)
.
frame
(
width
:
1
,
height
:
columnHeight
)
}
}
}
}
}
}
...
@@ -74,33 +92,30 @@ struct SplitReleasePanel: View {
...
@@ -74,33 +92,30 @@ struct SplitReleasePanel: View {
HStack
{
HStack
{
if
model
.
isRunning
{
if
model
.
isRunning
{
Text
(
Text
(
"运行
\(
model
.
panes
.
filter
{
$0
.
state
==
.
running
}
.
count
)
· 排队
\(
model
.
panes
.
filter
{
$0
.
state
==
.
queued
}
.
count
)
"
"运行
\(
model
.
panes
.
filter
{
$0
.
state
==
.
running
}
.
count
)
/
\(
model
.
panes
.
count
)
· 排队
\(
model
.
panes
.
filter
{
$0
.
state
==
.
queued
}
.
count
)
"
)
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
}
else
{
}
else
{
Text
(
"
\(
model
.
panes
.
count
)
/ 4 个窗口"
)
Text
(
"
\(
model
.
panes
.
count
)
/ 4 个窗口"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
}
}
Spacer
()
Spacer
()
Button
{
Button
(
action
:
model
.
publishAll
)
{
model
.
publishAll
()
}
label
:
{
Text
(
"一起发布
\(
model
.
panes
.
count
)
个项目"
)
Text
(
"一起发布
\(
model
.
panes
.
count
)
个项目"
)
.
font
(
ReleaseTypography
.
action
)
.
font
(
.
system
(
size
:
14
,
weight
:
.
semibold
))
.
padding
(
.
horizontal
,
22
)
.
foregroundStyle
(
.
white
)
.
frame
(
height
:
36
)
.
padding
(
.
horizontal
,
23
)
.
frame
(
height
:
40
)
}
}
.
disabled
(
model
.
isRunning
||
model
.
panes
.
count
<
2
)
.
disabled
(
model
.
isRunning
||
model
.
panes
.
count
<
2
)
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
ReleaseColors
.
action
,
prominent
:
true
))
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
ReleaseColors
.
action
,
prominent
:
true
))
}
}
.
padding
(
14
)
.
font
(
ReleaseTypography
.
detail
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
padding
(
.
horizontal
,
18
)
.
frame
(
height
:
66
)
}
}
if
let
error
=
model
.
error
{
if
let
error
=
model
.
error
{
Text
(
error
)
Text
(
error
)
.
font
(
.
caption
)
.
foregroundStyle
(
.
red
)
.
font
(
.
caption
)
.
textSelection
(
.
enabled
)
.
padding
([
.
horizontal
,
.
bottom
],
14
)
.
foregroundStyle
(
.
red
)
.
textSelection
(
.
enabled
)
.
padding
([
.
horizontal
,
.
bottom
],
14
)
}
}
}
}
.
frame
(
width
:
width
)
.
frame
(
width
:
width
)
...
@@ -113,221 +128,301 @@ struct SplitReleasePanel: View {
...
@@ -113,221 +128,301 @@ struct SplitReleasePanel: View {
private
struct
ProjectReleaseColumn
:
View
{
private
struct
ProjectReleaseColumn
:
View
{
let
model
:
SplitReleaseModel
let
model
:
SplitReleaseModel
@Bindable
var
pane
:
ReleasePaneState
@Bindable
var
pane
:
ReleasePaneState
let
height
:
CGFloat
@State
private
var
configurationDraft
:
DeployProfile
?
@State
private
var
configurationDraft
:
DeployProfile
?
@State
private
var
showsModules
=
false
private
var
project
:
ReleaseProject
?
{
model
.
project
(
for
:
pane
)
}
private
var
project
:
ReleaseProject
?
{
model
.
project
(
for
:
pane
)
}
private
var
profile
:
DeployProfile
?
{
project
?
.
profiles
.
first
{
$0
.
id
==
pane
.
profileID
}
}
private
var
profile
:
DeployProfile
?
{
project
?
.
profiles
.
first
{
$0
.
id
==
pane
.
profileID
}
}
private
var
editable
:
Bool
{
private
var
editable
:
Bool
{
pane
.
state
!=
.
running
&&
pane
.
state
!=
.
queued
&&
!
model
.
isRunning
pane
.
state
!=
.
running
&&
pane
.
state
!=
.
queued
&&
!
model
.
isRunning
}
}
private
var
columnHeight
:
CGFloat
{
min
(
630
,
max
(
420
,
(
NSScreen
.
main
?
.
visibleFrame
.
height
??
900
)
-
160
))
}
private
var
matches
:
[
String
]
{
private
var
matches
:
[
String
]
{
let
search
=
pane
.
search
.
trimmingCharacters
(
in
:
.
whitespacesAndNewlines
)
let
query
=
pane
.
search
.
trimmingCharacters
(
in
:
.
whitespacesAndNewlines
)
return
search
.
isEmpty
return
query
.
isEmpty
?
pane
.
availableModules
?
pane
.
availableModules
:
pane
.
availableModules
.
filter
{
$0
.
localizedStandardContains
(
search
)
}
:
pane
.
availableModules
.
filter
{
$0
.
localizedStandardContains
(
query
)
}
}
}
var
body
:
some
View
{
var
body
:
some
View
{
ScrollView
(
.
vertical
)
{
VStack
(
spacing
:
0
)
{
VStack
(
alignment
:
.
leading
,
spacing
:
11
)
{
ScrollView
(
.
vertical
)
{
HStack
{
VStack
(
alignment
:
.
leading
,
spacing
:
12
)
{
Menu
{
HStack
(
spacing
:
8
)
{
ForEach
(
Image
(
systemName
:
"folder"
)
model
.
settings
.
projects
.
filter
{
project
in
.
foregroundStyle
(
ReleaseColors
.
muted
)
!
model
.
panes
.
contains
{
Menu
{
$0
.
id
!=
pane
.
id
&&
$0
.
projectID
==
project
.
id
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
))
}
}
)
{
item
in
.
font
(
.
system
(
size
:
16
,
weight
:
.
semibold
))
Button
(
item
.
name
)
{
model
.
replace
(
pane
,
with
:
item
)
}
}
}
}
label
:
{
.
menuStyle
(
.
borderlessButton
)
HStack
{
.
menuIndicator
(
.
hidden
)
Image
(
systemName
:
"folder"
)
.
disabled
(
!
editable
)
Text
(
project
?
.
name
??
"选择项目"
)
.
lineLimit
(
1
)
Button
{
Image
(
systemName
:
"chevron.down"
)
model
.
remove
(
pane
)
.
font
(
.
system
(
size
:
9
))
}
label
:
{
Image
(
systemName
:
"xmark"
)
.
font
(
.
system
(
size
:
11
,
weight
:
.
semibold
))
.
frame
(
width
:
24
,
height
:
24
)
}
}
.
font
(
.
system
(
size
:
14
,
weight
:
.
semibold
))
.
buttonStyle
(
ReleaseButtonStyle
())
}
.
overlay
{
Circle
()
.
strokeBorder
(
ReleaseColors
.
border
)
}
.
menuStyle
(
.
borderlessButton
)
.
disabled
(
!
editable
)
.
menuIndicator
(
.
hidden
)
.
help
(
"减少窗口"
)
.
disabled
(
!
editable
)
Spacer
(
minLength
:
4
)
Button
{
model
.
remove
(
pane
)
}
label
:
{
Image
(
systemName
:
"xmark"
)
.
frame
(
width
:
22
,
height
:
22
)
}
}
.
help
(
"减少窗口"
)
.
frame
(
height
:
28
)
.
disabled
(
!
editable
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
if
let
project
{
if
let
project
{
if
project
.
type
==
.
cityKeeper
{
if
project
.
type
==
.
cityKeeper
{
menuRow
(
"发布配置"
,
selection
:
profile
?
.
title
??
"选择配置文件"
)
{
menuRow
(
"发布配置"
,
value
:
profile
?
.
title
??
"选择配置文件"
)
{
let
files
=
let
files
=
(
try
?
project
.
configurationFiles
())
??
project
.
profiles
.
map
(\
.
file
)
(
try
?
project
.
configurationFiles
())
ForEach
(
files
,
id
:
\
.
self
)
{
file
in
??
project
.
profiles
.
map
(\
.
file
)
Button
(
ForEach
(
files
,
id
:
\
.
self
)
{
file
in
project
.
profiles
.
first
(
where
:
{
$0
.
file
==
file
})?
.
title
Button
(
??
file
project
.
profiles
.
first
(
where
:
{
$0
.
file
==
file
})?
.
title
)
{
??
file
selectConfiguration
(
file
,
in
:
project
)
)
{
selectConfiguration
(
file
,
in
:
project
)
}
}
}
Divider
()
Button
(
"浏览其他 YAML…"
)
{
browseConfiguration
(
in
:
project
)
}
}
}
Divider
()
menuRow
(
Button
(
"浏览其他 YAML…"
)
{
browseConfiguration
(
in
:
project
)
}
"服务器"
,
}
value
:
pane
.
servers
.
first
(
where
:
{
$0
.
name
==
pane
.
server
})?
if
let
profile
{
.
displayName
??
"选择服务器"
Button
(
"编辑别名与 SSH 目标…"
)
{
configurationDraft
=
profile
}
)
{
.
font
(
ReleaseTypography
.
detail
)
ForEach
(
pane
.
servers
,
id
:
\
.
name
)
{
target
in
.
buttonStyle
(
ReleaseButtonStyle
())
Button
(
target
.
displayName
)
{
.
disabled
(
!
editable
)
pane
.
server
=
target
.
name
}
model
.
save
()
menuRow
(
}
"服务器"
,
selection
:
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
if
project
.
type
==
.
cityKeeper
{
Button
(
command
.
title
)
{
menuRow
(
"Maven"
,
selection
:
pane
.
mavenCommand
.
title
)
{
pane
.
mavenCommand
=
command
ForEach
(
MavenCommand
.
allCases
)
{
command
in
model
.
save
()
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
{
HStack
{
HStack
{
T
oggle
(
"VPC"
,
isOn
:
$
pane
.
useVPC
)
T
ext
(
"模块"
)
.
font
(
.
system
(
size
:
13
,
weight
:
.
medium
)
)
Spacer
()
Spacer
()
if
project
.
supportsVerifiedRelease
(
profile
)
{
Text
(
"已选
\(
pane
.
selectedCount
)
个"
)
Toggle
(
"验证发布"
,
isOn
:
$
pane
.
verified
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
Button
(
"预检"
)
{
model
.
publish
(
pane
,
action
:
.
preflight
)
}
.
disabled
(
!
editable
||
pane
.
modules
.
isEmpty
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
}
}
.
toggleStyle
(
.
checkbox
)
.
font
(
ReleaseTypography
.
detail
)
.
font
(
ReleaseTypography
.
detail
)
.
disabled
(
!
editable
)
.
padding
(
.
top
,
4
)
.
onChange
(
of
:
pane
.
useVPC
)
{
model
.
save
()
}
.
onChange
(
of
:
pane
.
verified
)
{
model
.
save
()
}
HStack
(
spacing
:
7
)
{
}
Image
(
systemName
:
"magnifyingglass"
)
HStack
{
.
foregroundStyle
(
ReleaseColors
.
muted
)
Image
(
systemName
:
"magnifyingglass"
)
TextField
(
"搜索模块…"
,
text
:
$
pane
.
search
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
textFieldStyle
(
.
plain
)
TextField
(
"搜索模块"
,
text
:
$
pane
.
search
)
.
onChange
(
of
:
pane
.
search
)
{
showsModules
=
true
}
.
textFieldStyle
(
.
plain
)
if
!
pane
.
search
.
isEmpty
{
if
!
pane
.
search
.
isEmpty
{
Button
{
pane
.
search
=
""
}
label
:
{
Image
(
systemName
:
"xmark.circle.fill"
)
}
.
buttonStyle
(
.
plain
)
}
Button
{
Button
{
pane
.
search
=
""
showsModules
.
toggle
()
}
label
:
{
}
label
:
{
Image
(
systemName
:
"xmark.circle.fill
"
)
Image
(
systemName
:
showsModules
?
"chevron.up"
:
"chevron.down
"
)
}
}
.
buttonStyle
(
.
plain
)
.
buttonStyle
(
.
plain
)
.
help
(
"选择模块"
)
}
}
}
.
font
(
ReleaseTypography
.
body
)
.
padding
(
8
)
.
padding
(
.
horizontal
,
11
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
.
frame
(
height
:
35
)
.
disabled
(
!
editable
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
.
disabled
(
!
editable
)
ScrollView
{
if
showsModules
{
LazyVStack
(
spacing
:
2
)
{
ScrollView
{
ForEach
(
matches
,
id
:
\
.
self
)
{
module
in
LazyVStack
(
spacing
:
2
)
{
Button
{
ForEach
(
matches
,
id
:
\
.
self
)
{
module
in
pane
.
toggle
(
module
)
Button
{
}
label
:
{
pane
.
toggle
(
module
)
HStack
(
spacing
:
8
)
{
}
label
:
{
Image
(
HStack
(
spacing
:
8
)
{
systemName
:
pane
.
modules
.
contains
(
module
)
Image
(
?
"checkmark.square.fill"
:
"square"
systemName
:
pane
.
modules
.
contains
(
module
)
)
?
"checkmark.square.fill"
:
"square"
.
foregroundStyle
(
)
pane
.
modules
.
contains
(
module
)
.
foregroundStyle
(
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
pane
.
modules
.
contains
(
module
)
Text
(
module
)
.
lineLimit
(
1
)
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
Spacer
()
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
)
}
}
.
frame
(
height
:
27
)
.
padding
(
.
horizontal
,
7
)
}
}
.
buttonStyle
(
ReleaseButtonStyle
())
.
padding
(
4
)
.
disabled
(
!
editable
)
}
}
if
matches
.
isEmpty
{
.
frame
(
height
:
min
(
112
,
CGFloat
(
matches
.
count
)
*
31
+
8
))
Text
(
"没有匹配的模块"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
padding
(
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
)
}
}
}
}
.
scrollIndicators
(
.
hidden
)
.
frame
(
height
:
30
)
}
}
}
.
frame
(
height
:
78
)
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
Text
(
"已选
\(
pane
.
selectedCount
)
个模块"
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
font
(
ReleaseTypography
.
detail
)
HStack
{
VStack
(
spacing
:
0
)
{
Text
(
paneTitle
)
.
font
(
ReleaseTypography
.
detail
)
HStack
{
Spacer
()
Text
(
"实时输出 ·
\(
paneTitle
)
"
)
if
pane
.
state
==
.
running
{
.
font
(
.
system
(
size
:
12
,
weight
:
.
medium
))
Button
(
pane
.
paused
?
"继续"
:
"暂停"
)
{
model
.
togglePause
(
pane
)
}
Spacer
()
.
disabled
(
pane
.
stopping
)
if
pane
.
state
==
.
running
{
Button
(
"停止"
)
{
model
.
stop
(
pane
)
}
Button
(
pane
.
paused
?
"继续"
:
"暂停"
)
{
model
.
togglePause
(
pane
)
}
.
disabled
(
pane
.
stopping
)
.
disabled
(
pane
.
stopping
)
}
Button
(
"停止"
)
{
model
.
stop
(
pane
)
}
}
.
disabled
(
pane
.
stopping
)
.
buttonStyle
(
ReleaseButtonStyle
())
}
.
foregroundStyle
(
ReleaseColors
.
muted
)
}
LogTextView
(
.
foregroundStyle
(
ReleaseColors
.
muted
)
text
:
pane
.
log
.
isEmpty
.
padding
(
.
horizontal
,
11
)
?
(
pane
.
state
==
.
queued
?
"等待构建资源…"
:
""
)
:
pane
.
log
,
.
frame
(
height
:
34
)
errorLine
:
nil
,
jumpRequest
:
0
,
.
background
(
ReleaseColors
.
surface
)
followsOutput
:
pane
.
state
==
.
running
LogTextView
(
)
text
:
pane
.
log
.
isEmpty
.
frame
(
height
:
150
)
?
(
pane
.
state
==
.
queued
?
"等待构建资源…"
:
"等待发布,命令和输出将在这里显示。"
)
.
background
(
ReleaseColors
.
terminal
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
:
pane
.
log
,
if
let
result
=
pane
.
result
{
errorLine
:
nil
,
jumpRequest
:
0
,
Button
(
"打开完整日志"
)
{
followsOutput
:
pane
.
state
==
.
running
NSWorkspace
.
shared
.
open
(
model
.
logURL
(
for
:
result
))
)
.
frame
(
height
:
195
)
}
}
.
font
(
ReleaseTypography
.
detail
)
.
buttonStyle
(
ReleaseButtonStyle
())
.
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
)
}
}
}
if
let
issue
=
pane
.
error
??
pane
.
result
?
.
message
,
!
issue
.
isEmpty
{
Text
(
issue
)
.
font
(
.
caption
)
.
foregroundStyle
(
.
red
)
.
lineLimit
(
2
)
}
Spacer
(
minLength
:
2
)
Button
{
model
.
publish
(
pane
)
}
label
:
{
Text
(
"发布此项目"
)
.
font
(
ReleaseTypography
.
action
)
.
frame
(
maxWidth
:
.
infinity
,
minHeight
:
33
)
}
.
disabled
(
model
.
isRunning
||
pane
.
modules
.
isEmpty
)
.
buttonStyle
(
ReleaseButtonStyle
(
base
:
ReleaseColors
.
surface
))
}
}
.
padding
(
18
)
}
Button
(
action
:
{
model
.
publish
(
pane
)
})
{
Text
(
"发布此项目"
)
.
font
(
.
system
(
size
:
13
,
weight
:
.
semibold
))
.
foregroundStyle
(
editable
?
ReleaseColors
.
blue
:
ReleaseColors
.
muted
)
.
frame
(
maxWidth
:
.
infinity
)
.
frame
(
height
:
39
)
}
.
disabled
(
model
.
isRunning
||
pane
.
modules
.
isEmpty
)
.
buttonStyle
(
ReleaseButtonStyle
())
.
overlay
{
RoundedRectangle
(
cornerRadius
:
8
)
.
strokeBorder
(
editable
?
ReleaseColors
.
blue
:
ReleaseColors
.
border
)
.
allowsHitTesting
(
false
)
}
}
.
padding
(
13
)
.
padding
(
.
horizontal
,
18
)
.
padding
(
.
bottom
,
18
)
}
}
.
frame
(
height
:
columnH
eight
)
.
frame
(
height
:
h
eight
)
.
font
(
ReleaseTypography
.
body
)
.
font
(
ReleaseTypography
.
body
)
.
popover
(
item
:
$
configurationDraft
)
{
draft
in
.
popover
(
item
:
$
configurationDraft
)
{
draft
in
ConfigurationEditor
(
profile
:
draft
)
{
updated
in
ConfigurationEditor
(
profile
:
draft
)
{
updated
in
...
@@ -339,33 +434,37 @@ private struct ProjectReleaseColumn: View {
...
@@ -339,33 +434,37 @@ private struct ProjectReleaseColumn: View {
private
var
paneTitle
:
String
{
private
var
paneTitle
:
String
{
switch
pane
.
state
{
switch
pane
.
state
{
case
.
idle
:
return
"命令行输出
"
case
.
idle
:
"等待发布
"
case
.
queued
:
return
"排队中"
case
.
queued
:
"排队中"
case
.
running
:
case
.
running
:
return
pane
.
stopping
?
"正在停止"
:
pane
.
paused
?
"已暂停"
:
pane
.
phase
?
.
title
??
"正在发布"
pane
.
stopping
?
"正在停止"
:
pane
.
paused
?
"已暂停"
:
pane
.
phase
?
.
title
??
"正在发布"
case
.
skipped
:
return
"未执行"
case
.
skipped
:
"未执行"
case
.
finished
:
return
pane
.
result
?
.
headline
??
"发布结束"
case
.
finished
:
pane
.
result
?
.
headline
??
"发布结束"
}
}
}
}
private
func
menuRow
<
Content
:
View
>
(
private
func
menuRow
<
Content
:
View
>
(
_
title
:
String
,
selection
:
String
,
_
label
:
String
,
value
:
String
,
@ViewBuilder
content
:
()
->
Content
@ViewBuilder
content
:
()
->
Content
)
->
some
View
{
)
->
some
View
{
HStack
(
spacing
:
7
)
{
HStack
(
spacing
:
8
)
{
Text
(
title
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
frame
(
width
:
60
,
alignment
:
.
leading
)
Text
(
label
)
.
foregroundStyle
(
ReleaseColors
.
muted
)
.
frame
(
width
:
60
,
alignment
:
.
leading
)
Menu
(
content
:
content
)
{
Menu
(
content
:
content
)
{
HStack
{
HStack
{
Text
(
selection
)
.
lineLimit
(
1
)
Text
(
value
)
.
lineLimit
(
1
)
Spacer
(
minLength
:
2
)
Spacer
(
minLength
:
3
)
Image
(
systemName
:
"chevron.down"
)
.
font
(
.
system
(
size
:
9
))
Image
(
systemName
:
"chevron.down"
)
.
font
(
.
system
(
size
:
10
))
}
}
.
padding
(
.
horizontal
,
8
)
.
padding
(
.
horizontal
,
11
)
.
frame
(
height
:
30
)
.
frame
(
height
:
36
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
6
))
.
frame
(
maxWidth
:
.
infinity
)
.
background
(
ReleaseColors
.
surface
,
in
:
RoundedRectangle
(
cornerRadius
:
7
))
.
overlay
{
RoundedRectangle
(
cornerRadius
:
7
)
.
strokeBorder
(
ReleaseColors
.
border
)
}
}
}
.
menuStyle
(
.
borderlessButton
)
.
menuStyle
(
.
borderlessButton
)
.
menuIndicator
(
.
hidden
)
.
menuIndicator
(
.
hidden
)
.
frame
(
maxWidth
:
.
infinity
)
.
disabled
(
!
editable
)
.
disabled
(
!
editable
)
}
}
}
}
...
...
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