mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +03:00
1. added multipath protocol and schema suport
2. added SCTP protocol and schema support 3. added set of NAS models support (Asustor, ReadyNAS, Drobo, QNAP, WD, Synology, Terramaster) 4. moved to fc00::/7 private segment 5. added Windows, MacOS and Linux UI for peers edit and current status
This commit is contained in:
parent
cfa293d189
commit
d8a4000141
198 changed files with 8589 additions and 697 deletions
BIN
contrib/ui/www/assets/ajax-loader.gif
Normal file
BIN
contrib/ui/www/assets/ajax-loader.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
160
contrib/ui/www/assets/edrive.css
Normal file
160
contrib/ui/www/assets/edrive.css
Normal file
|
@ -0,0 +1,160 @@
|
|||
.hide{display:none;}
|
||||
|
||||
body {
|
||||
font: 12px Verdana;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
hr {
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 2px solid gray;
|
||||
}
|
||||
a { color: #02b7ff; }
|
||||
|
||||
::-webkit-input-placeholder { color: #666 !important; }
|
||||
:-moz-placeholder { color: #666 !important; }
|
||||
::-moz-placeholder { color: #666 !important; }
|
||||
:-ms-input-placeholder { color: #666 !important; }
|
||||
|
||||
.nas-apps-config-form-message {
|
||||
background: #ccc;
|
||||
color: black;
|
||||
padding: 6px 12px;
|
||||
margin: 0 8px 8px 8px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background-color: #00c81e;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-message-error {
|
||||
background-color: #fa1c1ce8;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-middle {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-top {
|
||||
padding: 10px 20px;
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.nas-apps-config-form-bottom {
|
||||
text-align: right;
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.nas-apps-config-form-left { float: left; }
|
||||
.nas-apps-config-form-right {
|
||||
float: right;
|
||||
width: 200px;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-link-info {
|
||||
margin: 5px 0 20px 0;
|
||||
}
|
||||
|
||||
/* top */
|
||||
.nas-apps-config-form-app-logo {
|
||||
height: 110px;
|
||||
background: center center no-repeat;
|
||||
background-size: 439px 90px;
|
||||
background-image: url(logo.png),url(logo.svg);
|
||||
}
|
||||
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
||||
.nas-apps-config-form-app-logo { background-image: url(copy_logo@2x.png); }
|
||||
}
|
||||
.nas-apps-config-form-app-version {
|
||||
font-size: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* bottom */
|
||||
.nas-apps-config-form-partner-logo {
|
||||
height: 110px;
|
||||
background: center center no-repeat;
|
||||
background-image: url(partner-logo.png),url(partner-logo.svg);
|
||||
}
|
||||
|
||||
.nas-apps-config-form-auth {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.nas-apps-config-form-auth-id,
|
||||
.nas-apps-config-form-location-name {
|
||||
margin: 8px;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
.nas-apps-config-form-auth-link {
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-field-label {
|
||||
display: block;
|
||||
margin: 4px 8px -4px 8px;
|
||||
font-size: 10px;
|
||||
color: #999;
|
||||
}
|
||||
.nas-apps-config-form-field input,
|
||||
.nas-apps-config-form-field select {
|
||||
background: transparent;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 10px;
|
||||
padding: 6px 12px;
|
||||
font: 12px Verdana;
|
||||
border: 1px solid #666;
|
||||
margin: 8px;
|
||||
width: 200px;
|
||||
box-sizing: border-box;
|
||||
-o-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.nas-apps-config-form-field select:focus option {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-field input:focus,
|
||||
.nas-apps-config-form-field select:focus {
|
||||
border: 2px solid #02b7ff;
|
||||
outline: none;
|
||||
margin: 7px;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-button {
|
||||
height: 30px;
|
||||
width: 75px;
|
||||
color: white;
|
||||
background: black;
|
||||
font: 12px Verdana;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #666;
|
||||
margin: 8px;
|
||||
padding: 0 16px;
|
||||
cursor: pointer;
|
||||
background: -webkit-linear-gradient(#3f3f3f, #000);
|
||||
}
|
||||
|
||||
.nas-apps-config-form-button.nas-apps-feedback-button {
|
||||
width: auto !important;
|
||||
margin: 0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.nas-apps-config-form-button[type=submit] {
|
||||
border-color: #c1d3dc;
|
||||
background: -webkit-linear-gradient(#405f70, #000);
|
||||
box-shadow: inset 0 0 6px #405f70;
|
||||
}
|
||||
|
||||
.nas-apps-config-nas-logout-block {
|
||||
text-align: right;
|
||||
}
|
416
contrib/ui/www/assets/edrive.js
Normal file
416
contrib/ui/www/assets/edrive.js
Normal file
|
@ -0,0 +1,416 @@
|
|||
$(function () {
|
||||
var ed = 'ed' in window ? window.ed : {};
|
||||
var info = {
|
||||
devicename : null,
|
||||
vaultUrl : "https://github.com/RiV-chain/RiV-mesh"
|
||||
};
|
||||
var basicEDWebsite = "https://github.com/RiV-chain/RiV-mesh";
|
||||
var authNASScreen = '#authNASScreen';
|
||||
var isLoggedInMode = false;
|
||||
|
||||
$.ajaxSetup({cache: false});
|
||||
|
||||
var fillAjax = function (url, ajax) {
|
||||
ajax.url = "api/" + url;
|
||||
ajax.contentType = 'application/json';
|
||||
if ('fillAjax' in ed) {
|
||||
ed.fillAjax(ajax);
|
||||
}
|
||||
return ajax;
|
||||
};
|
||||
|
||||
var loadingMode = function (message) {
|
||||
$('#signupScreen').hide();
|
||||
$('#statusScreen').hide();
|
||||
$('#loginScreen').hide();
|
||||
$(authNASScreen).hide();
|
||||
$('#loadingMessage').text(message);
|
||||
$('#loadingScreen').show();
|
||||
};
|
||||
|
||||
var signupMode = function () {
|
||||
$('#signupScreen').show();
|
||||
$('#loadingScreen').hide();
|
||||
$('#statusScreen').hide();
|
||||
$('#loginScreen').hide();
|
||||
$('#signupAlert').hide();
|
||||
$('#inputPeerIPS').val('');
|
||||
$('#inputPeerPortS').val('');
|
||||
$('#inputPortConfirm').val('');
|
||||
};
|
||||
|
||||
var statusMode = function () {
|
||||
$('#signupScreen').hide();
|
||||
$('#loadingScreen').hide();
|
||||
$('#statusScreen').show();
|
||||
$('#loginScreen').hide();
|
||||
};
|
||||
|
||||
var errorHandler = function (httpObj) {
|
||||
if (httpObj.status > 300) {
|
||||
$('#loadingScreen').hide();
|
||||
if (httpObj.status === 401) {
|
||||
$('#signupScreen').hide();
|
||||
$('#statusScreen').hide();
|
||||
$('#loginScreen').hide();
|
||||
$('#loginToYourNAS').prop("href", ed.getNasAuthUrl());
|
||||
$(authNASScreen).show();
|
||||
$("#nasLogoutBlock").hide();
|
||||
} else {
|
||||
console.error(httpObj);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var loginMode = function () {
|
||||
$('#loadingScreen').hide();
|
||||
$('#statusScreen').hide();
|
||||
$('#signupScreen').hide();
|
||||
$('#loginScreen').show();
|
||||
};
|
||||
|
||||
var infoErrorCheckerScheduled = false;
|
||||
|
||||
var updateInfo = function (response) {
|
||||
info = {};
|
||||
for (var key in response) {
|
||||
info[key] = response[key];
|
||||
}
|
||||
for (var key in ed) {
|
||||
info[key] = ed[key];
|
||||
}
|
||||
};
|
||||
|
||||
var checkInfoError = function (response, forceSchedule) {
|
||||
forceSchedule = typeof (forceSchedule) !== "undefined" ? forceSchedule : true;
|
||||
if(isLoggedInMode) {
|
||||
if (response.isAuthenticated === false) {
|
||||
$('#statusAlert').html('Login failed: ' + response.authStatus);
|
||||
$('#statusAlert').addClass("nas-apps-config-form-message-error");
|
||||
$('#statusAlert').show();
|
||||
} else {
|
||||
$('#statusAlert').hide();
|
||||
}
|
||||
}
|
||||
if (response.appStatus === 'error') {
|
||||
$('#applicationAlert').html(response.errorMessage + '<br><br>Please resolve error before continue');
|
||||
$('#applicationAlert').show();
|
||||
$('#loginBtn').prop('disabled', true);
|
||||
$('#signupBtn').prop('disabled', true);
|
||||
$('#inputPeerIP').prop('disabled', true);
|
||||
$('#inputPeerPort').prop('disabled', true);
|
||||
$('#inputPeerIPS').prop('disabled', true);
|
||||
$('#inputPeerPortS').prop('disabled', true);
|
||||
$('#inputPortConfirm').prop('disabled', true);
|
||||
} else {
|
||||
$('#applicationAlert').hide();
|
||||
$('#loginBtn').prop('disabled', false);
|
||||
$('#signupBtn').prop('disabled', false);
|
||||
$('#inputPeerIP').prop('disabled', false);
|
||||
$('#inputPeerPort').prop('disabled', false);
|
||||
$('#inputPeerIPS').prop('disabled', false);
|
||||
$('#inputPeerPortS').prop('disabled', false);
|
||||
$('#inputPortConfirm').prop('disabled', false);
|
||||
}
|
||||
if(infoErrorCheckerScheduled !== true || forceSchedule === true) {
|
||||
$.ajax(fillAjax('getself', {})).done(function (response) {
|
||||
updateInfo(response);
|
||||
setTimeout(function(){checkInfoError(response, true);}, 1000);
|
||||
});
|
||||
infoErrorCheckerScheduled = true;
|
||||
}
|
||||
};
|
||||
|
||||
var startMode = function () {
|
||||
$('#loginAlert').hide();
|
||||
$('#inputPeerIP').val('');
|
||||
$('#inputPeerPort').val('');
|
||||
$.ajax(fillAjax('getself', {})).done(function (response) {
|
||||
if (ed.useAuthNASRichScreen) {
|
||||
$("#nasLogoutBlock").show();
|
||||
$('.nas-user-name').text(ed.getNasUser());
|
||||
}
|
||||
loginMode();
|
||||
if (response.size !== 0) {
|
||||
isLoggedInMode = true;
|
||||
statusMode();
|
||||
}
|
||||
var self = response;
|
||||
checkInfoError(response);
|
||||
$('#version').html((self.build_version !== null ? self.build_version : ' ') + (self.build_name !== null ? (' (' + self.build_name + ')') : ''));
|
||||
$('.nas-apps-config-form-app-version').show();
|
||||
$('#username').text(self.address);
|
||||
updateInfo(response);
|
||||
}).fail(errorHandler);
|
||||
$('#nasLoginAlert').hide();
|
||||
$('#nasInputPassword').val('');
|
||||
};
|
||||
|
||||
var waitForEvent = function (eventType, onSuccess, onError, timeout, startTime) {
|
||||
startTime = typeof (startTime) === "undefined" ? new Date() : startTime;
|
||||
timeout = typeof (timeout) === "undefined" ? Infinity : timeout;
|
||||
setTimeout(function () {
|
||||
if (((new Date()) - startTime) > timeout) {
|
||||
onError("timeout");
|
||||
} else {
|
||||
$.ajax(fillAjax('events', {
|
||||
method: 'GET'
|
||||
})).done(function (response) {
|
||||
for (var k in response) {
|
||||
if (response[k].sourceType === eventType) {
|
||||
$.ajax(fillAjax('event/' + k, {
|
||||
method: 'DELETE'
|
||||
}));
|
||||
if (response[k].type === 'success')
|
||||
onSuccess();
|
||||
else if (response[k].type === 'error')
|
||||
onError(response[k].errorMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
waitForEvent(eventType, onSuccess, onError, timeout, startTime);
|
||||
}).fail(function (httpObj) {
|
||||
if (httpObj.status === 0) {
|
||||
waitForEvent(eventType, onSuccess, onError, timeout, startTime);
|
||||
} else {
|
||||
errorHandler(httpObj);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
var loginDoneHandler = function () {
|
||||
function onSuccess() {
|
||||
//Show logged in screen
|
||||
$('#username').text(($('#inputPeerIPS').val() === "") ? $('#inputPeerIP').val() : $('#inputPeerIPS').val());
|
||||
statusMode();
|
||||
$('#statusAlert').html($('#loginSuccess').html());
|
||||
$('#statusAlert').removeClass("nas-apps-config-form-message-error");
|
||||
$('#statusAlert').show();
|
||||
}
|
||||
function onError(message) {
|
||||
if (message === "timeout") {
|
||||
$.ajax(fillAjax('info', {})).done(function (response) {
|
||||
if (response.isAuthenticated === false) {
|
||||
waitForEvent("login", onSuccess, onError, 30000);
|
||||
} else {
|
||||
onSuccess();
|
||||
}
|
||||
}).fail(errorHandler);
|
||||
} else {
|
||||
if (message === "PEER_UNAVAILABLE" || message === "DN_UNRESOLVED") {
|
||||
message = "Unable to connect to a peer";
|
||||
}
|
||||
$('#loginAlert').html(message);
|
||||
$('#loginAlert').show();
|
||||
loginMode();
|
||||
}
|
||||
}
|
||||
waitForEvent("login", onSuccess, onError, 30000);
|
||||
};
|
||||
|
||||
$('#loginBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
if ($('#loadingScreen').is(":visible")) return;
|
||||
$('#inputPeerIP').val($('#inputPeerIP').val().trim());
|
||||
if ($('#inputPeerIP').val().length === 0 || $('#inputPeerPort').val().trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
$('#loginAlert').hide();
|
||||
loadingMode($('#loginLoadingMessage').text());
|
||||
|
||||
$.ajax(fillAjax('user', {
|
||||
method: 'POST',
|
||||
data: JSON.stringify({user: $('#inputPeerIP').val(), pass: $('#inputPeerPort').val()})
|
||||
})).done(loginDoneHandler).statusCode({202: loginDoneHandler}).fail(errorHandler);
|
||||
});
|
||||
|
||||
|
||||
$("#inputPeerIP, #inputPeerPort").keypress(function (e) {
|
||||
if (e.which === 13) {
|
||||
$("#loginBtn").trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
$('#logoutBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
if ($('#loadingScreen').is(":visible")) return;
|
||||
|
||||
loadingMode($('#logoutLoadingMessage').text());
|
||||
var doneHandler = function () {
|
||||
$('#inputPeerIP').val('');
|
||||
$('#inputPeerPort').val('');
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 5000);
|
||||
};
|
||||
$.ajax(fillAjax('user', {
|
||||
method: 'DELETE'
|
||||
})).done(doneHandler).statusCode({202: doneHandler}).fail(errorHandler);
|
||||
});
|
||||
|
||||
$('#manageBackups').click(function (e) {
|
||||
e.preventDefault();
|
||||
$.ajax(fillAjax('autologin', {
|
||||
async: false
|
||||
})).done(function (response) {
|
||||
var params = response.autologinToken;
|
||||
params["tab"] = "naswizard";
|
||||
params["dname"] = info.devicename;
|
||||
window.open(info.vaultUrl + "/account/login.aspx?" + $.param(params), "_blank");
|
||||
}).fail(errorHandler);
|
||||
});
|
||||
|
||||
var currentLocation = function () {
|
||||
var url = location.href;
|
||||
// http://xxx/<path>/ -> http://xxx/<path>/
|
||||
if (url.slice(-1) === "/") {
|
||||
return url;
|
||||
// http://xxx/<path>/index.html -> http://xxx/<path>/
|
||||
} else if (url.lastIndexOf("/") < url.lastIndexOf(".")) {
|
||||
return url.substring(0, url.lastIndexOf("/") + 1);
|
||||
// http://xxx/<path> -> http://xxx/<path>/
|
||||
} else {
|
||||
return url + "/";
|
||||
}
|
||||
};
|
||||
|
||||
$('#logFileBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
window.open(currentLocation().split("#")[0] + 'log', "_blank");
|
||||
});
|
||||
|
||||
$('#getDiagFileBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
window.open(currentLocation().split("#")[0] + 'diagnostics.zip');
|
||||
});
|
||||
|
||||
$('#checkPeerBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
window.open(info.vaultUrl + "/account/check_peer?UName=" + encodeURIComponent($('#inputPeerIP').val().trim()), "_blank");
|
||||
});
|
||||
|
||||
$('#goToSignupBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
signupMode();
|
||||
});
|
||||
|
||||
$('#signupBackToLoginBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
startMode();
|
||||
});
|
||||
|
||||
var signupDoneHandler = function () {
|
||||
waitForEvent("register", loginDoneHandler, function (message) {
|
||||
$('#loadingScreen').hide();
|
||||
$('#signupScreen').show();
|
||||
$('#signupAlert').html(message);
|
||||
$('#signupAlert').show();
|
||||
});
|
||||
};
|
||||
|
||||
$('#signupBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
if ($('#loadingScreen').is(":visible")) return;
|
||||
|
||||
if ($('#inputPeerPortS').val() !== $('#inputPortConfirm').val()) {
|
||||
$('#signupAlert').text($('#hostFormatError').text());
|
||||
$('#signupAlert').show();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#inputPeerIPS').val($('#inputPeerIPS').val().trim());
|
||||
loadingMode($('#signupLoadingMessage').text());
|
||||
|
||||
$.ajax(fillAjax('user', {
|
||||
method: 'PUT',
|
||||
data: JSON.stringify({user: $('#inputPeerIPS').val(), pass: $('#inputPeerPortS').val(), c: ed.partnerId})
|
||||
})).done(signupDoneHandler).statusCode({202: signupDoneHandler}).fail(errorHandler);
|
||||
}); //signupBtn.click
|
||||
|
||||
$("#inputPeerIPS, #inputPeerPortS, #inputPortConfirm").keypress(function (e) {
|
||||
if (e.which === 13) {
|
||||
$("#signupBtn").trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
var nasLoginSuccess = function () {
|
||||
$('.nas-user-name').text(ed.getNasUser());
|
||||
};
|
||||
|
||||
var nasLoginFailure = function (message) {
|
||||
//Show notification: IP/DN errors
|
||||
if (typeof message !== 'undefined') {
|
||||
$('#nasLoginAlert').html(message);
|
||||
} else {
|
||||
$('#nasLoginAlert').text($('#ipOrDNError').text());
|
||||
}
|
||||
$(authNASScreen).show();
|
||||
$('#nasInputPassword').val('');
|
||||
$('#nasLoginAlert').show();
|
||||
$('#loadingScreen').hide();
|
||||
};
|
||||
|
||||
$('#nasLoginBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#nasInputUser').val($('#nasInputUser').val().trim());
|
||||
if ($('#nasInputUser').val().length === 0 || $('#nasInputPassword').val().trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
$('#nasLoginAlert').hide();
|
||||
loadingMode($('#loginLoadingMessage').text());
|
||||
ed.nasLoginCall(nasLoginSuccess, nasLoginFailure);
|
||||
});
|
||||
|
||||
|
||||
$("#nasInputUser, #nasInputPassword").keypress(function (e) {
|
||||
if (e.which === 13) {
|
||||
$("#nasLoginBtn").trigger("click");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#nasLogoutBtn').click(function (e) {
|
||||
e.preventDefault();
|
||||
ed.nasLogoutCall();
|
||||
$("#nasLogoutBlock").hide();
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
var main = function () {
|
||||
document.getElementById("dynamic_body").style.display = "block";
|
||||
$('title').text(ed.applicationName);
|
||||
$('.nas-os-name').text(ed.nasOSName);
|
||||
if ('nasVisitEDWebsiteLogin' in ed) {
|
||||
$('.nas-visit-ed-website-login').prop("href", ed.nasVisitEDWebsiteLogin);
|
||||
} else {
|
||||
$('.nas-visit-ed-website-login').prop("href", basicEDWebsite);
|
||||
}
|
||||
if ('nasVisitEDWebsiteSignup' in ed) {
|
||||
$('.nas-visit-ed-website-signup').prop("href", ed.nasVisitEDWebsiteSignup);
|
||||
} else {
|
||||
$('.nas-visit-ed-website-signup').prop("href", basicEDWebsite);
|
||||
}
|
||||
if ('nasVisitEDWebsiteLoggedin' in ed) {
|
||||
$('.nas-visit-ed-website-loggedin').prop("href", ed.nasVisitEDWebsiteLoggedin);
|
||||
} else {
|
||||
$('.nas-visit-ed-website-loggedin').prop("href", basicEDWebsite);
|
||||
}
|
||||
if ('signingUpMessageHtml' in ed) {
|
||||
$('#signingUpMessage').html(ed.signingUpMessageHtml);
|
||||
}
|
||||
if ('signingUpPropositionMessageHtml' in ed) {
|
||||
$('#signingUpPropositionMessage').html(ed.signingUpPropositionMessageHtml);
|
||||
}
|
||||
if ('useAuthNASRichScreen' in ed && ed.useAuthNASRichScreen) {
|
||||
authNASScreen = '#authNASRichScreen';
|
||||
} else {
|
||||
ed.useAuthNASRichScreen = false;
|
||||
}
|
||||
startMode();
|
||||
};
|
||||
|
||||
main();
|
||||
|
||||
});
|
BIN
contrib/ui/www/assets/favicon.png
Normal file
BIN
contrib/ui/www/assets/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
5
contrib/ui/www/assets/jquery.min.js
vendored
Normal file
5
contrib/ui/www/assets/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
contrib/ui/www/assets/logo.png
Normal file
BIN
contrib/ui/www/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
214
contrib/ui/www/index.html
Normal file
214
contrib/ui/www/index.html
Normal file
|
@ -0,0 +1,214 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
<link href="assets/edrive.css" rel="stylesheet" media="all">
|
||||
<link href="assets/partner.css" rel="stylesheet" media="all">
|
||||
<link rel="icon" type="image/x-icon" href="assets/favicon.png">
|
||||
<title>RiV-Mesh</title>
|
||||
<script src="assets/jquery.min.js"></script>
|
||||
<script src="assets/properties.js"></script>
|
||||
<script src="assets/edrive.js"></script>
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function(event) {
|
||||
setTimeout(function () {
|
||||
if(document.getElementById("dynamic_body").style.display === 'none') {
|
||||
document.getElementById("static_body").style.display = "block";
|
||||
}
|
||||
}, 100)
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="dynamic_body" style="display: none;">
|
||||
<div class="nas-apps-config-form-top">
|
||||
<div id="nasLogoutBlock" class="nas-apps-config-nas-logout-block hide"><a id="nasLogoutBtn" href="#">Log Out <b class="nas-user-name">Device User</b></a></div>
|
||||
<div class="nas-apps-config-form-app-logo"></div>
|
||||
<div class="nas-apps-config-form-app-version hide">Version <span id="version"></span></div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div id="applicationAlert" class="nas-apps-config-form-middle nas-apps-config-form-message nas-apps-config-form-message-error hide">
|
||||
Application error: Something went wrong
|
||||
</div>
|
||||
|
||||
<div id="loginScreen" class="nas-apps-config-form-middle hide">
|
||||
|
||||
<div id="loginAlert" class="nas-apps-config-form-message nas-apps-config-form-message-error hide">
|
||||
peer is unavailable
|
||||
</div>
|
||||
<h2 style="text-align: center;">Sign in with your RiV-Mesh credentials<br>to connect to your RiV-Mesh account</h2>
|
||||
<form id="loginForm" class="form-horizontal nas-apps-config-form-left">
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="inputEmail">Host</label>
|
||||
<input type="text" id="inputHost" placeholder="Host">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="inputPort">Port</label>
|
||||
<input id="inputPort" placeholder="Port">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<button id="loginBtn" type="submit" class="nas-apps-config-form-button" style="width: 110px">Add</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="nas-apps-config-form-right">
|
||||
<div>
|
||||
<a id="goToSignupBtn" href="#"><b>Sign Up</b></a>
|
||||
<div class="nas-apps-config-form-link-info" id="signingUpPropositionMessage">Don't have an RiV-Mesh peer? Add it here</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a id="checkPeerBtn" href='#' >Check peer online</a>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<a class="nas-visit-ed-website-login" href="#" target="_blank">Visit RiV-Mesh Website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="loadingScreen" class="hide" style="text-align:center; margin: 60px 0 60px 0">
|
||||
<h4>
|
||||
<span id="loadingMessage"></span> <span style="padding-left: 3px; padding-right: 3px;"></span> ...
|
||||
</h4>
|
||||
<br />
|
||||
<div style="margin-top:6px"> <img src="assets/ajax-loader.gif"> </div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="statusScreen" class="nas-apps-config-form-middle hide" style="text-align: center">
|
||||
|
||||
<div class=row>
|
||||
<div id="statusAlert" class="nas-apps-config-form-message hide">
|
||||
Successfully connected
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h4><font size=3>IPv6: <span class="nas-apps-config-form-auth-id" id="username"></span> </font> </h4>
|
||||
<br/>
|
||||
<button id="logoutBtn" class="nas-apps-config-form-button" style="width: 220px">Edit peers » </button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<br/><br/><br/>
|
||||
<a style="text-decoration: underline" target="_blank" class="nas-visit-ed-website-loggedin" href="#"><b>Learn more about RiV-Mesh</b></a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<br/><br/><br/>
|
||||
<a id='logFileBtn' style="text-decoration: underline" target="_blank" href="#">View log file</a>
|
||||
<br/>
|
||||
<a id='getDiagFileBtn' style="text-decoration: underline" target="_blank" href="#">Download diagnostics</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="authNASScreen" class="nas-apps-config-form-middle hide">
|
||||
<h2 style="text-align: center;">
|
||||
Warning: This browser is not yet authorized to access application like RiV-Mesh on your <span class="nas-os-name">device</span>. <br/><br/>
|
||||
Please <a id="loginToYourNAS" href='#'>login to your NAS device</a> and then try again.
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="authNASRichScreen" class="nas-apps-config-form-middle hide">
|
||||
<div id="nasLoginAlert" class="nas-apps-config-form-message nas-apps-config-form-message-error hide">
|
||||
Wrong username/password
|
||||
</div>
|
||||
|
||||
<h2 style="text-align: center">Please sign with your NAS credentials</h2>
|
||||
<form id="nasLoginForm" class="form-horizontal nas-apps-config-form-left" style="text-align: center; width:500px">
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="nasInputUser"><span class="nas-os-name">device</span> User</label>
|
||||
<input type="text" id="nasInputUser" placeholder="NAS Device user name">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="nasInputPassword">Password</label>
|
||||
<input type="password" id="nasInputPassword" placeholder="Password">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<button id="nasLoginBtn" type="submit" class="nas-apps-config-form-button" style="width: 110px">Login</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="signupScreen" class="nas-apps-config-form-middle hide">
|
||||
|
||||
<div id="signupAlert" class="nas-apps-config-form-message nas-apps-config-form-message-error hide">
|
||||
Wrong IP/port
|
||||
</div>
|
||||
|
||||
<form id="signupForm" class="form-horizontal nas-apps-config-form-left">
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="inputIPS">Host</label>
|
||||
<input type="text" id="inputIPS" placeholder="Host">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="inputPortS">Port</label>
|
||||
<input id="inputPortS" placeholder="Port">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<label class="nas-apps-config-form-field-label" for="inputPortConfirm">Confirm port</label>
|
||||
<input id="inputPortConfirm" placeholder="Confirm port">
|
||||
</div>
|
||||
|
||||
<div class="nas-apps-config-form-field">
|
||||
<button id="signupBtn" type="submit" class="nas-apps-config-form-button" style="width: 110px">Add</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="nas-apps-config-form-right">
|
||||
<div>
|
||||
<div class="nas-apps-config-form-link-info">
|
||||
<b id="signingUpMessage">If you are operating RiV-mesh peer and may create your pool request with your new per or use existing one <a href="https://github.com/RiV-chain/public-peers.">in GitHub</a></b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a id="signupBackToLoginBtn" href="#">Back to login</a>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
<a class="nas-visit-ed-website-signup" href="#" target="_blank">Visit RiV-Mesh Website</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="loginLoadingMessage" class="hide">Logging in </div>
|
||||
<div id="logoutLoadingMessage" class="hide">Logging out </div>
|
||||
<div id="signupLoadingMessage" class="hide">Addeing new peer<span class="nas-os-name">device</span></div>
|
||||
<div id="loginSuccess" class="hide">Successfully linked your RiV-Mesh account with your <span class="nas-os-name">device</span>!</div>
|
||||
<div id="ipOrDNError" class="hide">Peer host is uanavailable</div>
|
||||
<div id="hostFormatError" class="hide">Host format is incorrect: should be an IP or domain name</div>
|
||||
<hr />
|
||||
|
||||
<div class="nas-apps-config-form-bottom">
|
||||
<div class="nas-apps-config-form-partner-logo"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="static_body" style="display: none;">
|
||||
<h1 style="text-align: center;">Cannot render application interface</h1>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue