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

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 field">
  104. <input type="text" list="cloudbrain_dataset" placeholder="选择数据集" name="attachment" autofocus maxlength="36">
  105. <datalist id="cloudbrain_dataset" class="ui search" style='width:385px' name="attachment">
  106. {{range .attachments}}
  107. <option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
  108. {{end}}
  109. </datalist>
  110. </div>
  111. <div class="inline required field">
  112. <label>工作环境</label>
  113. <input name="de" id="cloudbrain_de" value="{{.env}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  114. </div>
  115. <div class="inline required field">
  116. <label>类型</label>
  117. <input name="job_type" id="cloudbrain_job_type" value="{{.notebook_type}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  118. </div>
  119. <div class="inline required field">
  120. <label>规格</label>
  121. <select id="cloudbrain_flavor" class="ui search dropdown" placeholder="选择规格" style='width:385px' name="flavor">
  122. {{range .flavors}}
  123. <option name="flavor" value="{{.Value}}">{{.Value}}</option>
  124. {{end}}
  125. </select>
  126. </div>
  127. <div class="inline required field">
  128. <label>数据集存放路径</label>
  129. <input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
  130. </div>
  131. <div class="inline field">
  132. <label>描述</label>
  133. <input name="description" id="cloudbrain_description" tabindex="3" autofocus maxlength="255">
  134. </div>
  135. <div class="inline field">
  136. <label></label>
  137. <button class="ui green button" onclick="showmask()">
  138. {{.i18n.Tr "repo.cloudbrain.new"}}
  139. </button>
  140. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  141. </div>
  142. </div>
  143. </form>
  144. </div>
  145. </div>
  146. </div>
  147. {{template "base/footer" .}}
  148. <script>
  149. // 点击按钮后遮罩层显示
  150. function showmask() {
  151. document.getElementById("mask").style.display = "block"
  152. }
  153. // 页面加载完毕后遮罩层隐藏
  154. document.onreadystatechange = function() {
  155. if (document.readyState === "complete") {
  156. document.getElementById("mask").style.display = "none"
  157. }
  158. }
  159. $('select.dropdown')
  160. .dropdown();
  161. $(function() {
  162. $("#cloudbrain_job_type").change(function() {
  163. if ($(this).val() == 'BENCHMARK') {
  164. $(".cloudbrain_benchmark").show();
  165. } else {
  166. $(".cloudbrain_benchmark").hide();
  167. }
  168. })
  169. })
  170. </script>