diff --git a/.gitignore b/.gitignore index cf4de6a..54e68fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,14 @@ -# Created by https://www.gitignore.io/api/xcode,cocoapods +# Created by https://www.gitignore.io/api/xcode,swift,objective-c +# Edit at https://www.gitignore.io/?templates=xcode,swift,objective-c -### CocoaPods ### -## CocoaPods GitIgnore Template - -# CocoaPods - Only use to conserve bandwidth / Save time on Pushing -# - Also handy if you have a lage number of dependant pods -# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGONRE THE LOCK FILE -Pods/ -Podfile.lock - -### Xcode ### +### Objective-C ### # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore ## Build generated -Build/ -Index/ +build/ DerivedData/ ## Various settings @@ -36,11 +27,127 @@ xcuserdata/ *.xccheckout *.xcscmblueprint +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Objective-C Patch ### + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated + +## Various settings + +## Other + +## Obj-C/Swift specific + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + + +### Xcode ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) + ### Xcode Patch ### *.xcodeproj/* !*.xcodeproj/project.pbxproj !*.xcodeproj/xcshareddata/ !*.xcworkspace/contents.xcworkspacedata /*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.gitignore.io/api/xcode,swift,objective-c -# End of https://www.gitignore.io/api/xcode,cocoapods +.DS_Store +Index \ No newline at end of file diff --git a/README.md b/README.md index 996e311..e971be7 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ ### Version -**1.1 Beta** +**1.1.1 Beta** -**1.0 Beta** +~~**1.1 Beta**~~ + +~~**1.0 Beta**~~ ### 功能 @@ -26,9 +28,12 @@ - OpenLog 清空并开启Log日志 - 双击行复制SQL语句到剪贴板 -### TODO +### TODO & DONE -- [ ] 表格自动换行并自适应列表行高 (看心情吧emmmmmmmmmmmmm) +- [x] ~~表格自动换行并自适应列表行高~~ +- [x] 增加表格 SQL 字段的宽度,横向滚动 +- [x] 新增完整 SQL 语句预览功能(实际上就是丢到另一个文本框 emmmm ) +- [ ] 暂未发现还有啥要修改的地方 emmmmmm ## Author @@ -41,6 +46,7 @@ Blog : [https://www.virzz.com](https://www.virzz.com) - 2018-02-17 重构程序,移除Pods,使用OC+libmysqlclient + 重写了下连接mysql的模块、通过OC调用系统libmysqlclient(😂😂😂😂😂)优化了下查询语句 - 2017-12-12 重构程序,使用Pods +- 2019-01-26 不知道写啥了,反正就是更新了,任性 ## License diff --git a/vMysqlMonitoring/Base.lproj/Main.storyboard b/vMysqlMonitoring/Base.lproj/Main.storyboard index 9b445db..4ab60bf 100644 --- a/vMysqlMonitoring/Base.lproj/Main.storyboard +++ b/vMysqlMonitoring/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -24,7 +24,7 @@ - + @@ -46,31 +46,31 @@ - + - - + + - + - + - - + + - + @@ -78,13 +78,15 @@ - + - - - - + + + + + + @@ -94,6 +96,11 @@ + + + + + @@ -107,26 +114,28 @@ - + - + - + - + - - - + + + + + @@ -137,6 +146,11 @@ + + + + + @@ -149,13 +163,14 @@ + - - + @@ -176,7 +191,7 @@ - + @@ -192,7 +207,7 @@ - + @@ -208,7 +223,7 @@ - + @@ -224,7 +239,7 @@ - + @@ -240,7 +255,7 @@ - + @@ -249,6 +264,15 @@ + + + + + + + + + @@ -259,6 +283,7 @@ + @@ -338,7 +363,7 @@ - + diff --git a/vMysqlMonitoring/Info.plist b/vMysqlMonitoring/Info.plist index 5fe1298..c124c5a 100644 --- a/vMysqlMonitoring/Info.plist +++ b/vMysqlMonitoring/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1 Beta + 1.1.1 Beta CFBundleVersion - 31 + 47 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/vMysqlMonitoring/ViewController.swift b/vMysqlMonitoring/ViewController.swift index 32a8474..6a34f1a 100644 --- a/vMysqlMonitoring/ViewController.swift +++ b/vMysqlMonitoring/ViewController.swift @@ -8,13 +8,14 @@ import Cocoa -let __VERSION__ = "Ver 1.1 Beta" +let __VERSION__ = "Ver 1.1.1 Beta" class ViewController: NSViewController { @IBOutlet weak var TableView: NSTableView! @IBOutlet weak var mainMenu: NSMenu! @IBOutlet weak var filterTextField: NSTextField! + @IBOutlet weak var previewTextField: NSTextField! @IBOutlet weak var dbHost: NSTextField! @IBOutlet weak var dbPort: NSTextField! @@ -99,7 +100,8 @@ class ViewController: NSViewController { for row in rows { VLog(msg: row) let _r = row as! NSMutableArray - originalData.append(["vtime":_r[0],"vsql":_r[1]]) + let t:Array = (_r[0] as! String).components(separatedBy: ".") + originalData.append(["vtime":t[0],"vsql":_r[1]]) } self.original_filter = originalData self.listData = originalData @@ -111,6 +113,15 @@ class ViewController: NSViewController { self.view.window?.makeFirstResponder(self.filterTextField) } + @IBAction func showInPreview(_ sender:Any){ + let row = self.TableView.selectedRow + if row<0 { + return + } + let msg = self.listData[row].value(forKey: "vsql") + self.previewTextField.stringValue = msg as! String + } + @IBAction func copyTableData(_ sender: Any){ let row = self.TableView.selectedRow if row<0 {