new tests
This commit is contained in:
+27
-1
@@ -9,6 +9,7 @@ extension Notification.Name {
|
||||
struct DBSynApp: App {
|
||||
@StateObject private var model = DatabaseModel()
|
||||
@AppStorage("preferences.appearance") private var appearance = "system"
|
||||
@State private var showingMigrationGenerator = false
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup("DBSyn") {
|
||||
@@ -21,6 +22,7 @@ struct DBSynApp: App {
|
||||
}
|
||||
}
|
||||
.environmentObject(model)
|
||||
.sheet(isPresented: $showingMigrationGenerator) { LaravelMigrationView(model: model) }
|
||||
.frame(minWidth: 800, minHeight: 520)
|
||||
}
|
||||
.defaultSize(width: 1200, height: 800)
|
||||
@@ -38,6 +40,9 @@ struct DBSynApp: App {
|
||||
}
|
||||
}
|
||||
WorkbenchFileCommands(model: model)
|
||||
CommandMenu("Tools") {
|
||||
Button("Generate Laravel Migration…") { showingMigrationGenerator = true }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +122,9 @@ struct WorkbenchSettingsView: View {
|
||||
@AppStorage("preferences.appearance")
|
||||
private var appearance = "system"
|
||||
|
||||
@AppStorage("preferences.migrationFilenamePrefix")
|
||||
private var migrationFilenamePrefix = "create"
|
||||
|
||||
var body: some View {
|
||||
TabView {
|
||||
|
||||
@@ -144,6 +152,9 @@ struct WorkbenchSettingsView: View {
|
||||
)
|
||||
}
|
||||
|
||||
migrationSettings
|
||||
.tabItem { Label("Laravel", systemImage: "curlybraces") }
|
||||
|
||||
generalSettings
|
||||
.tabItem {
|
||||
Label(
|
||||
@@ -152,10 +163,25 @@ struct WorkbenchSettingsView: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
.frame(width: 620, height: 390)
|
||||
.frame(width: 760, height: 480)
|
||||
.preferredColorScheme(appearance == "dark" ? .dark : appearance == "light" ? .light : nil)
|
||||
}
|
||||
|
||||
private var migrationSettings: some View {
|
||||
settingsPage("Laravel & Developer Tools") {
|
||||
Text("Generate Laravel migrations from a connected MySQL table or an imported CREATE TABLE SQL file.")
|
||||
.foregroundStyle(.secondary)
|
||||
settingsRow("Filename prefix") {
|
||||
TextField("create", text: $migrationFilenamePrefix)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
}
|
||||
Text("Open Tools → Generate Laravel Migration to preview, edit and save the generated PHP file.")
|
||||
.font(.callout).foregroundStyle(.secondary)
|
||||
Text("Generated migrations must be reviewed before execution. DBSyn never executes generated PHP.")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
private var editorSettings: some View {
|
||||
settingsPage("SQL Editor") {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user