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 7.3 kB

5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 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
5 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. </style>
  78. <div id="mask">
  79. <div id="loadingPage">
  80. <div class="rect1"></div>
  81. <div class="rect2"></div>
  82. <div class="rect3"></div>
  83. <div class="rect4"></div>
  84. <div class="rect5"></div>
  85. </div>
  86. </div>
  87. <div class="repository">
  88. {{template "repo/header" .}}
  89. <div class="repository new repo ui middle very relaxed page grid">
  90. <div class="column">
  91. {{template "base/alert" .}}
  92. <form class="ui form" action="{{.Link}}" method="post">
  93. {{.CsrfTokenHtml}}
  94. <h3 class="ui top attached header">
  95. {{.i18n.Tr "repo.cloudbrain.new"}}
  96. </h3>
  97. <div class="ui attached segment">
  98. <!-- <br> -->
  99. <div class="inline required field">
  100. <label>任务名称</label>
  101. <input name="job_name" id="cloudbrain_job_name" placeholder="任务名称" value="{{.job_name}}" tabindex="3" autofocus required maxlength="255">
  102. </div>
  103. <div class="inline required field" style="{{if .is_benchmark_enabled}}display:block;{{else}}display:none;{{end}}">
  104. <label>任务类型</label>
  105. <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type">
  106. <option name="job_type" value="DEBUG">DEBUG</option>
  107. <option name="job_type" value="BENCHMARK">BENCHMARK</option>
  108. </select>
  109. </div>
  110. <div class="inline required field">
  111. <label>镜像</label>
  112. <select class="ui search dropdown" id="cloudbrain_image" placeholder="选择镜像" style='width:385px' name="image">
  113. {{range .images}}
  114. <option name="image" value="{{.Place}}">{{.PlaceView}}</option>
  115. {{end}}
  116. </select>
  117. </div>
  118. <div class="inline required field">
  119. <label>数据集(只有zip格式的数据集才能发起云脑任务)</label>
  120. <select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment">
  121. {{range .attachments}}
  122. <option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
  123. {{end}}
  124. </select>
  125. </div>
  126. <div class="inline required field">
  127. <label>数据集存放路径</label>
  128. <input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  129. </div>
  130. <div class="inline required field">
  131. <label>模型存放路径</label>
  132. <input name="model_path" id="cloudbrain_model_path" value="{{.model_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  133. </div>
  134. <div class="inline required field">
  135. <label>代码存放路径</label>
  136. <input name="code_path" id="cloudbrain_code_path" value="{{.code_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  137. </div>
  138. <div class="inline required field cloudbrain_benchmark">
  139. <label>benchmark脚本存放路径</label>
  140. <input name="benchmark_path" id="cloudbrain_benchmark_path" value="{{.benchmark_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  141. </div>
  142. <div class="inline required field" hidden>
  143. <label>启动命令</label>
  144. <textarea name="command" rows="10" readonly="readonly">{{.command}}</textarea>
  145. </div>
  146. <div class="inline field">
  147. <label></label>
  148. <button class="ui green button" onclick="showmask()">
  149. {{.i18n.Tr "repo.cloudbrain.new"}}
  150. </button>
  151. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  152. </div>
  153. </div>
  154. </form>
  155. </div>
  156. </div>
  157. </div>
  158. {{template "base/footer" .}}
  159. <script>
  160. // 点击按钮后遮罩层显示
  161. function showmask() {
  162. document.getElementById("mask").style.display = "block"
  163. }
  164. // 页面加载完毕后遮罩层隐藏
  165. document.onreadystatechange = function() {
  166. if (document.readyState === "complete") {
  167. document.getElementById("mask").style.display = "none"
  168. }
  169. }
  170. $('select.dropdown')
  171. .dropdown();
  172. $(function() {
  173. $("#cloudbrain_job_type").change(function() {
  174. if ($(this).val() == 'BENCHMARK') {
  175. $(".cloudbrain_benchmark").show();
  176. } else {
  177. $(".cloudbrain_benchmark").hide();
  178. }
  179. })
  180. })
  181. </script>