export view=2: padStart(2) плотнее
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ipwhitelist",
|
"name": "ipwhitelist",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "IP WhiteList microservice for cloud provider",
|
"description": "IP WhiteList microservice for cloud provider",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ function renderTable(cidrs) {
|
|||||||
const [ip, mask] = c.split('/');
|
const [ip, mask] = c.split('/');
|
||||||
const [a, b, c2, d] = ip.split('.');
|
const [a, b, c2, d] = ip.split('.');
|
||||||
return '<tr>'
|
return '<tr>'
|
||||||
+ '<td>' + a.padStart(3, ' ') + '</td>'
|
+ '<td>' + a.padStart(2, ' ') + '</td>'
|
||||||
+ '<td>' + b.padStart(3, ' ') + '</td>'
|
+ '<td>' + b.padStart(2, ' ') + '</td>'
|
||||||
+ '<td>' + c2.padStart(3, ' ') + '</td>'
|
+ '<td>' + c2.padStart(2, ' ') + '</td>'
|
||||||
+ '<td>' + d.padStart(3, ' ') + '</td>'
|
+ '<td>' + d.padStart(2, ' ') + '</td>'
|
||||||
+ '<td> / ' + mask + '</td>'
|
+ '<td> / ' + mask + '</td>'
|
||||||
+ '</tr>';
|
+ '</tr>';
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user