Skip to content

Commit

Permalink
Disclaimer with confirmation checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
lucksus committed Oct 28, 2019
1 parent c1664f3 commit 42145d1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion holoscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Holoscape {
showSplashScreen() {
let window = new BrowserWindow({
width:890,
height:535,
height:635,
webPreferences: {
nodeIntegration: true
},
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mb.on('ready', async () => {

if(!conductor.hasConfig()) {
console.log("No conductor config found. Initializing...")
await new Promise((resolve)=>setTimeout(resolve, 1000))
global.holoscape.splash.webContents.send('request-network-config')
let config = await new Promise( (resolve, reject) => {
ipcMain.on('network-config-set', (event, config) => {
Expand Down
43 changes: 29 additions & 14 deletions views/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@
ul#log {
list-style-type: none;
}
#network-config-content {
width: 750px;
}
#network-config-wrapper {
left: -150px;
}
.disclaimer {
font-weight: bold;
}
.disclaimer-label {
font-weight: bold;
word-wrap: break-word;
}
</style>
</head>
<body class="background">
Expand Down Expand Up @@ -108,13 +121,10 @@ <h5 class="modal-title" id="exampleModalLabel">Unlock keystore...</h5>
</div>
</div>
<div class="modal fade" id="network-config-modal" tabindex="-1" role="dialog" aria-labelledby="network-config-modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-dialog" role="document" id="network-config-wrapper">
<div class="modal-content" id="network-config-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Network Configuration...</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h5 class="modal-title" id="exampleModalLabel">Holochain Network Configuration...</h5>
</div>
<div class="modal-body">
<div class="form-group">
Expand All @@ -136,23 +146,26 @@ <h5 class="modal-title" id="exampleModalLabel">Network Configuration...</h5>
<small id="dynamo-url-help" class="form-text text-muted"></small>
</div>
<div class="form-group" id="network-config-sim2h" v-if="network_type==='sim2h'">
<label for="sim2h-url">Sim2h Switchboard URL</label>
<input type="input" class="form-control" id="sim2h-url" aria-describedby="sim2h-url-help" placeholder="wss://sim2h.holochain.org:9000" value="wss://sim2h.holochain.org:9000">
<small id="sim2h-url-help" class="form-text text-muted">
The default of wss://sim2h.holochain.org points to a public pre-alpha test instance of the sim2h switch board.
This is a centralized simulation of the Holochain network that connects all agents of the DHT through one central switch board
<label for="sim2h-url">Sim2h Switch-Board URL</label>
<input type="input" class="form-control" id="sim2h-url" aria-describedby="sim2h-url-help" placeholder="wss://sim2h.holochain.org:9000" value="wss://sim2h.holochain.org:9000" v-model="sim2h_url">
<small id="sim2h-url-help" class="form-text text-muted" v-if="sim2h_url=='wss://sim2h.holochain.org:9000'">
The default URL wss://sim2h.holochain.org points to a public pre-alpha test instance of the sim2h switch board.
Sim2h is a centralized simulation of the Holochain network that connects all agents of the DHT through one central switch board
to enable easy debugging by logging all network traffic between all nodes.
<br>
You can run your own sim2h server to debug your hApp yourself.
The Holochain public server can be used for public testing during alpha stages.
<br>
<bold>
<bold class="disclaimer">
DISCLAIMER:
<ul>
<li>This public instance comes with no guarantee of up-time!</li>
<li>This is for testing only! Network traffic might be logged and stored for the purpose fo debugging Holochain during this alpha test phase!</li>
</ul>
</bold>
Please confirm:
<input type="checkbox" id="checkbox" v-model="disclaimer">
<label class="disclaimer-label" for="checkbox">I have understood that this is an early alpha test release and that all entry data might be logged for debugging purposes.</label>

</small>
</div>
Expand All @@ -168,7 +181,7 @@ <h5 class="modal-title" id="exampleModalLabel">Network Configuration...</h5>
</div>
<div class="modal-footer">
<button id="quit-button" type="button" class="btn btn-secondary quit-button" data-dismiss="modal">Quit</button>
<button id="set-network-type-button" type="button" class="btn btn-primary">Set Network Type</button>
<button id="set-network-type-button" type="button" class="btn btn-primary" :disabled="!disclaimer && network_type=='sim2h' && sim2h_url=='wss://sim2h.holochain.org:9000'">Set Network Type</button>
</div>
</div>
</div>
Expand All @@ -184,7 +197,9 @@ <h5 class="modal-title" id="exampleModalLabel">Network Configuration...</h5>
data: {
status: "Initializing...",
logs: require('electron').remote.getGlobal('holoscape').logMessages,
network_type: "sim1h"
network_type: "sim2h",
sim2h_url: 'wss://sim2h.holochain.org:9000',
disclaimer: false,
}
})

Expand Down

0 comments on commit 42145d1

Please sign in to comment.