Skip to content

Commit

Permalink
make metric file configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
karacolada committed Feb 28, 2024
1 parent b1e760e commit 7e680a8
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions simpleclient/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
$fuji_server = 'http://localhost:1071/fuji/api/v1/evaluate';
$fuji_username = 'marvel';
$fuji_password = 'wonderwoman';
$metric_version = "metrics_v0.7_software"; #"metrics_v0.7_software_cessda"; #"metrics_v0.5"; #"metrics_v0.7_software";
#$metric_version = "metrics_v0.7_software"; #"metrics_v0.7_software_cessda"; #"metrics_v0.5"; #"metrics_v0.7_software";
$usegithub = true;
################################################################

Expand Down Expand Up @@ -83,7 +83,14 @@
$input_service_type = $_POST['service_type'];
}
}
if(isset($_POST['metric_version'])){
$input_metric_version=$_POST['metric_version'];
}else{
$input_metric_version="metrics_v0.7_software";
}

$allowed_service_types = array('oai_pmh'=>'OAI-PMH','ogc_csw'=>'OGC CSW', 'sparql'=>'SPARQL');
$allowed_metric_versions = array('metrics_v0.7_software'=>'software-agnostic', 'metrics_v0.7_software_cessda'=>'software-CESSDA')

?>
<div class="container">
Expand Down Expand Up @@ -136,7 +143,20 @@
</select>
</div>
<div class="row align-items-end">
<div class="col">
<div class="col-8">
<label for="metric_version" class="col-form-label-sm">Metric version:</label>
<select class="form-select form-select-sm" name="metric_version" id="metric_version">
<?php
foreach($allowed_metric_versions as $mk=> $mv){
if ($mk == $input_metric_version)
echo '<option value ="'.$mk.'" selected>'.$mv.'</option>';
else
echo '<option value ="'.$mk.'">'.$mv.'</option>';
}
?>
</select>
</div>
<div class="col-4">
<?php
$usedatacite_checked = ' checked';
if ($usedatacite == false)
Expand Down Expand Up @@ -174,7 +194,7 @@
$message->test_debug = true;
$message->use_datacite = $usedatacite;
$message->use_github = $usegithub;
$message->metric_version = $metric_version;
$message->metric_version = $input_metric_version;
$post = json_encode($message);

$username = $fuji_username;
Expand Down

0 comments on commit 7e680a8

Please sign in to comment.