add luci app ttyd
This commit is contained in:
parent
186d20bf79
commit
8f68cf2f02
17
package/lean/luci-app-ttyd/Makefile
Normal file
17
package/lean/luci-app-ttyd/Makefile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright (C) 2016 Openwrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
LUCI_TITLE:=LuCI support for ttyd
|
||||||
|
LUCI_DEPENDS:=+ttyd
|
||||||
|
LUCI_PKGARCH:=all
|
||||||
|
PKG_VERSION:=1.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
# call BuildPackage - OpenWrt buildroot signature
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
module("luci.controller.terminal", package.seeall)
|
||||||
|
|
||||||
|
function index()
|
||||||
|
if not (luci.sys.call("pidof ttyd > /dev/null") == 0) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
entry({"admin", "system", "terminal"}, template("terminal"), _("TTYD Terminal"), 10).leaf = true
|
||||||
|
end
|
9
package/lean/luci-app-ttyd/luasrc/view/terminal.htm
Normal file
9
package/lean/luci-app-ttyd/luasrc/view/terminal.htm
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<%+header%>
|
||||||
|
<div class="cbi-map">
|
||||||
|
<h2 name="content"><%=translate("Terminal")%></h2>
|
||||||
|
<iframe id="terminal" style="width: 100%; min-height: 500px; border: none; border-radius: 3px;"></iframe>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.getElementById("terminal").src = window.location.protocol + "//" + window.location.hostname + ":7681";
|
||||||
|
</script>
|
||||||
|
<%+footer%>
|
5
package/lean/luci-app-ttyd/po/zh-cn/terminal.po
Normal file
5
package/lean/luci-app-ttyd/po/zh-cn/terminal.po
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||||
|
|
||||||
|
msgid "TTYD Terminal"
|
||||||
|
msgstr "TTYD 终端"
|
26
package/lean/luci-app-ttyd/root/etc/init.d/ttyd
Executable file
26
package/lean/luci-app-ttyd/root/etc/init.d/ttyd
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=99
|
||||||
|
SERVICE_WRITE_PID=1
|
||||||
|
SERVICE_DAEMONIZE=1
|
||||||
|
|
||||||
|
start() {
|
||||||
|
logger -t TTYD 'Starting ttyd service'
|
||||||
|
service_start /usr/bin/ttyd -i br-lan /bin/login
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
if [ -n "`pidof ttyd`" ]; then
|
||||||
|
logger -t TTYD 'Shutting down ttyd service'
|
||||||
|
service_stop /usr/bin/ttyd
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
logger -t TTYD 'Restarting ttyd service'
|
||||||
|
stop
|
||||||
|
sleep 2
|
||||||
|
start
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user