fix: reset gitee dom id

This commit is contained in:
NaccOll 2020-06-11 01:52:39 +08:00
parent c49b1b02b9
commit 4466147fd0
2 changed files with 3 additions and 3 deletions

View File

@ -605,11 +605,11 @@ public class GiteePushTrigger extends Trigger<Job<?, ?>> {
byte[] random = new byte[16]; // 16x8=128bit worth of randomness, since we use md5 digest as the API token
RANDOM.nextBytes(random);
String secretToken = Util.toHexString(random);
response.setHeader("script", "document.getElementById('secretToken').value='" + secretToken + "'");
response.setHeader("script", "document.getElementById('giteeSecretToken').value='" + secretToken + "'");
}
public void doClearSecretToken(@AncestorInPath final Job<?, ?> project, StaplerResponse response) {;
response.setHeader("script", "document.getElementById('secretToken').value=''");
response.setHeader("script", "document.getElementById('giteeSecretToken').value=''");
}
}
}

View File

@ -78,7 +78,7 @@
</f:entry>
<f:entry title="${%Secret.Token}" help="/plugin/gitee/help/help-secretToken.html">
<table>
<f:readOnlyTextbox field="secretToken" id="secretToken"/>
<f:readOnlyTextbox field="secretToken" id="giteeSecretToken"/>
<f:validateButton title="${%Generate}" method="generateSecretToken"/>
<f:validateButton title="${%Clear}" method="clearSecretToken"/>
</table>