1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
| #uses "classes/auth/OaAuthUI" #uses "panel"
OaAuthUI AuthUI;
const string username = "web_embed"; const string password = "web_embed";
const string DP_WEB_CONTROL = "Message_.";
string token;
main() { AuthUI.setUsername(username); AuthUI.setPassword(password);
if(AuthUI.getUsername() != "" && AuthUI.login() == OaAuthenticationError::None && AuthUI.setUiUser()) { AuthUI.setManagerUser(2); } else { noticeFailed.visible = true; }
titleBar(false);
moveModule(webModule.ModuleName, 0, 0);
if(!globalExists("NCC_PT_NODENAMES_GLOBAL")) { addGlobal("NCC_PT_NODENAMES_GLOBAL", DYN_LANGSTRING_VAR); addGlobal("NCC_PT_PANELNUMBER_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_PARENTNUMBER_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_DOWNWARDPANEL_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_UPWARDPANEL_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_PERMISSIONBIT_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_FILENAME_GLOBAL", DYN_STRING_VAR); addGlobal("NCC_PT_PANELTYPE_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_MODULENAME_GLOBAL", DYN_STRING_VAR); addGlobal("NCC_PT_SUMALERTNUMBER_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_MENUBAR_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_ICONBAR_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_MODAL_GLOBAL", DYN_BOOL_VAR); addGlobal("NCC_PT_CENTERED_GLOBAL", DYN_BOOL_VAR); addGlobal("NCC_PT_PARAMETER_GLOBAL", DYN_STRING_VAR); addGlobal("NCC_PT_ICONNAME_GLOBAL", DYN_STRING_VAR); addGlobal("NCC_PT_BACKWARDPANEL_GLOBAL", DYN_UINT_VAR); addGlobal("NCC_PT_FOREWARDPANEL_GLOBAL", DYN_UINT_VAR);
int error = dpGet("_PanelTopology.nodeName:_online.._value", NCC_PT_NODENAMES_GLOBAL, "_PanelTopology.panelNumber:_online.._value", NCC_PT_PANELNUMBER_GLOBAL, "_PanelTopology.parentNumber:_online.._value", NCC_PT_PARENTNUMBER_GLOBAL, "_PanelTopology.downwardPanel:_online.._value", NCC_PT_DOWNWARDPANEL_GLOBAL, "_PanelTopology.upwardPanel:_online.._value", NCC_PT_UPWARDPANEL_GLOBAL, "_PanelTopology.permissionBit:_online.._value", NCC_PT_PERMISSIONBIT_GLOBAL, "_PanelTopology.fileName:_online.._value", NCC_PT_FILENAME_GLOBAL, "_PanelTopology.panelType:_online.._value", NCC_PT_PANELTYPE_GLOBAL, "_PanelTopology.moduleName:_online.._value", NCC_PT_MODULENAME_GLOBAL, "_PanelTopology.sumAlertNumber:_online.._value", NCC_PT_SUMALERTNUMBER_GLOBAL, "_PanelTopology.menuBar:_online.._value",NCC_PT_MENUBAR_GLOBAL, "_PanelTopology.iconBar:_online.._value", NCC_PT_ICONBAR_GLOBAL, "_PanelTopology.modal:_online.._value", NCC_PT_MODAL_GLOBAL, "_PanelTopology.centered:_online.._value", NCC_PT_CENTERED_GLOBAL, "_PanelTopology.parameter:_online.._value", NCC_PT_PARAMETER_GLOBAL, "_PanelTopology.iconName:_online.._value", NCC_PT_ICONNAME_GLOBAL, "_PanelTopology.backwardPanel:_online.._value", NCC_PT_BACKWARDPANEL_GLOBAL, "_PanelTopology.forwardPanel:_online.._value", NCC_PT_FOREWARDPANEL_GLOBAL); if (error<0) { pt_showErrorCeg(error, ""); return; } }
token = $token;
dpConnect("listenning", 0, DP_WEB_CONTROL);
string dp; dp = myUiDpName()+"."; dpConnect("SetBackground", false, dp + "RootPanelOrigOn.PanelName:_online.._value", dp + "RootPanelOrigOn.ModuleName:_online.._value", dp + "RootPanelOrigOn.FileName:_online.._value"); }
void listenning(string name, string message) { mapping m = jsonDecode(message);
if(m["token"] != token) { return; }
string node = m["node"];
int ptIndex = getPTIndex(node);
string path = getPTFileByID(ptIndex); mapping m = getPTParameter(node); dyn_string para; for(int i = 0; i < m.count(); i ++ ) { para.append(m.keyAt(i) + ":" + m.valueAt(i)); }
RootPanelOnModule(path, node, webModule.ModuleName, para); }
void SetBackground(string dpPN, string fNewValuePN, string dpMN, string fNewValueMN, string dpFN, string fNewValueFN) { int index = getPTIndex(fNewValuePN);
if(index == 0) return;
if(strpos(fNewValueFN, "ProjectPanels") == -1) return;
string sName; while(true) { try { dyn_string sList = getShapes(fNewValueMN, fNewValuePN, "visible"); sName = sList[1]; break; } catch { DebugTN(__LINE__, getLastException()); } }
shape sh = getShape(fNewValueMN, fNewValuePN, sName);
shape p = sh.panel;
p.type = "WebPanel"; string myStyle = "PanelQT[type = \"WebPanel\"] { background-color: rgb(7, 14, 50); }";
p.styleSheet(myStyle);
myStyle = "PanelQT[type = \"table\"] { background-color: rgb(7, 14, 50); foreground-color: white; }";
p.styleSheet(myStyle); }
|