1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 23:58:35 -06:00

new: Show loading and no links text

This commit is contained in:
Sayantan Santra 2023-06-03 18:49:59 -05:00
parent a4e7c6b444
commit 7550d197b4
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
2 changed files with 6 additions and 0 deletions

View file

@ -44,6 +44,7 @@
</fieldset> </fieldset>
</form> </form>
<p name="loading-text">Loading links table...</p>
<table class="pure-table"> <table class="pure-table">
<caption>Active links</caption> <caption>Active links</caption>
<br> <br>

View file

@ -34,10 +34,15 @@ const refreshData = async () => {
const displayData = async (data) => { const displayData = async (data) => {
let site = await getSiteUrl(); let site = await getSiteUrl();
table_box = document.querySelector(".pure-table"); table_box = document.querySelector(".pure-table");
loading_text = document.getElementsByName("loading-text")[0];
if (data.length == 0) { if (data.length == 0) {
table_box.style.visibility = "hidden"; table_box.style.visibility = "hidden";
loading_text.style.display = "block";
loading_text.innerHTML = "No active links.";
} }
else { else {
loading_text.style.display = "none";
const table = document.querySelector("#url-table"); const table = document.querySelector("#url-table");
if (!window.isSecureContext) { if (!window.isSecureContext) {
const shortUrlHeader = document.getElementById("short-url-header"); const shortUrlHeader = document.getElementById("short-url-header");