62 lines
1.9 KiB
HTML
62 lines
1.9 KiB
HTML
<%
|
|
local util = require "luci.util"
|
|
local container_status = util.trim(util.exec("/usr/libexec/istorec/bmtedge.sh status"))
|
|
local container_install = (string.len(container_status) > 0)
|
|
local container_running = container_status == "running"
|
|
local uci = require "luci.model.uci".cursor()
|
|
local uid = uci:get_first("bmtedge", "bmtedge", "uid", ""),
|
|
-%>
|
|
<script src="/luci-static/bmtedge/qrcode.min.js"></script>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Status%></label>
|
|
<div class="cbi-value-field">
|
|
<% if container_running then %>
|
|
<button class="cbi-button cbi-button-success" disabled="true"><%:BlueMountain Edge is running%></button>
|
|
|
|
<div class="cbi-value cbi-value-last">
|
|
<label class="cbi-value-title"> </label>
|
|
<div class="cbi-value-field">
|
|
<input type="button" class="btn cbi-button cbi-button-apply" id="btnShowQr" name="start" value="显示二维码" />
|
|
</div>
|
|
</div>
|
|
|
|
<% else %>
|
|
<button class="cbi-button cbi-button-negative" disabled="true"><%:BlueMountain Edge is not running%></button>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="winContainer" style="display: none">
|
|
<div id="qrimage" style="
|
|
width: 256px;
|
|
height: 256px;
|
|
">
|
|
</div>
|
|
<h6>用“蓝山云”小程序扫码,请查看:<a href="https://doc.linkease.com" target="_blank">教程</a></h6>
|
|
</div>
|
|
|
|
<script>
|
|
(function() {
|
|
'use strict';
|
|
var shown = false;
|
|
var tryShowTips = function() {
|
|
if (shown) {
|
|
return;
|
|
}
|
|
shown = true;
|
|
$("#winContainer").show();
|
|
$("#winContainer").find(".button").click(function(){
|
|
$("#winContainer").hide();
|
|
show = false;
|
|
});
|
|
};
|
|
|
|
$('#btnShowQr').click(function(){
|
|
new QRCode(document.getElementById("qrimage"), "lsyK17032_"+"<%=uid%>");
|
|
tryShowTips();
|
|
});
|
|
|
|
})();
|
|
|
|
</script>
|