settings.html (4354B)
1 {{template "_header" .}} 2 <h1>Settings</h1> 3 4 {{if .Data.Error}} 5 <div style="background-color: #f8d7da; color: #721c24; padding: 10px; border: 1px solid #f5c6cb; border-radius: 4px; margin-bottom: 20px;"> 6 <strong>Error:</strong> {{.Data.Error}} 7 </div> 8 {{end}} 9 10 {{if .Data.Success}} 11 <div style="background-color: #d4edda; color: #155724; padding: 10px; border: 1px solid #c3e6cb; border-radius: 4px; margin-bottom: 20px;"> 12 <strong>Success:</strong> {{.Data.Success}} 13 </div> 14 {{end}} 15 16 <form method="post" style="max-width: 600px;"> 17 <div style="margin-bottom: 20px;"> 18 <label for="database_path" style="display: block; font-weight: bold; margin-bottom: 5px;">Database Path:</label> 19 <input type="text" id="database_path" name="database_path" value="{{.Data.Config.DatabasePath}}" required 20 style="width: 100%; padding: 8px; font-size: 14px;" 21 placeholder="./database.db"> 22 <small style="color: #666;">Path to SQLite database file (requires restart if changed)</small> 23 </div> 24 25 <div style="margin-bottom: 20px;"> 26 <label for="upload_dir" style="display: block; font-weight: bold; margin-bottom: 5px;">Upload Directory:</label> 27 <input type="text" id="upload_dir" name="upload_dir" value="{{.Data.Config.UploadDir}}" required 28 style="width: 100%; padding: 8px; font-size: 14px;" 29 placeholder="uploads"> 30 <small style="color: #666;">Directory where uploaded files are stored</small> 31 </div> 32 33 <div style="margin-bottom: 20px;"> 34 <label for="server_port" style="display: block; font-weight: bold; margin-bottom: 5px;">Server Port:</label> 35 <input type="text" id="server_port" name="server_port" value="{{.Data.Config.ServerPort}}" required 36 style="width: 100%; padding: 8px; font-size: 14px;" 37 placeholder=":8080"> 38 <small style="color: #666;">Port for web server (format: :8080, requires restart if changed)</small> 39 </div> 40 41 <div style="margin-bottom: 20px;"> 42 <label for="instance_name" style="display: block; font-weight: bold; margin-bottom: 5px;">Instance Name:</label> 43 <input type="text" id="instance_name" name="instance_name" value="{{.Data.Config.InstanceName}}" required 44 style="width: 100%; padding: 8px; font-size: 14px;" 45 placeholder=":8080"> 46 <small style="color: #666;">Instance Name, used in header and title bar</small> 47 </div> 48 49 <div style="margin-bottom: 20px;"> 50 <label for="gallery_size" style="display: block; font-weight: bold; margin-bottom: 5px;">Gallery Size:</label> 51 <input type="text" id="gallery_size" name="gallery_size" value="{{.Data.Config.GallerySize}}" required 52 style="width: 100%; padding: 8px; font-size: 14px;" 53 placeholder=":8080"> 54 <small style="color: #666;">Size of previews used in galleries</small> 55 </div> 56 57 <div style="margin-bottom: 20px;"> 58 <label for="items_per_page" style="display: block; font-weight: bold; margin-bottom: 5px;">Items per Page:</label> 59 <input type="text" id="items_per_page" name="items_per_page" value="{{.Data.Config.ItemsPerPage}}" required 60 style="width: 100%; padding: 8px; font-size: 14px;" 61 placeholder=":8080"> 62 <small style="color: #666;">Items per page in galleries</small> 63 </div> 64 65 <button type="submit" style="background-color: #007bff; color: white; padding: 10px 20px; border: none; border-radius: 4px; font-size: 16px;"> 66 Save Settings 67 </button> 68 </form> 69 70 <div style="margin-top: 40px; padding: 20px; background-color: #f8f9fa; border-radius: 5px;"> 71 <h3>Current Configuration:</h3> 72 <ul> 73 <li><strong>Database:</strong> {{.Data.Config.DatabasePath}}</li> 74 <li><strong>Upload Directory:</strong> {{.Data.Config.UploadDir}}</li> 75 <li><strong>Server Port:</strong> {{.Data.Config.ServerPort}}</li> 76 <li><strong>Instance Name:</strong> {{.Data.Config.InstanceName}}</li> 77 <li><strong>Gallery Size:</strong> {{.Data.Config.GallerySize}}</li> 78 <li><strong>Items per Page:</strong> {{.Data.Config.ItemsPerPage}}</li> 79 </ul> 80 81 <h4>Configuration File:</h4> 82 <p>Settings are stored in <code>config.json</code> in the application directory.</p> 83 </div> 84 85 {{template "_footer"}}