index.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1" />
  6. <meta name="theme-color" content="#f76c5d" />
  7. <meta name="description" content="ArozOS Photo" />
  8. <link rel="manifest" crossorigin="use-credentials" href="manifest.json">
  9. <title>Photo</title>
  10. <link rel="stylesheet" href="../script/semantic/semantic.min.css">
  11. <script src="../script/alpine.min.js"></script>
  12. <script src="../script/jquery.min.js"></script>
  13. <script src="../script/semantic/semantic.min.js"></script>
  14. <script src="../script/ao_module.js"></script>
  15. <style>
  16. @media only screen and (min-width: 850px) {
  17. #menu {
  18. flex: 1;
  19. max-width: 200px;
  20. min-width: 200px;
  21. height: 100vh;
  22. display: block;
  23. }
  24. #showmenuBtn {
  25. display: none;
  26. }
  27. }
  28. @media only screen and (max-width: 850px) {
  29. #menu {
  30. display: none;
  31. height: 100vh;
  32. }
  33. #showmenuBtn {
  34. position: fixed;
  35. bottom: 1.8em;
  36. left: 1em;
  37. }
  38. }
  39. #display {
  40. flex: 1;
  41. margin: 0 0;
  42. height: 100vh;
  43. }
  44. #main {
  45. display: flex;
  46. }
  47. body {
  48. overflow: hidden;
  49. }
  50. .imagecard{
  51. border: 1px solid transparent;
  52. }
  53. .imagecard img{
  54. width: 100%;
  55. }
  56. #viewbox{
  57. margin-left: 0px !important;
  58. margin-top: 0px !important;
  59. position: relative;
  60. }
  61. #viewboxContainer{
  62. height: 100%;
  63. overflow-y: auto;
  64. overflow-x: hidden;
  65. }
  66. #fadeplate{
  67. position: absolute;
  68. top: 0px;
  69. left: 0px;
  70. width: 100%;
  71. height: 100%;
  72. background: rgba(20,20,20,0.8);
  73. backdrop-filter: blur(2px);
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <script src="photo.js"></script>
  79. <div id="main" x-data='photoListObject()' x-init="init()">
  80. <div class="ui left vertical menu" id="menu">
  81. <div class="item" style="background-color: #f76c5d;">
  82. <img class="ui fluid image" src="img/banner.png">
  83. </div>
  84. <div class="item">
  85. Browse Photos
  86. <div class="menu">
  87. <template x-for="vroot in vroots" x-init="getRootInfo()">
  88. <a class="item" :rootpath="vroot[1]" x-on:click="updateRenderingPath(vroot[2]);"><i class="ui disk icon"></i> <span x-text="vroot[0] + ' (' + vroot[1] + ')'"></span></a>
  89. </template>
  90. </div>
  91. </div>
  92. <a id="parentFolderButton" class="item" x-on:click="parentFolder();" style="display:none;">
  93. <i class="reply icon"></i> Parent Folder
  94. </a>
  95. <div class="item">
  96. Sub Folders
  97. <div class="menu" style="max-height: 100px; overflow-y: auto;">
  98. <div class="item" id="nosubfolder" style="display:none;">No Sub Folders</div>
  99. <template x-for="folder in folders">
  100. <a class="item" x-on:click="updateRenderingPath(folder);" ><i class="ui folder open icon"></i> <span x-text="extractFolderName(folder);"></span></a>
  101. </template>
  102. </div>
  103. </div>
  104. <div class="item">
  105. Tags
  106. <div class="menu" >
  107. <div style="max-height: 100px; overflow-y: auto;">
  108. <template x-for="key in Object.keys(tags)">
  109. <a class="item" x-on:click="console.log( tags[key][0],tags[key][1]); images = tags[key]; $('#noimg').hide();" :filedata="encodeURIComponent(JSON.stringify(tags[key]));" ><i class="ui hashtag icon"></i> <span x-text="key"></span></a>
  110. </template>
  111. </div>
  112. </div>
  113. </div>
  114. <a class="item" onclick="rescan(this);">Rescan <i class="ui search icon"></i></a>
  115. <a class="item" onclick="showSetting();">Settings <i class="ui setting icon"></i></a>
  116. </div>
  117. <div id="display">
  118. <div id="noimg" class="ui basic segment" style="display:none;">
  119. <h4 class="ui header">
  120. <i class="red question icon"></i>
  121. <div class="content">
  122. Empty Folder
  123. <div class="sub header">There are no photo stored in <span x-text="currentPath + '/'"></span></div>
  124. </div>
  125. </h4>
  126. </div>
  127. <div id="viewboxContainer">
  128. <div id="viewbox" class="ui six cards viewbox">
  129. <template x-for="image in images">
  130. <div class="imagecard" style="cursor: pointer;" x-on:click="showImage($el); ShowModal();" :style="{width: renderSize + 'px', height: renderSize + 'px'}" :filedata="encodeURIComponent(JSON.stringify({'filename':image.split('/').pop(),'filepath':image}))">
  131. <a class="image" x-init="updateImageSizes();">
  132. <img :src="'../system/file_system/loadThumbnail?bytes=true&vpath=' + image">
  133. </a>
  134. </div>
  135. </template>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <button id="showmenuBtn" class="ui basic big icon button" onclick="toggleMenu();"><i class="ui content icon"></i></button>
  141. <!-- Photo Viewing Modal -->
  142. <div class="ui basic small modal viewer">
  143. <i class="close icon" style="margin-top: -2em;"></i>
  144. <div class="image content">
  145. <img id="fullImage" class="ui fluid image" src="" onload="$('.ui.modal.viewer').modal('refresh');"/>
  146. </div>
  147. </div>
  148. <div class="ui modal setting" x-data="settingObject()" x-init="init();">
  149. <i class="close icon"></i>
  150. <div class="header">
  151. Photo Classification Settings
  152. </div>
  153. <div class="content">
  154. <p><i class="angle right icon"></i> Select Neural Network Model for Classification</p>
  155. <div class="ui selection dropdown" id="selectedModel" onchange="updateSelectedModel($(this).dropdown('get value'));">
  156. <input type="hidden" name="nnm">
  157. <i class="dropdown icon"></i>
  158. <div class="default text">default</div>
  159. <div class="menu">
  160. <div class="item" data-value="yolo3">YOLO 3</div>
  161. <div class="item" data-value="darknet19">Darknet 19</div>
  162. </div>
  163. </div>
  164. <div class="ui green message" id="modelUpdated" style="display:none;">
  165. <div class="content">
  166. <i class="green small checkmark icon"></i> Model Updated
  167. </div>
  168. </div>
  169. <br>
  170. <small><i class="ui info icon"></i> For host with less than 1GB free memory, Darknet 19 is recommend. However, this might result is less accurate classification predictions.</small>
  171. <div class="ui divider"></div>
  172. <p><i class="angle right icon"></i> Base folder name to exclude when auto-tag generaton</p>
  173. <div id="newexc" class="ui action fluid input">
  174. <input type="text" placeholder="Private">
  175. <button class="ui blue basic button" x-on:click="addDir($el);"><i class="ui add icon"></i> Add</button>
  176. </div>
  177. <small>Example: To exclude *:/Photo/Private/, just fill in the folder name "Private"</small>
  178. <div class="ui middle aligned relaxed divided list">
  179. <div class="item" id="noexcRecords" style="display:none;"><i class="remove icon"></i> No Exclude Directory Record</div>
  180. <template x-for="excludedir in excludeDirs">
  181. <div class="item">
  182. <div class="right floated content">
  183. <div class="ui negative small basic button" x-on:click="removeDir(excludedir);"><i class="remove icon"></i> Remove</div>
  184. </div>
  185. <img class="ui avatar image" src="./img/collection.svg">
  186. <div class="content" x-text="excludedir + ' (Exclude *:/Photo/' + excludedir + '/)'">
  187. </div>
  188. </div>
  189. </template>
  190. </div>
  191. </div>
  192. <div class="actions">
  193. <div class="ui deny right button">
  194. Close
  195. </div>
  196. <div class="ui positive left labeled icon button" x-on:click="save();">
  197. Save
  198. <i class="checkmark icon"></i>
  199. </div>
  200. </div>
  201. </div>
  202. </body>
  203. <script>
  204. //Calculate image size on document ready
  205. $(window).on("resize ", function() {
  206. //check if the menu is opened
  207. if (window.innerWidth < 850) {
  208. $('#menu').slideUp('fast',function(){
  209. });
  210. }
  211. if (window.innerWidth >= 850) {
  212. $('#menu').slideDown('fast',function(){
  213. });
  214. }
  215. updateImageSizes();
  216. });
  217. function toggleMenu(){
  218. $('#menu').toggle('fast',function(){
  219. updateImageSizes();
  220. setTimeout(function(){
  221. updateImageSizes();
  222. }, 100);
  223. });
  224. }
  225. </script>
  226. </html>