This commit is contained in:
2026-02-01 03:07:48 +08:00
parent 97c13d5f44
commit aa7962c959
3 changed files with 31 additions and 2 deletions

View File

@@ -266,8 +266,35 @@ def mwcli(mw_input=0):
elif mw_input == 201:
os.system('curl -Lso- bench.sh | bash')
elif mw_input == 202:
print("SSH终端管理")
package = mw.getPanelDir()+'/plugins'
dst_plugin = mw.getServerDir() + "/webssh"
if not os.path.exists(dst_plugin):
mw.echoInfo("未安装!")
exit(0)
if not package in sys.path:
sys.path.append(package)
from webssh.index import App
obj = App()
data = obj.get_server_list()
data = json.loads(data)
if data['status']:
wlist = data['data']
wlist_len = len(wlist)
if wlist_len == 0:
mw.echoInfo("SSH终端管理,数据为空!")
exit(0)
mw.echoInfo("请选择:")
for x in range(wlist_len):
dst_data = wlist[x]
tag = dst_data['host']
if dst_data['ps'] != "":
tag = dst_data['ps']
print(str(x) +") " + tag)
def open_ssh_port():
@@ -356,6 +383,7 @@ def getPanelBindDomain():
def main():
print(sys.argv)
if len(sys.argv) == 1:
print('ERROR: Parameter error!')
exit(-2)

View File

@@ -152,9 +152,11 @@ class App():
if os.path.exists(self.__host_dir):
for name in os.listdir(self.__host_dir):
info_file = self.__host_dir + '/' + name + '/info.json'
# print(info_file)
if not os.path.exists(info_file):
continue
host_info = {}
try:
info_tmp = self.getSshInfo(info_file)

View File

@@ -633,7 +633,6 @@ mw_valkey(){
mw_ssh(){
cd ${PANEL_DIR} && python3 panel_tools.py cli 202
echo "123123"
}
mw_venv(){