TracCloudInternal: Difference between revisions

From Redrock Wiki

No edit summary
No edit summary
Line 19: Line 19:
</b>
</b>
</div>
</div>
<html>
<hr>
Manually update the status page. You must be logged in for this to function.<br>
<select id="status">
  <option value="X">Select a status</option>
  <option value="0">No Status/Testing</option>
  <option value="1">Online</option>
  <option value="2">Issues</option>
  <option value="3">Down</option>
</select>
<br>
<label>Optionally enter a custom status message</label>
<textarea id="message" style="width: 100%; height: 50px; margin-bottom: 10px;"></textarea>
<div id="result">
</div>
<button onclick="updateStatus()"><b>Update Status Page</b></button>
<script>
function updateStatus() {
  document.getElementById("result").innerHTML = '';
  let statusImg = document.getElementById("status").value;
  let customMessage = document.getElementById("message").value;
  let message = '';
  if (statusImg == 'X') {
console.log('Status is X');
document.getElementById("result").innerHTML = '<span style="color:red;">Missing status, no change applied.</span>';
return;
  }
 
  switch (statusImg) {
case '0':
statusImg = '6758774';
message = 'We are currently testing the status page, a normal status will be available here soon.';
break;
case '1':
statusImg = '7776411';
message = 'TracCloud is currently online and operating normally.';
break;
case '2':
statusImg = '8980804';
message = 'We are investigating possible issues and will update this page when more information is available.';
break;
case '3':
statusImg = '9329764';
message = 'TracCloud is currently experiencing issues. Our development team is working to resolve this as soon as possible.';
break;
}
if (customMessage) {
message = customMessage;
}
const finalMessage = `<div style="text-align: center;">[[File:${statusImg}.png|600px]]<BR><b>${message}</b></div>{{:TracCloudStatusHistory}}`
var params = {
action: 'edit',
title: 'TracCloudStatus',
text: finalMessage,
format: 'json'
},
api = new mw.Api();
api.postWithToken( 'csrf', params ).done( function ( data ) {
console.log( data );
document.getElementById("result").innerHTML = '<span style="color:green;">The status page has been updated.</span>';
} );
}
</script>
<hr>
</html>


__NOTOC__
__NOTOC__
__NOINDEX__
__NOINDEX__

Revision as of 15:45, 25 March 2026

This is used to track pages that are (intentionally) not commonly linked to. If you've managed to find this page, here's a cookie 🍪


Manually update the status page. You must be logged in for this to function.