mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-01 10:18:35 +08:00
Dev: Touch visual effects
This commit is contained in:
@@ -118,6 +118,8 @@ export default class Network extends Tool
|
||||
target.time = target.time - target.startTime;
|
||||
target.displayTime = formatTime(target.time);
|
||||
|
||||
if (target.done && (target.status < 200 || target >= 300)) target.hasErr = true;
|
||||
|
||||
this._render();
|
||||
}
|
||||
_bindEvent()
|
||||
@@ -306,9 +308,9 @@ export default class Network extends Tool
|
||||
|
||||
var settings = this._parent.get('settings');
|
||||
settings.text('Network')
|
||||
.add(cfg, 'overrideXhr', 'Catch Xhr Requests')
|
||||
.add(cfg, 'hideXhrResource', 'Hide Xhr Resource Timing')
|
||||
.add(cfg, 'disablePerformance', 'Disable Performance Timing')
|
||||
.switch(cfg, 'overrideXhr', 'Catch Xhr Requests')
|
||||
.switch(cfg, 'hideXhrResource', 'Hide Xhr Resource Timing')
|
||||
.switch(cfg, 'disablePerformance', 'Disable Performance Timing')
|
||||
.separator();
|
||||
}
|
||||
_render()
|
||||
@@ -319,7 +321,7 @@ export default class Network extends Tool
|
||||
|
||||
var renderData = {entries: this._resourceTimingData};
|
||||
|
||||
if (util.keys(this._requests).length > 0)
|
||||
if (!util.isEmpty(this._requests))
|
||||
{
|
||||
renderData.requests = this._requests;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{{#if requests}}
|
||||
<ul class="eruda-requests">
|
||||
{{#each requests}}
|
||||
<li class="eruda-request" data-id="{{@key}}">
|
||||
<li class="eruda-request {{#if hasErr}}eruda-error{{/if}}" data-id="{{@key}}">
|
||||
<span>{{name}}</span>
|
||||
<span>{{status}}</span>
|
||||
<span>{{method}}</span>
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
height: 41px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
white-space: nowrap;
|
||||
&.error {
|
||||
span {
|
||||
color: $red;
|
||||
}
|
||||
}
|
||||
span {
|
||||
display: inline-block;
|
||||
line-height: 40px;
|
||||
|
||||
@@ -133,5 +133,7 @@ function fullUrl(url)
|
||||
{
|
||||
if (util.startWith(url, 'http')) return url;
|
||||
|
||||
if (!util.startWith(url, '/')) url = '/' + url;
|
||||
|
||||
return origin + url;
|
||||
}
|
||||
Reference in New Issue
Block a user