mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Introducing Orca Cloud: https://cloud.orcaslicer.com (#13414)
* Add OrcaCloud sync platform and preset bundle sharing system Introduce OrcaCloud, a cloud sync platform for user presets, alongside a preset bundle system that enables sharing printer/filament/process profiles as local exportable bundles or subscribed cloud bundles. OrcaCloud platform: - Auth to Orca Cloud - Encrypted token storage (file-based or system keychain) - User preset sync with - Profile migration from default/bambu folders on first login - Homepage integration with entrance to cloud.orcaslicer.com Preset bundles: - Local bundle import/export with bundle_structure.json metadata - Subscribed cloud bundles with version-based update checking - Thread-safe concurrent bundle access with read-write mutex - Canonical bundle preset naming (_local/<id>/... and _subscribed/<id>/...) - Bundle presets are read-only; grouped under subheaders in combo boxes - PresetBundleDialog with auto-sync toggle, refresh, update notifications - Hyperlinked bundle names to cloud bundle pages Co-authored-by: Sabriel Koh <sabrielkcr@gmail.com> Co-authored-by: Derrick <derrick992110@gmail.com> Co-authored-by: Mykola Nahirnyi <mnahirnyi@amcbridge.com> Co-authored-by: Ian Chua <iancrb00@gmail.com> Co-authored-by: Draginraptor <draginraptor@gmail.com> Co-authored-by: ExPikaPaka <112851715+ExPikaPaka@users.noreply.github.com> Co-authored-by: Ian Bassi <ian.bassi@outlook.com> Co-authored-by: Ocraftyone <Ocraftyone@users.noreply.github.com> Co-authored-by: yw4z <ywsyildiz@gmail.com> Co-authored-by: peterm-m <101202951+peterm-m@users.noreply.github.com> * Fixed an issue on Windows it failed to login Orca Cloud with Google account
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//var TestData={"sequence_id":"0","command":"get_recent_projects","response":[{"path":"D:\\work\\Models\\Toy\\3d-puzzle-cube-model_files\\3d-puzzle-cube.3mf","time":"2022\/3\/24 20:33:10"},{"path":"D:\\work\\Models\\Art\\Carved Stone Vase - remeshed+drainage\\Carved Stone Vase.3mf","time":"2022\/3\/24 17:11:51"},{"path":"D:\\work\\Models\\Art\\Kity & Cat\\Cat.3mf","time":"2022\/3\/24 17:07:55"},{"path":"D:\\work\\Models\\Toy\\鐩村墤.3mf","time":"2022\/3\/24 17:06:02"},{"path":"D:\\work\\Models\\Toy\\minimalistic-dual-tone-whistle-model_files\\minimalistic-dual-tone-whistle.3mf","time":"2022\/3\/22 21:12:22"},{"path":"D:\\work\\Models\\Toy\\spiral-city-model_files\\spiral-city.3mf","time":"2022\/3\/22 18:58:37"},{"path":"D:\\work\\Models\\Toy\\impossible-dovetail-puzzle-box-model_files\\impossible-dovetail-puzzle-box.3mf","time":"2022\/3\/22 20:08:40"}]};
|
||||
|
||||
var m_HotModelList=null;
|
||||
var bambuSectionExpanded = false;
|
||||
|
||||
function OnInit()
|
||||
{
|
||||
@@ -8,6 +9,7 @@ function OnInit()
|
||||
TranslatePage();
|
||||
|
||||
SendMsg_GetLoginInfo();
|
||||
SendMsg_GetBambuLoginInfo();
|
||||
SendMsg_GetRecentFile();
|
||||
SendMsg_GetStaffPick();
|
||||
}
|
||||
@@ -77,11 +79,7 @@ function Set_RecentFile_MouseRightBtn_Event()
|
||||
|
||||
function SetLoginPanelVisibility(visible) {
|
||||
var leftBoard = document.getElementById("LeftBoard");
|
||||
if (visible) {
|
||||
leftBoard.style.display = "block";
|
||||
} else {
|
||||
leftBoard.style.display = "none";
|
||||
}
|
||||
leftBoard.style.display = "block";
|
||||
}
|
||||
|
||||
function HandleStudio( pVal )
|
||||
@@ -90,24 +88,41 @@ function HandleStudio( pVal )
|
||||
|
||||
if (strCmd == "get_recent_projects") {
|
||||
ShowRecentFileList(pVal["response"]);
|
||||
} else if (strCmd == "studio_userlogin") {
|
||||
SetLoginInfo(pVal["data"]["avatar"], pVal["data"]["name"]);
|
||||
} else if (strCmd == "studio_useroffline") {
|
||||
SetUserOffline();
|
||||
} else if (strCmd == "orca_userlogin") {
|
||||
SetOrcaLoginInfo(pVal["data"]["avatar"], pVal["data"]["name"]);
|
||||
} else if (strCmd == "orca_useroffline") {
|
||||
SetOrcaUserOffline();
|
||||
} else if (strCmd == "studio_bambu_userlogin") {
|
||||
SetBambuLoginInfo(pVal["data"]["avatar"], pVal["data"]["name"]);
|
||||
} else if (strCmd == "studio_bambu_useroffline") {
|
||||
SetBambuUserOffline();
|
||||
} else if (strCmd == "studio_set_mallurl") {
|
||||
SetMallUrl(pVal["data"]["url"]);
|
||||
} else if (strCmd == "studio_clickmenu") {
|
||||
let strName = pVal["data"]["menu"];
|
||||
|
||||
GotoMenu(strName);
|
||||
} else if (strCmd == "cloud_providers_info") {
|
||||
if (pVal["data"]["providers"] && pVal["data"]["providers"].indexOf("bbl") >= 0) {
|
||||
$("#BambuCloudSection").show();
|
||||
} else {
|
||||
$("#BambuCloudSection").hide();
|
||||
}
|
||||
} else if (strCmd == "network_plugin_installtip") {
|
||||
let nShow = pVal["show"] * 1;
|
||||
|
||||
if (nShow == 1) {
|
||||
// Auto-expand Bambu section to show the tip
|
||||
if (!bambuSectionExpanded) ToggleBambuSection();
|
||||
$("#BambuLogin1").hide();
|
||||
$("#NoPluginTip").show();
|
||||
$("#NoPluginTip").css("display", "flex");
|
||||
} else {
|
||||
$("#NoPluginTip").hide();
|
||||
// Only restore login button if not already logged in
|
||||
if ($("#BambuLogin2").is(":hidden")) {
|
||||
$("#BambuLogin1").show();
|
||||
}
|
||||
}
|
||||
} else if (strCmd == "modelmall_model_advise_get") {
|
||||
//alert('hot');
|
||||
@@ -120,8 +135,8 @@ function HandleStudio( pVal )
|
||||
|
||||
m_HotModelList = pVal["hits"];
|
||||
ShowStaffPick(m_HotModelList);
|
||||
} else if (data.cmd === "SetLoginPanelVisibility") {
|
||||
SetLoginPanelVisibility(data.visible);
|
||||
} else if (strCmd == "SetLoginPanelVisibility") {
|
||||
SetLoginPanelVisibility(pVal["data"]["visible"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,32 +161,32 @@ function GotoMenu( strMenu )
|
||||
}
|
||||
}
|
||||
|
||||
function SetLoginInfo( strAvatar, strName )
|
||||
function SetOrcaLoginInfo( strAvatar, strName )
|
||||
{
|
||||
$("#Login1").hide();
|
||||
|
||||
$("#OrcaLogin1").hide();
|
||||
|
||||
$("#UserName").text(strName);
|
||||
|
||||
|
||||
let OriginAvatar=$("#UserAvatarIcon").prop("src");
|
||||
if(strAvatar!=OriginAvatar)
|
||||
if(strAvatar != null && strAvatar.trim() !== '' && strAvatar!=OriginAvatar)
|
||||
$("#UserAvatarIcon").prop("src",strAvatar);
|
||||
else
|
||||
{
|
||||
//alert('Avatar is Same');
|
||||
}
|
||||
|
||||
$("#Login2").show();
|
||||
$("#Login2").css("display","flex");
|
||||
|
||||
$("#OrcaLogin2").show();
|
||||
$("#OrcaLogin2").css("display","flex");
|
||||
}
|
||||
|
||||
function SetUserOffline()
|
||||
function SetOrcaUserOffline()
|
||||
{
|
||||
$("#UserAvatarIcon").prop("src","img/c.jpg");
|
||||
$("#UserName").text('');
|
||||
$("#Login2").hide();
|
||||
|
||||
$("#Login1").show();
|
||||
$("#Login1").css("display","flex");
|
||||
$("#OrcaLogin2").hide();
|
||||
|
||||
$("#OrcaLogin1").show();
|
||||
$("#OrcaLogin1").css("display","flex");
|
||||
}
|
||||
|
||||
function SetMallUrl( strUrl )
|
||||
@@ -246,6 +261,17 @@ function SendMsg_GetLoginInfo()
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function SendSimpleCommand(command) {
|
||||
var tSend = {};
|
||||
tSend['sequence_id'] = Math.round(new Date() / 1000);
|
||||
tSend['command'] = command;
|
||||
SendWXMessage(JSON.stringify(tSend));
|
||||
}
|
||||
|
||||
function OnOrcaLoginOrRegister() { SendSimpleCommand("homepage_orca_login_or_register"); }
|
||||
function OnOrcaLogOut() { SendSimpleCommand("homepage_orca_logout"); }
|
||||
function SendMsg_GetOrcaLoginInfo() { SendSimpleCommand("get_orca_login_info"); }
|
||||
|
||||
|
||||
function SendMsg_GetRecentFile()
|
||||
{
|
||||
@@ -373,10 +399,52 @@ function OnLogOut()
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="homepage_logout";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
// --- Bambu Cloud Section ---
|
||||
|
||||
function ToggleBambuSection() {
|
||||
var body = document.getElementById('BambuCloudBody');
|
||||
var chevron = document.querySelector('.bambu-chevron');
|
||||
if (!body || !chevron) return;
|
||||
bambuSectionExpanded = !bambuSectionExpanded;
|
||||
if (bambuSectionExpanded) {
|
||||
body.classList.add('expanded');
|
||||
chevron.classList.add('expanded');
|
||||
} else {
|
||||
body.classList.remove('expanded');
|
||||
chevron.classList.remove('expanded');
|
||||
}
|
||||
}
|
||||
|
||||
function SetBambuLoginInfo(strAvatar, strName) {
|
||||
$("#BambuLogin1").hide();
|
||||
$("#BambuUserName").text(strName);
|
||||
if (strAvatar && strAvatar.trim() !== '') {
|
||||
$("#BambuAvatarIcon").prop("src", strAvatar);
|
||||
}
|
||||
$("#BambuLogin2").show();
|
||||
$("#BambuLogin2").css("display", "flex");
|
||||
$(".bambu-status-dot").addClass("online");
|
||||
}
|
||||
|
||||
function SetBambuUserOffline() {
|
||||
$("#BambuAvatarIcon").prop("src", "img/c.jpg");
|
||||
$("#BambuUserName").text('');
|
||||
$("#BambuLogin2").hide();
|
||||
if ($("#NoPluginTip").is(":hidden")) {
|
||||
$("#BambuLogin1").show();
|
||||
$("#BambuLogin1").css("display", "flex");
|
||||
}
|
||||
$(".bambu-status-dot").removeClass("online");
|
||||
}
|
||||
|
||||
function OnBambuLoginOrRegister() { SendSimpleCommand("homepage_bambu_login_or_register"); }
|
||||
function OnBambuLogOut() { SendSimpleCommand("homepage_bambu_logout"); }
|
||||
function SendMsg_GetBambuLoginInfo() { SendSimpleCommand("get_bambu_login_info"); }
|
||||
|
||||
function BeginDownloadNetworkPlugin()
|
||||
{
|
||||
var tSend={};
|
||||
@@ -431,19 +499,7 @@ function InitStaffPick()
|
||||
},
|
||||
slidesPerView : 'auto',
|
||||
slidesPerGroup : 3
|
||||
// autoplay: {
|
||||
// delay: 3000,
|
||||
// stopOnLastSlide: false,
|
||||
// disableOnInteraction: true,
|
||||
// disableOnInteraction: false
|
||||
// },
|
||||
// pagination: {
|
||||
// el: '.swiper-pagination',
|
||||
// },
|
||||
// scrollbar: {
|
||||
// el: '.swiper-scrollbar',
|
||||
// draggable: true
|
||||
// }
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user