-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ship the new WebUI #590
Merged
Merged
Ship the new WebUI #590
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d8fa019
feat: bundle the new WebUI
lidel aa616fd
fix: reload bundled WebUI on IPFS Client change
lidel 60b186c
chore: webui v2.0
lidel 02ee4de
refactor: fetch webui from IPFS
lidel fd7586f
fix: use random preloader as a fallback
lidel b170b22
fix: remove maps from final bundle
lidel 80cfce2
feat: refresh IPNS webui when API backend changes
lidel a6c4a72
feat: display revision in ipfs-webui
lidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* This is a fallback script used when ipfs cli fails or is not available | ||
* More details: https://github.com/ipfs-shipyard/ipfs-webui/issues/843 | ||
*/ | ||
const tar = require('tar') | ||
const request = require('request') | ||
const progress = require('request-progress') | ||
|
||
const cid = process.argv[2] | ||
const destination = process.argv[3] | ||
|
||
// pick random preloader | ||
const no = Math.round(Math.random()) // 0 or 1 | ||
const url = 'https://node' + no + '.preload.ipfs.io/api/v0/get?arg=' + cid + '&archive=true&compress=true' | ||
|
||
console.log('Fallback to HTTP GET from: ' + url) | ||
|
||
progress(request(url), { lengthHeader: 'x-content-length', delay: 10000 }) | ||
.on('progress', (state) => console.log(`progress: ${Math.round(state.percent)} %, transferred: ${state.size.transferred}`, state)) | ||
.on('response', (response) => console.log('Status Code', response.statusCode)) | ||
.on('error', (error) => console.log('Download Error', error)) | ||
.on('close', () => console.log('Done! webui extracted to: ' + destination)) | ||
.pipe( | ||
tar.extract({ | ||
strip: 1, | ||
C: destination | ||
}) | ||
) |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olizilla FYI this is part of #590. It will detect webui loaded from:
https://webui.ipfs.io
http://127.0.0.1:8080/ipns/webui.ipfs.io
And reload it when companion API state changes (on/off/port change etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#/
will only be added by the app after the initial bundle has loaded (unless the user has bookmarked it explicitly)...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was on purpose to remove false-positive matches on random websites and avoid double-reload when quickly switching between backends.