mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-09 20:29:26 +08:00
update
This commit is contained in:
+13
-2
@@ -271,7 +271,7 @@ def mwcli(mw_input=0):
|
||||
dst_plugin = mw.getServerDir() + "/webssh"
|
||||
if not os.path.exists(dst_plugin):
|
||||
mw.echoInfo("未安装!")
|
||||
exit(0)
|
||||
exit(1)
|
||||
|
||||
if not package in sys.path:
|
||||
sys.path.append(package)
|
||||
@@ -286,6 +286,18 @@ def mwcli(mw_input=0):
|
||||
wlist_len = len(wlist)
|
||||
if wlist_len == 0:
|
||||
mw.echoInfo("SSH终端管理,数据为空!")
|
||||
exit(1)
|
||||
|
||||
if len(sys.argv) == 4:
|
||||
pos = int(sys.argv[3])
|
||||
if pos >= wlist_len:
|
||||
mw.echoInfo("SSH终端管理,超过限制!")
|
||||
exit(1)
|
||||
dst_data = wlist[pos]
|
||||
tmp_host = dst_data["host"]
|
||||
info = obj.get_server_by_host_data(tmp_host)
|
||||
pp_info = tmp_host+"|"+info["port"]+"|"+info['username']+"|"+info['password']+""
|
||||
print(pp_info)
|
||||
exit(0)
|
||||
|
||||
mw.echoInfo("请选择:")
|
||||
@@ -383,7 +395,6 @@ def getPanelBindDomain():
|
||||
|
||||
|
||||
def main():
|
||||
print(sys.argv)
|
||||
if len(sys.argv) == 1:
|
||||
print('ERROR: Parameter error!')
|
||||
exit(-2)
|
||||
|
||||
@@ -120,6 +120,11 @@ class App():
|
||||
destr = mw.deDoubleCrypt('mdserver-web', rdata)
|
||||
return json.loads(destr)
|
||||
|
||||
def get_server_by_host_data(self, host):
|
||||
info_file = self.__host_dir + '/' + host + '/info.json'
|
||||
info_data = self.getSshInfo(info_file)
|
||||
return info_data
|
||||
|
||||
def get_server_by_host(self):
|
||||
args = self.getArgs()
|
||||
check = self.checkArgs(args, ['host'])
|
||||
|
||||
Reference in New Issue
Block a user