Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
eResearch
sails-hook-redbox-labarchives
Commits
ba3d887a
Commit
ba3d887a
authored
Feb 01, 2019
by
Moises Sacal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added host info to be displayed at the login page
parent
548f357c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
1 deletion
+30
-1
angular/labarchives/dist/main.bundle.js
angular/labarchives/dist/main.bundle.js
+1
-1
angular/labarchives/src/app/components/labarchives-login.component.ts
...rchives/src/app/components/labarchives-login.component.ts
+4
-0
angular/labarchives/src/app/labarchives.service.ts
angular/labarchives/src/app/labarchives.service.ts
+13
-0
api/controllers/LabarchivesController.js
api/controllers/LabarchivesController.js
+5
-0
index.js
index.js
+1
-0
typescript/api/controllers/LabarchivesController.ts
typescript/api/controllers/LabarchivesController.ts
+6
-0
No files found.
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> {
submitted
=
false
;
errorMessage
:
string
=
undefined
;
closeLabel
:
string
;
location
:
string
;
user
:
any
;
loggedIn
:
boolean
;
...
...
@@ -67,6 +68,8 @@ export class LabarchivesLoginField extends FieldBase<any> {
const
userInfo
=
await
this
.
labarchivesService
.
getUserInfo
();
const
user
=
userInfo
[
'
user
'
];
this
.
userEmail
=
user
[
'
email
'
];
const
info
=
await
this
.
labarchivesService
.
info
();
this
.
location
=
info
[
'
location
'
];
}
async
login
(
form
)
{
...
...
@@ -144,6 +147,7 @@ export class LabarchivesLoginField extends FieldBase<any> {
<div *ngIf="!field.loggedIn" class="col-md-6">
<div class="form-row">
<p>{{ field.helpLoginLabel }}</p>
<p><a href="{{ field.location }}" target="_blank" rel="noopener noreferrer">{{ field.location }}</a></p>
<ul>
<li *ngFor="let help of field.helpLoginLabelList">{{ help }}</li>
</ul>
...
...
angular/labarchives/src/app/labarchives.service.ts
View file @
ba3d887a
...
...
@@ -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
)
{
const
wsUrl
=
this
.
brandingAndPortalUrl
+
'
/ws/labarchives/login
'
;
try
{
...
...
api/controllers/LabarchivesController.js
View file @
ba3d887a
...
...
@@ -11,6 +11,7 @@ var Controllers;
constructor
()
{
super
();
this
.
_exportedMethods
=
[
'
info
'
,
'
login
'
,
'
link
'
,
'
checkLink
'
,
...
...
@@ -18,6 +19,10 @@ var Controllers;
];
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
)
{
const
user
=
{
username
:
req
.
param
(
'
username
'
),
...
...
index.js
View file @
ba3d887a
...
...
@@ -56,6 +56,7 @@ module.exports = function (sails) {
routes
:
{
before
:
{},
after
:
{
'
get /:branding/:portal/ws/labarchives/info
'
:
LabarchivesController
.
info
,
'
get /:branding/:portal/ws/labarchives/list
'
:
LabarchivesController
.
list
,
'
post /:branding/:portal/ws/labarchives/login
'
:
LabarchivesController
.
login
,
'
post /:branding/:portal/ws/labarchives/link
'
:
LabarchivesController
.
link
,
...
...
typescript/api/controllers/LabarchivesController.ts
View file @
ba3d887a
...
...
@@ -22,6 +22,7 @@ export module Controllers {
export
class
LabarchivesController
extends
controller
.
Controllers
.
Core
.
Controller
{
protected
_exportedMethods
:
any
=
[
'
info
'
,
'
login
'
,
'
link
'
,
'
checkLink
'
,
...
...
@@ -36,6 +37,11 @@ export module Controllers {
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
)
{
const
user
=
{
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