-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from DIG-Network/release/v0.0.1-alpha.23
Release/v0.0.1 alpha.23
- Loading branch information
Showing
6 changed files
with
175 additions
and
18 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
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,109 @@ | ||
export const renderStoreNotFoundView = ( | ||
storeId: string, | ||
rootHash: string, | ||
chainName: string, | ||
peerIp?: string | null | ||
) => { | ||
// If no peers are available, show "Store not found on this network" | ||
if (!peerIp) { | ||
return ` | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f0f0f0; | ||
} | ||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
.box { | ||
width: 90%; | ||
max-width: 500px; | ||
border: 1px solid #ddd; | ||
border-radius: 10px; | ||
padding: 20px; | ||
background-color: #ffffff; | ||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
} | ||
.message { | ||
font-size: 1.2em; | ||
color: #333; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="box"> | ||
<h2 class="message">Store Not Found on This Network</h2> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
`; | ||
} | ||
|
||
// If there are peers available, show the redirect option | ||
return ` | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f0f0f0; | ||
} | ||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
.box { | ||
width: 90%; | ||
max-width: 500px; | ||
border: 1px solid #ddd; | ||
border-radius: 10px; | ||
padding: 20px; | ||
background-color: #ffffff; | ||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
} | ||
.message { | ||
font-size: 1.2em; | ||
color: #333; | ||
} | ||
.button { | ||
background-color: #007BFF; | ||
color: white; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 5px; | ||
font-size: 1em; | ||
cursor: pointer; | ||
margin-top: 20px; | ||
text-decoration: none; | ||
display: inline-block; | ||
} | ||
.button:hover { | ||
background-color: #0056b3; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="box"> | ||
<h2 class="message">Store Not Found on This Peer</h2> | ||
<p>Click the button below to redirect to another peer.</p> | ||
<a class="button" href="http://${peerIp}:4161/${chainName}.${storeId}.${rootHash}"> | ||
Redirect | ||
</a> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
`; | ||
}; |