minor label fix for the space used information and fix for the username whose quota must be retrieved when profile page is shown
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@142496 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
57baa7a957
commit
51fdce6b35
|
@ -376,7 +376,7 @@ public class StatisticsPanel extends Composite {
|
||||||
Button quotaStorageValue = new Button();
|
Button quotaStorageValue = new Button();
|
||||||
quotaStorageValue.setType(ButtonType.LINK);
|
quotaStorageValue.setType(ButtonType.LINK);
|
||||||
quotaStorageValue.setText(decimalFormat + "%");
|
quotaStorageValue.setText(decimalFormat + "%");
|
||||||
quotaStorageValue.setTitle("You are currently using " + NumberFormat.getFormat("#.##").format(current) + "MB out of " + max + "MB in the Infrastructure Storage");
|
quotaStorageValue.setTitle("Currently using " + NumberFormat.getFormat("#.##").format(current) + "MB of " + max + "MB assigned in the Infrastructure Storage");
|
||||||
storage.appendToPanel(quotaStorageValue);
|
storage.appendToPanel(quotaStorageValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,23 +85,20 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
if(quotaServiceBaseUrl != null){
|
if(quotaServiceBaseUrl != null){
|
||||||
|
|
||||||
userName = ServerUtils.getCurrentUser(this.getThreadLocalRequest()).getUsername();
|
userName = ServerUtils.getCurrentUser(this.getThreadLocalRequest()).getUsername();
|
||||||
|
quotaOfUser = userName;
|
||||||
// do not show quota info to other users
|
|
||||||
|
// check the user's quota to be shown
|
||||||
if(userid != null && !userid.equals(userName))
|
if(userid != null && !userid.equals(userName))
|
||||||
quotaOfUser = userid;
|
quotaOfUser = userid;
|
||||||
|
|
||||||
quotaOfUser = userName;
|
|
||||||
logger.debug("Fetching info for quota of user " + quotaOfUser);
|
logger.debug("Fetching info for quota of user " + quotaOfUser);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
UserInfrastructureQuotaStorageCache cache = UserInfrastructureQuotaStorageCache.getCacheInstance();
|
UserInfrastructureQuotaStorageCache cache = UserInfrastructureQuotaStorageCache.getCacheInstance();
|
||||||
|
|
||||||
if(cache.get(quotaOfUser) != null)
|
if(cache.get(quotaOfUser) != null)
|
||||||
toReturn = cache.get(quotaOfUser);
|
toReturn = cache.get(quotaOfUser);
|
||||||
else{
|
else{
|
||||||
|
|
||||||
// ask the service ...
|
|
||||||
PortalContext pContext = PortalContext.getConfiguration();
|
PortalContext pContext = PortalContext.getConfiguration();
|
||||||
String rootContextToken = pContext.getCurrentUserToken("/" + pContext.getInfrastructureName(), quotaOfUser);
|
String rootContextToken = pContext.getCurrentUserToken("/" + pContext.getInfrastructureName(), quotaOfUser);
|
||||||
URL request = new URL(quotaServiceBaseUrl + "?timeinterval=FOREVER&gcube-token=" + rootContextToken);
|
URL request = new URL(quotaServiceBaseUrl + "?timeinterval=FOREVER&gcube-token=" + rootContextToken);
|
||||||
|
|
Loading…
Reference in New Issue