cleanup , header & logo
This commit is contained in:
+7
-93
@@ -7,7 +7,7 @@
|
||||
(______)(___/(____)(_)\_)
|
||||
By Nike
|
||||
|
||||
This file is part of EIC implementation of SPARC.
|
||||
This file is part of P42 implementation of SPARC.
|
||||
* @category MyEic
|
||||
* @subcategory Libraries
|
||||
* @extends User
|
||||
@@ -101,7 +101,10 @@ class myUser extends app.LoadedClasses.User {
|
||||
email: 'info@nicsys.eu'
|
||||
};
|
||||
this.roles = ['admin']
|
||||
return
|
||||
this.isAuthenticated = true
|
||||
console.log('Will call callback...', callBack)
|
||||
callBack();
|
||||
/*
|
||||
|
||||
fetch(app.config.userLib.authEndpoint+'?'+crypto.randomUUID(),{
|
||||
headers: headers,
|
||||
@@ -146,7 +149,8 @@ class myUser extends app.LoadedClasses.User {
|
||||
.catch((err) => {
|
||||
console.error('Server error calling authorizer checkAuthenticated (Network error)',err);
|
||||
document.location.href = '/eulogin-error.html';
|
||||
});
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,25 +159,6 @@ class myUser extends app.LoadedClasses.User {
|
||||
*/
|
||||
getMessageBusUserInfo() { return(this.identity.uuid) }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} objects An array of URI to be checked
|
||||
* @param {*} role
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getBusinessPermissions(objects, role) {
|
||||
let requestedObjects = { resources: objects }
|
||||
let uri = app.config.userLib.resourcePermissionsEndpoint.replace('{id}', this.identity.uuid);
|
||||
|
||||
// This is just to make use of the whole base model request mechanism (especially for the 401 flow)
|
||||
let fakeModel = new EICModel(null, null)
|
||||
return(
|
||||
fakeModel.request(uri, 'POST', requestedObjects)
|
||||
.then( async serverData => {
|
||||
return(serverData.payload)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -198,77 +183,6 @@ class myUser extends app.LoadedClasses.User {
|
||||
document.location.href = this.authUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
startKeepAlive() {
|
||||
if((!app.config.userLib.keepAliveSeconds) || this.KALtimer) return
|
||||
this.KALtimer = setInterval(this.doKeepAlive.bind(this), 1000*app.config.userLib.keepAliveSeconds)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
stopKeepAlive() {
|
||||
if(this.KALtimer) clearInterval(this.KALtimer)
|
||||
this.KALtimer = null
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
doKeepAlive() {
|
||||
this.checkAuthenticated(()=>{
|
||||
// KAL was successfull... do we care ?
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isVIP(){
|
||||
if(Array.isArray(this.platformRestrictions.allowedRoles)){
|
||||
let intersect = this.roles.filter(r => (this.platformRestrictions.allowedRoles.includes(r)) )
|
||||
if(intersect.length>0) return(true)
|
||||
}
|
||||
if((Array.isArray(this.platformRestrictions.allowedUUIDs)) &&
|
||||
(this.platformRestrictions.allowedUUIDs.includes(this.identity.uuid))){
|
||||
return(true)
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo should be handled by an external view
|
||||
*/
|
||||
ShowCurtain() {
|
||||
let link = document.createElement("link");
|
||||
link.rel='stylesheet'
|
||||
link.type='text/css'
|
||||
link.href='/app/thirdparty/eicui/eicui-2.0.css'
|
||||
document.head.appendChild(link)
|
||||
|
||||
let style = document.createElement('style')
|
||||
style.innerHTML = ` .maintenance{ width: 40vw!important; text-align: center; margin: auto!important; } `
|
||||
document.head.appendChild(style)
|
||||
|
||||
let content = document.createElement('div')
|
||||
content.innerHTML = `
|
||||
<article class="maintenance" eiccard="" aria-enabled="true" >
|
||||
<header><h1>Maintenance</h1></header>
|
||||
<section>
|
||||
<alert eicalert="" danger="">
|
||||
The site is currently under maintenance.</br>
|
||||
Please come back later.
|
||||
</alert>
|
||||
</section>
|
||||
</article>
|
||||
`
|
||||
document.body.appendChild(content)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} info
|
||||
|
||||
Reference in New Issue
Block a user