code backu

This commit is contained in:
OttoMao 2015-04-28 21:10:14 +08:00
parent a63063ee3c
commit 329f84ee47
5 changed files with 19628 additions and 24 deletions

View File

@ -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);

View File

@ -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">&#xf00c9;</i></span> </td> <td><%= method %> <span class="protocol protocol_<%= protocol %>" title="https"><i class="iconfont">&#xf00c9;</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">&#xf00c9;</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>

View File

@ -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

File diff suppressed because it is too large Load Diff

15
web/react.min.js vendored

File diff suppressed because one or more lines are too long