|
@@ -127,11 +127,48 @@
|
|
|
[section addFormRow:row];
|
|
|
}
|
|
|
|
|
|
- // Section CAPABILITIES -------------------------------------------------
|
|
|
+ // Section DIAGNOSTICS -------------------------------------------------
|
|
|
|
|
|
section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_diagnostics_", nil)];
|
|
|
[form addFormSection:section];
|
|
|
|
|
|
+ NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
+ NSString *logFile = [documentPath stringByAppendingPathComponent:@"communication.log"];
|
|
|
+
|
|
|
+ if ([[NSFileManager defaultManager] fileExistsAtPath:logFile]) {
|
|
|
+
|
|
|
+ row = [XLFormRowDescriptor formRowDescriptorWithTag:@"log" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"Log", nil)];
|
|
|
+ row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundCell;
|
|
|
+ [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
|
|
|
+ [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
|
|
|
+ [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
|
|
|
+ [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"capabilities"] width:50 height:50 color:NCBrandColor.sharedInstance.icon] forKey:@"imageView.image"];
|
|
|
+ row.action.formBlock = ^(XLFormRowDescriptor * sender) {
|
|
|
+
|
|
|
+ [self deselectFormRow:sender];
|
|
|
+
|
|
|
+ NCViewerQuickLook *viewerQuickLook = [NCViewerQuickLook new];
|
|
|
+ [viewerQuickLook quickLookWithUrl:[NSURL fileURLWithPath:logFile] viewController:self];
|
|
|
+ };
|
|
|
+ [section addFormRow:row];
|
|
|
+
|
|
|
+ row = [XLFormRowDescriptor formRowDescriptorWithTag:@"clearlog" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"Clear Log", nil)];
|
|
|
+ row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundCell;
|
|
|
+ [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
|
|
|
+ [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
|
|
|
+ [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
|
|
|
+ [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"capabilities"] width:50 height:50 color:NCBrandColor.sharedInstance.icon] forKey:@"imageView.image"];
|
|
|
+ row.action.formBlock = ^(XLFormRowDescriptor * sender) {
|
|
|
+
|
|
|
+ [self deselectFormRow:sender];
|
|
|
+
|
|
|
+ [[NCCommunicationCommon shared] clearFileLog];
|
|
|
+ [[NCCommunicationCommon shared] writeLog:@"[LOG] Start session"];
|
|
|
+ };
|
|
|
+ [section addFormRow:row];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"capabilities" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_capabilities_", nil)];
|
|
|
row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundCell;
|
|
|
[row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
|