-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented JSON viewer only with files (#556)
* [Th2-4830] Hide next/prev buttons in verificationTable and add button to reset width of columns (#547) * hide next/prev btns and add resetWidth btn * bump version * deleted comments * changed button to same style as others * changed buttons styling * updated readme (#552) * implemented JSON viewer only with files * added ability to request files from shared folder * added styling to load file from server * moved from axios to fetch * Moved api requests to ApiSchema * changed return on error * bump version * [TH2-5125] Add opening workspace with event from query parameters (#557) * TH2-4996: UI: Cannot show event if its scope contains # symbol (#558) * TH2-4996: UI: Cannot show event if its scope contains # symbol * bump version * TH2-4993: UI doesn't provide the list of available books (#559) * [TH2-4979] UI doesn't update scopes list when I update time range (#560) * [TH2-4978] UI skips a message that should be highlighted in the messa… (#561) [TH2-4978] UI skips a message that should be highlighted in the message box when the event is clicked * [TH2-5155] Add ability to turn back to the attached message (#562) * bump version (#563) * [TH2-5158] Outline searched messages (#564) * [TH2-5164] Raw message in ASCII display mode has incorrect character if the content is in UTF8 (#566) * [TH2-4909] Add sorting for list of event-scopes in UI (#565) * added local file upload and basic functions for server load * bump version to 5.2 --------- Co-authored-by: Osinkin Roman <[email protected]> Co-authored-by: Petr Zlydenko <[email protected]>
- Loading branch information
1 parent
bd81a31
commit 2f0c4c9
Showing
40 changed files
with
1,356 additions
and
94 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import notificationsStore from '../stores/NotificationsStore'; | ||
import { JSONViewerApiSchema } from './ApiSchema'; | ||
|
||
const directoriesURL = '/resources/'; | ||
|
||
const JSONViewerHttpApi: JSONViewerApiSchema = { | ||
getLinks: async (dir?: string) => { | ||
const res = await fetch(`${directoriesURL}${dir || ''}`, { | ||
cache: 'reload', | ||
headers: { | ||
Accept: 'application/json, text/plain, */*', | ||
}, | ||
}); | ||
if (res.ok) { | ||
const text = await res.text(); | ||
const links: string[] = []; | ||
let tempText = text.slice(); | ||
const linkStartInf = `a href="`; | ||
let linkStart = tempText.indexOf(linkStartInf); | ||
while (linkStart > -1) { | ||
tempText = tempText.slice(linkStart + linkStartInf.length); | ||
const linkEnd = tempText.indexOf(`"`); | ||
const link = tempText.slice(0, linkEnd); | ||
links.push(link); | ||
linkStart = tempText.indexOf(linkStartInf); | ||
} | ||
return links; | ||
} | ||
notificationsStore.handleRequestError(res); | ||
return []; | ||
}, | ||
getFile: async (directory: string, file: string) => { | ||
const res = await fetch(`${directoriesURL}/${directory}/${file}`, { | ||
headers: { | ||
Accept: 'application/json, text/plain, */*', | ||
}, | ||
}); | ||
|
||
if (res.ok) { | ||
return res.json(); | ||
} | ||
notificationsStore.handleRequestError(res); | ||
return {}; | ||
}, | ||
}; | ||
|
||
export default JSONViewerHttpApi; |
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
Oops, something went wrong.