Feature/home page improve (#4602)

* Add new MyRRF custom printer

* hide user panel when networking plugin is not installed/used

* Fixed a bug that promption of installing plugin notification was not displayed when trying to switch to Bambu device tab

* replay missing_connection animated image when switching to device tab
This commit is contained in:
SoftFever 2024-03-22 19:30:13 +08:00 committed by GitHub
parent 2d737f62b5
commit 1e08b855df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 710 additions and 814 deletions

View file

@ -80,62 +80,54 @@ function Set_RecentFile_MouseRightBtn_Event()
}
function SetLoginPanelVisibility(visible) {
var leftBoard = document.getElementById("LeftBoard");
if (visible) {
leftBoard.style.display = "block";
} else {
leftBoard.style.display = "none";
}
}
function HandleStudio( pVal )
{
let strCmd = pVal['command'];
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=="studio_set_mallurl" )
{
SetMallUrl( pVal['data']['url'] );
}
else if( strCmd=="studio_clickmenu" )
{
let strName=pVal['data']['menu'];
GotoMenu(strName);
}
else if( strCmd=="network_plugin_installtip" )
{
let nShow=pVal["show"]*1;
if(nShow==1)
{
$("#NoPluginTip").show();
$("#NoPluginTip").css("display","flex");
}
else
{
$("#NoPluginTip").hide();
}
}
else if( strCmd=="modelmall_model_advise_get")
{
//alert('hot');
if( m_HotModelList!=null )
{
let SS1=JSON.stringify(pVal['hits']);
let SS2=JSON.stringify(m_HotModelList);
if( SS1==SS2 )
return;
}
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 == "studio_set_mallurl") {
SetMallUrl(pVal["data"]["url"]);
} else if (strCmd == "studio_clickmenu") {
let strName = pVal["data"]["menu"];
m_HotModelList=pVal['hits'];
ShowStaffPick( m_HotModelList );
}
GotoMenu(strName);
} else if (strCmd == "network_plugin_installtip") {
let nShow = pVal["show"] * 1;
if (nShow == 1) {
$("#NoPluginTip").show();
$("#NoPluginTip").css("display", "flex");
} else {
$("#NoPluginTip").hide();
}
} else if (strCmd == "modelmall_model_advise_get") {
//alert('hot');
if (m_HotModelList != null) {
let SS1 = JSON.stringify(pVal["hits"]);
let SS2 = JSON.stringify(m_HotModelList);
if (SS1 == SS2) return;
}
m_HotModelList = pVal["hits"];
ShowStaffPick(m_HotModelList);
} else if (data.cmd === "SetLoginPanelVisibility") {
SetLoginPanelVisibility(data.visible);
}
}
function GotoMenu( strMenu )