Skip to content

Commit c67fec6

Browse files
authored
Merge pull request #47 from cmushroom/dev
2.2.0
2 parents 5f738f6 + 8e9d4d7 commit c67fec6

33 files changed

+667
-281
lines changed

.version

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"latestVersionNum": 15,
3-
"latestVersion": "2.1.0",
2+
"latestVersionNum": 16,
3+
"latestVersion": "2.2.0",
44
"updateType": "hint",
5-
"releaseNotes": "1. 使用界面添加Key时,无法同时设置key名和value bug #43! \n2. 登录redis后修改窗标题 #41。 \n3. redis 列表拖拽排序 #35 \n4. 测试链接loading没有消失bug!"
5+
"releaseNotes": "1. 查询key 分页列表时, 总数量使用异步查询,列表快速返回 #36 \n2. 增加lua脚本执行功能。"
66
}

redis-pro.xcodeproj/project.pbxproj

+16-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
437BC24726452AE400E2C84D /* StringFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC24626452AE400E2C84D /* StringFormatter.swift */; };
6161
437BC2492645413000E2C84D /* MDoubleField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC2482645413000E2C84D /* MDoubleField.swift */; };
6262
437BC24E26461E2100E2C84D /* NumberHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC24D26461E2100E2C84D /* NumberHelper.swift */; };
63-
437BC25126467A3D00E2C84D /* SidebarFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437BC25026467A3D00E2C84D /* SidebarFooter.swift */; };
6463
437C09352649039000F1904C /* DatabasePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437C09342649039000F1904C /* DatabasePicker.swift */; };
6564
437C0937264952B300F1904C /* MTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437C0936264952B300F1904C /* MTabView.swift */; };
6665
4382203E265668CC00DA7F9E /* MLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4382203D265668CC00DA7F9E /* MLoading.swift */; };
@@ -154,6 +153,9 @@
154153
62D741B9284B776D0049AB3C /* RedisConfigStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741B8284B776D0049AB3C /* RedisConfigStore.swift */; };
155154
62D741BB284B827A0049AB3C /* SlowLogStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BA284B82790049AB3C /* SlowLogStore.swift */; };
156155
62D741BD284C66560049AB3C /* ClientListStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BC284C66560049AB3C /* ClientListStore.swift */; };
156+
62D741BF288414E00049AB3C /* LuaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741BE288414E00049AB3C /* LuaView.swift */; };
157+
62D741C1288415180049AB3C /* LuaStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741C0288415180049AB3C /* LuaStore.swift */; };
158+
62D741C3288416470049AB3C /* RedisClientLua.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D741C2288416470049AB3C /* RedisClientLua.swift */; };
157159
62E8F9D22765019D006A5326 /* MIntField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D12765019D006A5326 /* MIntField.swift */; };
158160
62E8F9D62765EC97006A5326 /* NSecureField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D52765EC97006A5326 /* NSecureField.swift */; };
159161
62E8F9D92765F197006A5326 /* MPasswordField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8F9D82765F197006A5326 /* MPasswordField.swift */; };
@@ -257,7 +259,6 @@
257259
437BC24626452AE400E2C84D /* StringFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringFormatter.swift; sourceTree = "<group>"; };
258260
437BC2482645413000E2C84D /* MDoubleField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDoubleField.swift; sourceTree = "<group>"; };
259261
437BC24D26461E2100E2C84D /* NumberHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberHelper.swift; sourceTree = "<group>"; };
260-
437BC25026467A3D00E2C84D /* SidebarFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarFooter.swift; sourceTree = "<group>"; };
261262
437C09342649039000F1904C /* DatabasePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabasePicker.swift; sourceTree = "<group>"; };
262263
437C0936264952B300F1904C /* MTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MTabView.swift; sourceTree = "<group>"; };
263264
4382203C26564D6900DA7F9E /* redis-proRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "redis-proRelease.entitlements"; sourceTree = "<group>"; };
@@ -355,6 +356,9 @@
355356
62D741B8284B776D0049AB3C /* RedisConfigStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedisConfigStore.swift; sourceTree = "<group>"; };
356357
62D741BA284B82790049AB3C /* SlowLogStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlowLogStore.swift; sourceTree = "<group>"; };
357358
62D741BC284C66560049AB3C /* ClientListStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientListStore.swift; sourceTree = "<group>"; };
359+
62D741BE288414E00049AB3C /* LuaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LuaView.swift; sourceTree = "<group>"; };
360+
62D741C0288415180049AB3C /* LuaStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LuaStore.swift; sourceTree = "<group>"; };
361+
62D741C2288416470049AB3C /* RedisClientLua.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedisClientLua.swift; sourceTree = "<group>"; };
358362
62E8F9D12765019D006A5326 /* MIntField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MIntField.swift; sourceTree = "<group>"; };
359363
62E8F9D52765EC97006A5326 /* NSecureField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSecureField.swift; sourceTree = "<group>"; };
360364
62E8F9D82765F197006A5326 /* MPasswordField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPasswordField.swift; sourceTree = "<group>"; };
@@ -585,7 +589,6 @@
585589
children = (
586590
62CB3D742619AEC20061E8C3 /* RedisKeysListView.swift */,
587591
431266CE261C4E0900FB6B69 /* RedisKeySearchRowView.swift */,
588-
437BC25026467A3D00E2C84D /* SidebarFooter.swift */,
589592
437C09342649039000F1904C /* DatabasePicker.swift */,
590593
);
591594
path = Sidebar;
@@ -638,6 +641,7 @@
638641
432A6ADE26A7C3D200F6DB64 /* RedisConfigView.swift */,
639642
43CD28B1267C6D0800E11876 /* ClientsListView.swift */,
640643
43F22EEC269ED9D500A00F97 /* SlowLogView.swift */,
644+
62D741BE288414E00049AB3C /* LuaView.swift */,
641645
);
642646
path = System;
643647
sourceTree = "<group>";
@@ -655,6 +659,7 @@
655659
620AF6C127D48923002D6895 /* RedisClientSystem.swift */,
656660
620AF6C327D48973002D6895 /* RedisClientConfig.swift */,
657661
620AF6C527D48996002D6895 /* RedisClientSlowLog.swift */,
662+
62D741C2288416470049AB3C /* RedisClientLua.swift */,
658663
);
659664
path = RedisClient;
660665
sourceTree = "<group>";
@@ -709,6 +714,7 @@
709714
62D741B8284B776D0049AB3C /* RedisConfigStore.swift */,
710715
62D741BA284B82790049AB3C /* SlowLogStore.swift */,
711716
62D741BC284C66560049AB3C /* ClientListStore.swift */,
717+
62D741C0288415180049AB3C /* LuaStore.swift */,
712718
);
713719
path = Store;
714720
sourceTree = "<group>";
@@ -954,6 +960,7 @@
954960
62D1BA93284257AA00F41CAD /* ZSetValueStore.swift in Sources */,
955961
4382204026574E3F00DA7F9E /* MSpin.swift in Sources */,
956962
626C4C622820376700B7A542 /* RedisFavoriteDefaultSelectTypeEnum.swift in Sources */,
963+
62D741C1288415180049AB3C /* LuaStore.swift in Sources */,
957964
62D741B9284B776D0049AB3C /* RedisConfigStore.swift in Sources */,
958965
62E9F13F2849DA9F00F4FABF /* SystemEnvironment.swift in Sources */,
959966
627E1BC8282FCEE300163D6B /* ScanStore.swift in Sources */,
@@ -998,7 +1005,6 @@
9981005
4314A34126243ED500053FEE /* PageBar.swift in Sources */,
9991006
62CB3D7D2619AF990061E8C3 /* RedisKeyModel.swift in Sources */,
10001007
CEF000FF2771B6640020A27E /* NTextEditor.swift in Sources */,
1001-
437BC25126467A3D00E2C84D /* SidebarFooter.swift in Sources */,
10021008
4301C86626BBF86E00C08E19 /* SSHForward.swift in Sources */,
10031009
4314A34F2625B46E00053FEE /* RediStackClient.swift in Sources */,
10041010
431266CC261C450300FB6B69 /* Tag.swift in Sources */,
@@ -1044,10 +1050,12 @@
10441050
6237D034275CFF1F000ACD6A /* NIntField.swift in Sources */,
10451051
431FD83F26BD160800151934 /* RedisConnectionTypeEnum.swift in Sources */,
10461052
4373C50125C2E75B002B700E /* BizError.swift in Sources */,
1053+
62D741BF288414E00049AB3C /* LuaView.swift in Sources */,
10471054
431266EE261D517500FB6B69 /* RedisKeyTypePicker.swift in Sources */,
10481055
62E8F9D62765EC97006A5326 /* NSecureField.swift in Sources */,
10491056
62D741BD284C66560049AB3C /* ClientListStore.swift in Sources */,
10501057
620AF6BA27D48848002D6895 /* RedisClientHash.swift in Sources */,
1058+
62D741C3288416470049AB3C /* RedisClientLua.swift in Sources */,
10511059
4314A344262546DF00053FEE /* Extensions.swift in Sources */,
10521060
43CD28782671FA2A00E11876 /* RedisInfoModel.swift in Sources */,
10531061
437BC2492645413000E2C84D /* MDoubleField.swift in Sources */,
@@ -1223,7 +1231,7 @@
12231231
CODE_SIGN_IDENTITY = "-";
12241232
CODE_SIGN_STYLE = Automatic;
12251233
COMBINE_HIDPI_IMAGES = YES;
1226-
CURRENT_PROJECT_VERSION = 15;
1234+
CURRENT_PROJECT_VERSION = 16;
12271235
DEVELOPMENT_ASSET_PATHS = "\"redis-pro/Preview Content\"";
12281236
ENABLE_PREVIEWS = YES;
12291237
INFOPLIST_FILE = "redis-pro/Info.plist";
@@ -1232,7 +1240,7 @@
12321240
"@executable_path/../Frameworks",
12331241
);
12341242
MACOSX_DEPLOYMENT_TARGET = 11.0;
1235-
MARKETING_VERSION = 2.1.0;
1243+
MARKETING_VERSION = 2.2.0;
12361244
PRODUCT_BUNDLE_IDENTIFIER = "com.cmushroom.redis-pro";
12371245
PRODUCT_NAME = "$(TARGET_NAME)";
12381246
SWIFT_VERSION = 5.0;
@@ -1248,7 +1256,7 @@
12481256
CODE_SIGN_IDENTITY = "-";
12491257
CODE_SIGN_STYLE = Automatic;
12501258
COMBINE_HIDPI_IMAGES = YES;
1251-
CURRENT_PROJECT_VERSION = 15;
1259+
CURRENT_PROJECT_VERSION = 16;
12521260
DEVELOPMENT_ASSET_PATHS = "\"redis-pro/Preview Content\"";
12531261
DEVELOPMENT_TEAM = "";
12541262
ENABLE_PREVIEWS = YES;
@@ -1258,7 +1266,7 @@
12581266
"@executable_path/../Frameworks",
12591267
);
12601268
MACOSX_DEPLOYMENT_TARGET = 11.0;
1261-
MARKETING_VERSION = 2.1.0;
1269+
MARKETING_VERSION = 2.2.0;
12621270
PRODUCT_BUNDLE_IDENTIFIER = "com.cmushroom.redis-pro";
12631271
PRODUCT_NAME = "$(TARGET_NAME)";
12641272
PROVISIONING_PROFILE_SPECIFIER = "";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<array/>
5+
</plist>

redis-pro.xcodeproj/xcuserdata/chengpan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

-98
Original file line numberDiff line numberDiff line change
@@ -3,102 +3,4 @@
33
uuid = "1F6FC20B-7A60-4E4D-9CFD-509EE3AA4D81"
44
type = "1"
55
version = "2.0">
6-
<Breakpoints>
7-
<BreakpointProxy
8-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9-
<BreakpointContent
10-
uuid = "610FCD96-2A2C-404D-8E30-3949F98E4FD2"
11-
shouldBeEnabled = "No"
12-
ignoreCount = "0"
13-
continueAfterRunningActions = "No"
14-
filePath = "redis-pro/Store/StringValueStore.swift"
15-
startingColumnNumber = "9223372036854775807"
16-
endingColumnNumber = "9223372036854775807"
17-
startingLineNumber = "70"
18-
endingLineNumber = "70"
19-
landmarkName = "unknown"
20-
landmarkType = "0">
21-
</BreakpointContent>
22-
</BreakpointProxy>
23-
<BreakpointProxy
24-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25-
<BreakpointContent
26-
uuid = "CB4A3BF5-84F0-4861-A6F9-F41050242A46"
27-
shouldBeEnabled = "No"
28-
ignoreCount = "0"
29-
continueAfterRunningActions = "No"
30-
filePath = "redis-pro/Store/AppStore.swift"
31-
startingColumnNumber = "9223372036854775807"
32-
endingColumnNumber = "9223372036854775807"
33-
startingLineNumber = "123"
34-
endingLineNumber = "123"
35-
landmarkName = "unknown"
36-
landmarkType = "0">
37-
</BreakpointContent>
38-
</BreakpointProxy>
39-
<BreakpointProxy
40-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
41-
<BreakpointContent
42-
uuid = "983436FB-5B00-4DC1-B929-0FD6A69AE09B"
43-
shouldBeEnabled = "No"
44-
ignoreCount = "0"
45-
continueAfterRunningActions = "No"
46-
filePath = "redis-pro/Views/Components/Table/NTable.swift"
47-
startingColumnNumber = "9223372036854775807"
48-
endingColumnNumber = "9223372036854775807"
49-
startingLineNumber = "316"
50-
endingLineNumber = "316"
51-
landmarkName = "tableView(_:pasteboardWriterForRow:)"
52-
landmarkType = "7">
53-
</BreakpointContent>
54-
</BreakpointProxy>
55-
<BreakpointProxy
56-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
57-
<BreakpointContent
58-
uuid = "D71B5807-CBF5-4528-8DF8-9489993BE534"
59-
shouldBeEnabled = "No"
60-
ignoreCount = "0"
61-
continueAfterRunningActions = "No"
62-
filePath = "redis-pro/Views/Components/Table/NTable.swift"
63-
startingColumnNumber = "9223372036854775807"
64-
endingColumnNumber = "9223372036854775807"
65-
startingLineNumber = "334"
66-
endingLineNumber = "334"
67-
landmarkName = "tableView(_:acceptDrop:row:dropOperation:)"
68-
landmarkType = "7">
69-
</BreakpointContent>
70-
</BreakpointProxy>
71-
<BreakpointProxy
72-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
73-
<BreakpointContent
74-
uuid = "E721C4FA-4ECF-4FB8-8912-BE9EB08B5142"
75-
shouldBeEnabled = "No"
76-
ignoreCount = "0"
77-
continueAfterRunningActions = "No"
78-
filePath = "redis-pro/Views/Components/Table/NTable.swift"
79-
startingColumnNumber = "9223372036854775807"
80-
endingColumnNumber = "9223372036854775807"
81-
startingLineNumber = "341"
82-
endingLineNumber = "341"
83-
landmarkName = "tableView(_:acceptDrop:row:dropOperation:)"
84-
landmarkType = "7">
85-
</BreakpointContent>
86-
</BreakpointProxy>
87-
<BreakpointProxy
88-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89-
<BreakpointContent
90-
uuid = "F96A3103-3387-4310-B335-10D015B02D5A"
91-
shouldBeEnabled = "No"
92-
ignoreCount = "0"
93-
continueAfterRunningActions = "No"
94-
filePath = "redis-pro/Views/Components/Table/NTable.swift"
95-
startingColumnNumber = "9223372036854775807"
96-
endingColumnNumber = "9223372036854775807"
97-
startingLineNumber = "312"
98-
endingLineNumber = "312"
99-
landmarkName = "tableView(_:pasteboardWriterForRow:)"
100-
landmarkType = "7">
101-
</BreakpointContent>
102-
</BreakpointProxy>
103-
</Breakpoints>
1046
</Bucket>

redis-pro/Common/Helpers/StringHelper.swift

+74-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class StringHelper {
1616
if text.count <= len {
1717
return text
1818
}
19-
var newText = text.substring(to: len)
19+
var newText = text.substr(to: len)
2020
newText.append("...")
2121
return newText
2222
}
@@ -30,24 +30,92 @@ class StringHelper {
3030

3131
return NSLocalizedString(template, comment: "")
3232
}
33+
34+
static func trim(_ v:String) -> String {
35+
return v.trimmingCharacters(in: .whitespacesAndNewlines)
36+
}
37+
38+
static func split(_ v:String, isTrim: Bool = true) -> [String] {
39+
return v.components(separatedBy: .whitespacesAndNewlines).map {
40+
isTrim ? self.trim($0) : $0
41+
}
42+
}
43+
44+
static func split(_ v:String) -> [String] {
45+
return split(v, isTrim: true)
46+
}
47+
48+
static func startWith(_ v:String, start: String) -> Bool {
49+
return v.hasPrefix(start)
50+
}
51+
52+
static func startWithIgnoreCase(_ v:String, start: String) -> Bool {
53+
return v.lowercased().hasPrefix(start.lowercased())
54+
}
55+
56+
57+
static func removeStart(_ v:String, start: String) -> String {
58+
guard v.hasPrefix(start) else { return v }
59+
return String(v.dropFirst(start.count))
60+
}
61+
62+
63+
static func removeStartIgnoreCase(_ v:String, start: String) -> String {
64+
guard startWithIgnoreCase(v, start: start) else { return v }
65+
return String(v.dropFirst(start.count))
66+
}
3367
}
3468

3569
extension String {
70+
var length: Int {
71+
return count
72+
}
73+
74+
75+
subscript (i: Int) -> String {
76+
return self[i ..< i + 1]
77+
}
78+
79+
subscript (r: Range<Int>) -> String {
80+
let range = Range(uncheckedBounds: (lower: max(0, min(length, r.lowerBound)),
81+
upper: min(length, max(0, r.upperBound))))
82+
let start = index(startIndex, offsetBy: range.lowerBound)
83+
let end = index(start, offsetBy: range.upperBound - range.lowerBound)
84+
return String(self[start ..< end])
85+
}
86+
87+
func indexOf(_ input: String,
88+
options: String.CompareOptions = .literal) -> String.Index? {
89+
return self.range(of: input, options: options)?.lowerBound
90+
}
91+
92+
func lastIndexOf(_ input: String) -> String.Index? {
93+
return indexOf(input, options: .backwards)
94+
}
95+
3696
func index(from: Int) -> Index {
3797
return self.index(startIndex, offsetBy: from)
3898
}
39-
40-
func substring(from: Int) -> String {
99+
100+
func substr(from: Int) -> String {
41101
let fromIndex = index(from: from)
42102
return String(self[fromIndex...])
43103
}
44-
45-
func substring(to: Int) -> String {
104+
105+
func substr(from: String.Index) -> String {
106+
return String(self[from...])
107+
}
108+
109+
func substr(to: Int) -> String {
46110
let toIndex = index(from: to)
47111
return String(self[..<toIndex])
48112
}
49113

50-
func substring(with r: Range<Int>) -> String {
114+
func substr(to: String.Index) -> String {
115+
return String(self[..<to])
116+
}
117+
118+
func substr(_ r: Range<Int>) -> String {
51119
let startIndex = index(from: r.lowerBound)
52120
let endIndex = index(from: r.upperBound)
53121
return String(self[startIndex..<endIndex])

0 commit comments

Comments
 (0)