Skip to content

Commit

Permalink
Merge pull request #47 from cmushroom/dev
Browse files Browse the repository at this point in the history
2.2.0
  • Loading branch information
chengpan168 committed Jul 31, 2022
2 parents 5f738f6 + 8e9d4d7 commit c67fec6
Show file tree
Hide file tree
Showing 33 changed files with 667 additions and 281 deletions.
6 changes: 3 additions & 3 deletions .version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"latestVersionNum": 15,
"latestVersion": "2.1.0",
"latestVersionNum": 16,
"latestVersion": "2.2.0",
"updateType": "hint",
"releaseNotes": "1. 使用界面添加Key时,无法同时设置key名和value bug #43! \n2. 登录redis后修改窗标题 #41。 \n3. redis 列表拖拽排序 #35 \n4. 测试链接loading没有消失bug!"
"releaseNotes": "1. 查询key 分页列表时, 总数量使用异步查询,列表快速返回 #36 \n2. 增加lua脚本执行功能。"
}
24 changes: 16 additions & 8 deletions redis-pro.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
437BC24726452AE400E2C84D /* StringFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC24626452AE400E2C84D /* StringFormatter.swift */; };
437BC2492645413000E2C84D /* MDoubleField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC2482645413000E2C84D /* MDoubleField.swift */; };
437BC24E26461E2100E2C84D /* NumberHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC24D26461E2100E2C84D /* NumberHelper.swift */; };
437BC25126467A3D00E2C84D /* SidebarFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC25026467A3D00E2C84D /* SidebarFooter.swift */; };
437C09352649039000F1904C /* DatabasePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437C09342649039000F1904C /* DatabasePicker.swift */; };
437C0937264952B300F1904C /* MTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437C0936264952B300F1904C /* MTabView.swift */; };
4382203E265668CC00DA7F9E /* MLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4382203D265668CC00DA7F9E /* MLoading.swift */; };
Expand Down Expand Up @@ -154,6 +153,9 @@
62D741B9284B776D0049AB3C /* RedisConfigStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741B8284B776D0049AB3C /* RedisConfigStore.swift */; };
62D741BB284B827A0049AB3C /* SlowLogStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BA284B82790049AB3C /* SlowLogStore.swift */; };
62D741BD284C66560049AB3C /* ClientListStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BC284C66560049AB3C /* ClientListStore.swift */; };
62D741BF288414E00049AB3C /* LuaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BE288414E00049AB3C /* LuaView.swift */; };
62D741C1288415180049AB3C /* LuaStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741C0288415180049AB3C /* LuaStore.swift */; };
62D741C3288416470049AB3C /* RedisClientLua.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741C2288416470049AB3C /* RedisClientLua.swift */; };
62E8F9D22765019D006A5326 /* MIntField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D12765019D006A5326 /* MIntField.swift */; };
62E8F9D62765EC97006A5326 /* NSecureField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D52765EC97006A5326 /* NSecureField.swift */; };
62E8F9D92765F197006A5326 /* MPasswordField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D82765F197006A5326 /* MPasswordField.swift */; };
Expand Down Expand Up @@ -257,7 +259,6 @@
437BC24626452AE400E2C84D /* StringFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringFormatter.swift; sourceTree = "<group>"; };
437BC2482645413000E2C84D /* MDoubleField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDoubleField.swift; sourceTree = "<group>"; };
437BC24D26461E2100E2C84D /* NumberHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberHelper.swift; sourceTree = "<group>"; };
437BC25026467A3D00E2C84D /* SidebarFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarFooter.swift; sourceTree = "<group>"; };
437C09342649039000F1904C /* DatabasePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabasePicker.swift; sourceTree = "<group>"; };
437C0936264952B300F1904C /* MTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MTabView.swift; sourceTree = "<group>"; };
4382203C26564D6900DA7F9E /* redis-proRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "redis-proRelease.entitlements"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -355,6 +356,9 @@
62D741B8284B776D0049AB3C /* RedisConfigStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedisConfigStore.swift; sourceTree = "<group>"; };
62D741BA284B82790049AB3C /* SlowLogStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlowLogStore.swift; sourceTree = "<group>"; };
62D741BC284C66560049AB3C /* ClientListStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientListStore.swift; sourceTree = "<group>"; };
62D741BE288414E00049AB3C /* LuaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LuaView.swift; sourceTree = "<group>"; };
62D741C0288415180049AB3C /* LuaStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LuaStore.swift; sourceTree = "<group>"; };
62D741C2288416470049AB3C /* RedisClientLua.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedisClientLua.swift; sourceTree = "<group>"; };
62E8F9D12765019D006A5326 /* MIntField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MIntField.swift; sourceTree = "<group>"; };
62E8F9D52765EC97006A5326 /* NSecureField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSecureField.swift; sourceTree = "<group>"; };
62E8F9D82765F197006A5326 /* MPasswordField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPasswordField.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -585,7 +589,6 @@
children = (
62CB3D742619AEC20061E8C3 /* RedisKeysListView.swift */,
431266CE261C4E0900FB6B69 /* RedisKeySearchRowView.swift */,
437BC25026467A3D00E2C84D /* SidebarFooter.swift */,
437C09342649039000F1904C /* DatabasePicker.swift */,
);
path = Sidebar;
Expand Down Expand Up @@ -638,6 +641,7 @@
432A6ADE26A7C3D200F6DB64 /* RedisConfigView.swift */,
43CD28B1267C6D0800E11876 /* ClientsListView.swift */,
43F22EEC269ED9D500A00F97 /* SlowLogView.swift */,
62D741BE288414E00049AB3C /* LuaView.swift */,
);
path = System;
sourceTree = "<group>";
Expand All @@ -655,6 +659,7 @@
620AF6C127D48923002D6895 /* RedisClientSystem.swift */,
620AF6C327D48973002D6895 /* RedisClientConfig.swift */,
620AF6C527D48996002D6895 /* RedisClientSlowLog.swift */,
62D741C2288416470049AB3C /* RedisClientLua.swift */,
);
path = RedisClient;
sourceTree = "<group>";
Expand Down Expand Up @@ -709,6 +714,7 @@
62D741B8284B776D0049AB3C /* RedisConfigStore.swift */,
62D741BA284B82790049AB3C /* SlowLogStore.swift */,
62D741BC284C66560049AB3C /* ClientListStore.swift */,
62D741C0288415180049AB3C /* LuaStore.swift */,
);
path = Store;
sourceTree = "<group>";
Expand Down Expand Up @@ -954,6 +960,7 @@
62D1BA93284257AA00F41CAD /* ZSetValueStore.swift in Sources */,
4382204026574E3F00DA7F9E /* MSpin.swift in Sources */,
626C4C622820376700B7A542 /* RedisFavoriteDefaultSelectTypeEnum.swift in Sources */,
62D741C1288415180049AB3C /* LuaStore.swift in Sources */,
62D741B9284B776D0049AB3C /* RedisConfigStore.swift in Sources */,
62E9F13F2849DA9F00F4FABF /* SystemEnvironment.swift in Sources */,
627E1BC8282FCEE300163D6B /* ScanStore.swift in Sources */,
Expand Down Expand Up @@ -998,7 +1005,6 @@
4314A34126243ED500053FEE /* PageBar.swift in Sources */,
62CB3D7D2619AF990061E8C3 /* RedisKeyModel.swift in Sources */,
CEF000FF2771B6640020A27E /* NTextEditor.swift in Sources */,
437BC25126467A3D00E2C84D /* SidebarFooter.swift in Sources */,
4301C86626BBF86E00C08E19 /* SSHForward.swift in Sources */,
4314A34F2625B46E00053FEE /* RediStackClient.swift in Sources */,
431266CC261C450300FB6B69 /* Tag.swift in Sources */,
Expand Down Expand Up @@ -1044,10 +1050,12 @@
6237D034275CFF1F000ACD6A /* NIntField.swift in Sources */,
431FD83F26BD160800151934 /* RedisConnectionTypeEnum.swift in Sources */,
4373C50125C2E75B002B700E /* BizError.swift in Sources */,
62D741BF288414E00049AB3C /* LuaView.swift in Sources */,
431266EE261D517500FB6B69 /* RedisKeyTypePicker.swift in Sources */,
62E8F9D62765EC97006A5326 /* NSecureField.swift in Sources */,
62D741BD284C66560049AB3C /* ClientListStore.swift in Sources */,
620AF6BA27D48848002D6895 /* RedisClientHash.swift in Sources */,
62D741C3288416470049AB3C /* RedisClientLua.swift in Sources */,
4314A344262546DF00053FEE /* Extensions.swift in Sources */,
43CD28782671FA2A00E11876 /* RedisInfoModel.swift in Sources */,
437BC2492645413000E2C84D /* MDoubleField.swift in Sources */,
Expand Down Expand Up @@ -1223,7 +1231,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_ASSET_PATHS = "\"redis-pro/Preview Content\"";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = "redis-pro/Info.plist";
Expand All @@ -1232,7 +1240,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.cmushroom.redis-pro";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1248,7 +1256,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_ASSET_PATHS = "\"redis-pro/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
Expand All @@ -1258,7 +1266,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.cmushroom.redis-pro";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http:https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,102 +3,4 @@
uuid = "1F6FC20B-7A60-4E4D-9CFD-509EE3AA4D81"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "610FCD96-2A2C-404D-8E30-3949F98E4FD2"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Store/StringValueStore.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "70"
endingLineNumber = "70"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "CB4A3BF5-84F0-4861-A6F9-F41050242A46"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Store/AppStore.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "123"
endingLineNumber = "123"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "983436FB-5B00-4DC1-B929-0FD6A69AE09B"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Views/Components/Table/NTable.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "316"
endingLineNumber = "316"
landmarkName = "tableView(_:pasteboardWriterForRow:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D71B5807-CBF5-4528-8DF8-9489993BE534"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Views/Components/Table/NTable.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "334"
endingLineNumber = "334"
landmarkName = "tableView(_:acceptDrop:row:dropOperation:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E721C4FA-4ECF-4FB8-8912-BE9EB08B5142"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Views/Components/Table/NTable.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "341"
endingLineNumber = "341"
landmarkName = "tableView(_:acceptDrop:row:dropOperation:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F96A3103-3387-4310-B335-10D015B02D5A"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Views/Components/Table/NTable.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "312"
endingLineNumber = "312"
landmarkName = "tableView(_:pasteboardWriterForRow:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
80 changes: 74 additions & 6 deletions redis-pro/Common/Helpers/StringHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StringHelper {
if text.count <= len {
return text
}
var newText = text.substring(to: len)
var newText = text.substr(to: len)
newText.append("...")
return newText
}
Expand All @@ -30,24 +30,92 @@ class StringHelper {

return NSLocalizedString(template, comment: "")
}

static func trim(_ v:String) -> String {
return v.trimmingCharacters(in: .whitespacesAndNewlines)
}

static func split(_ v:String, isTrim: Bool = true) -> [String] {
return v.components(separatedBy: .whitespacesAndNewlines).map {
isTrim ? self.trim($0) : $0
}
}

static func split(_ v:String) -> [String] {
return split(v, isTrim: true)
}

static func startWith(_ v:String, start: String) -> Bool {
return v.hasPrefix(start)
}

static func startWithIgnoreCase(_ v:String, start: String) -> Bool {
return v.lowercased().hasPrefix(start.lowercased())
}


static func removeStart(_ v:String, start: String) -> String {
guard v.hasPrefix(start) else { return v }
return String(v.dropFirst(start.count))
}


static func removeStartIgnoreCase(_ v:String, start: String) -> String {
guard startWithIgnoreCase(v, start: start) else { return v }
return String(v.dropFirst(start.count))
}
}

extension String {
var length: Int {
return count
}


subscript (i: Int) -> String {
return self[i ..< i + 1]
}

subscript (r: Range<Int>) -> String {
let range = Range(uncheckedBounds: (lower: max(0, min(length, r.lowerBound)),
upper: min(length, max(0, r.upperBound))))
let start = index(startIndex, offsetBy: range.lowerBound)
let end = index(start, offsetBy: range.upperBound - range.lowerBound)
return String(self[start ..< end])
}

func indexOf(_ input: String,
options: String.CompareOptions = .literal) -> String.Index? {
return self.range(of: input, options: options)?.lowerBound
}

func lastIndexOf(_ input: String) -> String.Index? {
return indexOf(input, options: .backwards)
}

func index(from: Int) -> Index {
return self.index(startIndex, offsetBy: from)
}

func substring(from: Int) -> String {
func substr(from: Int) -> String {
let fromIndex = index(from: from)
return String(self[fromIndex...])
}

func substring(to: Int) -> String {

func substr(from: String.Index) -> String {
return String(self[from...])
}

func substr(to: Int) -> String {
let toIndex = index(from: to)
return String(self[..<toIndex])
}

func substring(with r: Range<Int>) -> String {
func substr(to: String.Index) -> String {
return String(self[..<to])
}

func substr(_ r: Range<Int>) -> String {
let startIndex = index(from: r.lowerBound)
let endIndex = index(from: r.upperBound)
return String(self[startIndex..<endIndex])
Expand Down
Loading

0 comments on commit c67fec6

Please sign in to comment.