Commit 1d312d6e authored by zpc's avatar zpc

Rebuild release workspace with compact summaries and full-height consoles

parent 94f84cae
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.3.1</string> <string>1.3.2</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>8</string> <string>9</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>14.0</string> <string>14.0</string>
<key>LSUIElement</key> <key>LSUIElement</key>
......
...@@ -6,6 +6,7 @@ struct LogTextView: NSViewRepresentable { ...@@ -6,6 +6,7 @@ struct LogTextView: NSViewRepresentable {
let errorLine: Int? let errorLine: Int?
let jumpRequest: Int let jumpRequest: Int
var followsOutput = false var followsOutput = false
var fontSize: CGFloat = 11
final class Coordinator { final class Coordinator {
var text: String? var text: String?
...@@ -41,7 +42,7 @@ struct LogTextView: NSViewRepresentable { ...@@ -41,7 +42,7 @@ struct LogTextView: NSViewRepresentable {
coordinator.text = text coordinator.text = text
coordinator.errorRange = nil coordinator.errorRange = nil
let styled = NSMutableAttributedString(string: text, attributes: [ 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) .foregroundColor: NSColor(srgbRed: 0.78, green: 0.83, blue: 0.90, alpha: 1)
]) ])
if let errorLine, let range = lineRange(at: errorLine) { if let errorLine, let range = lineRange(at: errorLine) {
......
...@@ -10,16 +10,24 @@ struct SplitReleasePanel: View { ...@@ -10,16 +10,24 @@ struct SplitReleasePanel: View {
private var columnWidth: CGFloat { private var columnWidth: CGFloat {
let available = (NSScreen.main?.visibleFrame.width ?? 1440) - 32 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 { 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) return min(desired, (NSScreen.main?.visibleFrame.width ?? 1440) - 32)
} }
private var columnHeight: CGFloat { 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 { var body: some View {
...@@ -33,14 +41,14 @@ struct SplitReleasePanel: View { ...@@ -33,14 +41,14 @@ struct SplitReleasePanel: View {
) )
.rotationEffect(.degrees(-90)) .rotationEffect(.degrees(-90))
} }
.frame(width: 26, height: 26) .frame(width: 32, height: 32)
Text("Java 发布").font(.system(size: 18, weight: .semibold)) Text("Java 发布").font(.system(size: 23, weight: .semibold))
Spacer() Spacer()
Button(action: model.add) { Button(action: model.add) {
Label("增加窗口", systemImage: "plus") Label("增加窗口", systemImage: "plus")
.font(ReleaseTypography.action) .font(ReleaseTypography.action)
.padding(.horizontal, 10) .padding(.horizontal, 10)
.frame(height: 29) .frame(height: 35)
} }
.disabled( .disabled(
model.isRunning || model.panes.count >= 4 model.isRunning || model.panes.count >= 4
...@@ -64,7 +72,7 @@ struct SplitReleasePanel: View { ...@@ -64,7 +72,7 @@ struct SplitReleasePanel: View {
.accessibilityLabel("项目设置") .accessibilityLabel("项目设置")
} }
.padding(.horizontal, 18) .padding(.horizontal, 18)
.frame(height: 58) .frame(height: 70)
Rectangle().fill(ReleaseColors.border).frame(height: 1) Rectangle().fill(ReleaseColors.border).frame(height: 1)
...@@ -87,7 +95,8 @@ struct SplitReleasePanel: View { ...@@ -87,7 +95,8 @@ struct SplitReleasePanel: View {
} }
} }
} }
.scrollIndicators(.automatic) .frame(height: columnHeight)
.scrollIndicators(.hidden)
Rectangle().fill(ReleaseColors.border).frame(height: 1) Rectangle().fill(ReleaseColors.border).frame(height: 1)
HStack { HStack {
if model.isRunning { if model.isRunning {
...@@ -100,18 +109,18 @@ struct SplitReleasePanel: View { ...@@ -100,18 +109,18 @@ struct SplitReleasePanel: View {
Spacer() Spacer()
Button(action: model.publishAll) { Button(action: model.publishAll) {
Text("一起发布 \(model.panes.count) 个项目") Text("一起发布 \(model.panes.count) 个项目")
.font(.system(size: 14, weight: .semibold)) .font(.system(size: 18, weight: .semibold))
.foregroundStyle(.white) .foregroundStyle(.white)
.padding(.horizontal, 23) .padding(.horizontal, 36)
.frame(height: 40) .frame(height: 46)
} }
.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))
} }
.font(ReleaseTypography.detail) .font(.system(size: 16))
.foregroundStyle(ReleaseColors.muted) .foregroundStyle(.white.opacity(0.9))
.padding(.horizontal, 18) .padding(.horizontal, 18)
.frame(height: 66) .frame(height: 78)
} }
if let error = model.error { if let error = model.error {
Text(error).font(.caption).foregroundStyle(.red) Text(error).font(.caption).foregroundStyle(.red)
...@@ -119,7 +128,17 @@ struct SplitReleasePanel: View { ...@@ -119,7 +128,17 @@ struct SplitReleasePanel: View {
} }
} }
.frame(width: width) .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) .environment(\.colorScheme, .dark)
.tint(ReleaseColors.blue) .tint(ReleaseColors.blue)
} }
...@@ -131,6 +150,9 @@ private struct ProjectReleaseColumn: View { ...@@ -131,6 +150,9 @@ private struct ProjectReleaseColumn: View {
let height: CGFloat let height: CGFloat
@State private var configurationDraft: DeployProfile? @State private var configurationDraft: DeployProfile?
@State private var showsModules = false @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 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 } }
...@@ -145,13 +167,24 @@ private struct ProjectReleaseColumn: View { ...@@ -145,13 +167,24 @@ private struct ProjectReleaseColumn: View {
} }
var body: some View { var body: some View {
VStack(spacing: 0) { VStack(alignment: .leading, spacing: 18) {
ScrollView(.vertical) {
VStack(alignment: .leading, spacing: 12) {
HStack(spacing: 8) { HStack(spacing: 8) {
Image(systemName: "folder") Button {
.foregroundStyle(ReleaseColors.muted) showsProjects.toggle()
Menu { } 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( ForEach(
model.settings.projects.filter { candidate in model.settings.projects.filter { candidate in
!model.panes.contains { !model.panes.contains {
...@@ -159,110 +192,53 @@ private struct ProjectReleaseColumn: View { ...@@ -159,110 +192,53 @@ private struct ProjectReleaseColumn: View {
} }
} }
) { candidate in ) { candidate in
Button(candidate.name) { model.replace(pane, with: candidate) } Button(candidate.name) {
showsProjects = false
model.replace(pane, with: candidate)
} }
} label: { .buttonStyle(ReleaseButtonStyle())
HStack {
Text(project?.name ?? "选择项目")
.lineLimit(1)
.frame(maxWidth: .infinity, alignment: .leading)
Image(systemName: "chevron.down")
.font(.system(size: 10, weight: .semibold))
} }
.font(.system(size: 16, weight: .semibold))
} }
.menuStyle(.borderlessButton) .padding(16)
.menuIndicator(.hidden) .frame(minWidth: 220, alignment: .leading)
.disabled(!editable) .environment(\.colorScheme, .dark)
}
Button { Button {
model.remove(pane) model.remove(pane)
} label: { } label: {
Image(systemName: "xmark") Label("减少窗口", systemImage: "xmark")
.font(.system(size: 11, weight: .semibold)) .font(.system(size: 11))
.frame(width: 24, height: 24) .padding(.horizontal, 8)
.frame(height: 26)
} }
.buttonStyle(ReleaseButtonStyle()) .buttonStyle(ReleaseButtonStyle())
.overlay { Circle().strokeBorder(ReleaseColors.border) } .overlay {
RoundedRectangle(cornerRadius: 7).strokeBorder(Color.white.opacity(0.35))
}
.disabled(!editable) .disabled(!editable)
.help("减少窗口") .help("减少窗口")
} }
.frame(height: 28) .frame(height: 28)
if let project { if project != nil {
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 { Button {
configurationDraft = profile showsConfiguration.toggle()
} label: { } label: {
Image(systemName: "slider.horizontal.3") HStack(spacing: 4) {
} Text(configurationSummary).lineLimit(1).truncationMode(.middle)
.buttonStyle(ReleaseButtonStyle()) Image(systemName: "chevron.down").font(.system(size: 9))
.help("编辑配置别名和 SSH 目标")
.disabled(!editable)
} }
.foregroundStyle(Color.white.opacity(0.85))
.frame(maxWidth: .infinity, alignment: .leading)
.contentShape(Rectangle())
} }
.toggleStyle(.checkbox) .buttonStyle(.plain)
.font(ReleaseTypography.detail)
.disabled(!editable) .disabled(!editable)
.onChange(of: pane.useVPC) { model.save() } .help("选择发布配置、服务器和 Maven")
.onChange(of: pane.verified) { model.save() } .popover(isPresented: $showsConfiguration) {
configurationControls
} }
HStack {
Text("模块").font(.system(size: 13, weight: .medium))
Spacer()
Text("已选 \(pane.selectedCount) 个")
.foregroundStyle(ReleaseColors.muted)
}
.font(ReleaseTypography.detail)
.padding(.top, 4)
HStack(spacing: 7) { HStack(spacing: 7) {
Image(systemName: "magnifyingglass") Image(systemName: "magnifyingglass")
.foregroundStyle(ReleaseColors.muted) .foregroundStyle(ReleaseColors.muted)
...@@ -287,50 +263,16 @@ private struct ProjectReleaseColumn: View { ...@@ -287,50 +263,16 @@ private struct ProjectReleaseColumn: View {
} }
.font(ReleaseTypography.body) .font(ReleaseTypography.body)
.padding(.horizontal, 11) .padding(.horizontal, 11)
.frame(height: 35) .frame(height: 34)
.background(ReleaseColors.surface, in: RoundedRectangle(cornerRadius: 7)) .background(ReleaseColors.surface, in: RoundedRectangle(cornerRadius: 7))
.overlay { .overlay {
RoundedRectangle(cornerRadius: 7).strokeBorder(ReleaseColors.border) RoundedRectangle(cornerRadius: 7).strokeBorder(Color.white.opacity(0.32))
} }
.disabled(!editable) .disabled(!editable)
.popover(isPresented: $showsModules, arrowEdge: .bottom) {
if showsModules { modulePicker
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 { if !pane.modules.isEmpty {
ScrollView(.horizontal) { ScrollView(.horizontal) {
HStack(spacing: 6) { HStack(spacing: 6) {
...@@ -344,11 +286,11 @@ private struct ProjectReleaseColumn: View { ...@@ -344,11 +286,11 @@ private struct ProjectReleaseColumn: View {
.font(.system(size: 9, weight: .semibold)) .font(.system(size: 9, weight: .semibold))
} }
.font(ReleaseTypography.detail) .font(ReleaseTypography.detail)
.foregroundStyle(ReleaseColors.blue) .foregroundStyle(.white)
.padding(.horizontal, 10) .padding(.horizontal, 10)
.frame(height: 27) .frame(height: 30)
.background( .background(
ReleaseColors.blue.opacity(0.15), ReleaseColors.action,
in: Capsule()) in: Capsule())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
...@@ -357,13 +299,17 @@ private struct ProjectReleaseColumn: View { ...@@ -357,13 +299,17 @@ private struct ProjectReleaseColumn: View {
} }
} }
.scrollIndicators(.hidden) .scrollIndicators(.hidden)
.frame(height: 30) .frame(height: 32)
} else {
Text("请选择模块").foregroundStyle(ReleaseColors.muted)
.frame(height: 32)
} }
VStack(spacing: 0) { VStack(spacing: 0) {
HStack { HStack {
Text("实时输出 · \(paneTitle)") Text("实时输出 · \(paneTitle)")
.font(.system(size: 12, weight: .medium)) .font(.system(size: 14, weight: .medium))
.lineLimit(1)
Spacer() Spacer()
if pane.state == .running { if pane.state == .running {
Button(pane.paused ? "继续" : "暂停") { model.togglePause(pane) } Button(pane.paused ? "继续" : "暂停") { model.togglePause(pane) }
...@@ -372,7 +318,7 @@ private struct ProjectReleaseColumn: View { ...@@ -372,7 +318,7 @@ private struct ProjectReleaseColumn: View {
.disabled(pane.stopping) .disabled(pane.stopping)
} }
} }
.foregroundStyle(ReleaseColors.muted) .foregroundStyle(.white.opacity(0.9))
.padding(.horizontal, 11) .padding(.horizontal, 11)
.frame(height: 34) .frame(height: 34)
.background(ReleaseColors.surface) .background(ReleaseColors.surface)
...@@ -381,11 +327,13 @@ private struct ProjectReleaseColumn: View { ...@@ -381,11 +327,13 @@ private struct ProjectReleaseColumn: View {
? (pane.state == .queued ? "等待构建资源…" : "等待发布,命令和输出将在这里显示。") ? (pane.state == .queued ? "等待构建资源…" : "等待发布,命令和输出将在这里显示。")
: pane.log, : pane.log,
errorLine: nil, jumpRequest: 0, errorLine: nil, jumpRequest: 0,
followsOutput: pane.state == .running followsOutput: pane.state == .running, fontSize: 13
) )
.frame(height: 195) .frame(maxWidth: .infinity, maxHeight: .infinity)
.layoutPriority(1)
} }
.buttonStyle(ReleaseButtonStyle()) .buttonStyle(ReleaseButtonStyle())
.frame(maxHeight: .infinity)
.background(ReleaseColors.terminal, in: RoundedRectangle(cornerRadius: 8)) .background(ReleaseColors.terminal, in: RoundedRectangle(cornerRadius: 8))
.clipShape(RoundedRectangle(cornerRadius: 8)) .clipShape(RoundedRectangle(cornerRadius: 8))
.overlay { .overlay {
...@@ -402,27 +350,38 @@ private struct ProjectReleaseColumn: View { ...@@ -402,27 +350,38 @@ private struct ProjectReleaseColumn: View {
Text(issue).font(.caption).foregroundStyle(.red).lineLimit(2) Text(issue).font(.caption).foregroundStyle(.red).lineLimit(2)
} }
} }
}
.padding(18)
}
Button(action: { model.publish(pane) }) { Button(action: { model.publish(pane) }) {
Text("发布此项目") Text("发布此项目")
.font(.system(size: 13, weight: .semibold)) .font(.system(size: 15, weight: .medium))
.foregroundStyle(editable ? ReleaseColors.blue : ReleaseColors.muted) .foregroundStyle(
editable && !pane.modules.isEmpty ? .white : ReleaseColors.muted
)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.frame(height: 39) .frame(height: 40)
} }
.disabled(model.isRunning || pane.modules.isEmpty) .disabled(model.isRunning || pane.modules.isEmpty)
.buttonStyle(ReleaseButtonStyle()) .buttonStyle(ReleaseButtonStyle())
.overlay { .overlay {
RoundedRectangle(cornerRadius: 8) RoundedRectangle(cornerRadius: 8)
.strokeBorder(editable ? ReleaseColors.blue : ReleaseColors.border) .strokeBorder(Color.white.opacity(0.4))
.allowsHitTesting(false) .allowsHitTesting(false)
} }
.padding(.horizontal, 18)
.padding(.bottom, 18)
} }
.padding(18)
.frame(height: height) .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) .font(ReleaseTypography.body)
.popover(item: $configurationDraft) { draft in .popover(item: $configurationDraft) { draft in
ConfigurationEditor(profile: draft) { updated in ConfigurationEditor(profile: draft) { updated in
...@@ -432,6 +391,144 @@ private struct ProjectReleaseColumn: View { ...@@ -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 { private var paneTitle: String {
switch pane.state { switch pane.state {
case .idle: "等待发布" case .idle: "等待发布"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment