mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 20:43:20 +08:00
@ -311,6 +311,7 @@ setup:
|
|||||||
keyEditors:
|
keyEditors:
|
||||||
public: Invalid Public Key - Doesn't start with ssh-rsa
|
public: Invalid Public Key - Doesn't start with ssh-rsa
|
||||||
private: Invalid Private Key
|
private: Invalid Private Key
|
||||||
|
load: Load from File
|
||||||
sshKey:
|
sshKey:
|
||||||
generate: Generating SSH Key
|
generate: Generating SSH Key
|
||||||
title: In order to access this repository, this public key must be copied as a deploy key
|
title: In order to access this repository, this public key must be copied as a deploy key
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
- version: "1.71"
|
- version: "1.71"
|
||||||
draft: true
|
draft: true
|
||||||
|
improvements:
|
||||||
|
- text: "Allow SSH Keys to be loaded from the FS - #74"
|
||||||
|
image: ssh_key_file.jpeg
|
||||||
bugs:
|
bugs:
|
||||||
- text: "Dark Theme: Render checkboxes in a lighter color"
|
- text: "Dark Theme: Render checkboxes in a lighter color"
|
||||||
- text: "Fix Relative Parent links not working - #256"
|
- text: "Fix Relative Parent links not working - #256"
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
|
||||||
|
import 'package:gitjournal/utils/logger.dart';
|
||||||
|
|
||||||
class PublicKeyEditor extends StatelessWidget {
|
class PublicKeyEditor extends StatelessWidget {
|
||||||
final Key formKey;
|
final Key formKey;
|
||||||
@ -74,18 +79,45 @@ class KeyEditor extends StatelessWidget {
|
|||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
);
|
);
|
||||||
|
|
||||||
return SizedBox(
|
var screenSize = MediaQuery.of(context).size;
|
||||||
width: double.infinity,
|
|
||||||
height: 80.0,
|
return Column(
|
||||||
child: Container(
|
children: [
|
||||||
color: Theme.of(context).buttonColor,
|
Container(
|
||||||
child: SingleChildScrollView(
|
constraints: BoxConstraints(
|
||||||
child: Container(
|
maxHeight: screenSize.height / 4,
|
||||||
padding: const EdgeInsets.all(8.0),
|
),
|
||||||
child: form,
|
color: Theme.of(context).buttonColor,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: form,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
OutlineButton(
|
||||||
|
child: Text(tr("setup.keyEditors.load")),
|
||||||
|
onPressed: _pickAndLoadFile,
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _pickAndLoadFile() async {
|
||||||
|
var result = await FilePicker.platform.pickFiles();
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
var file = File(result.files.single.path);
|
||||||
|
try {
|
||||||
|
var data = await file.readAsString();
|
||||||
|
textEditingController.text = data.trim();
|
||||||
|
} catch (e, stackTrace) {
|
||||||
|
Log.e(
|
||||||
|
"Open File for importing SSH Key",
|
||||||
|
ex: e,
|
||||||
|
stacktrace: stackTrace,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0-nullsafety.2"
|
version: "6.0.0-nullsafety.2"
|
||||||
|
file_picker:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: file_picker
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.6"
|
||||||
fimber:
|
fimber:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -58,6 +58,7 @@ dependencies:
|
|||||||
timeago: ^2.0.27
|
timeago: ^2.0.27
|
||||||
multicast_dns: ^0.2.2
|
multicast_dns: ^0.2.2
|
||||||
bonsoir: ^0.1.2+2
|
bonsoir: ^0.1.2+2
|
||||||
|
file_picker: ^2.0.6
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_launcher_icons: "^0.7.2"
|
flutter_launcher_icons: "^0.7.2"
|
||||||
|
Reference in New Issue
Block a user