Heim  >  Artikel  >  Backend-Entwicklung  >  在web页面中加入shell脚本控制台,大概是如何实现,谢谢

在web页面中加入shell脚本控制台,大概是如何实现,谢谢

WBOY
WBOYOriginal
2016-08-04 09:21:252386Durchsuche

https://github.com/nickola/web-console/releases/

在web页面中加入shell脚本控制台,大概是如何实现,谢谢

在web中加入shell脚本控制台的

我大致知道后台的情况了,但是这个界面如何实现,而且执行命令后的数据显示的格式都和linux中的控制台类似的格式

回复内容:

https://github.com/nickola/web-console/releases/

在web页面中加入shell脚本控制台,大概是如何实现,谢谢

在web中加入shell脚本控制台的

我大致知道后台的情况了,但是这个界面如何实现,而且执行命令后的数据显示的格式都和linux中的控制台类似的格式

https://github.com/nickola/web-console/blob/master/src/webconsole.main.php#L9-L32

这个库封装的是 http://php.net/manual/zh/function.proc-open.php


针对题主的更新:

terminal的实现使用的是 https://github.com/jcubic/jquery.terminal

exec,system,··,这些都可以执行shell命令,你可以做个ajax请求,返回命令结果,然后自己调下样式就行了

web中的shell并不是真正的shell,通过后端处理接受命令并过滤,再使用php中的exec调用
界面实现:
1.前端绘制
2.flash动画

1.只能模拟样式
2.exec等调用shell脚本的方式在操作
3.毕

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn