appCard.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. export const appCard = (data) => {
  2. // dont look at anything in here.
  3. let app_name = data.name || data.title.toLowerCase();
  4. let shortened_name = "";
  5. let shortened_desc = data.description.slice(0, 60) + "...";
  6. let modal = app_name.replaceAll(" ", "-");
  7. let form_id = app_name.replaceAll("-", "_");
  8. let note = data.note ? data.note.replaceAll(". ", ".\n") : "no notes available";
  9. let description = data.description.replaceAll(". ", ".\n") || "no description available";
  10. let command = data.command ? data.command : "";
  11. let command_check = command ? "checked" : "";
  12. let privileged = data.privileged || "";
  13. let privileged_check = privileged ? "checked" : "";
  14. let repository = data.repository || "";
  15. let source = data.image || "";
  16. let net_host, net_bridge, net_docker = '';
  17. let net_name = 'AppBridge';
  18. // if data.network is set to host, bridge, or docker set the radio button to checked
  19. if (data.network == 'host') {
  20. net_host = 'checked';
  21. } else if (data.network) {
  22. net_bridge = 'checked';
  23. net_name = data.network;
  24. } else {
  25. net_docker = 'checked';
  26. }
  27. if (data.title.length > 28) {
  28. shortened_name = (data.title).slice(0, 25) + "...";
  29. }
  30. else {
  31. shortened_name = data.title;
  32. }
  33. if (repository != "") {
  34. source = (`${repository.url}/raw/master/${repository.stackfile}`);
  35. }
  36. function CatagoryColor(category) {
  37. switch (category) {
  38. case 'Other':
  39. return '<span class="badge bg-blue-lt">Other</span> ';
  40. case 'Productivity':
  41. return '<span class="badge bg-blue-lt">Productivity</span> ';
  42. case 'Tools':
  43. return '<span class="badge bg-blue-lt">Tools</span> ';
  44. case 'Dashboard':
  45. return '<span class="badge bg-blue-lt">Dashboard</span> ';
  46. case 'Communication':
  47. return '<span class="badge bg-azure-lt">Communication</span> ';
  48. case 'Media':
  49. return '<span class="badge bg-azure-lt">Media</span> ';
  50. case 'CMS':
  51. return '<span class="badge bg-azure-lt">CMS</span> ';
  52. case 'Monitoring':
  53. return '<span class="badge bg-indigo-lt">Monitoring</span> ';
  54. case 'LDAP':
  55. return '<span class="badge bg-purple-lt">LDAP</span> ';
  56. case 'Arr':
  57. return '<span class="badge bg-purple-lt">Arr</span> ';
  58. case 'Database':
  59. return '<span class="badge bg-red-lt">Database</span> ';
  60. case 'Paid':
  61. return '<span class="badge bg-red-lt" title="This is a paid product or contains paid features.">Paid</span> ';
  62. case 'Gaming':
  63. return '<span class="badge bg-pink-lt">Gaming</span> ';
  64. case 'Finance':
  65. return '<span class="badge bg-orange-lt">Finance</span> ';
  66. case 'Networking':
  67. return '<span class="badge bg-yellow-lt">Networking</span> ';
  68. case 'Authentication':
  69. return '<span class="badge bg-lime-lt">Authentication</span> ';
  70. case 'Development':
  71. return '<span class="badge bg-green-lt">Development</span> ';
  72. case 'Media Server':
  73. return '<span class="badge bg-teal-lt">Media Server</span> ';
  74. case 'Downloaders':
  75. return '<span class="badge bg-cyan-lt">Downloaders</span> ';
  76. default:
  77. return ''; // default to other if the category is not recognized
  78. }
  79. }
  80. // set data.catagories to 'other' if data.catagories is empty or undefined
  81. if (data.categories == null || data.categories == undefined || data.categories == '') {
  82. data.categories = ['Other'];
  83. }
  84. let categories = '';
  85. for (let i = 0; i < data.categories.length; i++) {
  86. categories += CatagoryColor(data.categories[i]);
  87. }
  88. if (data.restart_policy == null) {
  89. data.restart_policy = 'unless-stopped';
  90. }
  91. let ports_data = [], volumes_data = [], env_data = [], label_data = [];
  92. for (let i = 0; i < 12; i++) {
  93. // Get port details
  94. try {
  95. let ports = data.ports[i];
  96. let port_check = ports ? "checked" : "";
  97. let port_external = ports.split(":")[0] ? ports.split(":")[0] : ports.split("/")[0];
  98. let port_internal = ports.split(":")[1] ? ports.split(":")[1].split("/")[0] : ports.split("/")[0];
  99. let port_protocol = ports.split("/")[1] ? ports.split("/")[1] : "";
  100. // remove /tcp or /udp from port_external if it exists
  101. if (port_external.includes("/")) {
  102. port_external = port_external.split("/")[0];
  103. }
  104. ports_data.push({
  105. check: port_check,
  106. external: port_external,
  107. internal: port_internal,
  108. protocol: port_protocol
  109. });
  110. } catch {
  111. ports_data.push({
  112. check: "",
  113. external: "",
  114. internal: "",
  115. protocol: ""
  116. });
  117. }
  118. // Get volume details
  119. try {
  120. let volumes = data.volumes[i];
  121. let volume_check = volumes ? "checked" : "";
  122. let volume_bind = volumes.bind ? volumes.bind : "";
  123. let volume_container = volumes.container ? volumes.container.split(":")[0] : "";
  124. let volume_readwrite = "rw";
  125. if (volumes.readonly == true) {
  126. volume_readwrite = "ro";
  127. }
  128. volumes_data.push({
  129. check: volume_check,
  130. bind: volume_bind,
  131. container: volume_container,
  132. readwrite: volume_readwrite
  133. });
  134. } catch {
  135. volumes_data.push({
  136. check: "",
  137. bind: "",
  138. container: "",
  139. readwrite: ""
  140. });
  141. }
  142. // Get environment details
  143. try {
  144. let env = data.env[i];
  145. let env_check = "";
  146. let env_default = env.default ? env.default : "";
  147. if (env.set) { env_default = env.set;}
  148. let env_description = env.description ? env.description : "";
  149. let env_label = env.label ? env.label : "";
  150. let env_name = env.name ? env.name : "";
  151. env_data.push({
  152. check: env_check,
  153. default: env_default,
  154. description: env_description,
  155. label: env_label,
  156. name: env_name
  157. });
  158. } catch {
  159. env_data.push({
  160. check: "",
  161. default: "",
  162. description: "",
  163. label: "",
  164. name: ""
  165. });
  166. }
  167. // Get label details
  168. try {
  169. let label = data.labels[i];
  170. let label_check = "";
  171. let label_name = label.name ? label.name : "";
  172. let label_value = label.value ? label.value : "";
  173. label_data.push({
  174. check: label_check,
  175. name: label_name,
  176. value: label_value
  177. });
  178. } catch {
  179. label_data.push({
  180. check: "",
  181. name: "",
  182. value: ""
  183. });
  184. }
  185. }
  186. return `
  187. <div class="col-md-6 col-lg-3">
  188. <div class="card">
  189. <div class="card-body p-4 text-center">
  190. <span class="avatar avatar-xlplus mb-3 rounded"><img src='${data.logo}' width="144px" height="144px" loading="lazy"/></span>
  191. <h3 class="m-0 mb-1"><a href="#">${shortened_name}</a></h3>
  192. <div class="text-secondary">${shortened_desc}</div>
  193. <div class="mt-3">
  194. ${categories}
  195. </div>
  196. </div>
  197. <div class="d-flex">
  198. <a href="#" class="card-btn" data-bs-toggle="modal" data-bs-target="#${modal}-info">
  199. <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-article" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M3 4m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"></path> <path d="M7 8h10"></path> <path d="M7 12h10"></path> <path d="M7 16h10"></path></svg>
  200.   Learn More
  201. </a>
  202. <a href="#" class="card-btn" data-bs-toggle="modal" data-bs-target="#${modal}-install">
  203. <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-bar-to-down" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M4 20l16 0"></path> <path d="M12 14l0 -10"></path> <path d="M12 14l4 -4"></path> <path d="M12 14l-4 -4"></path></svg>
  204.   Install
  205. </a>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="modal modal-blur fade" id="${modal}-info" tabindex="-1" role="dialog" aria-hidden="true">
  210. <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
  211. <div class="modal-content">
  212. <div class="modal-body">
  213. <div class="modal-title">${data.title}</div>
  214. <div>${description}</div>
  215. </div>
  216. <div class="modal-footer">
  217. <button type="button" class="btn btn-link link-secondary me-auto" data-bs-dismiss="modal">Cancel</button>
  218. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Okay</button>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="modal modal-blur fade" id="${modal}-install" tabindex="-1" role="dialog" aria-hidden="true">
  224. <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
  225. <div class="modal-content">
  226. <div class="modal-header">
  227. <h5 class="modal-title">Install ${data.title}</h5>
  228. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  229. </div>
  230. <div class="modal-body">
  231. <pre class="text-secondary">${note}</pre>
  232. <form action="/install" name="${form_id}_install" id="${form_id}_install" method="POST">
  233. <div class="row mb-3 align-items-end">
  234. <div class="col-lg-6">
  235. <label class="form-label">Container Name: </label>
  236. <input type="text" class="form-control" name="service_name" value="${app_name}" hidden/>
  237. <input type="text" class="form-control" name="name" value="${app_name}"/>
  238. </div>
  239. <div class="col-lg-3">
  240. <label class="form-label">Image: </label>
  241. <input type="text" class="form-control" name="image" value="${source}"/>
  242. </div>
  243. <div class="col-lg-3">
  244. <label class="form-label">Restart Policy: </label>
  245. <select class="form-select" name="restart_policy">
  246. <option value="${data.restart_policy}" selected hidden>${data.restart_policy}</option>
  247. <option value="unless-stopped">unless-stopped</option>
  248. <option value="on-failure">on-failure</option>
  249. <option value="never">never</option>
  250. <option value="always">always</option>
  251. </select>
  252. </div>
  253. </div>
  254. <label class="form-label">Network Mode</label>
  255. <div class="form-selectgroup-boxes row mb-3">
  256. <div class="col">
  257. <label class="form-selectgroup-item">
  258. <input type="radio" name="net_mode" value="host" class="form-selectgroup-input" ${net_host}>
  259. <span class="form-selectgroup-label d-flex align-items-center p-3">
  260. <span class="me-3">
  261. <span class="form-selectgroup-check"></span>
  262. </span>
  263. <span class="form-selectgroup-label-content">
  264. <span class="form-selectgroup-title strong mb-1">Host Network</span>
  265. <span class="d-block text-secondary">Same as host. No isolation. ex.127.0.0.1</span>
  266. </span>
  267. </span>
  268. </label>
  269. </div>
  270. <div class="col">
  271. <label class="form-selectgroup-item">
  272. <input type="radio" name="net_mode" value="${net_name}" class="form-selectgroup-input" ${net_bridge}>
  273. <span class="form-selectgroup-label d-flex align-items-center p-3">
  274. <span class="me-3">
  275. <span class="form-selectgroup-check"></span>
  276. </span>
  277. <span class="form-selectgroup-label-content">
  278. <span class="form-selectgroup-title strong mb-1">Bridge Network</span>
  279. <span class="d-block text-secondary">Containers can communicate using names.</span>
  280. </span>
  281. </span>
  282. </label>
  283. </div>
  284. <div class="col">
  285. <label class="form-selectgroup-item">
  286. <input type="radio" name="net_mode" value="docker" class="form-selectgroup-input" ${net_docker}>
  287. <span class="form-selectgroup-label d-flex align-items-center p-3">
  288. <span class="me-3">
  289. <span class="form-selectgroup-check"></span>
  290. </span>
  291. <span class="form-selectgroup-label-content">
  292. <span class="form-selectgroup-title strong mb-1">Docker Network</span>
  293. <span class="d-block text-secondary">Isolated on the docker network. ex.172.0.34.2</span>
  294. </span>
  295. </span>
  296. </label>
  297. </div>
  298. </div>
  299. <div class="accordion" id="${modal}-accordion">
  300. <div class="accordion-item">
  301. <h2 class="accordion-header" id="heading-1">
  302. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-1" aria-expanded="false">
  303. Ports
  304. </button>
  305. </h2>
  306. <div id="collapse-1" class="accordion-collapse collapse" data-bs-parent="#${modal}-accordion">
  307. <div class="accordion-body pt-0">
  308. <div class="row mb-1 align-items-end">
  309. <div class="col-auto">
  310. <input class="form-check-input" name="port0" type="checkbox" ${ports_data[0].check}>
  311. </div>
  312. <div class="col">
  313. <label class="form-label">External Port</label>
  314. <input type="text" class="form-control" name="port_0_external" value="${ports_data[0].external}"/>
  315. </div>
  316. <div class="col">
  317. <label class="form-label">Internal Port</label>
  318. <input type="text" class="form-control" name="port_0_internal" value="${ports_data[0].internal}"/>
  319. </div>
  320. <div class="col-lg-2">
  321. <label class="form-label">Protocol</label>
  322. <select class="form-select" name="port_0_protocol">
  323. <option value="${ports_data[0].protocol}" selected hidden>${ports_data[0].protocol}</option>
  324. <option value="tcp">tcp</option>
  325. <option value="udp">udp</option>
  326. </select>
  327. </div>
  328. </div>
  329. <div class="row mb-1 align-items-end">
  330. <div class="col-auto">
  331. <input class="form-check-input" name="port1" type="checkbox" ${ports_data[1].check}>
  332. </div>
  333. <div class="col">
  334. <input type="text" class="form-control" name="port_1_external" value="${ports_data[1].external}"/>
  335. </div>
  336. <div class="col">
  337. <input type="text" class="form-control" name="port_1_internal" value="${ports_data[1].internal}"/>
  338. </div>
  339. <div class="col-lg-2">
  340. <select class="form-select" name="port_1_protocol">
  341. <option value="${ports_data[1].protocol}" selected hidden>${ports_data[1].protocol}</option>
  342. <option value="tcp">tcp</option>
  343. <option value="udp">udp</option>
  344. </select>
  345. </div>
  346. </div>
  347. <div class="row mb-1 align-items-end">
  348. <div class="col-auto">
  349. <input class="form-check-input" name="port2" type="checkbox" ${ports_data[2].check}>
  350. </div>
  351. <div class="col">
  352. <input type="text" class="form-control" name="port_2_external" value="${ports_data[2].external}"/>
  353. </div>
  354. <div class="col">
  355. <input type="text" class="form-control" name="port_2_internal" value="${ports_data[2].internal}"/>
  356. </div>
  357. <div class="col-lg-2">
  358. <select class="form-select" name="port_2_protocol">
  359. <option value="${ports_data[2].protocol}" selected hidden>${ports_data[2].protocol}</option>
  360. <option value="tcp">tcp</option>
  361. <option value="udp">udp</option>
  362. </select>
  363. </div>
  364. </div>
  365. <div class="row mb-1 align-items-end">
  366. <div class="col-auto">
  367. <input class="form-check-input" name="port3" type="checkbox" ${ports_data[3].check}>
  368. </div>
  369. <div class="col">
  370. <input type="text" class="form-control" name="port_3_external" value="${ports_data[3].external}"/>
  371. </div>
  372. <div class="col">
  373. <input type="text" class="form-control" name="port_3_internal" value="${ports_data[3].internal}"/>
  374. </div>
  375. <div class="col-lg-2">
  376. <select class="form-select" name="port_3_protocol">
  377. <option value="${ports_data[3].protocol}" selected hidden>${ports_data[3].protocol}</option>
  378. <option value="tcp">tcp</option>
  379. <option value="udp">udp</option>
  380. </select>
  381. </div>
  382. </div>
  383. <div class="row mb-1 align-items-end">
  384. <div class="col-auto">
  385. <input class="form-check-input" name="port4" type="checkbox" ${ports_data[4].check}>
  386. </div>
  387. <div class="col">
  388. <input type="text" class="form-control" name="port_4_external" value="${ports_data[4].external}"/>
  389. </div>
  390. <div class="col">
  391. <input type="text" class="form-control" name="port_4_internal" value="${ports_data[4].internal}"/>
  392. </div>
  393. <div class="col-lg-2">
  394. <select class="form-select" name="port_4_protocol">
  395. <option value="${ports_data[4].protocol}" selected hidden>${ports_data[4].protocol}</option>
  396. <option value="tcp">tcp</option>
  397. <option value="udp">udp</option>
  398. </select>
  399. </div>
  400. </div>
  401. <div class="row mb-1 align-items-end">
  402. <div class="col-auto">
  403. <input class="form-check-input" name="port5" type="checkbox" ${ports_data[5].check}>
  404. </div>
  405. <div class="col">
  406. <input type="text" class="form-control" name="port_5_external" value="${ports_data[5].external}"/>
  407. </div>
  408. <div class="col">
  409. <input type="text" class="form-control" name="port_5_internal" value="${ports_data[5].internal}"/>
  410. </div>
  411. <div class="col-lg-2">
  412. <select class="form-select" name="port_5_protocol">
  413. <option value="${ports_data[5].protocol}" selected hidden>${ports_data[5].protocol}</option>
  414. <option value="tcp">tcp</option>
  415. <option value="udp">udp</option>
  416. </select>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. <div class="accordion-item">
  423. <h2 class="accordion-header" id="heading-2">
  424. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-2" aria-expanded="false">
  425. Volumes
  426. </button>
  427. </h2>
  428. <div id="collapse-2" class="accordion-collapse collapse" data-bs-parent="#${modal}-accordion">
  429. <div class="accordion-body pt-0">
  430. <div class="row mb-1 align-items-end">
  431. <div class="col-auto">
  432. <input class="form-check-input" name="volume0" type="checkbox" ${volumes_data[0].check}>
  433. </div>
  434. <div class="col">
  435. <input type="text" class="form-control" name="volume_0_bind" value="${volumes_data[0].bind}"/>
  436. </div>
  437. <div class="col">
  438. <input type="text" class="form-control" name="volume_0_container" value="${volumes_data[0].container}"/>
  439. </div>
  440. <div class="col-lg-2">
  441. <select class="form-select" name="volume_0_readwrite">
  442. <option value="${volumes_data[0].readwrite}" selected hidden>${volumes_data[0].readwrite}</option>
  443. <option value="rw">rw</option>
  444. <option value="ro">ro</option>
  445. </select>
  446. </div>
  447. </div>
  448. <div class="row mb-1 align-items-end">
  449. <div class="col-auto">
  450. <input class="form-check-input" name="volume1" type="checkbox" ${volumes_data[1].check}>
  451. </div>
  452. <div class="col">
  453. <input type="text" class="form-control" name="volume_1_bind" value="${volumes_data[1].bind}"/>
  454. </div>
  455. <div class="col">
  456. <input type="text" class="form-control" name="volume_1_container" value="${volumes_data[1].container}"/>
  457. </div>
  458. <div class="col-lg-2">
  459. <select class="form-select" name="volume_1_readwrite">
  460. <option value="${volumes_data[1].readwrite}" selected hidden>${volumes_data[1].readwrite}</option>
  461. <option value="rw">rw</option>
  462. <option value="ro">ro</option>
  463. </select>
  464. </div>
  465. </div>
  466. <div class="row mb-1 align-items-end">
  467. <div class="col-auto">
  468. <input class="form-check-input" name="volume2" type="checkbox" ${volumes_data[2].check}>
  469. </div>
  470. <div class="col">
  471. <input type="text" class="form-control" name="volume_2_bind" value="${volumes_data[2].bind}"/>
  472. </div>
  473. <div class="col">
  474. <input type="text" class="form-control" name="volume_2_container" value="${volumes_data[2].container}"/>
  475. </div>
  476. <div class="col-lg-2">
  477. <select class="form-select" name="volume_2_readwrite">
  478. <option value="${volumes_data[2].readwrite}" selected hidden>${volumes_data[2].readwrite}</option>
  479. <option value="rw">rw</option>
  480. <option value="ro">ro</option>
  481. </select>
  482. </div>
  483. </div>
  484. <div class="row mb-1 align-items-end">
  485. <div class="col-auto">
  486. <input class="form-check-input" name="volume3" type="checkbox" ${volumes_data[3].check}>
  487. </div>
  488. <div class="col">
  489. <input type="text" class="form-control" name="volume_3_bind" value="${volumes_data[3].bind}"/>
  490. </div>
  491. <div class="col">
  492. <input type="text" class="form-control" name="volume_3_container" value="${volumes_data[3].container}"/>
  493. </div>
  494. <div class="col-lg-2">
  495. <select class="form-select" name="volume_3_readwrite">
  496. <option value="${volumes_data[3].readwrite}" selected hidden>${volumes_data[3].readwrite}</option>
  497. <option value="rw">rw</option>
  498. <option value="ro">ro</option>
  499. </select>
  500. </div>
  501. </div>
  502. <div class="row mb-1 align-items-end">
  503. <div class="col-auto">
  504. <input class="form-check-input" name="volume4" type="checkbox" ${volumes_data[4].check}>
  505. </div>
  506. <div class="col">
  507. <input type="text" class="form-control" name="volume_4_bind" value="${volumes_data[4].bind}"/>
  508. </div>
  509. <div class="col">
  510. <input type="text" class="form-control" name="volume_4_container" value="${volumes_data[4].container}"/>
  511. </div>
  512. <div class="col-lg-2">
  513. <select class="form-select" name="volume_4_readwrite">
  514. <option value="${volumes_data[4].readwrite}" selected hidden>${volumes_data[4].readwrite}</option>
  515. <option value="rw">rw</option>
  516. <option value="ro">ro</option>
  517. </select>
  518. </div>
  519. </div>
  520. <div class="row mb-1 align-items-end">
  521. <div class="col-auto">
  522. <input class="form-check-input" name="volume5" type="checkbox" ${volumes_data[5].check}>
  523. </div>
  524. <div class="col">
  525. <input type="text" class="form-control" name="volume_5_bind" value="${volumes_data[5].bind}"/>
  526. </div>
  527. <div class="col">
  528. <input type="text" class="form-control" name="volume_5_container" value="${volumes_data[5].container}"/>
  529. </div>
  530. <div class="col-lg-2">
  531. <select class="form-select" name="volume_5_readwrite">
  532. <option value="${volumes_data[5].readwrite}" selected hidden>${volumes_data[5].readwrite}</option>
  533. <option value="rw">rw</option>
  534. <option value="ro">ro</option>
  535. </select>
  536. </div>
  537. </div>
  538. </div>
  539. </div>
  540. </div>
  541. <div class="accordion-item">
  542. <h2 class="accordion-header" id="heading-3">
  543. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-3" aria-expanded="false">
  544. Environment Variables
  545. </button>
  546. </h2>
  547. <div id="collapse-3" class="accordion-collapse collapse" data-bs-parent="#${modal}-accordion">
  548. <div class="accordion-body pt-0">
  549. <div class="row mb-1 align-items-end">
  550. <div class="col-auto">
  551. <input class="form-check-input" type="checkbox" name="env0" ${env_data[0].check}>
  552. </div>
  553. <div class="col">
  554. <label class="form-label">Variable</label>
  555. <input type="text" class="form-control" name="env_0_name" value="${env_data[0].name}"/>
  556. </div>
  557. <div class="col">
  558. <label class="form-label">Value</label>
  559. <input type="text" class="form-control" name="env_0_default" value="${env_data[0].default}"/>
  560. </div>
  561. </div>
  562. <div class="row mb-1 align-items-end">
  563. <div class="col-auto">
  564. <input class="form-check-input" type="checkbox" name="env1" ${env_data[1].check}>
  565. </div>
  566. <div class="col">
  567. <input type="text" class="form-control" name="env_1_name" value="${env_data[1].name}"/>
  568. </div>
  569. <div class="col">
  570. <input type="text" class="form-control" name="env_1_default" value="${env_data[1].default}"/>
  571. </div>
  572. </div>
  573. <div class="row mb-1 align-items-end">
  574. <div class="col-auto">
  575. <input class="form-check-input" type="checkbox" name="env2" ${env_data[2].check}>
  576. </div>
  577. <div class="col">
  578. <input type="text" class="form-control" name="env_2_name" value="${env_data[2].name}"/>
  579. </div>
  580. <div class="col">
  581. <input type="text" class="form-control" name="env_2_default" value="${env_data[2].default}"/>
  582. </div>
  583. </div>
  584. <div class="row mb-1 align-items-end">
  585. <div class="col-auto">
  586. <input class="form-check-input" type="checkbox" name="env3" ${env_data[3].check}>
  587. </div>
  588. <div class="col">
  589. <input type="text" class="form-control" name="env_3_name" value="${env_data[3].name}"/>
  590. </div>
  591. <div class="col">
  592. <input type="text" class="form-control" name="env_3_default" value="${env_data[3].default}"/>
  593. </div>
  594. </div>
  595. <div class="row mb-1 align-items-end">
  596. <div class="col-auto">
  597. <input class="form-check-input" type="checkbox" name="env4" ${env_data[4].check}>
  598. </div>
  599. <div class="col">
  600. <input type="text" class="form-control" name="env_4_name" value="${env_data[4].name}"/>
  601. </div>
  602. <div class="col">
  603. <input type="text" class="form-control" name="env_4_default" value="${env_data[4].default}"/>
  604. </div>
  605. </div>
  606. <div class="row mb-1 align-items-end">
  607. <div class="col-auto">
  608. <input class="form-check-input" type="checkbox" name="env5" ${env_data[5].check}>
  609. </div>
  610. <div class="col">
  611. <input type="text" class="form-control" name="env_5_name" value="${env_data[5].name}"/>
  612. </div>
  613. <div class="col">
  614. <input type="text" class="form-control" name="env_5_default" value="${env_data[5].default}"/>
  615. </div>
  616. </div>
  617. <div class="row mb-1 align-items-end">
  618. <div class="col-auto">
  619. <input class="form-check-input" type="checkbox" name="env6" ${env_data[6].check}>
  620. </div>
  621. <div class="col">
  622. <input type="text" class="form-control" name="env_6_name" value="${env_data[6].name}"/>
  623. </div>
  624. <div class="col">
  625. <input type="text" class="form-control" name="env_6_default" value="${env_data[6].default}"/>
  626. </div>
  627. </div>
  628. <div class="row mb-1 align-items-end">
  629. <div class="col-auto">
  630. <input class="form-check-input" type="checkbox" name="env7" ${env_data[7].check}>
  631. </div>
  632. <div class="col">
  633. <input type="text" class="form-control" name="env_7_name" value="${env_data[7].name}"/>
  634. </div>
  635. <div class="col">
  636. <input type="text" class="form-control" name="env_7_default" value="${env_data[7].default}"/>
  637. </div>
  638. </div>
  639. <div class="row mb-1 align-items-end">
  640. <div class="col-auto">
  641. <input class="form-check-input" type="checkbox" name="env8" ${env_data[8].check}>
  642. </div>
  643. <div class="col">
  644. <input type="text" class="form-control" name="env_8_name" value="${env_data[8].name}"/>
  645. </div>
  646. <div class="col">
  647. <input type="text" class="form-control" name="env_8_default" value="${env_data[8].default}"/>
  648. </div>
  649. </div>
  650. <div class="row mb-1 align-items-end">
  651. <div class="col-auto">
  652. <input class="form-check-input" type="checkbox" name="env9" ${env_data[9].check}>
  653. </div>
  654. <div class="col">
  655. <input type="text" class="form-control" name="env_9_name" value="${env_data[9].name}"/>
  656. </div>
  657. <div class="col">
  658. <input type="text" class="form-control" name="env_9_default" value="${env_data[9].default}"/>
  659. </div>
  660. </div>
  661. <div class="row mb-1 align-items-end">
  662. <div class="col-auto">
  663. <input class="form-check-input" type="checkbox" name="env10" ${env_data[10].check}>
  664. </div>
  665. <div class="col">
  666. <input type="text" class="form-control" name="env_10_name" value="${env_data[10].name}"/>
  667. </div>
  668. <div class="col">
  669. <input type="text" class="form-control" name="env_10_default" value="${env_data[10].default}"/>
  670. </div>
  671. </div>
  672. <div class="row mb-1 align-items-end">
  673. <div class="col-auto">
  674. <input class="form-check-input" type="checkbox" name="env11" ${env_data[11].check}>
  675. </div>
  676. <div class="col">
  677. <input type="text" class="form-control" name="env_11_name" value="${env_data[11].name}"/>
  678. </div>
  679. <div class="col">
  680. <input type="text" class="form-control" name="env_11_default" value="${env_data[11].default}"/>
  681. </div>
  682. </div>
  683. </div>
  684. </div>
  685. </div>
  686. <div class="accordion-item">
  687. <h2 class="accordion-header" id="heading-4">
  688. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-4" aria-expanded="false">
  689. Labels
  690. </button>
  691. </h2>
  692. <div id="collapse-4" class="accordion-collapse collapse" data-bs-parent="#${modal}-accordion">
  693. <div class="accordion-body pt-0">
  694. <div class="row mb-1 align-items-end">
  695. <div class="col-auto">
  696. <input class="form-check-input" type="checkbox" name="label0" ${label_data[0].check}>
  697. </div>
  698. <div class="col">
  699. <label class="form-label">Variable</label>
  700. <input type="text" class="form-control" name="label_0_name" value="${label_data[0].name}"/>
  701. </div>
  702. <div class="col">
  703. <label class="form-label">Value</label>
  704. <input type="text" class="form-control" name="label_0_value" value="${label_data[0].value}"/>
  705. </div>
  706. </div>
  707. <div class="row mb-1 align-items-end">
  708. <div class="col-auto">
  709. <input class="form-check-input" type="checkbox" name="label1" ${label_data[1].check}>
  710. </div>
  711. <div class="col">
  712. <input type="text" class="form-control" name="label_1_name" value="${label_data[1].name}"/>
  713. </div>
  714. <div class="col">
  715. <input type="text" class="form-control" name="label_1_value" value="${label_data[1].value}"/>
  716. </div>
  717. </div>
  718. <div class="row mb-1 align-items-end">
  719. <div class="col-auto">
  720. <input class="form-check-input" type="checkbox" name="label2" ${label_data[2].check}>
  721. </div>
  722. <div class="col">
  723. <input type="text" class="form-control" name="label_2_name" value="${label_data[2].name}"/>
  724. </div>
  725. <div class="col">
  726. <input type="text" class="form-control" name="label_2_value" value="${label_data[2].value}"/>
  727. </div>
  728. </div>
  729. <div class="row mb-1 align-items-end">
  730. <div class="col-auto">
  731. <input class="form-check-input" type="checkbox" name="label3" ${label_data[3].check}>
  732. </div>
  733. <div class="col">
  734. <input type="text" class="form-control" name="label_3_name" value="${label_data[3].name}"/>
  735. </div>
  736. <div class="col">
  737. <input type="text" class="form-control" name="label_3_value" value="${label_data[3].value}"/>
  738. </div>
  739. </div>
  740. <div class="row mb-1 align-items-end">
  741. <div class="col-auto">
  742. <input class="form-check-input" type="checkbox" name="label4" ${label_data[4].check}>
  743. </div>
  744. <div class="col">
  745. <input type="text" class="form-control" name="label_4_name" value="${label_data[4].name}"/>
  746. </div>
  747. <div class="col">
  748. <input type="text" class="form-control" name="label_4_value" value="${label_data[4].value}"/>
  749. </div>
  750. </div>
  751. <div class="row mb-1 align-items-end">
  752. <div class="col-auto">
  753. <input class="form-check-input" type="checkbox" name="label5" ${label_data[5].check}>
  754. </div>
  755. <div class="col">
  756. <input type="text" class="form-control" name="label_5_name" value="${label_data[5].name}"/>
  757. </div>
  758. <div class="col">
  759. <input type="text" class="form-control" name="label_5_value" value="${label_data[5].value}"/>
  760. </div>
  761. </div>
  762. <div class="row mb-1 align-items-end">
  763. <div class="col-auto">
  764. <input class="form-check-input" type="checkbox" name="label6" ${label_data[6].check}>
  765. </div>
  766. <div class="col">
  767. <input type="text" class="form-control" name="label_6_name" value="${label_data[6].name}"/>
  768. </div>
  769. <div class="col">
  770. <input type="text" class="form-control" name="label_6_value" value="${label_data[6].value}"/>
  771. </div>
  772. </div>
  773. <div class="row mb-1 align-items-end">
  774. <div class="col-auto">
  775. <input class="form-check-input" type="checkbox" name="label7" ${label_data[7].check}>
  776. </div>
  777. <div class="col">
  778. <input type="text" class="form-control" name="label_7_name" value="${label_data[7].name}"/>
  779. </div>
  780. <div class="col">
  781. <input type="text" class="form-control" name="label_7_value" value="${label_data[7].value}"/>
  782. </div>
  783. </div>
  784. <div class="row mb-1 align-items-end">
  785. <div class="col-auto">
  786. <input class="form-check-input" type="checkbox" name="label8" ${label_data[8].check}>
  787. </div>
  788. <div class="col">
  789. <input type="text" class="form-control" name="label_8_name" value="${label_data[8].name}"/>
  790. </div>
  791. <div class="col">
  792. <input type="text" class="form-control" name="label_8_value" value="${label_data[8].value}"/>
  793. </div>
  794. </div>
  795. <div class="row mb-1 align-items-end">
  796. <div class="col-auto">
  797. <input class="form-check-input" type="checkbox" name="label9" ${label_data[9].check}>
  798. </div>
  799. <div class="col">
  800. <input type="text" class="form-control" name="label_9_name" value="${label_data[9].name}"/>
  801. </div>
  802. <div class="col">
  803. <input type="text" class="form-control" name="label_9_value" value="${label_data[9].value}"/>
  804. </div>
  805. </div>
  806. <div class="row mb-1 align-items-end">
  807. <div class="col-auto">
  808. <input class="form-check-input" type="checkbox" name="label10" ${label_data[10].check}>
  809. </div>
  810. <div class="col">
  811. <input type="text" class="form-control" name="label_10_name" value="${label_data[10].name}"/>
  812. </div>
  813. <div class="col">
  814. <input type="text" class="form-control" name="label_10_value" value="${label_data[10].value}"/>
  815. </div>
  816. </div>
  817. <div class="row mb-1 align-items-end">
  818. <div class="col-auto">
  819. <input class="form-check-input" type="checkbox" name="label11" ${label_data[11].check}>
  820. </div>
  821. <div class="col">
  822. <input type="text" class="form-control" name="label_11_name" value="${label_data[11].name}"/>
  823. </div>
  824. <div class="col">
  825. <input type="text" class="form-control" name="label_11_value" value="${label_data[11].value}"/>
  826. </div>
  827. </div>
  828. </div>
  829. </div>
  830. </div>
  831. <div class="accordion-item">
  832. <h2 class="accordion-header" id="heading-5">
  833. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-5" aria-expanded="false">
  834. Extras
  835. </button>
  836. </h2>
  837. <div id="collapse-5" class="accordion-collapse collapse" data-bs-parent="#${modal}-accordion">
  838. <div class="accordion-body pt-0">
  839. <div class="row mb-1 align-items-end">
  840. <div class="col-auto">
  841. <input class="form-check-input" name="command_check" type="checkbox" ${command_check}>
  842. </div>
  843. <div class="col">
  844. <label class="form-label">Command</label>
  845. <input type="text" class="form-control" name="command" value="${command}"/>
  846. </div>
  847. </div>
  848. <div class="row mb-1 align-items-end">
  849. <div class="col-auto">
  850. <input class="form-check-input" name="privileged" type="checkbox" ${privileged_check}>
  851. </div>
  852. <div class="col">
  853. <label class="form-label">Privileged Mode</label>
  854. </div>
  855. </div>
  856. </div>
  857. </div>
  858. </div>
  859. </div>
  860. </form>
  861. </div>
  862. <div class="modal-footer">
  863. <button type="button" class="btn me-auto" data-bs-dismiss="modal">Close</button>
  864. <input type="submit" form="${form_id}_install" class="btn btn-success" value="Install"/>
  865. </div>
  866. </div>
  867. </div>
  868. </div>`;
  869. }