mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add server management to web client
This commit is contained in:
parent
6b8d9149bc
commit
f7ba95439b
11 changed files with 363 additions and 46 deletions
|
@ -751,19 +751,25 @@
|
|||
});
|
||||
};
|
||||
|
||||
function replaceAll(str, find, replace) {
|
||||
|
||||
return str.split(find).join(replace);
|
||||
|
||||
//return str.replace(new RegExp(find, 'g'), replace);
|
||||
}
|
||||
|
||||
self.getConnectPasswordHash = function (password) {
|
||||
|
||||
password = password || '';
|
||||
|
||||
password = password
|
||||
.replace("&", "&")
|
||||
.replace("/", "\")
|
||||
.replace("!", "!")
|
||||
.replace("$", "$")
|
||||
.replace("\"", """)
|
||||
.replace("<", "<")
|
||||
.replace(">", ">")
|
||||
.replace("'", "'");
|
||||
password = replaceAll(password, "&", "&");
|
||||
password = replaceAll(password, "/", "\");
|
||||
password = replaceAll(password, "!", "!");
|
||||
password = replaceAll(password, "$", "$");
|
||||
password = replaceAll(password, "\"", """);
|
||||
password = replaceAll(password, "<", "<");
|
||||
password = replaceAll(password, ">", ">");
|
||||
password = replaceAll(password, "'", "'");
|
||||
|
||||
return CryptoJS.MD5(password).toString();
|
||||
};
|
||||
|
@ -784,6 +790,50 @@
|
|||
|
||||
})[0];
|
||||
};
|
||||
|
||||
self.getUserInvitations = function () {
|
||||
|
||||
var url = "https://connect.mediabrowser.tv/service/servers?userId=" + self.connectUserId() + "&status=Waiting";
|
||||
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
headers: {
|
||||
"X-Connect-UserToken": self.connectToken()
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
self.deleteServer = function (serverId) {
|
||||
|
||||
var url = "https://connect.mediabrowser.tv/service/serverAuthorizations?serverId=" + serverId + "&userId=" + self.connectUserId();
|
||||
|
||||
return $.ajax({
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
headers: {
|
||||
"X-Connect-UserToken": self.connectToken()
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
self.acceptServer = function (authorizationId) {
|
||||
|
||||
var url = "https://connect.mediabrowser.tv/service/ServerAuthorizations/accept?id=" + authorizationId;
|
||||
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
headers: {
|
||||
"X-Connect-UserToken": self.connectToken()
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
})(window, jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue