Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
e71cfa7e
Commit
e71cfa7e
authored
Apr 11, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functionality to login component
parent
ebd028f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
12 deletions
+55
-12
login.component.html
Breeze.UI/src/app/login/login.component.html
+18
-6
login.component.ts
Breeze.UI/src/app/login/login.component.ts
+36
-5
setup.component.html
Breeze.UI/src/app/setup/setup.component.html
+1
-1
No files found.
Breeze.UI/src/app/login/login.component.html
View file @
e71cfa7e
<h1>
Welcome back
</h1>
<
p>
Please enter your password to decrypt your wallet
</p
>
<form
(
ngSubmit
)="
onSubmit
()"
#
passwordForm=
"ngForm"
>
<
div
*
ngIf=
"hasWallet"
>
<p>
Choose the wallet you want to open:
</p
>
<div
class=
"form-group"
>
<label
for=
"password"
>
Your password:
</label>
<input
type=
"password"
class=
"form-control"
id=
"password"
required
name=
"password"
>
<label
for=
"walletLabel"
>
Wallet to open:
</label>
<select
name=
"wallet"
#
walletName
>
<option
*
ngFor=
"let wallet of wallets"
>
{{wallet}}
</option>
</select>
</div>
<button
type=
"submit"
class=
"btn btn-success"
>
Decrypt
</button>
</form>
\ No newline at end of file
<p>
Please enter your password to decrypt your wallet
</p>
<form
(
ngSubmit
)="
onSubmit
()"
#
passwordForm=
"ngForm"
>
<div
class=
"form-group"
>
<label
for=
"password"
>
Your password:
</label>
<input
type=
"password"
class=
"form-control"
id=
"password"
required
name=
"password"
>
</div>
<button
type=
"submit"
class=
"btn btn-success"
>
Decrypt
</button>
</form>
<p></p>
</div>
<p>
If you like to create or restore a wallet please click the button below.
</p>
<button
type=
"button"
(
click
)="
clickedCreate
()"
class=
"btn btn-success"
>
Create or restore wallet
</button>
\ No newline at end of file
Breeze.UI/src/app/login/login.component.ts
View file @
e71cfa7e
...
...
@@ -10,26 +10,53 @@ import { WalletLoad } from '../shared/wallet-load';
})
export
class
LoginComponent
implements
OnInit
{
constructor
(
private
apiService
:
ApiService
,
private
router
:
Router
)
{
}
private
walletLoad
:
WalletLoad
;
private
hasWallet
:
boolean
=
false
;
private
wallets
:
[
any
];
private
walletPath
:
string
;
private
responseMessage
:
any
;
private
errorMessage
:
any
;
private
walletLoad
:
WalletLoad
;
ngOnInit
()
{
this
.
apiService
.
getWalletFiles
()
.
subscribe
(
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
this
.
responseMessage
=
response
;
this
.
wallets
=
response
.
json
().
walletsFiles
;
this
.
walletPath
=
response
.
json
().
walletsPath
;
console
.
log
(
this
.
wallets
);
if
(
this
.
wallets
.
length
>
0
)
{
this
.
hasWallet
=
true
;
}
}
},
error
=>
{
this
.
errorMessage
=
<
any
>
error
;
if
(
error
.
status
>=
400
)
{
alert
(
this
.
errorMessage
);
console
.
log
(
this
.
errorMessage
);
}
}
);
}
private
onSubmit
()
{
this
.
walletLoad
=
new
WalletLoad
();
this
.
walletLoad
.
password
=
"
123
"
;
this
.
walletLoad
.
name
=
"
tes
t"
this
.
walletLoad
.
folderPath
=
"
folderPath
"
this
.
walletLoad
.
password
=
"
test
"
;
this
.
walletLoad
.
name
=
"
myFirstWalle
t"
this
.
walletLoad
.
folderPath
=
"
/home/dev0tion/Desktop/Wallets
"
this
.
apiService
.
loadWallet
(
this
.
walletLoad
)
.
subscribe
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
this
.
responseMessage
=
response
;
this
.
router
.
navigate
[
'/wallet'
]
this
.
router
.
navigate
([
'/wallet'
]);
}
},
error
=>
{
...
...
@@ -41,4 +68,8 @@ export class LoginComponent implements OnInit {
}
);
}
private
clickedCreate
()
{
this
.
router
.
navigate
([
'/setup'
]);
}
}
\ No newline at end of file
Breeze.UI/src/app/setup/setup.component.html
View file @
e71cfa7e
<h1>
Welcome to Breeze.
Looks like you're new here.
</h1>
<h1>
Welcome to Breeze.
</h1>
<p>
If you haven't used Breeze before, please create a new wallet.
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment