THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

This is Gitea test Portainer repository mirror from Github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

569 lines
27 KiB

  1. <form class="form-horizontal" name="templateForm">
  2. <!-- title-input -->
  3. <div class="form-group" ng-class="{ 'has-error': templateForm.template_title.$invalid }">
  4. <label for="template_title" class="col-sm-3 col-lg-2 control-label text-left">Title</label>
  5. <div class="col-sm-9 col-lg-10">
  6. <input type="text" class="form-control" name="template_title" ng-model="$ctrl.model.Title" placeholder="e.g. my-template" required auto-focus>
  7. </div>
  8. </div>
  9. <div class="form-group" ng-show="templateForm.template_title.$invalid">
  10. <div class="col-sm-12 small text-warning">
  11. <div ng-messages="templateForm.template_title.$error">
  12. <p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- !title-input -->
  17. <!-- description-input -->
  18. <div class="form-group" ng-class="{ 'has-error': templateForm.template_description.$invalid }">
  19. <label for="template_description" class="col-sm-3 col-lg-2 control-label text-left">Description</label>
  20. <div class="col-sm-9 col-lg-10">
  21. <input type="text" class="form-control" name="template_description" ng-model="$ctrl.model.Description" placeholder="e.g. template description..." required>
  22. </div>
  23. </div>
  24. <div class="form-group" ng-show="templateForm.template_description.$invalid">
  25. <div class="col-sm-12 small text-warning">
  26. <div ng-messages="templateForm.template_description.$error">
  27. <p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- !description-input -->
  32. <div class="col-sm-12 form-section-title interactive" ng-click="$ctrl.state.collapseTemplate = !$ctrl.state.collapseTemplate">
  33. Template
  34. <span class="small space-left">
  35. <a ng-if="$ctrl.state.collapseTemplate"><i class="fa fa-plus" aria-hidden="true"></i> expand</a>
  36. <a ng-if="!$ctrl.state.collapseTemplate"><i class="fa fa-minus" aria-hidden="true"></i> collapse</a>
  37. </span>
  38. </div>
  39. <!-- template-details -->
  40. <div uib-collapse="$ctrl.state.collapseTemplate">
  41. <div ng-if="$ctrl.showTypeSelector">
  42. <div class="form-group"></div>
  43. <div class="form-group" style="margin-bottom: 0">
  44. <div class="boxselector_wrapper">
  45. <div>
  46. <input type="radio" id="template_container" ng-model="$ctrl.model.Type" ng-value="1">
  47. <label for="template_container">
  48. <div class="boxselector_header">
  49. <i class="fa fa-server" aria-hidden="true" style="margin-right: 2px;"></i>
  50. Container
  51. </div>
  52. <p>Container template</p>
  53. </label>
  54. </div>
  55. <div>
  56. <input type="radio" id="template_swarm_stack" ng-model="$ctrl.model.Type" ng-value="2">
  57. <label for="template_swarm_stack">
  58. <div class="boxselector_header">
  59. <i class="fa fa-th-list" aria-hidden="true" style="margin-right: 2px;"></i>
  60. Swarm stack
  61. </div>
  62. <p>Stack template (Swarm)</p>
  63. </label>
  64. </div>
  65. <div>
  66. <input type="radio" id="template_compose_stack" ng-model="$ctrl.model.Type" ng-value="3">
  67. <label for="template_compose_stack">
  68. <div class="boxselector_header">
  69. <i class="fa fa-th-list" aria-hidden="true" style="margin-right: 2px;"></i>
  70. Compose stack
  71. </div>
  72. <p>Stack template (Compose)</p>
  73. </label>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <!-- name -->
  79. <div class="form-group">
  80. <label for="template_name" class="col-sm-3 col-lg-2 control-label text-left">
  81. Name
  82. <portainer-tooltip position="bottom" message="Default name that will be associated to the template"></portainer-tooltip>
  83. </label>
  84. <div class="col-sm-9 col-lg-10">
  85. <input type="text" class="form-control" name="template_name" ng-model="$ctrl.model.Name" placeholder="e.g. myApp">
  86. </div>
  87. </div>
  88. <!-- !name -->
  89. <!-- logo -->
  90. <div class="form-group">
  91. <label for="template_logo" class="col-sm-3 col-lg-2 control-label text-left">
  92. Logo URL
  93. <portainer-tooltip position="bottom" message="Recommended size: 60x60"></portainer-tooltip>
  94. </label>
  95. <div class="col-sm-9 col-lg-10">
  96. <input type="text" class="form-control" name="template_logo" ng-model="$ctrl.model.Logo" placeholder="e.g. https://portainer.io/images/logos/nginx.png">
  97. </div>
  98. </div>
  99. <!-- !logo -->
  100. <!-- note -->
  101. <div class="form-group">
  102. <label for="template_note" class="col-sm-3 col-lg-2 control-label text-left">
  103. Note
  104. <portainer-tooltip position="bottom" message="Usage / extra information about the template. Supports HTML."></portainer-tooltip>
  105. </label>
  106. <div class="col-sm-9 col-lg-10">
  107. <textarea class="form-control" name="template_note" ng-model="$ctrl.model.Note" placeholder='You can use this field to specify extra information. <br/> It supports <b>HTML</b>.'></textarea>
  108. </div>
  109. </div>
  110. <!-- !note -->
  111. <!-- platform -->
  112. <div class="form-group">
  113. <label for="template_platform" class="col-sm-3 col-lg-2 control-label text-left">
  114. Platform
  115. </label>
  116. <div class="col-sm-9 col-lg-10">
  117. <select class="form-control" name="template_platform" ng-model="$ctrl.model.Platform">
  118. <option value="">Multi-platform</option>
  119. <option value="linux">Linux</option>
  120. <option value="windows">Windows</option>
  121. </select>
  122. </div>
  123. </div>
  124. <!-- !platform -->
  125. <!-- categories -->
  126. <div class="form-group">
  127. <label for="template_categories" class="col-sm-3 col-lg-2 control-label text-left">
  128. Categories
  129. </label>
  130. <div class="col-sm-9 col-lg-10">
  131. <ui-select multiple tagging tagging-label="(new category)" ng-model="$ctrl.model.Categories" sortable="true" style="width: 300px;" title="Choose a category">
  132. <ui-select-match placeholder="Select categories...">{{ $item }}</ui-select-match>
  133. <ui-select-choices repeat="category in $ctrl.categories | filter:$select.search">
  134. {{ category }}
  135. </ui-select-choices>
  136. </ui-select>
  137. </div>
  138. </div>
  139. <!-- !categories -->
  140. <!-- administrator-only -->
  141. <div class="form-group">
  142. <div class="col-sm-12">
  143. <label for="tls" class="control-label text-left">
  144. Administrator template
  145. <portainer-tooltip position="bottom" message="Should this template be only available to administrator users."></portainer-tooltip>
  146. </label>
  147. <label class="switch" style="margin-left: 20px;">
  148. <input type="checkbox" ng-model="$ctrl.model.AdministratorOnly"><i></i>
  149. </label>
  150. </div>
  151. </div>
  152. <!-- administrator-only -->
  153. </div>
  154. <!-- !template-details -->
  155. <div ng-if="$ctrl.model.Type === 2 || $ctrl.model.Type === 3">
  156. <div class="col-sm-12 form-section-title interactive" ng-click="$ctrl.state.collapseStack = !$ctrl.state.collapseStack">
  157. Stack
  158. <span class="small space-left">
  159. <a ng-if="$ctrl.state.collapseStack"><i class="fa fa-plus" aria-hidden="true"></i> expand</a>
  160. <a ng-if="!$ctrl.state.collapseStack"><i class="fa fa-minus" aria-hidden="true"></i> collapse</a>
  161. </span>
  162. </div>
  163. <!-- stack-details -->
  164. <div uib-collapse="$ctrl.state.collapseStack">
  165. <!-- repository-url -->
  166. <div class="form-group" ng-class="{ 'has-error': templateForm.template_repository_url.$invalid }">
  167. <label for="template_repository_url" class="col-sm-3 col-lg-2 control-label text-left">Repository URL</label>
  168. <div class="col-sm-9 col-lg-10">
  169. <input type="text" class="form-control" name="template_repository_url" ng-model="$ctrl.model.Repository.url" placeholder="https://github.com/portainer/portainer-compose" required>
  170. </div>
  171. </div>
  172. <div class="form-group" ng-show="templateForm.template_repository_url.$invalid">
  173. <div class="col-sm-12 small text-warning">
  174. <div ng-messages="templateForm.template_repository_url.$error">
  175. <p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- !repository-url -->
  180. <!-- composefile-path -->
  181. <div class="form-group">
  182. <label for="template_repository_path" class="col-sm-3 col-lg-2 control-label text-left">
  183. Compose file path
  184. </label>
  185. <div class="col-sm-9 col-lg-10">
  186. <input type="text" class="form-control" name="template_repository_path" ng-model="$ctrl.model.Repository.stackfile" placeholder='docker-compose.yml'>
  187. </div>
  188. </div>
  189. <!-- !composefile-path -->
  190. </div>
  191. <!-- !stack-details -->
  192. </div>
  193. <div ng-if="$ctrl.model.Type === 1">
  194. <div class="col-sm-12 form-section-title interactive" ng-click="$ctrl.state.collapseContainer = !$ctrl.state.collapseContainer">
  195. Container
  196. <span class="small space-left">
  197. <a ng-if="$ctrl.state.collapseContainer"><i class="fa fa-plus" aria-hidden="true"></i> expand</a>
  198. <a ng-if="!$ctrl.state.collapseContainer"><i class="fa fa-minus" aria-hidden="true"></i> collapse</a>
  199. </span>
  200. </div>
  201. <!-- container-details -->
  202. <div uib-collapse="$ctrl.state.collapseContainer">
  203. <por-image-registry
  204. model="$ctrl.model.RegistryModel"
  205. auto-complete="true"
  206. label-class="col-sm-1" input-class="col-sm-11"
  207. ></por-image-registry>
  208. <!-- command -->
  209. <div class="form-group">
  210. <label for="template_command" class="col-sm-3 col-lg-2 control-label text-left">
  211. Command
  212. <portainer-tooltip position="bottom" message="The command to run in the container. If not specified, the container will use the default command specified in its Dockerfile."></portainer-tooltip>
  213. </label>
  214. <div class="col-sm-9 col-lg-10">
  215. <input type="text" class="form-control" name="template_command" ng-model="$ctrl.model.Command" placeholder='/bin/bash -c \"echo hello\" && exit 777'>
  216. </div>
  217. </div>
  218. <!-- !command -->
  219. <!-- hostname -->
  220. <div class="form-group">
  221. <label for="template_hostname" class="col-sm-3 col-lg-2 control-label text-left">
  222. Hostname
  223. <portainer-tooltip position="bottom" message="Set the hostname of the container. Will use Docker default if not specified."></portainer-tooltip>
  224. </label>
  225. <div class="col-sm-9 col-lg-10">
  226. <input type="text" class="form-control" name="template_hostname" ng-model="$ctrl.model.Hostname" placeholder='mycontainername'>
  227. </div>
  228. </div>
  229. <!-- !hostname -->
  230. <!-- network -->
  231. <div class="form-group">
  232. <label for="template_network" class="col-sm-3 col-lg-2 control-label text-left">
  233. Network
  234. </label>
  235. <div class="col-sm-10">
  236. <select class="form-control" ng-options="net.Name for net in $ctrl.networks" ng-model="$ctrl.model.Network">
  237. <option disabled hidden value="">Select a network</option>
  238. </select>
  239. </div>
  240. </div>
  241. <!-- !network -->
  242. <!-- port-mapping -->
  243. <div class="form-group" >
  244. <div class="col-sm-12" style="margin-top: 5px;">
  245. <label class="control-label text-left">Port mapping</label>
  246. <span class="label label-default interactive" style="margin-left: 10px;" ng-click="$ctrl.addPortBinding()">
  247. <i class="fa fa-plus-circle" aria-hidden="true"></i> map additional port
  248. </span>
  249. </div>
  250. <div class="col-sm-12" style="margin-top: 10px" ng-if="$ctrl.model.Ports.length > 0">
  251. <span class="small text-muted">Portainer will automatically assign a port if you leave the host port empty.</span>
  252. </div>
  253. <!-- port-mapping-input-list -->
  254. <div class="col-sm-12">
  255. <div class="col-sm-12 form-inline" style="margin-top: 10px;">
  256. <div ng-repeat="portBinding in $ctrl.model.Ports" style="margin-top: 2px;">
  257. <!-- host-port -->
  258. <div class="input-group col-sm-4 input-group-sm">
  259. <span class="input-group-addon">host</span>
  260. <input type="text" class="form-control" ng-model="portBinding.hostPort" placeholder="e.g. 80 or 1.2.3.4:80 (optional)">
  261. </div>
  262. <!-- !host-port -->
  263. <span style="margin: 0 10px 0 10px;">
  264. <i class="fa fa-long-arrow-alt-right" aria-hidden="true"></i>
  265. </span>
  266. <!-- container-port -->
  267. <div class="input-group col-sm-4 input-group-sm">
  268. <span class="input-group-addon">container</span>
  269. <input type="text" class="form-control" ng-model="portBinding.containerPort" placeholder="e.g. 80">
  270. </div>
  271. <!-- !container-port -->
  272. <!-- protocol-actions -->
  273. <div class="input-group col-sm-3 input-group-sm">
  274. <div class="btn-group btn-group-sm">
  275. <label class="btn btn-primary" ng-model="portBinding.protocol" uib-btn-radio="'tcp'">TCP</label>
  276. <label class="btn btn-primary" ng-model="portBinding.protocol" uib-btn-radio="'udp'">UDP</label>
  277. </div>
  278. <button class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removePortBinding($index)">
  279. <i class="fa fa-trash" aria-hidden="true"></i>
  280. </button>
  281. </div>
  282. <!-- !protocol-actions -->
  283. </div>
  284. </div>
  285. </div>
  286. <!-- !port-mapping-input-list -->
  287. </div>
  288. <!-- !port-mapping -->
  289. <!-- volumes -->
  290. <div class="form-group" >
  291. <div class="col-sm-12" style="margin-top: 5px;">
  292. <label class="control-label text-left">Volume mapping</label>
  293. <span class="label label-default interactive" style="margin-left: 10px;" ng-click="$ctrl.addVolume()">
  294. <i class="fa fa-plus-circle" aria-hidden="true"></i> map additional volume
  295. </span>
  296. </div>
  297. <div class="col-sm-12" style="margin-top: 10px" ng-if="$ctrl.model.Volumes.length > 0">
  298. <span class="small text-muted">Portainer will automatically create and map a local volume when using the <b>auto</b> option.</span>
  299. </div>
  300. <div ng-repeat="volume in $ctrl.model.Volumes">
  301. <div class="col-sm-12" style="margin-top: 10px;">
  302. <!-- volume-line1 -->
  303. <div class="col-sm-12 form-inline">
  304. <!-- container-path -->
  305. <div class="input-group input-group-sm col-sm-6">
  306. <span class="input-group-addon">container</span>
  307. <input type="text" class="form-control" ng-model="volume.container" placeholder="e.g. /path/in/container">
  308. </div>
  309. <!-- !container-path -->
  310. <!-- volume-type -->
  311. <div class="input-group col-sm-5" style="margin-left: 5px;">
  312. <div class="btn-group btn-group-sm">
  313. <label class="btn btn-primary" ng-model="volume.type" uib-btn-radio="'auto'" ng-click="volume.bind = ''">Auto</label>
  314. <label class="btn btn-primary" ng-model="volume.type" uib-btn-radio="'bind'" ng-click="volume.bind = ''">Bind</label>
  315. </div>
  316. <button class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removeVolume($index)">
  317. <i class="fa fa-trash" aria-hidden="true"></i>
  318. </button>
  319. </div>
  320. <!-- !volume-type -->
  321. </div>
  322. <!-- !volume-line1 -->
  323. <!-- volume-line2 -->
  324. <div class="col-sm-12 form-inline" style="margin-top: 5px;" ng-if="volume.type !== 'auto'">
  325. <i class="fa fa-long-arrow-alt-right" aria-hidden="true"></i>
  326. <!-- bind -->
  327. <div class="input-group input-group-sm col-sm-6" ng-if="volume.type === 'bind'">
  328. <span class="input-group-addon">host</span>
  329. <input type="text" class="form-control" ng-model="volume.bind" placeholder="e.g. /path/on/host">
  330. </div>
  331. <!-- !bind -->
  332. <!-- read-only -->
  333. <div class="input-group input-group-sm col-sm-5" style="margin-left: 5px;">
  334. <div class="btn-group btn-group-sm">
  335. <label class="btn btn-primary" ng-model="volume.readonly" uib-btn-radio="false">Writable</label>
  336. <label class="btn btn-primary" ng-model="volume.readonly" uib-btn-radio="true">Read-only</label>
  337. </div>
  338. </div>
  339. <!-- !read-only -->
  340. </div>
  341. <!-- !volume-line2 -->
  342. </div>
  343. </div>
  344. </div>
  345. <!-- !volumes -->
  346. <!-- labels -->
  347. <div class="form-group" >
  348. <div class="col-sm-12" style="margin-top: 5px;">
  349. <label class="control-label text-left">Labels</label>
  350. <span class="label label-default interactive" style="margin-left: 10px;" ng-click="$ctrl.addLabel()">
  351. <i class="fa fa-plus-circle" aria-hidden="true"></i> add label
  352. </span>
  353. </div>
  354. <!-- labels-input-list -->
  355. <div class="col-sm-12">
  356. <div class="col-sm-12 form-inline" style="margin-top: 10px;">
  357. <div ng-repeat="label in $ctrl.model.Labels" style="margin-top: 2px;">
  358. <div class="input-group col-sm-5 input-group-sm">
  359. <span class="input-group-addon">name</span>
  360. <input type="text" class="form-control" ng-model="label.name" placeholder="e.g. com.example.foo">
  361. </div>
  362. <div class="input-group col-sm-5 input-group-sm">
  363. <span class="input-group-addon">value</span>
  364. <input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar">
  365. </div>
  366. <button class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removeLabel($index)">
  367. <i class="fa fa-trash" aria-hidden="true"></i>
  368. </button>
  369. </div>
  370. </div>
  371. </div>
  372. <!-- !labels-input-list -->
  373. </div>
  374. <!-- !labels -->
  375. <!-- restart_policy -->
  376. <div class="form-group">
  377. <label for="template_restart_policy" class="col-sm-3 col-lg-2 control-label text-left">
  378. Restart policy
  379. </label>
  380. <div class="col-sm-9 col-lg-10">
  381. <select class="form-control" name="template_platform" ng-model="$ctrl.model.RestartPolicy">
  382. <option value="always">Always</option>
  383. <option value="unless-stopped">Unless stopped</option>
  384. <option value="on-failure">On failure</option>
  385. <option value="no">None</option>
  386. </select>
  387. </div>
  388. </div>
  389. <!-- !restart_policy -->
  390. <!-- privileged-mode -->
  391. <div class="form-group">
  392. <div class="col-sm-12">
  393. <label for="tls" class="control-label text-left">
  394. Privileged mode
  395. <portainer-tooltip position="bottom" message="Start the container in privileged mode."></portainer-tooltip>
  396. </label>
  397. <label class="switch" style="margin-left: 20px;">
  398. <input type="checkbox" ng-model="$ctrl.model.Privileged"><i></i>
  399. </label>
  400. </div>
  401. </div>
  402. <!-- !privileged-mode -->
  403. <!-- interactive-mode -->
  404. <div class="form-group">
  405. <div class="col-sm-12">
  406. <label for="tls" class="control-label text-left">
  407. Interactive mode
  408. <portainer-tooltip position="bottom" message="Start the container in foreground (equivalent of -i -t flags)."></portainer-tooltip>
  409. </label>
  410. <label class="switch" style="margin-left: 20px;">
  411. <input type="checkbox" ng-model="$ctrl.model.Interactive"><i></i>
  412. </label>
  413. </div>
  414. </div>
  415. <!-- !interactive-mode -->
  416. </div>
  417. <!-- !container-details -->
  418. </div>
  419. <div class="col-sm-12 form-section-title interactive" ng-click="$ctrl.state.collapseEnv = !$ctrl.state.collapseEnv">
  420. Environment
  421. <span class="small space-left">
  422. <a ng-if="$ctrl.state.collapseEnv"><i class="fa fa-plus" aria-hidden="true"></i> expand</a>
  423. <a ng-if="!$ctrl.state.collapseEnv"><i class="fa fa-minus" aria-hidden="true"></i> collapse</a>
  424. </span>
  425. </div>
  426. <!-- environment-details -->
  427. <div uib-collapse="$ctrl.state.collapseEnv">
  428. <!-- env -->
  429. <div class="form-group" >
  430. <div class="col-sm-12" style="margin-top: 5px;">
  431. <label class="control-label text-left">Environment variables</label>
  432. <span class="label label-default interactive" style="margin-left: 10px;" ng-click="$ctrl.addEnvVar()">
  433. <i class="fa fa-plus-circle" aria-hidden="true"></i> add variable
  434. </span>
  435. </div>
  436. <!-- env-var-list -->
  437. <div style="margin-top: 10px;">
  438. <div class="col-sm-12 template-envvar" ng-repeat="var in $ctrl.model.Env" style="margin-top: 10px;">
  439. <div class="form-group"></div>
  440. <div class="form-group" style="margin-bottom: 0">
  441. <div class="boxselector_wrapper">
  442. <div>
  443. <input type="radio" id="preset_var_{{$index}}" ng-model="var.type" ng-value="1" ng-change="$ctrl.changeEnvVarType(var)">
  444. <label for="preset_var_{{$index}}">
  445. <div class="boxselector_header">
  446. <i class="fa fa-user-slash" aria-hidden="true" style="margin-right: 2px;"></i>
  447. Preset
  448. </div>
  449. <p>Preset variable</p>
  450. </label>
  451. </div>
  452. <div>
  453. <input type="radio" id="text_var_{{$index}}" ng-model="var.type" ng-value="2" ng-change="$ctrl.changeEnvVarType(var)">
  454. <label for="text_var_{{$index}}">
  455. <div class="boxselector_header">
  456. <i class="fa fa-edit" aria-hidden="true" style="margin-right: 2px;"></i>
  457. Text
  458. </div>
  459. <p>Free text value</p>
  460. </label>
  461. </div>
  462. <div>
  463. <input type="radio" id="select_var_{{$index}}" ng-model="var.type" ng-value="3">
  464. <label for="select_var_{{$index}}">
  465. <div class="boxselector_header">
  466. <i class="fa fa-list-ol" aria-hidden="true" style="margin-right: 2px;"></i>
  467. Select
  468. </div>
  469. <p>Choose value from list</p>
  470. </label>
  471. </div>
  472. </div>
  473. </div>
  474. <div class="form-group">
  475. <label class="col-sm-2 control-label text-left">
  476. Name
  477. </label>
  478. <div class="col-sm-8">
  479. <input type="text" class="form-control" ng-model="var.name" placeholder="env_var">
  480. </div>
  481. <div class="col-sm-2">
  482. <button class="btn btn-sm btn-danger space-left" type="button" ng-click="$ctrl.removeEnvVar($index)">
  483. <i class="fa fa-trash" aria-hidden="true"></i>
  484. </button>
  485. </div>
  486. </div>
  487. <div ng-if="var.type == 2 || var.type == 3">
  488. <div class="form-group">
  489. <label class="col-sm-2 control-label text-left">
  490. Label
  491. </label>
  492. <div class="col-sm-10">
  493. <input type="text" class="form-control" ng-model="var.label" placeholder="Choose a label">
  494. </div>
  495. </div>
  496. <div class="form-group">
  497. <label class="col-sm-2 control-label text-left" style="margin-top: 2px;">
  498. Description
  499. </label>
  500. <div class="col-sm-10" style="margin-top: 2px;">
  501. <input type="text" class="form-control" ng-model="var.description" placeholder="Tooltip">
  502. </div>
  503. </div>
  504. </div>
  505. <div class="form-group" ng-if="var.type === 1 || var.type === 2">
  506. <label class="col-sm-2 control-label text-left">
  507. Default value
  508. </label>
  509. <div class="col-sm-10">
  510. <input type="text" class="form-control" ng-model="var.default" placeholder="default_value">
  511. </div>
  512. </div>
  513. <div ng-if="var.type === 3" style="margin-bottom: 5px;" class="form-group">
  514. <div class="col-sm-12" style="margin-top: 5px;">
  515. <label class="control-label text-left">Values</label>
  516. <span class="label label-default interactive" style="margin-left: 10px;" ng-click="$ctrl.addEnvVarValue(var)">
  517. <i class="fa fa-plus-circle" aria-hidden="true"></i> add allowed value
  518. </span>
  519. </div>
  520. <!-- envvar-values-list -->
  521. <div class="col-sm-12">
  522. <div class="col-sm-12 form-inline" style="margin-top: 10px;">
  523. <div ng-repeat="val in var.select" style="margin-top: 2px;">
  524. <div class="input-group col-sm-5 input-group-sm">
  525. <span class="input-group-addon">name</span>
  526. <input type="text" class="form-control" ng-model="val.text" placeholder="Yes, I agree">
  527. </div>
  528. <div class="input-group col-sm-5 input-group-sm">
  529. <span class="input-group-addon">value</span>
  530. <input type="text" class="form-control" ng-model="val.value" placeholder="Y">
  531. </div>
  532. <div class="input-group col-sm-1 input-group-sm">
  533. <button class="btn btn-sm btn-danger" type="button" ng-click="$ctrl.removeEnvVarValue(var, $index)">
  534. <i class="fa fa-trash" aria-hidden="true"></i>
  535. </button>
  536. <input style="margin-left: 5px;" type="checkbox" ng-model="val.default" id="val_default_{{$index}}"><label for="val_default_{{$index}}" class="space-left">Default</label>
  537. </div>
  538. </div>
  539. </div>
  540. </div>
  541. <!-- envvar-values-list -->
  542. </div>
  543. <div class="col-sm-12" ng-show="$ctrl.model.Env.length > 1">
  544. <div class="line-separator"></div>
  545. </div>
  546. </div>
  547. </div>
  548. <!-- !env-var-list -->
  549. </div>
  550. <!-- !env -->
  551. </div>
  552. <!-- !environment-details -->
  553. <!-- actions -->
  554. <div class="col-sm-12 form-section-title">
  555. Actions
  556. </div>
  557. <div class="form-group">
  558. <div class="col-sm-12">
  559. <button type="button" class="btn btn-primary btn-sm" ng-click="$ctrl.formAction()" ng-disabled="$ctrl.actionInProgress || !templateForm.$valid" button-spinner="$ctrl.actionInProgress">
  560. <span ng-hide="$ctrl.actionInProgress">{{ $ctrl.formActionLabel }}</span>
  561. <span ng-show="$ctrl.actionInProgress">In progress...</span>
  562. </button>
  563. </div>
  564. </div>
  565. <!-- !actions -->
  566. </form>