mirror of
https://github.com/google/nomulus.git
synced 2025-05-31 01:34:05 +02:00
Add a set of radio buttons for relock duration (#535)
* Add a set of radio buttons for relock duration
This commit is contained in:
parent
7880aab386
commit
73b98d298b
3 changed files with 37 additions and 1 deletions
|
@ -167,6 +167,7 @@ registry.registrar.RegistryLock.prototype.lockOrUnlockDomain_ = function(isLock,
|
||||||
var domain = goog.dom.getRequiredElement('domain-lock-input-value').value;
|
var domain = goog.dom.getRequiredElement('domain-lock-input-value').value;
|
||||||
var passwordElem = goog.dom.getElement('domain-lock-password');
|
var passwordElem = goog.dom.getElement('domain-lock-password');
|
||||||
var password = passwordElem == null ? null : passwordElem.value;
|
var password = passwordElem == null ? null : passwordElem.value;
|
||||||
|
var relockDuration = this.getRelockDurationFromModal_()
|
||||||
goog.net.XhrIo.send('/registry-lock-post',
|
goog.net.XhrIo.send('/registry-lock-post',
|
||||||
e => this.fillLocksPage_(e),
|
e => this.fillLocksPage_(e),
|
||||||
'POST',
|
'POST',
|
||||||
|
@ -174,13 +175,30 @@ registry.registrar.RegistryLock.prototype.lockOrUnlockDomain_ = function(isLock,
|
||||||
'clientId': this.clientId,
|
'clientId': this.clientId,
|
||||||
'fullyQualifiedDomainName': domain,
|
'fullyQualifiedDomainName': domain,
|
||||||
'isLock': isLock,
|
'isLock': isLock,
|
||||||
'password': password
|
'password': password,
|
||||||
|
'relockDurationMillis': relockDuration
|
||||||
}), {
|
}), {
|
||||||
'X-CSRF-Token': this.xsrfToken,
|
'X-CSRF-Token': this.xsrfToken,
|
||||||
'Content-Type': 'application/json; charset=UTF-8'
|
'Content-Type': 'application/json; charset=UTF-8'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the duration after which we will re-lock a locked domain. Will return null if we
|
||||||
|
* are locking a domain, or if the user selects the "Never" option
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
registry.registrar.RegistryLock.prototype.getRelockDurationFromModal_ = function() {
|
||||||
|
var inputElements = goog.dom.getElementsByTagNameAndClass("input", "relock-duration-input");
|
||||||
|
for (var i = 0; i < inputElements.length; i++) {
|
||||||
|
var elem = inputElements[i];
|
||||||
|
if (elem.checked && elem.value !== "0") {
|
||||||
|
return elem.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Click handler for unlocking domains (button click).
|
* Click handler for unlocking domains (button click).
|
||||||
* @private
|
* @private
|
||||||
|
|
|
@ -132,6 +132,24 @@
|
||||||
<input type="password" id="domain-lock-password">
|
<input type="password" id="domain-lock-password">
|
||||||
<br>
|
<br>
|
||||||
{/if}
|
{/if}
|
||||||
|
{if not $isLock}
|
||||||
|
<div>
|
||||||
|
<br>
|
||||||
|
<p>Automatically re-lock the domain after:</p>
|
||||||
|
<input type="radio" name="relock-duration" id="one-hour-duration" value="3600000"
|
||||||
|
class="relock-duration-input">
|
||||||
|
<label for="one-hour-duration">1 hour</label><br>
|
||||||
|
<input type="radio" name="relock-duration" id="six-hour-duration" value="21600000"
|
||||||
|
class="relock-duration-input" checked>
|
||||||
|
<label for="six-hour-duration">6 hours</label><br>
|
||||||
|
<input type="radio" name="relock-duration" id="twenty-four-hour-duration" value="86400000"
|
||||||
|
class="relock-duration-input">
|
||||||
|
<label for="twenty-four-hour-duration">24 hours</label><br>
|
||||||
|
<input type="radio" name="relock-duration" id="never-relock-duration" value="0"
|
||||||
|
class="relock-duration-input">
|
||||||
|
<label for="never-relock-duration">Never</label><br>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
<div id="modal-error-message" hidden class="{css('kd-errormessage')}"></div>
|
<div id="modal-error-message" hidden class="{css('kd-errormessage')}"></div>
|
||||||
<div class="{css('buttons-div')}">
|
<div class="{css('buttons-div')}">
|
||||||
<button id="domain-lock-cancel" class="{css('kd-button')}">Cancel</button>
|
<button id="domain-lock-cancel" class="{css('kd-button')}">Cancel</button>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 57 KiB |
Loading…
Add table
Add a link
Reference in a new issue