mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-23 15:51:25 +00:00
code backu
This commit is contained in:
parent
a63063ee3c
commit
329f84ee47
@ -78,14 +78,16 @@ function webInterface(config){
|
|||||||
res.end(resDom);
|
res.end(resDom);
|
||||||
});
|
});
|
||||||
|
|
||||||
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
|
|
||||||
indexHTML = util.simpleRender(indexTpl, {
|
|
||||||
rule : ruleSummary || "",
|
|
||||||
wsPort : wsPort,
|
|
||||||
ipAddress : ipAddress || "127.0.0.1"
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(function(req,res,next){
|
app.use(function(req,res,next){
|
||||||
|
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
|
||||||
|
indexHTML = util.simpleRender(indexTpl, {
|
||||||
|
rule : ruleSummary || "",
|
||||||
|
wsPort : wsPort,
|
||||||
|
ipAddress : ipAddress || "127.0.0.1"
|
||||||
|
});
|
||||||
|
|
||||||
if(req.url == "/"){
|
if(req.url == "/"){
|
||||||
res.setHeader("Content-Type", "text/html");
|
res.setHeader("Content-Type", "text/html");
|
||||||
res.end(indexHTML);
|
res.end(indexHTML);
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<link rel="stylesheet" href="/css/uikit.gradient.min.css" />
|
<link rel="stylesheet" href="/css/uikit.gradient.min.css" />
|
||||||
<link rel="stylesheet" href="/css/page.css" />
|
<link rel="stylesheet" href="/css/page.css" />
|
||||||
<link rel="icon" type="image/png" href="/favico.png" />
|
<link rel="icon" type="image/png" href="/favico.png" />
|
||||||
<script charset="utf-8" id="seajsnode"src="http://static.alipayobjects.com/seajs/??seajs/2.2.0/sea.js,seajs-combo/1.0.1/seajs-combo.js,seajs-style/1.0.2/seajs-style.js"></script>
|
<script charset="utf-8" id="seajsnode" src="http://static.alipayobjects.com/seajs/??seajs/2.2.0/sea.js,seajs-combo/1.0.1/seajs-combo.js,seajs-style/1.0.2/seajs-style.js"></script>
|
||||||
|
<script src="./react.js"></script>
|
||||||
|
<script src="./JSXTransformer.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="topHead">
|
<div class="topHead">
|
||||||
@ -62,11 +63,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="J_content"></div>
|
||||||
|
|
||||||
<input type="hidden" id="socketPort" value="{{wsPort}}" />
|
<input type="hidden" id="socketPort" value="{{wsPort}}" />
|
||||||
<input type="hidden" id="baseUrl" value="{{ipAddress}}" />
|
<input type="hidden" id="baseUrl" value="{{ipAddress}}" />
|
||||||
<input type="hidden" id="customMenu" value="{{menu}}" />
|
<input type="hidden" id="customMenu" value="{{menu}}" />
|
||||||
|
|
||||||
<script type="text/template" id="main_table_row">
|
<script id="main_table_row">
|
||||||
<td class="data_id"><%= _id %></td>
|
<td class="data_id"><%= _id %></td>
|
||||||
<td><%= method %> <span class="protocol protocol_<%= protocol %>" title="https"><i class="iconfont">󰃉</i></span> </td>
|
<td><%= method %> <span class="protocol protocol_<%= protocol %>" title="https"><i class="iconfont">󰃉</i></span> </td>
|
||||||
<td class="http_status http_status_<%= statusCode %>"><%= statusCode %></td>
|
<td class="http_status http_status_<%= statusCode %>"><%= statusCode %></td>
|
||||||
@ -80,5 +83,55 @@
|
|||||||
<script src="/anyproxy_wsUtil.js"></script>
|
<script src="/anyproxy_wsUtil.js"></script>
|
||||||
<script src="/he.js"></script>
|
<script src="/he.js"></script>
|
||||||
<script src="/list.js"></script>
|
<script src="/list.js"></script>
|
||||||
|
|
||||||
|
<script type="text/jsx">
|
||||||
|
var RecordPanel = React.createClass({
|
||||||
|
getInitialState : function(){
|
||||||
|
return {
|
||||||
|
list : []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
render : function(){
|
||||||
|
var rowCollection = this.state.list.map(function(item){
|
||||||
|
return (
|
||||||
|
<RecordRow data={item}></RecordRow>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<RecordRow />
|
||||||
|
{rowCollection}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var RecordRow = React.createClass({
|
||||||
|
getInitialState : function(){
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
render : function(){
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
aaa
|
||||||
|
<td class="data_id">-- _id --</td>
|
||||||
|
<td>-- method -- <span class="protocol protocol_-- protocol --" title="https"><i class="iconfont">󰃉</i></span> </td>
|
||||||
|
<td class="http_status http_status_-- statusCode --">-- statusCode --</td>
|
||||||
|
<td title="-- host --">-- host --</td>
|
||||||
|
<td title="-- path --">-- path --</td>
|
||||||
|
<td>-- mime --</td>
|
||||||
|
<td>-- startTimeStr --</td>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
React.render(
|
||||||
|
<RecordPanel />,
|
||||||
|
document.getElementById("J_content")
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -14,6 +14,8 @@ seajs.use(['$', 'Underscore', 'Backbone',"Handlebars","Popup","./detail"], funct
|
|||||||
|
|
||||||
var isInApp = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.list;
|
var isInApp = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.list;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//record detail
|
//record detail
|
||||||
var DetailView = function(){
|
var DetailView = function(){
|
||||||
var self = this,
|
var self = this,
|
||||||
|
19562
web/react.js
vendored
Normal file
19562
web/react.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15
web/react.min.js
vendored
15
web/react.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user