Browse Source

copy the aws keys

pull/5637/merge
Chris Lu 3 days ago
parent
commit
3f879b8d2b
  1. 26
      weed/admin/static/js/admin.js

26
weed/admin/static/js/admin.js

@ -2120,7 +2120,7 @@ function showModal(title, content) {
modalDiv.setAttribute('role', 'dialog'); modalDiv.setAttribute('role', 'dialog');
const modalDialog = document.createElement('div'); const modalDialog = document.createElement('div');
modalDialog.className = 'modal-dialog';
modalDialog.className = 'modal-dialog modal-lg';
modalDialog.setAttribute('role', 'document'); modalDialog.setAttribute('role', 'document');
const modalContent = document.createElement('div'); const modalContent = document.createElement('div');
@ -2207,6 +2207,16 @@ function showSecretKey(accessKey, secretKey) {
</button> </button>
</div> </div>
</div> </div>
<div class="mb-3">
<label class="form-label"><strong>Export Commands (for easy copy & paste):</strong></label>
<div class="input-group">
<textarea id="${modalId}_exportCommands" class="form-control font-monospace" rows="2" readonly>export AWS_ACCESS_KEY_ID=${escapedAccessKey}
export AWS_SECRET_ACCESS_KEY=${escapedSecretKey}</textarea>
<button class="btn btn-outline-secondary" onclick="copyFromInput('${modalId}_exportCommands')">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
`; `;
showModal('Access Key Details', content); showModal('Access Key Details', content);
@ -2222,6 +2232,10 @@ function showNewAccessKeyModal(accessKeyData) {
<i class="fas fa-check-circle me-2"></i> <i class="fas fa-check-circle me-2"></i>
<strong>Success!</strong> Your new access key has been created. <strong>Success!</strong> Your new access key has been created.
</div> </div>
<div class="alert alert-warning">
<i class="fas fa-exclamation-triangle me-2"></i>
<strong>Important:</strong> This is the only time the secret key will be displayed. Please save it securely.
</div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label"><strong>Access Key:</strong></label> <label class="form-label"><strong>Access Key:</strong></label>
<div class="input-group"> <div class="input-group">
@ -2240,6 +2254,16 @@ function showNewAccessKeyModal(accessKeyData) {
</button> </button>
</div> </div>
</div> </div>
<div class="mb-3">
<label class="form-label"><strong>Export Commands (for easy copy & paste):</strong></label>
<div class="input-group">
<textarea id="${modalId}_exportCommands" class="form-control font-monospace" rows="2" readonly>export AWS_ACCESS_KEY_ID=${escapedAccessKey}
export AWS_SECRET_ACCESS_KEY=${escapedSecretKey}</textarea>
<button class="btn btn-outline-secondary" onclick="copyFromInput('${modalId}_exportCommands')">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
`; `;
showModal('New Access Key Created', content); showModal('New Access Key Created', content);

Loading…
Cancel
Save