Skip to content

Commit

Permalink
web ui - finish
Browse files Browse the repository at this point in the history
  • Loading branch information
NoiseByNorthwest committed Mar 10, 2018
1 parent e1db18c commit e0d0e8c
Show file tree
Hide file tree
Showing 34 changed files with 1,068 additions and 528 deletions.
330 changes: 185 additions & 145 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/docs/as-fg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/as-fp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/as-ms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/as-ov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/as-tl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/as.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/cp-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/cp-list1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/docs/cp-list2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion assets/web-ui/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ table.data_table td > a {
cursor:-moz-grabbing;
}

table.layout {
border-spacing: 0;
width: 100%;
}

table.layout td {
padding: 0;
}

.widget {
border: solid 1px #022;
}
Expand All @@ -139,7 +148,7 @@ table.data_table td > a {
user-select: none;
}

#control-bar select {
#metric-selector select {
background-color: #000;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/web-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1>SPX Control Panel</h1>
],
},
defaultValue: '0',
description: 'When profiling a long running request / command, this option will allow you to contain report size and thus keeping it small enough to be exploitable.',
description: 'When profiling a long running request, this option will allow you to contain report size and thus keeping it small enough to be exploitable.',
},
{
key: 'SPX_METRICS',
Expand Down
12 changes: 8 additions & 4 deletions assets/web-ui/js/fmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function lpad(str, len, char) {

export function date(d) {
return d.getFullYear()
+ '-' + lpad(d.getMonth(), 2, '0')
+ '-' + lpad(d.getMonth() + 1, 2, '0')
+ '-' + lpad(d.getDate(), 2, '0')
+ ' ' + lpad(d.getHours(), 2, '0')
+ ':' + lpad(d.getMinutes(), 2, '0')
Expand Down Expand Up @@ -42,15 +42,19 @@ export function pct(n) {
}

export function time(n) {
if (n > 1000 * 1000 * 1000) {
return round(n / (1000 * 1000 * 1000), 2).toFixed(2) + 's';
}

if (n > 1000 * 1000) {
return round(n / (1000 * 1000), 2).toFixed(2) + 's';
return round(n / (1000 * 1000), 2).toFixed(2) + 'ms';
}

if (n > 1000) {
return round(n / (1000), 2).toFixed(2) + 'ms';
return round(n / (1000), 2).toFixed(2) + 'us';
}

return round(n, 0) + 'us';
return round(n, 0) + 'ns';
}

export function memory(n) {
Expand Down
10 changes: 5 additions & 5 deletions assets/web-ui/js/math.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

export function round(n, d) {
let scale = Math.pow(10, d || 0);
const scale = Math.pow(10, d || 0);

return Math.round(n * scale) / scale;
}
Expand Down Expand Up @@ -44,7 +44,7 @@ export class Vec3 {
}

toHTMLColor() {
let c = this.copy().bound();
const c = this.copy().bound();

return 'rgb(' + [
parseInt(c.x * 255),
Expand Down Expand Up @@ -74,8 +74,8 @@ export class Vec3 {
static lerpPath(vectors, dist) {
dist = bound(dist);

let span = 1 / (vectors.length - 1);
let firstIdx = Math.min(vectors.length - 2, parseInt(dist / span));
const span = 1 / (vectors.length - 1);
const firstIdx = bound(parseInt(dist / span), 0, vectors.length - 2);

return this.lerp(
vectors[firstIdx],
Expand Down Expand Up @@ -128,7 +128,7 @@ export class Range {
}

subRange(ratio, num) {
let width = ratio * this.length();
const width = ratio * this.length();

return new Range(
Math.max(this.begin, this.begin + width * num),
Expand Down
Loading

0 comments on commit e0d0e8c

Please sign in to comment.