You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

new.tmpl 8.2 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {{template "base/head" .}}
  2. <style>
  3. /* 遮罩层css效果图 */
  4. #mask {
  5. position: fixed;
  6. top: 0px;
  7. left: 0px;
  8. right: 0px;
  9. bottom: 0px;
  10. filter: alpha(opacity=60);
  11. background-color: #777;
  12. z-index: 1000;
  13. display: none;
  14. opacity: 0.8;
  15. -moz-opacity: 0.5;
  16. padding-top: 100px;
  17. color: #000000
  18. }
  19. /* 加载圈css效果图 */
  20. #loadingPage {
  21. margin: 200px auto;
  22. width: 50px;
  23. height: 40px;
  24. text-align: center;
  25. font-size: 10px;
  26. display: block;
  27. }
  28. #loadingPage>div {
  29. background-color: green;
  30. height: 100%;
  31. width: 6px;
  32. display: inline-block;
  33. -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
  34. animation: sk-stretchdelay 1.2s infinite ease-in-out;
  35. }
  36. #loadingPage .rect2 {
  37. -webkit-animation-delay: -1.1s;
  38. animation-delay: -1.1s;
  39. }
  40. #loadingPage .rect3 {
  41. -webkit-animation-delay: -1.0s;
  42. animation-delay: -1.0s;
  43. }
  44. #loadingPage .rect4 {
  45. -webkit-animation-delay: -0.9s;
  46. animation-delay: -0.9s;
  47. }
  48. #loadingPage .rect5 {
  49. -webkit-animation-delay: -0.8s;
  50. animation-delay: -0.8s;
  51. }
  52. @-webkit-keyframes sk-stretchdelay {
  53. 0%,
  54. 40%,
  55. 100% {
  56. -webkit-transform: scaleY(0.4)
  57. }
  58. 20% {
  59. -webkit-transform: scaleY(1.0)
  60. }
  61. }
  62. @keyframes sk-stretchdelay {
  63. 0%,
  64. 40%,
  65. 100% {
  66. transform: scaleY(0.4);
  67. -webkit-transform: scaleY(0.4);
  68. }
  69. 20% {
  70. transform: scaleY(1.0);
  71. -webkit-transform: scaleY(1.0);
  72. }
  73. }
  74. .inline.required.field.cloudbrain_benchmark {
  75. display: none;
  76. }
  77. .inline.required.field.cloudbrain_snn4imagenet {
  78. display: none;
  79. }
  80. </style>
  81. <div id="mask">
  82. <div id="loadingPage">
  83. <div class="rect1"></div>
  84. <div class="rect2"></div>
  85. <div class="rect3"></div>
  86. <div class="rect4"></div>
  87. <div class="rect5"></div>
  88. </div>
  89. </div>
  90. <div class="repository">
  91. {{template "repo/header" .}}
  92. <div class="repository new repo ui middle very relaxed page grid">
  93. <div class="column">
  94. {{template "base/alert" .}}
  95. <form class="ui form" action="{{.Link}}" method="post">
  96. {{.CsrfTokenHtml}}
  97. <h3 class="ui top attached header">
  98. {{.i18n.Tr "repo.cloudbrain.new"}}
  99. </h3>
  100. <div class="ui attached segment">
  101. <!-- <br> -->
  102. <div class="inline required field">
  103. <label>任务名称</label>
  104. <input name="job_name" id="cloudbrain_job_name" placeholder="任务名称" value="{{.job_name}}" tabindex="3" autofocus required maxlength="255">
  105. </div>
  106. <div class="inline required field" style="{{if .is_benchmark_enabled}}display:block;{{else if .is_snn4imagenet_enabled}}display:block;{{else}}display:none;{{end}}">
  107. <label>任务类型</label>
  108. <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type">
  109. <option name="job_type" value="DEBUG">DEBUG</option>
  110. <option name="job_type" value="BENCHMARK">BENCHMARK</option>
  111. <option name="job_type" value="SNN4IMAGENET">SNN4IMAGENET</option>
  112. </select>
  113. </div>
  114. <div class="inline required field">
  115. <label>镜像</label>
  116. <select class="ui search dropdown" id="cloudbrain_image" placeholder="选择镜像" style='width:385px' name="image">
  117. {{range .images}}
  118. <option name="image" value="{{.Place}}">{{.PlaceView}}</option>
  119. {{end}}
  120. {{range .public_images}}
  121. <option name="image" value="{{.Place}}">{{.PlaceView}}</option>
  122. {{end}}
  123. </select>
  124. </div>
  125. <div class="inline required field">
  126. <label>数据集(只有zip格式的数据集才能发起云脑任务)</label>
  127. <select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment">
  128. {{range .attachments}}
  129. <option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
  130. {{end}}
  131. </select>
  132. </div>
  133. <div class="inline required field">
  134. <label>数据集存放路径</label>
  135. <input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  136. </div>
  137. <div class="inline required field">
  138. <label>模型存放路径</label>
  139. <input name="model_path" id="cloudbrain_model_path" value="{{.model_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  140. </div>
  141. <div class="inline required field">
  142. <label>代码存放路径</label>
  143. <input name="code_path" id="cloudbrain_code_path" value="{{.code_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  144. </div>
  145. <div class="inline required field cloudbrain_benchmark">
  146. <label>benchmark脚本存放路径</label>
  147. <input name="benchmark_path" id="cloudbrain_benchmark_path" value="{{.benchmark_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  148. </div>
  149. <div class="inline required field cloudbrain_snn4imagenet">
  150. <label>snn4imagenet脚本存放路径</label>
  151. <input name="snn4imagenet_path" id="cloudbrain_snn4imagenet_path" value="{{.snn4imagenet_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  152. </div>
  153. <div class="inline required field" hidden>
  154. <label>启动命令</label>
  155. <textarea name="command" rows="10" readonly="readonly">{{.command}}</textarea>
  156. </div>
  157. <div class="inline field">
  158. <label></label>
  159. <button class="ui green button" onclick="showmask()">
  160. {{.i18n.Tr "repo.cloudbrain.new"}}
  161. </button>
  162. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  163. </div>
  164. </div>
  165. </form>
  166. </div>
  167. </div>
  168. </div>
  169. {{template "base/footer" .}}
  170. <script>
  171. // 点击按钮后遮罩层显示
  172. function showmask() {
  173. document.getElementById("mask").style.display = "block"
  174. }
  175. // 页面加载完毕后遮罩层隐藏
  176. document.onreadystatechange = function() {
  177. if (document.readyState === "complete") {
  178. document.getElementById("mask").style.display = "none"
  179. }
  180. }
  181. $('select.dropdown')
  182. .dropdown();
  183. $(function() {
  184. $("#cloudbrain_job_type").change(function() {
  185. if ($(this).val() == 'BENCHMARK') {
  186. $(".cloudbrain_benchmark").show();
  187. } else if ($(this).val() == 'SNN4IMAGENET') {
  188. $(".cloudbrain_snn4imagenet").show();
  189. } else {
  190. $(".cloudbrain_benchmark").hide();
  191. $(".cloudbrain_snn4imagenet").hide();
  192. }
  193. })
  194. })
  195. </script>