1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-24 22:42:28 +00:00

Add initial support for http git clone with authentification

This commit is contained in:
2025-01-13 17:59:08 +01:00
parent 46145241fc
commit 6ac11e2da7
12 changed files with 187 additions and 54 deletions

View File

@ -23,7 +23,7 @@ Page {
visible: folderModel.count == 0
Text {
text: i18n.tr("No password found<br>You can import a password store zip in the settings")
text: i18n.tr("No password found<br>You can import a password store by cloning or importing a zip in the settings")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter

View File

@ -28,7 +28,7 @@ Page {
}
Text {
id: repoUrlLabe
id: repoUrlLabel
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
@ -37,12 +37,29 @@ Page {
}
TextField {
id: textFieldInput
id: repoUrlInput
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
placeholderText: i18n.tr('Git repo url')
}
Text {
id: repoPasswordLabel
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
text: i18n.tr('Password')
}
TextField {
id: repoPasswordInput
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
echoMode: TextInput.Password
}
Button {
@ -51,7 +68,13 @@ Page {
width: parent.width
text: i18n.tr('Clone')
onClicked: {
var ret = Git.clone(textFieldInput.text, Pass.password_store);
var ret = false;
if(repoPasswordInput.text === "") {
ret = Git.clone_http(repoUrlInput.text, Pass.password_store);
} else {
ret = Git.clone_http_pass(repoUrlInput.text, Pass.password_store, repoPasswordInput.text);
}
if (ret)
PopupUtils.open(dialogImportGitCloneSuccess);
else