-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect URLs in /info and render them as links
With this commit urls form the /info endpoint are deteceted and rendered as links. The downside is to make that work I had to drop the collapsible info section in the overview list and replaced it with an resizable/scrollabe <pre> section.
- Loading branch information
Showing
11 changed files
with
72 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
spring-boot-admin-server-ui/modules/applications/filters/limitLines.js
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
spring-boot-admin-server-ui/modules/applications/filters/linkify.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2014 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
'use strict'; | ||
|
||
var linkify = require('linkifyjs/string'); | ||
|
||
module.exports = function () { | ||
return function (input, maxLength) { | ||
var max = maxLength || Number.MAX_VALUE; | ||
return linkify(input, { | ||
target: '_blank', | ||
format: function(url, type) { | ||
if (type === 'url' && url.length > max) { | ||
url = url.replace(/https?:\/\//, ''); | ||
if (url.length > max) { | ||
var last = url.lastIndexOf('/'); | ||
if (last >= 0 && (url.length - last) < max) { | ||
var end = url.substr(last); | ||
var first = url.lastIndexOf('/', max - 3 - end.length); | ||
if (first < 0) { | ||
first = max - 3 - end.length; | ||
} | ||
url = url.substr(0, first + 1) + '...' + end; | ||
} else { | ||
url = url.substr(0, max - 3) + '...'; | ||
} | ||
} | ||
} | ||
return url; | ||
} | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
spring-boot-admin-server-ui/test/unit/applications/filters/limitLines.js
This file was deleted.
Oops, something went wrong.