|
|
@@ -10,17 +10,30 @@ settings =[]
|
|
10
|
10
|
customer_code = ''
|
|
11
|
11
|
surgery_date = str(time.strftime('%Y%m%d', time.localtime(time.time())))
|
|
12
|
12
|
|
|
|
13
|
+
|
|
13
|
14
|
with open('./settings.json', encoding='utf-8')as json_file:
|
|
14
|
15
|
json_data = json.load(json_file)
|
|
15
|
16
|
settings.append(json_data['window_name'])
|
|
16
|
17
|
settings.append(json_data['window_position'])
|
|
17
|
18
|
settings.append(json_data['branch_location'])
|
|
18
|
19
|
settings.append(json_data['surgery_room_number'])
|
|
|
20
|
+ settings.append(json_data['ddns'])
|
|
|
21
|
+ settings.append(json_data['account']) #settings[5]
|
|
|
22
|
+ settings.append(json_data['password']) #settings[6]
|
|
19
|
23
|
|
|
20
|
24
|
window.title(settings[0])
|
|
21
|
25
|
window.geometry(settings[1])
|
|
22
|
26
|
window.resizable(False,False)
|
|
23
|
27
|
|
|
|
28
|
+def sshConnect():
|
|
|
29
|
+ ssh = paramiko.SSHClient()
|
|
|
30
|
+ ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
|
31
|
+ ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
|
|
|
32
|
+
|
|
|
33
|
+ stdin, stdout, stderr = ssh.exec_command('echo this is paramiko')
|
|
|
34
|
+ # TODO: 여기에 스크립트 명령어 입력
|
|
|
35
|
+ print(stdout.readlines())
|
|
|
36
|
+
|
|
24
|
37
|
label_branch = tkinter.Label(window, text = '지점 위치: ' + settings[2] + ' / 수술방 번호: ' + str(settings[3]))
|
|
25
|
38
|
label_customer_code = tkinter.Label(window, text="고객번호(지점 번호 포함 9자리)")
|
|
26
|
39
|
|
|
|
@@ -55,6 +68,7 @@ def askQuit():
|
|
55
|
68
|
msg_box = messagebox.askquestion("기록 중지 확인", '기록을 중지하시겠습니까?')
|
|
56
|
69
|
if msg_box == 'yes':
|
|
57
|
70
|
#TODO: docker 중지 명령어 보내기
|
|
|
71
|
+ sshConnect()
|
|
58
|
72
|
window.destroy()
|
|
59
|
73
|
|
|
60
|
74
|
|
|
|
@@ -67,6 +81,9 @@ def buttonAction(event):
|
|
67
|
81
|
askQuit()
|
|
68
|
82
|
# def fillSurgeryDate():
|
|
69
|
83
|
|
|
|
84
|
+
|
|
|
85
|
+
|
|
|
86
|
+
|
|
70
|
87
|
entry_customer_code = tkinter.Entry(window)
|
|
71
|
88
|
entry_surgery_date = tkinter.Entry(window)
|
|
72
|
89
|
button_confirm = tkinter.Button(window, text="입력완료", width=20, height=2)
|
|
|
@@ -80,4 +97,7 @@ entry_customer_code.pack()
|
|
80
|
97
|
|
|
81
|
98
|
button_confirm.pack()
|
|
82
|
99
|
|
|
83
|
|
-window.mainloop()
|
|
|
100
|
+window.mainloop()
|
|
|
101
|
+
|
|
|
102
|
+
|
|
|
103
|
+
|