interface.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <div>
  2. <div id='blockpy-content'>
  3. <div class="blockpy-editor">
  4. <div class="white blockpy-blocks blockpy-editor-menu"> <img class="fullscreenIcon"
  5. src="./images/icon-fullscreen.svg"> <img class="fullscreenIcon hidden"
  6. src="./images/icon-fullscreen-exit.svg">
  7. <div class='blockly-div' style="width:100%;height:100%;"></div>
  8. </div>
  9. </div>
  10. <div id='sss' style='display:block;overflow: auto;'>
  11. <div id="py-editor" class="blockpy-editor card-panel"
  12. style='height:calc(100% - 245px);display:block;overflow:auto'>
  13. <div class="card-header" style='position:relative;height: 60px;line-height: 60px;background: #f1f2f5;'>
  14. <!--<span class="header-icon">&lt &gt</span>--> <span class="header-text translate-code
  15. translatable_pythonSourceCode" style='font-weight: 800;font-size: 20px;margin-left: 25px;'>Python
  16. Source Code</span> <a class="copy_code" style="position:absolute;top: 5px;right: 75px;"
  17. data-clipboard-action="copy"> <img src="./images/icon-copy.png" style="width: 33px;margin-top:
  18. 7px;"> </a> <a class="blockpy-toolbar-download" style="position:absolute;top: 5px;right:
  19. 39px;"> <img src="./images/icon-downward.png" style="width: 33px;margin-top: 7px;"> </a><a
  20. class="blockpy-toolbar-upload" style="position:absolute;top: 5px;right: 5px;"> <img
  21. src="./images/upload.png" style="width: 33px;margin-top: 7px;"> </a> <img
  22. class="fullscreenIcon hidden" src="./images/icon-fullscreen.svg"> <img class="fullscreenIcon
  23. hidden" src="./images/icon-fullscreen-exit.svg"> </div>
  24. <div class="card-content" style="position:relative;height: calc(100% - 60px);overflow:auto;">
  25. <div class="blockpy-toolbar">
  26. <div class='blockpy-text blockpy-editor-menu'>
  27. <div class='blockpy-text-sidebar'></div> <textarea readonly
  28. class='codemirror-div language-python'></textarea>
  29. </div>
  30. <!-- <a class="copy_code" style="position:fixed;top:112px;right:25px;z-index:999;cursor:pointer;" data-clipboard-action="copy"> <img src="./images/icon-copy.svg" width="24px"> </a> <div class="blockpy-toolbar-download" style="position:fixed;top:113px;right:55px;z-index:999;cursor:pointer;"> <img src="./images/icon-downward.svg" width="24px"> </div>-->
  31. </div>
  32. </div>
  33. <!-- <a class="copy_code" style="position:absolute;top:160px;right:70px;z-index:999;cursor:pointer;" data-clipboard-action="copy"> <img src="./images/icon-copy.svg" width="24px"> </a> <div class="blockpy-toolbar-download" style="position:absolute;top:160px;right:95px;z-index:999;cursor:pointer;"> <img src="./images/icon-downward.svg" width="24px"> </div> -->
  34. </div>
  35. <div class='blockpy-content-left card-panel'
  36. style='display: block;background: #f8f8f8;min-height: 245px;position:relative;'>
  37. <div class="card-header" style='height: 60px;line-height: 60px;background: #f1f2f5;'>
  38. <!-- http://help.cocorobo.cn/#/getting-started/info target="_blank"-->
  39. <div style='float:right;'><a class="header-link upload_instruction" href="#"
  40. data-tooltip-id="61c522fa-be27-2a3e-1f2d-cde212348740"><img src="./icons/instruction.png">
  41. </a> <a id="plugin_download" download="" class="header-link" target="_blank" href="http://api.cocorobo.cn/releases/pythonuploaderv0.1/download/windows
  42. data-tooltip-id=" 9e546554-688a-01c7-cde3-faaff99b557d"> <img
  43. src="./icons/plugin_download.png"> <img
  44. style="position:absolute;height:10px;right:45px;bottom:32px; display:none; "
  45. src="./icons/icon_new.png"> </a> <label class="hidden"><input type="checkbox"
  46. class="filled-in" /><span class="translatable_Adapter_fill_connected filled-in_nocheked"
  47. style="color: #26a69a;font-size: 17px;font-weight: 600;">Adapter is
  48. disconnected</span></label></div>
  49. <!--<span class="header-icon"><img style="width: 30px;margin: 8px 8px 8px 20px;" src="./images/zhixing.png"> </span>-->
  50. <span class="header-text translate-code translatable_title_device"
  51. style='font-weight: 800;font-size: 20px;margin-left: 25px;'>Device</span>
  52. <div style="display: inline-block;margin-left: 20px;"><select class="select-connected "
  53. id="select-connected">
  54. <option class="select-connected translatable_select_connecteds" style="color: #000;">The
  55. cable to upload</option>
  56. <option style="color: #000;" class="aaaaa translatable_no_select_connecteds">Wireless cable
  57. upload</option>
  58. </select></div>
  59. </div>
  60. <!--<div class="card-header"> <span class="header-icon" style="line-height:40px;"><img style="height:30px;vertical-align:middle;" src="./images/icon-aspect.svg"></span> <span class="header-text translate-output">Output Area</span> <img class="fullscreenIcon" src="./images/icon-fullscreen.svg"> <img class="fullscreenIcon hidden" src="./images/icon-fullscreen-exit.svg"> </div>-->
  61. <!--<div class="card-content" style="display:block;grid-template-rows:1fr 50px;"> <div style="border-bottom:1px solid #ddd;padding:8px;overflow:hidden;"> <div style="height:100%;overflow:hidden;"> <div class='blockpy-printer blockpy-printer-default' style="resize:none;height:98%;width:100%;border:1px solid #818181;"> </div> </div> </div>-->
  62. <div class="card-content" style="padding:8px 10px;width:100%">
  63. <div class="row">
  64. <div class="col s12"><img id="error-btn" class="activator" src="./icons/error.png"> <span
  65. id="status_bar" class="translatable_statusbar">直接将代码上传到电子模块中。</span></div>
  66. </div>
  67. <div class="row">
  68. <div class="col s12">
  69. <div class="progress" style="margin:7px 0;">
  70. <div class="determinate blue" style="width:0%;"></div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="row btn-network">
  75. <div class="col s6" style="padding-right:1px;">
  76. <div class="select-wrapper initialized"><span class="caret">▼</span><input type="text"
  77. class="select-dropdown" id="select_dropdown" readonly="true"
  78. data-activates="select-options-eca84f35-6884-7dc4-9d8b-c14115abe698"
  79. value="检测不到连接端口">
  80. <ul id="select-options-eca84f35-6884-7dc4-9d8b-c14115abe698" class="dropdown-content
  81. select-dropdown ">
  82. <li class="disabled "><span>检测不到连接端口</span></li>
  83. </ul><select id="ports" data-select-id="eca84f35-6884-7dc4-9d8b-c14115abe698"
  84. class="initialized">
  85. <option value="null" disabled="">检测不到连接端口</option>
  86. </select>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="row btn-network hidden">
  91. <div class="col cs6" style="padding-right:1px;width:100%">
  92. <div class="select-wrapper initialized" style='float: left;width: 45%;'><input type="text"
  93. class="select-dropdown" data-activates="" id='ipAddress' placeholder="请输入ip地址">
  94. </div>
  95. <div style='display:inline-block'><a onclick='button_click();' class="waves-effect waves-light
  96. btn blue" style="margin-left: 0.5rem;margin-top: 4px;"><span id="ConnectBtn">Connect
  97. </spanbutton_click></a></div>
  98. </div>
  99. </div>
  100. <div class="row" style="position:absolute;bottom:15px;">
  101. <div id="uploader-btns" class="col s12"><a onclick='sendfile();' class="waves-effect
  102. waves-light btn blue" style="margin-right:0.5rem;"><span id="runCode">Run
  103. Code</span></a><a onclick="uploadfile()" class="waves-effect waves-light btn blue"
  104. style="margin-right:0.5rem;"><span id="uploadFiles">Upload files</span></a><a onclick="sendstring('machine.reset()')" class="waves-effect
  105. waves-light btn blue" style="margin-right:0.5rem;"><span id="resetDevice">Reset
  106. Device</span></a></div>
  107. </div>
  108. </div>
  109. <div class="blockpy-toolbar btn-toolbar hidden" style="align-self:center;margin: 20px 8px 0;text-align:
  110. center;">
  111. <div class="btn-toolbar-title">直接将代码上传到电子模块中<div></div>
  112. </div>
  113. <div class="btn-toolbar-inputbox"><input type="text" name="webrepl_url" id="url"
  114. placeholder="Select a device"><input type="submit" id='button' value='Connect'
  115. onclick='button_click(); return false'></div>
  116. <div class="btn-toolbar-btnbox"></div>
  117. <!--<button onclick='sendfile();' style='width: 80%;background: #6e83cc !important;margin-top: 15px;font-size: 16px;height:45px' class='waves-effect waves-light btn blue blockpy-run translate-execute'>上傳</button>-->
  118. <!--<button class='waves-effect waves-light btn blue blockpy-run translate-execute'>UPLOAD</button>-->
  119. <!-- <button href="#aiymodal" class='waves-effect waves-light btn blue modal-trigger'>run on aiy</button> -->
  120. <!--<button id="resetAll" class='waves-effect waves-light btn blue translate-reset' style="float:right;">reset</button> <button id="clearOutput" class='waves-effect waves-light btn blue translate-clear' style="float:right;margin-right:5px;">clear</button>-->
  121. </div>
  122. <div class="blockpy-toolbar btn-toolbar hidden" style="align-self:center;margin: 20px 8px 0;text-align:
  123. center;">
  124. <div class="btn-toolbar-title2">直接将代码上传到电子模块中 <div></div>
  125. </div>
  126. <div class="btn-toolbar-inputbox2"><select>
  127. <option>检测不到连接端口</option>
  128. </select></div>
  129. </div>
  130. </div>
  131. <div class="card plugin_options options_hide">
  132. <div class="card-content">
  133. <div><a download="" href="http://api.cocorobo.cn/releases/pythonuploaderv0.1/download/mac"
  134. target="_black"><img src="./icons/mac-icon.png">Mac </a> <a download=""
  135. href="http://api.cocorobo.cn/releases/pythonuploaderv0.1/download/windows"
  136. target="_black"><img src="./icons/windows-icon.png">Windows </a> </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <div class='modal blockpy-popup'>
  143. <div class='modal-content' id='modal-message'>
  144. <div class='modal-header'>
  145. <h4 class='modal-title'>Dynamic Content</h4>
  146. </div>
  147. <hr style="border-top: 1px solid #ddd;margin:20px 0 10px 0;">
  148. <div class='modal-body' style='width:100%;min-height:200px;'> </div>
  149. </div>
  150. <div class='modal-footer'> <button
  151. class='waves-effect waves-light btn blue modal-close translate-close'>close</button>
  152. </div>
  153. </div>
  154. <div id="aiymodal" class="modal">
  155. <div class="modal-content" height="50%">
  156. <h4>Run on AIY</h4>
  157. <p>This feature gives you the ability to run your AIY python code directly to the AIY Vision Kit
  158. or Voice Kit, follow the instruction below:</p>
  159. <div style="margin-top:30px;"> <b style="background-color:#fff; border-radius:25px;padding:
  160. 10px 20px; box-shadow: 1px 5px 23px -10px rgba(0,0,0,0.59);">Step 1</b> </div>
  161. <div style="margin-top:30px;"> Run the <b data-position="bottom" data-tooltip="I am a
  162. tooltip" class="tooltipped">AIY Helper</b>, <a id="AIYdownload"
  163. style="cursor:pointer;">Download</a> the python code to local, <br />make sure you are
  164. in the same network with the Google AIY Vision Kit. </div>
  165. <div style="margin-top:30px;"> <b style="background-color:#fff; border-radius:25px;padding:
  166. 10px 20px; box-shadow: 1px 5px 23px -10px rgba(0,0,0,0.59);">Step 2</b> </div>
  167. <div class="input-field col s9" style="margin-top:0px;"> Enter the IP Address of your Google
  168. AIY Kit: <div class="input-field inline"> <input id="aiyip_input" class="validate">
  169. </div> <a id="aiyModalRun" onclick="functionSSH();" style="margin-left:10px;"
  170. class="waves-effect blue waves-light btn">Run</a> <a id="aiyModalStop" onclick="functionSSHstop();"
  171. style="margin-left:10px;" class="waves-effect blue
  172. waves-light btn">Stop</a>
  173. <!-- <a id="aiyModalRun" style="margin-left:10px;" class="waves-effect blue waves-light btn">Run</a> -->
  174. <!-- <a id="aiyModalStop" style="margin-left:10px;" class="waves-effect blue waves-light btn">Stop</a> -->
  175. </div>
  176. <div id="modal_preload" style="display:none">
  177. <div style="position:relative;top:50%;transform:translateY(-50%);height:128px;width:128px;margin:0
  178. auto;">
  179. <div class="preloader-wrapper big active" style="top:0;left:0">
  180. <div class="spinner-layer spinner-blue-only">
  181. <div class="circle-clipper left">
  182. <div class="circle"></div>
  183. </div>
  184. <div class="gap-patch">
  185. <div class="circle"></div>
  186. </div>
  187. <div class="circle-clipper right">
  188. <div class="circle" style="border-width: 8px;"></div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="modal-footer" style="margin-top:-20px;"> <a href="#!" class="modal-close
  196. waves-effect waves-green btn-flat">Close</a> </div>
  197. <div class="card-reveal grey darken-3 white-text" style="padding:8px 13px;">
  198. <div class="card-title" style="height:18%;margin-bottom:2px;">
  199. <span class="translatable_errmsg" style="font-weight:normal;">Error Message</span>
  200. <a id="err-copy" style="display:inline-block;margin-left:26px;" data-clipboard-action="copy"
  201. data-clipboard-target="#err-msg">
  202. <i class="material-icons right" style="color:#fff;font-size:18px;cursor:pointer;">content_copy</i>
  203. </a>
  204. <i class="material-icons right" style="cursor:pointer;">close</i>
  205. </div>
  206. <div style="width:100%;height:78%;">
  207. <textarea readonly id="err-msg"
  208. style="overflow:visible;font-family:consolas;font-size:14px;height:100%;resize:none;border:none;"></textarea>
  209. </div>
  210. </div>
  211. </div>