Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ public Object profile(@PathVariable(value = ID) String id) {
return ResponseEntityBuilder.ok(profile);
}

@RequestMapping(path = "/query_profile/text/{" + ID + "}", method = RequestMethod.GET)
public Object text_profile(@PathVariable(value = ID) String id) {
String profile = ProfileManager.getInstance().getProfile(id);
if (profile == null) {
return ResponseEntityBuilder.okWithCommonError("ID " + id + " does not exist");
}
return ResponseEntityBuilder.ok(profile);
}

@RequestMapping(path = "/query_profile", method = RequestMethod.GET)
public Object query() {
Map<String, Object> result = Maps.newHashMap();
Expand Down
6 changes: 3 additions & 3 deletions ui/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export function getLog<T>(data: any): Promise<Result<T>> {

//query_profile
export function queryProfile<T>(data: any): Promise<Result<T>> {
let LocalUrl = '/rest/v1/query_profile/';
if (data.path) {
LocalUrl = `/rest/v1/query_profile/${data.path}`;
let LocalUrl = '/rest/v1/query_profile';
if (data.profile_id) {
LocalUrl = `/rest/v1/query_profile/text/${data.profile_id}`;
}
return request(LocalUrl, data);
}
Expand Down
6 changes: 4 additions & 2 deletions ui/src/pages/query-profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function QueryProfile(params: any) {
const history = useHistory();
const doQueryProfile = function (ac?: AbortController) {
const param = {
path: getLastPath(),
profile_id: getLastPath(),
signal: ac?.signal,
};
queryProfile(param)
Expand Down Expand Up @@ -190,7 +190,9 @@ export default function QueryProfile(params: any) {
{profile ? (
<pre
ref={container}
style={{ background: '#f9f9f9', padding: '20px' }}
style={{ background: '#f9f9f9', padding: '20px', whiteSpace: 'pre-wrap',
fontFamily: 'Menlo, Monaco, \'Courier New\', monospace'
}}
>
{/* {profile} */}
</pre>
Expand Down
Loading