Initial Commit
This commit is contained in:
		
							
								
								
									
										41
									
								
								Resources/Views/base.leaf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								Resources/Views/base.leaf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
    <head>
 | 
			
		||||
        <title>#if(pageTitle ?? false): #(pageTitle) - #(config.title) #else: #(config.title) #endif</title>
 | 
			
		||||
        <link rel="stylesheet" type="text/css" href="/tabler/css/tabler.css">
 | 
			
		||||
        <link rel="stylesheet" type="text/css" href="/tabler/css/dashboard.css">
 | 
			
		||||
        <script src="/tabler/js/core.js"></script>
 | 
			
		||||
        <script src="/tabler/js/dashboard.js"></script>
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
    <div class="page">
 | 
			
		||||
        <div class="flex-fill">
 | 
			
		||||
            <div class="header py-4">
 | 
			
		||||
                <div class="container">
 | 
			
		||||
                    <div class="d-flex">
 | 
			
		||||
                        <a class="header-brand" href="/">#(config.title)</a>
 | 
			
		||||
                        <div class="d-flex order-lg-2 ml-auto">
 | 
			
		||||
                            <div class="nav-item d-none d-md-flex">
 | 
			
		||||
                                <a href="https://github.com/tabler/tabler" class="btn btn-sm btn-outline-primary" target="_blank">Source code</a>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="header d-lg-flex p-0">
 | 
			
		||||
                <div class="container">
 | 
			
		||||
                    <div class="row align-items-center">
 | 
			
		||||
                        <div class="col-lg order-lg-first">
 | 
			
		||||
                            <ul class="nav nav-tabs border-0 flex-column flex-lg-row">
 | 
			
		||||
                                <li class="nav-item">
 | 
			
		||||
                                    <a href="/" class="nav-link #(homeStatus ?? false)"><i class="fe fe-home"></i> Home</a>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            #evaluate(body)
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										56
									
								
								Resources/Views/home.leaf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								Resources/Views/home.leaf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
#let(homeStatus = "active")
 | 
			
		||||
#let(pageTitle = "Home")
 | 
			
		||||
#define(body):
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="page-header"><h1 class="page-title">Status</h1></div>
 | 
			
		||||
        #for((node,services) in config.services):
 | 
			
		||||
            <h6>#(node)</h6>
 | 
			
		||||
            <div class="row row-cards row-deck">
 | 
			
		||||
                #for(service in services):
 | 
			
		||||
                    <div class="col">
 | 
			
		||||
                        <div class="card">
 | 
			
		||||
                            <div class="card-header">
 | 
			
		||||
                                <h3 class="card-title">#(service["name"])</h3>
 | 
			
		||||
                                <div class="card-options">
 | 
			
		||||
                                    <span class="tag">
 | 
			
		||||
                                        Status
 | 
			
		||||
                                        <span id="#(service["name"])Status" class="tag-addon">Unavailable</span>
 | 
			
		||||
                                    </span>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="card-body">
 | 
			
		||||
                                #(service["description"])
 | 
			
		||||
                            </div>
 | 
			
		||||
                            #if(service["url"]):
 | 
			
		||||
                                <div class="card-footer">
 | 
			
		||||
                                    URL: <a href="#(service["url"])">#(service["url"])</a>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            #endif
 | 
			
		||||
                        </div>
 | 
			
		||||
                        #if(service["url"]):
 | 
			
		||||
                            <script>
 | 
			
		||||
                                fullURL = '#(service["url"])'
 | 
			
		||||
                                var url = fullURL.replace("https://", "")
 | 
			
		||||
                                url = url.replace("http://", "")
 | 
			
		||||
                                var request = new XMLHttpRequest()
 | 
			
		||||
                                request.open('GET', "/status/" + url, true)
 | 
			
		||||
                                request.onload = function () {
 | 
			
		||||
                                    var data = JSON.parse(this.response)
 | 
			
		||||
                                    if (data.down === "true" || parseInt(data.code) > 500 && parseInt(data.code) < 600 ) {
 | 
			
		||||
                                        document.getElementById('#(service["name"])Status').classList.add("tag-danger")
 | 
			
		||||
                                        document.getElementById('#(service["name"])Status').innerHTML = "Offline"
 | 
			
		||||
                                    } else {
 | 
			
		||||
                                        document.getElementById('#(service["name"])Status').classList.add("tag-success")
 | 
			
		||||
                                        document.getElementById('#(service["name"])Status').innerHTML = "Online"
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                                request.send()
 | 
			
		||||
                            </script>
 | 
			
		||||
                        #endif
 | 
			
		||||
                    </div>
 | 
			
		||||
                #endfor
 | 
			
		||||
            </div>
 | 
			
		||||
        #endfor
 | 
			
		||||
    </div>
 | 
			
		||||
#enddefine
 | 
			
		||||
#inline("base")
 | 
			
		||||
							
								
								
									
										4
									
								
								Resources/Views/test.leaf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Resources/Views/test.leaf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
#define(body):
 | 
			
		||||
    <h1>It works!</h1>
 | 
			
		||||
#enddefine
 | 
			
		||||
#inline("base")
 | 
			
		||||
							
								
								
									
										74
									
								
								Resources/config.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								Resources/config.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
{
 | 
			
		||||
  "title": "Statusboard",
 | 
			
		||||
  "services": {
 | 
			
		||||
    "cluster-00": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Nginx",
 | 
			
		||||
        "url": "https://nginx.arsenm.dev",
 | 
			
		||||
        "description": "Nginx Proxy Manager and Reverse Proxy."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Cockpit",
 | 
			
		||||
        "url": "https://servers.arsenm.dev",
 | 
			
		||||
        "description": "Cockpit server metric monitoring dashboard for linux servers."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Portainer",
 | 
			
		||||
        "url": "https://portainer.arsenm.dev",
 | 
			
		||||
        "description": "Portainer interactive web GUI for docker and docker swarm."
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "cluster-01": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "CDSBot",
 | 
			
		||||
        "description": "Discord bot for the Cultum Dei Scientiam discord server."
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "cluster-03": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Pihole",
 | 
			
		||||
        "description": "Pihole DNS-based network-wide adblocker."
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "cluster-04": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Dashmachine",
 | 
			
		||||
        "url": "https://dashmachine.arsenm.dev",
 | 
			
		||||
        "description": "Dashmachine configurable personal dashboard."
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "cluster-05": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Outline VPN",
 | 
			
		||||
        "description": "Outline SOCKS-based VPN from Jigsaw."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Liwu",
 | 
			
		||||
        "url": "https://liwu.gifts",
 | 
			
		||||
        "description": "Liwu gift chooser. Find Gifts for Others Based Off Their Personality Traits."
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "cluster-06": [
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Minecraft Server",
 | 
			
		||||
        "url": "https://mc.arsen6331.com",
 | 
			
		||||
        "description": "Minecraft server with Geyser for the CDS discord server."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Gitea",
 | 
			
		||||
        "url": "https://gitea.arsenm.dev",
 | 
			
		||||
        "description": "Personal Gitea instance."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Minio",
 | 
			
		||||
        "url": "https://minio.arsenm.dev",
 | 
			
		||||
        "description": "Instance of the minio object storage server."
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "name": "Nextcloud",
 | 
			
		||||
        "url": "https://nextcloud.arsenm.dev",
 | 
			
		||||
        "description": "Nextcloud personal cloud and web office suite."
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user