Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-console
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Larrosa
web-console
Commits
43415c9f
Commit
43415c9f
authored
May 27, 2022
by
ajlarrosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avances
parent
5c116707
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
592 additions
and
16769 deletions
+592
-16769
config.yaml
conf/config.yaml
+1
-1
ssh-web-console.exe
ssh-web-console.exe
+0
-0
.eslintcache
web/.eslintcache
+1
-1
package-lock.json
web/package-lock.json
+0
-16653
Signin.tsx
web/src/components/Signin.tsx
+56
-2
yarn.lock
web/yarn.lock
+534
-112
No files found.
conf/config.yaml
View file @
43415c9f
ssh-web-console.exe
View file @
43415c9f
No preview for this file type
web/.eslintcache
View file @
43415c9f
This diff is collapsed.
Click to expand it.
web/package-lock.json
deleted
100644 → 0
View file @
5c116707
This diff is collapsed.
Click to expand it.
web/src/components/Signin.tsx
View file @
43415c9f
...
@@ -10,13 +10,20 @@ import apiRouters from '../config/api_routers';
...
@@ -10,13 +10,20 @@ import apiRouters from '../config/api_routers';
const
Signin
=
(
props
:
RouteComponentProps
)
=>
{
const
Signin
=
(
props
:
RouteComponentProps
)
=>
{
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
window
.
addEventListener
(
'message'
,
(
event
)
=>
{
window
.
addEventListener
(
'message'
,
(
event
)
=>
{
const
baseUrl
=
process
.
env
.
REACT_APP_CLUSTER_URL
as
string
;
console
.
log
(
event
.
origin
);
console
.
log
(
process
.
env
.
REACT_APP_CLUSTER_URL
);
console
.
log
(
'-----'
);
console
.
log
(
!
event
.
origin
.
includes
(
baseUrl
));
console
.
log
(
'-----'
);
console
.
log
(
event
.
data
);
console
.
log
(
'-----'
);
if
(
!
event
.
origin
.
includes
(
process
.
env
.
REACT_APP_CLUSTER_URL
!
))
return
;
if
(
!
event
.
origin
.
includes
(
process
.
env
.
REACT_APP_CLUSTER_URL
!
))
return
;
doSignin
(
event
.
data
);
doSignin
(
event
.
data
);
});
});
},
[]);
},
[]);
const
{
t
}
=
useTranslation
([
'signin'
]);
const
{
t
}
=
useTranslation
([
'signin'
]);
const
doSignin
=
(
data
:
Record
<
string
,
string
>
)
=>
{
const
doSignin
=
(
data
:
Record
<
string
,
string
>
)
=>
{
Utils
.
axiosInstance
Utils
.
axiosInstance
.
post
(
Utils
.
loadUrl
(
apiRouters
.
router
.
sign_in
,
null
),
{
.
post
(
Utils
.
loadUrl
(
apiRouters
.
router
.
sign_in
,
null
),
{
...
@@ -26,22 +33,47 @@ const Signin = (props: RouteComponentProps) => {
...
@@ -26,22 +33,47 @@ const Signin = (props: RouteComponentProps) => {
passwd
:
data
.
password
,
passwd
:
data
.
password
,
})
})
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
console
.
log
(
response
);
try
{
try
{
if
(
!
response
.
data
||
response
.
data
.
has_error
)
{
if
(
!
response
.
data
||
response
.
data
.
has_error
)
{
switch
(
response
.
data
.
message
)
{
switch
(
response
.
data
.
message
)
{
case
0
:
case
0
:
console
.
log
(
t
(
'signin:form_has_error'
));
toaster
.
danger
(
t
(
'signin:form_has_error'
));
toaster
.
danger
(
t
(
'signin:form_has_error'
));
break
;
break
;
case
1
:
case
1
:
console
.
log
(
t
(
'signin:form_error_passport'
));
toaster
.
danger
(
t
(
'signin:form_error_passport'
));
toaster
.
danger
(
t
(
'signin:form_error_passport'
));
break
;
break
;
case
2
:
case
2
:
console
.
log
(
t
(
'signin:form_error_ssh_login'
));
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
));
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
));
break
;
break
;
}
}
if
(
window
&&
window
.
parent
)
{
console
.
log
(
'Send Message has error'
);
window
.
parent
.
postMessage
(
{
message
:
'close'
,
},
'*'
,
);
}
props
.
history
.
push
(
'/'
);
}
else
{
}
else
{
if
(
!
response
.
data
.
addition
)
{
if
(
!
response
.
data
.
addition
)
{
toaster
.
danger
(
t
(
'signin:form_error_remote_server'
));
toaster
.
danger
(
t
(
'signin:form_error_remote_server'
));
if
(
window
&&
window
.
parent
)
{
console
.
log
(
'Send Message Else'
);
window
.
parent
.
postMessage
(
{
message
:
'close'
,
},
'*'
,
);
}
props
.
history
.
push
(
'/'
);
}
else
{
}
else
{
toaster
.
success
(
t
(
'signin:signin_success'
));
toaster
.
success
(
t
(
'signin:signin_success'
));
localStorage
.
setItem
(
'user.host'
,
data
.
host
);
localStorage
.
setItem
(
'user.host'
,
data
.
host
);
...
@@ -55,11 +87,33 @@ const Signin = (props: RouteComponentProps) => {
...
@@ -55,11 +87,33 @@ const Signin = (props: RouteComponentProps) => {
}
}
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
));
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
));
if
(
window
&&
window
.
parent
)
{
console
.
log
(
'Send Message Error 1'
);
window
.
parent
.
postMessage
(
{
message
:
'close'
,
},
'*'
,
);
}
props
.
history
.
push
(
'/'
);
}
}
})
})
.
catch
((
e
:
Error
)
=>
{
.
catch
((
e
:
Error
)
=>
{
console
.
log
(
e
.
message
);
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
)
+
': '
+
e
.
message
);
toaster
.
danger
(
t
(
'signin:form_error_ssh_login'
)
+
': '
+
e
.
message
);
if
(
window
&&
window
.
parent
)
{
console
.
log
(
'Send Message Error 2'
);
window
.
parent
.
postMessage
(
{
message
:
'close'
,
},
'*'
,
);
}
props
.
history
.
push
(
'/'
);
});
});
};
};
...
@@ -74,7 +128,7 @@ const Signin = (props: RouteComponentProps) => {
...
@@ -74,7 +128,7 @@ const Signin = (props: RouteComponentProps) => {
<
Heading
marginBottom=
"0.6rem"
marginTop=
"0.6rem"
size=
{
700
}
>
<
Heading
marginBottom=
"0.6rem"
marginTop=
"0.6rem"
size=
{
700
}
>
{
t
(
'signin:form_title'
)
}
{
t
(
'signin:form_title'
)
}
</
Heading
>
</
Heading
>
<
span
>
Waiting for loging
</
span
>
<
span
>
Waiting for loging
- Test 8
</
span
>
!
</
div
>
</
div
>
</
Pane
>
</
Pane
>
);
);
...
...
web/yarn.lock
View file @
43415c9f
This diff is collapsed.
Click to expand it.
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