-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
246 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/**************************************************************************** | ||
*项目名称:SAEA.WebRedisManager.Controllers | ||
*CLR 版本:4.0.30319.42000 | ||
*机器名称:WENLI-PC | ||
*命名空间:SAEA.WebRedisManager.Controllers | ||
*类 名 称:ConsoleController | ||
*版 本 号:V1.0.0.0 | ||
*创建人: yswenli | ||
*电子邮箱:wenguoli_520@qq.com | ||
*创建时间:2019/3/26 11:05:29 | ||
*描述: | ||
*===================================================================== | ||
*修改时间:2019/3/26 11:05:29 | ||
*修 改 人: yswenli | ||
*版 本 号: V1.0.0.0 | ||
*描 述: | ||
*****************************************************************************/ | ||
using SAEA.MVC; | ||
using SAEA.Redis.WebManager.Libs; | ||
|
||
namespace SAEA.WebRedisManager.Controllers | ||
{ | ||
public class ConsoleController : Controller | ||
{ | ||
public ActionResult SendCmd(string name, string cmd) | ||
{ | ||
if (!string.IsNullOrEmpty(cmd)) | ||
{ | ||
return Content(CurrentRedisClient.Send(name, cmd)); | ||
} | ||
return Content("输入的命令不能为空~"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>命令行</title> | ||
<link href="/Content/css/layui.css" rel="stylesheet" /> | ||
<link href="/Content/css/global.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<div class="layui-fluid"> | ||
<div class="layui-row layui-col-space15" style="margin-top:15px;"> | ||
<div class="layui-card"> | ||
<div class="layui-card-header" style="font-size:18px;"> | ||
redis 命令行模式 <a href="http://doc.redisfans.com/" target="_blank" style="color:#0094ff;">更多redis命令</a> | ||
</div> | ||
<div class="layui-card-body layuiadmin-card-list" style="height:36px;"> | ||
<div class="layui-col-sm12 layui-col-md12"> | ||
<input type="text" id="cmdTxt" placeholder="请输入redis命令" class="layui-input" style="display:inline-block;width:800px;border-radius: 10px 0 0 10px;" /> | ||
<button id="runBtn" class="layui-btn layui-btn-normal" style="margin-left: -4px;margin-top: -1px;border-radius: 0 10px 10px 0px;">Run</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="layui-card"> | ||
<div class="layui-card-header" style="font-size:18px;"> | ||
<button id="clearBtn" class="layui-btn layui-btn-xs layui-btn-normal">清空</button> | ||
</div> | ||
<div class="layui-card-body layuiadmin-card-list" style="height:400px;"> | ||
<div class="layui-col-sm12 layui-col-md12"> | ||
<textarea id="resultTxt" class="layui-textarea" style="height:533px;width:100%;resize:none;overflow:auto;background-color:#000;color:lawngreen;border-radius: 10px;" readonly="readonly"></textarea> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="Content/js/layui.js"></script> | ||
<script src="Content/js/requestpamars.js"></script> | ||
<script src="Content/js/redis.console.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
layui.use(['jquery', 'layer', 'form'], function () { | ||
|
||
var layer = layui.layer, form = layui.form, $ = layui.$; | ||
|
||
var redis_name = encodeURIComponent(GetRequest().name); | ||
|
||
var layerIndex = -1; | ||
|
||
|
||
|
||
$("#runBtn").click(function () { | ||
|
||
var cmd = $("#cmdTxt").val(); | ||
|
||
if (cmd !== undefined && cmd !== "") { | ||
|
||
cmd = encodeURIComponent(cmd); | ||
|
||
layerIndex = layer.msg('加载中', { | ||
icon: 16 | ||
, shade: 0.01 | ||
}); | ||
|
||
$.post("/console/sendcmd", `name=${redis_name}&cmd=${cmd}`, (result) => { | ||
var v = `输入:\r\n ${decodeURIComponent(cmd) | ||
}\r\n\r\n输出:\r\n${result}\r\n\r\n${$("#resultTxt").val()}`; | ||
$("#resultTxt").val(v); | ||
$("#resultTxt")[0].scrollTop = 0; | ||
layer.close(layerIndex); | ||
}); | ||
} | ||
|
||
}); | ||
|
||
|
||
$("#clearBtn").click(() => { | ||
$("#resultTxt").val(""); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.