yggdrasil-go/contrib/ui/nas-asustor/www/assets/properties.js
vadym d8a4000141 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
2022-10-27 22:03:37 +03:00

35 lines
1.3 KiB
JavaScript

var ed = {
partnerId: 1422,
applicationName: 'RiV Mesh Asustor ADM App',
nasOSName: 'Asustor ADM',
useAuthNASRichScreen: true,
nasVisitEDWebsiteLogin: "https://github.com/RiV-chain/RiV-mesh",
nasVisitEDWebsiteSignup: "https://github.com/RiV-chain/RiV-mesh",
nasVisitEDWebsiteLoggedin: "https://github.com/RiV-chain/RiV-mesh",
getNasAuthUrl: function () {
return "/";
},
nasLoginCall: function (nasLoginSuccess, nasLoginFailure) {
var d = new Date();
d.setTime(d.getTime() + (10 * 60 * 1000));
document.cookie = "access_key=" + btoa( "user=" + encodeURIComponent($('#nasInputUser').val()) + ";pwd=" + encodeURIComponent($('#nasInputPassword').val()))+ "; expires=" + d.toUTCString() + "; path=/";
$.ajax({url: "api/getself"}).done(function () {
window.location.reload();
}).fail(function () {
ed.nasLogoutCall();
nasLoginFailure();
});
},
nasLogoutCall: function () {
document.cookie = "access_key=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/";
},
getNasUser: function() {
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
return decodeURIComponent(atob(getCookie('access_key')).split(';')[0].split('=')[1]);
}
};