|9eddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlZdd lmZdd lmZGd d eZd ZdZdZdZdZdZdZdS))absolute_importN)boolean_to_0_1)FormattedException) exec_utility)UIConfig)check_quota_enabled)Feature)is_panel_feature_supportedceZdZdS)UIConfigExceptionN)__name__ __module__ __qualname__M/opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfig/ui_config_lib.pyr r sDrr z+/usr/share/l.v.e-manager/utils/dynamicui.pyc\ttS)a6 Retrives UI settings from config file :return: dict. For example: {'inodeLimits': {'showUserInodesUsage': False}, 'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False, 'hidePHPextensions': True} } ) filter_flagsr get_configrrr get_ui_configrs"  --// 0 00rc ttdgd\}}}n;#t$r.}tdt |zdtidd}~wwxYw|dkr"td|zd z|zdtiddS) Nz--sync-conf=allT)stderrz Can't execute file %(ctl_cmd)s: ctl_cmd)messagecontextrz#Error while executing %(ctl_cmd)s:  )rDYNAMIC_UI_CTL_CMDOSErrorr str)retcodeouterres r refresh_panelr%*sN();>O=PY]^^^cc NNN,NQTUVQWQW,W-68J,K!M!MNN NN!||,QTW,WZ],]`c,c-68J,K!M!MNN N|s A)AAc2 t|dd }ddd}d||z}ttjd}t j|dd |tj n#tjtf$rYnwxYwt|d S) a Sets UI settings to UI config file Using subfunction _set_ui_config :param parameters_dict: Parameters to set dictionary. For example: {'inodeLimits': {'showUserInodesUsage': False}, 'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False, 'hidePHPextensions': True} } :return: None uiSettings hidePythonAppdisabledenabled)01zFcloudlinux-selector set --json --interpreter python --selector-status wTz /bin/bash)shell executablestdoutrN) ropenosdevnull subprocess check_callSTDOUTCalledProcessErrorKeyError_set_ui_config)parameters_dictenablepythonapp lve_to_select py_commandFNULLs r set_ui_configr?5s  (_\-J?-[)[\\'i88 _O,- RZ%%jUZcmctuuuuu  )8 4     ?#####sA)A,,BBcdt|tdS)aW Sets UI settings to config file :param parameters_dict: Parameters to set dictionary. For example: {'inodeLimits': {'showUserInodesUsage': False}, 'uiSettings': {'hideRubyApp': False, 'hideLVEUserStat': False, 'hidePythonApp': False, 'hidePHPextensions': True} } :return: None N)r set_configr%)r:s rr9r9Ss) JJ/***OOOOOrc\t|d t|dn#t$rYnwxYw t t js)|didn#t$rYnwxYw|S)Nr' inodeLimitshideLVEUserStat) panel_filtergetr popr8r r LVE) mapped_flagss rrrbs!!,//000  ,   ] + + +       )'+66 F   \2 . . 2 23D E E E      s$#A AAAB B)(B)cLtjrttjs|dtjsttjs|dttjs|dttj s|dttj s,|d|ddSdS)z Function that filters UI Settings dictionary depending on panel type :param ui_settings: UI Settings that is filtered hideRubyAppr( hideNodeJsApp hideXrayApp hidePhpApphidePHPextensionsN) detect is_cpanelr r RUBY_SELECTORrGis_pleskPYTHON_SELECTORNODEJS_SELECTORXRAY PHP_SELECTOR) ui_settingss rrErEqs    '*7+@AA' &&& ) :7;R S S)((( %g&= > >)((( %gl 3 3' &&& %g&: ; ;- %%%+,,,,,--r) __future__rr2r4clconfig_utilsrclcommon.clexceptionr cllimits.librclcommon.ui_configrclcommon.clquotar cldetectlibrPclcommon.constr clcommon.cpapir r rrr%r?r9rrErrrrbsS'&&&&& ******333333%%%%%%''''''000000""""""555555     *   C 1 1 1NNN$$$<      -----r