<%#
 Copyright 2008-2024 by sirpdboy <herboy2008@gmail.com>
 https://github.com/sirpdboy/luci-app-ddns-go
 Licensed to the public under the Apache License 2.0.
-%>
<%
	local running = luci.sys.exec("pidof ddns-go | awk -F ' ' '{print $1}'")
%>
<%+header%>
<div class="cbi-map">

<% if tonumber(running) ~= nil then %>
<iframe  id="ddnsgo" style="width: 100%; min-height: 580px; border: none; border-radius: .375rem;box-shadow: rgba(0, 0, 0, 0.75) 0px 0px 15px -5px;"><br/><em style=\"color:red\">
<p ><em><%:The DDNS-GO service is not running.%></em></p>
</iframe>

</div>
<script type="text/javascript">
        document.getElementById("ddnsgo").src = window.location.protocol + "//" + window.location.hostname + ":<%=luci.model.uci.cursor():get_first("ddns-go", "basic", "port") %>";
 		document.getElementById("ddnsgo").height = document.documentElement.clientHeight;
        window.onresize = function(){
            document.getElementById("ddnsgo").height = document.documentElement.clientHeight;
        }
</script>
<% else %>
	<style>.running{text-align: center;} .running>h1{font-size: 25px; color: #333; margin: 1rem;} .running>p{ font-size: 1.2rem; color: #8391a2; margin: 1rem;}</style>
	<div class="running">
	<img src="data:image/svg+xml;base64, " height="100">
		<h1><font color="color:red"><%:The DDNS-GO service is not running.%></font></h1>
		<p><%:Please enable the DDNS-GO service%></p>
    </div>
<% end -%>
</div>
<%+footer%>
