[fix] tweaks
This commit is contained in:
parent
5bedb0c2a9
commit
3ce2e4514d
@ -6,17 +6,17 @@ const dbInit = {};
|
||||
|
||||
const bulkData = [
|
||||
{ "index" : { "_index" : "changelog" } },
|
||||
{ "author" : "John Ripper <john@theripper.com",
|
||||
{ "author" : "John Ripper <john@theripper.com>",
|
||||
"content":"* machines: Installed the server\n```debootstrap -t foobar```",
|
||||
"server": "server.example.com",
|
||||
"created_at":"2020-05-23T09:50:33.397Z"},
|
||||
{ "index" : { "_index" : "changelog" } },
|
||||
{ "author" : "John Ripper <john@theripper.com",
|
||||
{ "author" : "John Ripper <john@theripper.com>",
|
||||
"content":"* db: Installed mysql\n```apt install mariadb-server```",
|
||||
"server": "server.example.com",
|
||||
"created_at":"2020-05-23T10:50:33.397Z"},
|
||||
{ "index" : { "_index" : "changelog" } },
|
||||
{ "author" : "John Ripper <john@theripper.com",
|
||||
{ "author" : "John Ripper <john@theripper.com>",
|
||||
"content":"* nginx: add package\n```apt install nginx-full```",
|
||||
"server": "server.example.com",
|
||||
"created_at":"2020-05-23T16:50:33.397Z"}
|
||||
|
@ -13,6 +13,8 @@
|
||||
font-size: .875rem;
|
||||
color: #888;
|
||||
line-height:1.2em;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
|
||||
.log .meta p {
|
||||
@ -41,6 +43,11 @@
|
||||
}
|
||||
.log pre .cmd {
|
||||
background: #eee;
|
||||
color: #003e80;
|
||||
color: #333f4d;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
@media (max-width: 991.98px){
|
||||
.log .meta {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
@ -21,20 +21,24 @@ escape = function(string) {
|
||||
};
|
||||
var urlRegex = /(\S+): (https?://[^\s]+)/g;
|
||||
url = function(string){
|
||||
return ''+string.replace(urlRegex, '<a target="_blank" href="$2">$1</a>')
|
||||
}
|
||||
return ''+string.replace(urlRegex, '<a target="_blank" href="$2">$1</a>');
|
||||
};
|
||||
var titleRegex = /^(.*\n)/;
|
||||
title = function(string){
|
||||
return ''+string.replace(titleRegex, '<b>$1</b>');
|
||||
}
|
||||
var cmdRegex = /```([^`]*?)```/g
|
||||
};
|
||||
var cmdRegex = /```([^`]*?)```/g;
|
||||
cmd = function(string) {
|
||||
return ''+string.replace(cmdRegex, '<span class="cmd">$1</span>');
|
||||
}
|
||||
date = function(date){
|
||||
var D = new Date(date);
|
||||
};
|
||||
date = function(string){
|
||||
var D = new Date(string);
|
||||
return D.toLocaleDateString()+" "+D.toLocaleTimeString();
|
||||
}
|
||||
};
|
||||
mailRegexp = /(.*) <(.+@.+)>/;
|
||||
mail = function( string ){
|
||||
return ''+string.replace(mailRegexp, '<a href="mailto:$2">$1</a>');
|
||||
};
|
||||
function updatePage(data){
|
||||
|
||||
var content = "";
|
||||
@ -51,13 +55,13 @@ function updatePage(data){
|
||||
content += `
|
||||
|
||||
<div class="log row">
|
||||
<div class="meta col-lg-2 text-right">
|
||||
<div class="meta col-lg-2 ">
|
||||
<p class="server"> ${escape(item.server)} </p>
|
||||
<a href="/log/${id}">
|
||||
${date(escape(item.created_at))} <br/>
|
||||
</a>
|
||||
<div class="d-none d-lg-block">
|
||||
<p class="author"> ${escape(item.author)} </p>
|
||||
<p class="author"> ${mail(escape(item.author))} </p>
|
||||
<p>
|
||||
<a class="actions-toggle btn-link btn-sm">Actions</a>
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user