Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions app/gamux/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>Gamux</title>
<script>
window.gequire = require;
window.k= require
delete window.require;
delete window.exports;
delete window.module;
Expand Down Expand Up @@ -34,7 +35,56 @@
<div class="top5">下载</div>
<div class="top6"><input>搜索</div>
</div>

<div class="">
<a href="#" onclick="test_cmd()">run cmd test</a>
</div>

<script>

var spawn = window.k('child_process').spawn;

function test_cmd()
{

free = spawn('free', ['-m']);

// 捕获标准输出并将其打印到控制台
free.stdout.on('data', function (data) {
console.log('标准输出:\n' + data);
});

// 捕获标准错误输出并将其打印到控制台
free.stderr.on('data', function (data) {
console.log('标准错误输出:\n' + data);
});

// 注册子进程关闭事件
free.on('exit', function (code, signal) {
console.log('子进程已退出,代码:' + code);
});

return 0;
}


function lanchGame(game)
{
console.log(game)
return test_cmd()
}

</script>


<!--<div class="g-main-bottom">

<iframe rc="http://api.gamux.org/template/list.php?archive=all" style="width: 99.5%; height: 0px;display:none"></iframe>


</div>
-->

<div class="g-main-bottom">
<div class="top-breadcrumb">
<ol class="am-breadcrumb">
Expand All @@ -51,6 +101,8 @@
<div class="pagi-up"><a href="#up" class="pua" style="display:none;">前一页</a></div>
<div class="pagi-down"><a href="#down" class="pda">后一页</a></div>
<div class="pagi-last"><a href="#last" class="pla">尾页</a></div>


</div>
</div>
<script>
Expand Down
11 changes: 11 additions & 0 deletions app/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,22 @@ function Gapi(ifsync=false) {
'</div>' +
'<div class="list-block-c am-u-md-4">' +
'<button><a href="#" class="getgame" game="'+data[i]['namespace']+'">点击进入</a></button>' +
'<button><a href="#" class="lanchgame" game="'+data[i]['namespace']+'">lanch</a></button>' +

'</div>' +
'</div>' +
'</li>'
);
}

$('.lanchgame').click(function(){
console.log('lanch start')
var namespace = $(this).attr('game');
ret=lanchGame(namespace);
console.log('lanch end'+ret)

})

$('.getgame').click( function() {
var namespace = $(this).attr('game');
$.ajax({
Expand Down