Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
eResearch
sails-hook-redbox-labarchives
Commits
ba3d887a
Commit
ba3d887a
authored
Feb 01, 2019
by
Moises Sacal
Browse files
added host info to be displayed at the login page
parent
548f357c
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
angular/labarchives/dist/main.bundle.js
View file @
ba3d887a
This diff is collapsed.
Click to expand it.
angular/labarchives/src/app/components/labarchives-login.component.ts
View file @
ba3d887a
...
@@ -27,6 +27,7 @@ export class LabarchivesLoginField extends FieldBase<any> {
...
@@ -27,6 +27,7 @@ export class LabarchivesLoginField extends FieldBase<any> {
submitted
=
false
;
submitted
=
false
;
errorMessage
:
string
=
undefined
;
errorMessage
:
string
=
undefined
;
closeLabel
:
string
;
closeLabel
:
string
;
location
:
string
;
user
:
any
;
user
:
any
;
loggedIn
:
boolean
;
loggedIn
:
boolean
;
...
@@ -67,6 +68,8 @@ export class LabarchivesLoginField extends FieldBase<any> {
...
@@ -67,6 +68,8 @@ export class LabarchivesLoginField extends FieldBase<any> {
const
userInfo
=
await
this
.
labarchivesService
.
getUserInfo
();
const
userInfo
=
await
this
.
labarchivesService
.
getUserInfo
();
const
user
=
userInfo
[
'
user
'
];
const
user
=
userInfo
[
'
user
'
];
this
.
userEmail
=
user
[
'
email
'
];
this
.
userEmail
=
user
[
'
email
'
];
const
info
=
await
this
.
labarchivesService
.
info
();
this
.
location
=
info
[
'
location
'
];
}
}
async
login
(
form
)
{
async
login
(
form
)
{
...
@@ -144,6 +147,7 @@ export class LabarchivesLoginField extends FieldBase<any> {
...
@@ -144,6 +147,7 @@ export class LabarchivesLoginField extends FieldBase<any> {
<div *ngIf="!field.loggedIn" class="col-md-6">
<div *ngIf="!field.loggedIn" class="col-md-6">
<div class="form-row">
<div class="form-row">
<p>{{ field.helpLoginLabel }}</p>
<p>{{ field.helpLoginLabel }}</p>
<p><a href="{{ field.location }}" target="_blank" rel="noopener noreferrer">{{ field.location }}</a></p>
<ul>
<ul>
<li *ngFor="let help of field.helpLoginLabelList">{{ help }}</li>
<li *ngFor="let help of field.helpLoginLabelList">{{ help }}</li>
</ul>
</ul>
...
...
angular/labarchives/src/app/labarchives.service.ts
View file @
ba3d887a
...
@@ -34,6 +34,19 @@ export class LabarchivesService extends BaseService {
...
@@ -34,6 +34,19 @@ export class LabarchivesService extends BaseService {
}
}
}
}
public
async
info
()
{
const
wsUrl
=
this
.
brandingAndPortalUrl
+
'
/ws/labarchives/info
'
;
try
{
const
result
=
await
this
.
http
.
get
(
wsUrl
,
this
.
options
).
toPromise
();
return
Promise
.
resolve
(
this
.
extractData
(
result
));
}
catch
(
e
)
{
return
Promise
.
reject
(
new
Error
(
e
));
}
}
public
async
login
(
username
,
password
)
{
public
async
login
(
username
,
password
)
{
const
wsUrl
=
this
.
brandingAndPortalUrl
+
'
/ws/labarchives/login
'
;
const
wsUrl
=
this
.
brandingAndPortalUrl
+
'
/ws/labarchives/login
'
;
try
{
try
{
...
...
api/controllers/LabarchivesController.js
View file @
ba3d887a
...
@@ -11,6 +11,7 @@ var Controllers;
...
@@ -11,6 +11,7 @@ var Controllers;
constructor
()
{
constructor
()
{
super
();
super
();
this
.
_exportedMethods
=
[
this
.
_exportedMethods
=
[
'
info
'
,
'
login
'
,
'
login
'
,
'
link
'
,
'
link
'
,
'
checkLink
'
,
'
checkLink
'
,
...
@@ -18,6 +19,10 @@ var Controllers;
...
@@ -18,6 +19,10 @@ var Controllers;
];
];
this
.
config
=
new
Config_1
.
Config
(
sails
.
config
.
workspaces
);
this
.
config
=
new
Config_1
.
Config
(
sails
.
config
.
workspaces
);
}
}
info
(
req
,
res
)
{
this
.
config
.
brandingAndPortalUrl
=
BrandingService
.
getFullPath
(
req
);
this
.
ajaxOk
(
req
,
res
,
null
,
{
location
:
this
.
config
.
location
,
status
:
true
});
}
login
(
req
,
res
)
{
login
(
req
,
res
)
{
const
user
=
{
const
user
=
{
username
:
req
.
param
(
'
username
'
),
username
:
req
.
param
(
'
username
'
),
...
...
index.js
View file @
ba3d887a
...
@@ -56,6 +56,7 @@ module.exports = function (sails) {
...
@@ -56,6 +56,7 @@ module.exports = function (sails) {
routes
:
{
routes
:
{
before
:
{},
before
:
{},
after
:
{
after
:
{
'
get /:branding/:portal/ws/labarchives/info
'
:
LabarchivesController
.
info
,
'
get /:branding/:portal/ws/labarchives/list
'
:
LabarchivesController
.
list
,
'
get /:branding/:portal/ws/labarchives/list
'
:
LabarchivesController
.
list
,
'
post /:branding/:portal/ws/labarchives/login
'
:
LabarchivesController
.
login
,
'
post /:branding/:portal/ws/labarchives/login
'
:
LabarchivesController
.
login
,
'
post /:branding/:portal/ws/labarchives/link
'
:
LabarchivesController
.
link
,
'
post /:branding/:portal/ws/labarchives/link
'
:
LabarchivesController
.
link
,
...
...
typescript/api/controllers/LabarchivesController.ts
View file @
ba3d887a
...
@@ -22,6 +22,7 @@ export module Controllers {
...
@@ -22,6 +22,7 @@ export module Controllers {
export
class
LabarchivesController
extends
controller
.
Controllers
.
Core
.
Controller
{
export
class
LabarchivesController
extends
controller
.
Controllers
.
Core
.
Controller
{
protected
_exportedMethods
:
any
=
[
protected
_exportedMethods
:
any
=
[
'
info
'
,
'
login
'
,
'
login
'
,
'
link
'
,
'
link
'
,
'
checkLink
'
,
'
checkLink
'
,
...
@@ -36,6 +37,11 @@ export module Controllers {
...
@@ -36,6 +37,11 @@ export module Controllers {
this
.
config
=
new
Config
(
sails
.
config
.
workspaces
);
this
.
config
=
new
Config
(
sails
.
config
.
workspaces
);
}
}
public
info
(
req
,
res
)
{
this
.
config
.
brandingAndPortalUrl
=
BrandingService
.
getFullPath
(
req
);
this
.
ajaxOk
(
req
,
res
,
null
,
{
location
:
this
.
config
.
location
,
status
:
true
});
}
login
(
req
,
res
)
{
login
(
req
,
res
)
{
const
user
=
{
const
user
=
{
username
:
req
.
param
(
'
username
'
),
username
:
req
.
param
(
'
username
'
),
...
...
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