} onClick={this.handleAddPlugin} n={this.props.n} tips={"Add a new "+this.props.data.Name}/>
{minus}
-
+
- {makeinfo(this.props.keys,this.props.selected,this.props.Cdata,this.props.n)}
+ {makeinfo(this.props.keys,this.props.selected,this.props.Cdata)}
{this.props.comments}
);
}
}
class ManagePlugins extends React.Component{
constructor(props) {
super(props);
this.handleCostChange = this.handleCostChange.bind(this);
this.handleAddPlugin = this.handleAddPlugin.bind(this);
this.handleRmvPlugin = this.handleRmvPlugin.bind(this);
this.state={
displayed:[],
varsum:{}
};
this.state.displayed.push(this.randomint());
}
handleRmvPlugin(n){
console.log("remove : "+n);
console.log(this.state.displayed);
$('#'+n.target).modal('hide');
var tmp=this.state.displayed;
tmp.splice(n.n,1);
this.setState({displayed:tmp});
console.log(this.state.displayed);
this.handleCostChange(n.n,0);
}
handleAddPlugin(n){
var tmp=this.state.displayed;
tmp.splice(n+1,0,this.randomint());
this.setState({displayed:tmp});
}
handleCostChange(n,cost) {
- console.log("here");
this.state.varsum[n]=cost;
this.props.handleCostChange(this.props.n,sum(this.state.varsum));
}
randomint(){
const tmp=this.state.displayed;
var rnd;
do {
rnd=Math.floor(Math.random() * 100);
var cont=false;
for (let i = 0; i < tmp.length ; i++) {
- if (tmp[i]==rnd){
+ if (tmp[i]===rnd){
cont=true;
}
}
} while(cont);
return rnd;
}
give_id(index){
return this.state.displayed[index]
}
give_n(){
const disp=this.state.displayed;
- // console.log(disp);
- // var n=0;
- // for (let i in disp) {
- // console.log("here");
- // if (disp[i] == true ){
- // n++;
- // }
- // }
- // console.log("n= "+n)
return disp.length
}
render() {
let show_minus = false;
if (this.give_n()>1) {
show_minus=true;
}
return(
{(index) => }
);}
}
class PluginsMain extends React.Component {
constructor(props) {
super(props);
this.handleCostChange = this.handleCostChange.bind(this);
this.state={'varsum':{}};
}
handleCostChange(name,e) {
// console.log("name"+name);
this.state.varsum[name]=e;
this.props.TotalCost(sum(this.state.varsum));
}
render() {
return(
{(index) => }
);
}
}
// ---------------------
// ---------------------
class Main extends React.Component {
constructor(props) {
super(props);
this.handleCostChange = this.handleCostChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
this.state={'total':0,'prevtotal':0};
+ this.input = React.createRef();
}
handleCostChange(total) {
// console.log("there total : "+total )
- if (this.state.prevtotal != total){
+ if (this.state.prevtotal !== total){
// console.log("updated :"+total);
// console.log("prev :"+this.state.prevtotal);
this.setState({'total':total});
this.setState({'prevtotal':total});
}
}
+ handleSubmit(event) {
+ alert('A name was submitted: ');
+ console.log(event);
+ event.preventDefault();
+ //console.log(this.input)
+ var json = toJSONString(this.input);
+ console.log(json);
+ }
render() {
return(
-
);
}
}
// ---------------------
// ---------------------
ReactDOM.render(
,document.getElementById('root'));
-$(document).ready(function(){
- $('[data-toggle="popover"]').popover();
-});
+
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
-$('.popover-dismiss').popover({
- trigger: 'focus'
-});
diff --git a/js/data.js b/js/data.js
index 3a06132..4aaa975 100644
--- a/js/data.js
+++ b/js/data.js
@@ -1,333 +1,347 @@
// Providers
// ----------------------------------------------------
// ----------------------------------------------------
// Storage
const NasEpfl = {
Style: "AmountRatesCost",
Provider : "EPFL-VPSI",
Name:'NAS',
Url : [
{Name:'VPSI-Website',Url:'https://support.epfl.ch/help/epfl?id=epfl_service_status&service=49a363acdb34c700ef64731b8c96191f'}
],
AmountName: "Amount",
AmountUnit: "TB",
AmountMin : 1,
AmountMax : 100,
AmountStep : 1,
AmountFree:1,
AmountFreeCumulative:false,
RateVar : true,
RateName : 'Performance',
Rates : {
'Collaborative': 165,
'On-line archive': 110,
'Raw': 55
},
RateUnit : "CHF / TB"
};
const SwitchEpfl = {
Style : 'CategoryCost',
Provider : "Switch-EPFL",
Name:'Online Storage',
Url : [
{Name:'Switch Website',Url:'https://drive.switch.ch/'}
],
CatName:'Options',
Cat:{
'Cloud Based max 50GB':0,
},
CatUnit:'CHF',
};
const GoogleDriveEdu = {
Style : 'CategoryCost',
Provider : "Google Drive Educ",
Name:'Online Storage',
Url : [
{Name :'Google Education Page',Url:'https://edu.google.com/?modal_active=none'}
],
CatName:'Options',
Cat:{
'Cloud Based illimited':0,
},
CatUnit:'CHF',
};
// ELN
const SLIMSEpfl = {
Style:'CategoryAmountRatesCost',
Provider : "EPFL-LSIS",
Name:'SLIMS',
Url : [
{Name:'SLIMS on LSIS Website',Url:'https://lsis.epfl.ch/page-140284-en.html'},
{Name:'SLIMS Cost on LSIS Website',Url:'https://lsis.epfl.ch/cms/site/lsis/lang/en/lims'},
{Name: 'Genohm (SLIMS Company)',Url:'https://www.genohm.com/'}
],
CatName:'PI Status',
Cat:{
'Full Professor':3000,
'Associate Professor':2000,
'Tenure Track Assistant Professor or Core Facility':1000
},
CatUnit:'CHF',
AmountName: "Storage",
AmountUnit: "TB",
AmountMin : 1,
AmountMax : 100,
AmountStep : 1,
AmountFree:0,
AmountFreeCumulative:false,
RateVar : true,
RateName: 'ELN Storage',
Rates : {
'Stored on EPFL Server': 300,
},
RateUnit : "CHF / TB"
};
// Database
const MysqlEpfl = {
Style : 'CategoryCost',
Provider : "EPFL-VPSI",
Name:'MySql',
Url : [
{Name:'EPFL VPSI ',Url:'https://support.epfl.ch/epfl?id=epfl_service_status&service=eb026fa0db34c700ef64731b8c96198e'}
],
CatName:'Options',
Cat:{
'MySQL max 2GB':0,
},
CatUnit:'CHF',
};
// Repository
const Zenodo = {
Style : 'CategoryCost',
Provider : "Zenodo-CERN",
Name:'Zenodo',
Url : [
{Name:'Zenodo Website',Url:'https://www.zenodo.org/'},
{Name:'About Zenodo',Url:'http://about.zenodo.org/'},
],
CatName:'Options',
Cat:{
'Max 50GB per Dataset':0,
},
CatUnit:'CHF',
};
const C4science = {
Style : 'CategoryCost',
Provider : "EPFL-SCITAS",
Name:'C4Science',
Url : [
{Name:'C4Science Website',Url:'https://www.c4science.ch/'}
],
CatName:'Options',
Cat:{
'Free for text file':0,
},
CatUnit:'CHF',
};
const Github = {
Style: "AmountRatesCost",
Provider : "GitHub",
Name:'GitHub',
Url : [
{Name:'Github Website Pricing',Url:'https://github.com/pricing'}
],
AmountName: "Number of user",
AmountUnit: "User(s)",
AmountMin : 1,
AmountMax : 100,
AmountStep : 1,
AmountFree:0,
AmountFreeCumulative:false,
RateVar : true,
RateName:'Plan',
Rates:{
'OpenSource project':0,
'Developer (for one user)':81.6,
'Team (min 5 users)':104.9,
'Business Cloud':244.7
},
RateUnit:'CHF / Users',
};
const Bitbucket= {
Style: "AmountRatesCost",
Provider : "Bitbucket",
Name:'BitBucket',
Url : [
{Name:'Bitbucket Website Pricing',Url:'https://bitbucket.org/product/pricing'}
],
AmountName: "Number of user",
AmountUnit: "User(s)",
AmountMin : 1,
AmountMax : 100,
AmountStep : 1,
AmountFree:0,
AmountFreeCumulative:false,
RateVar : true,
RateName:'Plan',
Rates:{
'Free (up to 5 users)':0,
'Standard for growing teams (min 5 users)':24,
'Premium for large teams (min 5 users)':60,
},
RateUnit:'CHF / Users',
};
const Gitlab= {
Style: "AmountRatesCost",
Provider : "Gitlab",
Name:'Gitlab',
Url : [
{Name:'Gitlab Website Pricing',Url:'https://about.gitlab.com/pricing/'}
],
AmountName: "Number of user",
AmountUnit: "User(s)",
AmountMin : 1,
AmountMax : 100,
AmountStep : 1,
AmountFree:0,
AmountFreeCumulative:false,
RateVar : true,
RateName:'Plan',
Rates:{
'Core Self Hosted':0,
'Free Cloud Based' : 0,
'Starter Self Hosted':48,
'Bronze Cloud based':48,
'Premium Self Hosted':228,
'Silver Cloud Based':228
},
RateUnit:'CHF / Users',
};
const Figshare = {
Style : 'CategoryCost',
Provider : "FigShare",
Name:'Figshare',
Url : [
{Name:'Figshare website',Url:'https://figshare.com/'},
{Name:'Figshare Pricing',Url:'https://www.g2crowd.com/products/figshare/pricing'}
],
CatName:'Options',
Cat:{
'Free 1GB':0,
'10GB':96,
'15GB':132,
'20GB':180
},
CatUnit:'CHF',
};
const Dryad = {
Style : 'CategoryAmountRatesCost',
Provider : "Dryad",
Name:'Dyrad',
Url : [
{Name:'Dryad Website Pricing',Url:'https://Datadryad.org/pages/payment'}
],
CatName:'Options',
Cat:{
'up to 20GB if DPC covered':0,
'up to 20GB if no DPC covered':120
},
CatUnit:'CHF',
AmountName: "Extra - Storage",
AmountUnit: "GB",
AmountMin : 0,
AmountMax : 100,
AmountStep : 10,
AmountFree:0,
AmountFreeCumulative:false,
RateVar : true,
RateName: 'ELN Storage',
Rates : {
'Extra Storage': 50,
},
RateUnit : "CHF / GB"
};
-// Categories definition
+
+
+// System variable definition
// ----------------------------------------------------
// ----------------------------------------------------
const NoneSelected={
Style: 'NoneSelect',
Provider:'None',
Name:'Select a Provider',
Url:'',
};
+const UserCostSelect={
+ Style : 'UserCost',
+ Provider:'Provide your own provider',
+ Name:'',
+ Url:'',
+};
+
+// Categories definition
+// ----------------------------------------------------
+// ----------------------------------------------------
const storage={
Name : 'Active Storage',
Icon : 'storage.png',
Url : [
{Name:'EPFL RDM',Url:'https://researchData.epfl.ch/work-with-Data/storage/'}
],
Intro :'',
Data :[NoneSelected,
NasEpfl,
SwitchEpfl,
- GoogleDriveEdu
+ GoogleDriveEdu,
+ UserCostSelect,
]
};
const ELN={
Name : 'Electronic LabBook',
Icon : 'eln.png',
Url : [
{Name: 'EPFL RDM',Url:'https://researchData.epfl.ch/work-with-Data/active-Data-management/'}
],
Intro :'',
Data :[NoneSelected,
SLIMSEpfl,
-
+ UserCostSelect,
]
};
const Database={
Name : 'Database',
Icon : 'database.png',
Url : '',
Intro :'',
Data :[NoneSelected,
MysqlEpfl,
-
+ UserCostSelect,
]
};
const repository={
Name : 'Repository',
Icon : 'repos.png',
Url : [
{Name:'EPFL RDM WebPage',Url:'https://researchData.epfl.ch/publish-preserve/'}
],
Intro :'',
Data :[
NoneSelected,
Zenodo,
C4science,
Github,
Bitbucket,
Gitlab,
Figshare,
Dryad,
+ UserCostSelect,
]
};
// Combine Categories
// ----------------------------------------------------
// ----------------------------------------------------
const MainData={
Currency:'CHF',
Data:[storage,ELN,Database,repository]
};