Skip to content

Commit

Permalink
Minor code changes for LOCKSS mockup
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondap committed Feb 1, 2024
1 parent f190810 commit 3aaabee
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
48 changes: 30 additions & 18 deletions server/views/job/uploads.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ <h2>Upload Targets</h2>
// Hide first radio and btnCreate
$('#createAUSpinner').show()
setTimeout(function() {
//var newAUID =
$('#createAUSpinner').hide()
newAUID = `AU-${Math.floor(Math.random() * 10000)}`
$('#addToAU').val(newAUID)
$('#btnLookupAU').hide()
$('#newAUDiv').hide()
$('#lookupSpan').show()
}, 1200)
}
function showHideLookup() {
Expand All @@ -45,28 +50,35 @@ <h2>Upload Targets</h2>

<div class="form-check mt-5 mb-5">
<p>You're sending this bag to one or more LOCKSS services.</p>

<div id="newAUDiv">
<input type="radio" name="auOption" id="newAU" onchange="showHideCreate()"/>
<label for="newAU">Create a new archival unit for this bag.</label>
<span id="createSpan" class="mr-3" style="display:none"><button type="button" role="button" id="btnCreateAU" onclick="createNewAU">Create New AU</button></span>
<span id="createSpan" class="mr-3" style="display:none">
<button class="btn button-primary" type="button" role="button" id="btnCreateAU" onclick="createNewAU()">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create New AU
</button>
</span>
</div>


<div class="spinner-border" role="status" id="createAUSpinner" style="display:none">
<span class="sr-only">Loading...</span>
<div id="existingAUDiv">
<input type="radio" name="auOption" id="existingAU" onchange="showHideLookup()"/>
<label for="existingAU">Add this bag to an existing archival unit.</label>
<span id="lookupSpan" class="mr-3" style="display:none">
<input list="auids" id="addToAU" name="addToAU" />
<datalist id="auids">
<option value="AU-001"></option>
<option value="AU-002"></option>
<option value="AU-003"></option>
<option value="AU-004"></option>
<option value="AU-005"></option>
</datalist>
<button type="button" role="button" id="btnLookupAU" onclick="lookupAU">Look up AU</button>
</span>
</div>

<br/><br/>
<input type="radio" name="auOption" id="existingAU" onchange="showHideLookup()"/>
<label for="existingAU">Add this bag to an existing archival unit.</label>
<span id="lookupSpan" class="mr-3" style="display:none">
<input list="auids" id="addToAU" name="addToAU" />
<datalist id="auids">
<option value="AU-001"></option>
<option value="AU-002"></option>
<option value="AU-003"></option>
<option value="AU-004"></option>
<option value="AU-005"></option>
</datalist>
<button type="button" role="button" id="btnLookupAU" onclick="lookupAU">Look up AU</button>
</span>
</div>


Expand Down
4 changes: 4 additions & 0 deletions server/views/storage_service/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ <h2>Storage Service</h2>

{{ template "partials/input_text.html" dict "field" .form.Fields.Port }}

<!-- LOCKSS MOCKUP
{{ template "partials/input_text.html" dict "field" .form.Fields.Bucket }}
{{ template "partials/input_select.html" dict "field" .form.Fields.AllowsUpload }}
{{ template "partials/input_select.html" dict "field" .form.Fields.AllowsDownload }}
-->

{{ template "partials/input_text.html" dict "field" .form.Fields.Login }}

{{ template "partials/input_text.html" dict "field" .form.Fields.Password }}
Expand Down

0 comments on commit 3aaabee

Please sign in to comment.