SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
Add Iceberg table details view
Chris Lud9e3fb2b8ea5
diff --git a/weed/admin/dash/s3tables_management.go b/weed/admin/dash/s3tables_management.goindex a77a8201ce..2903a6ebe9 100644--- a/weed/admin/dash/s3tables_management.go+++ b/weed/admin/dash/s3tables_management.go@@ -7,6 +7,8 @@ import ("fmt""io""net/http"+ "sort"+ "strconv""strings""time"@@ -218,6 +220,7 @@ func (s *AdminServer) GetIcebergNamespacesData(ctx context.Context, catalogName,return IcebergNamespacesData{CatalogName: catalogName,+ BucketARN: bucketArn,Namespaces: namespaces,TotalNamespaces: len(namespaces),LastUpdated: time.Now(),@@ -242,12 +245,288 @@ func (s *AdminServer) GetIcebergTablesData(ctx context.Context, catalogName, bucreturn IcebergTablesData{CatalogName: catalogName,NamespaceName: namespace,+ BucketARN: bucketArn,Tables: tables,TotalTables: len(tables),LastUpdated: time.Now(),}, nil}+// GetIcebergTableDetailsData returns Iceberg table metadata and snapshot information.+func (s *AdminServer) GetIcebergTableDetailsData(ctx context.Context, catalogName, bucketArn, namespace, tableName string) (IcebergTableDetailsData, error) {+ var resp s3tables.GetTableResponse+ req := &s3tables.GetTableRequest{+ TableBucketARN: bucketArn,+ Namespace: []string{namespace},+ Name: tableName,+ }+ if err := s.executeS3TablesOperation(ctx, "GetTable", req, &resp); err != nil {+ return IcebergTableDetailsData{}, err+ }++ details := IcebergTableDetailsData{+ CatalogName: catalogName,+ NamespaceName: namespace,+ TableName: resp.Name,+ BucketARN: bucketArn,+ TableARN: resp.TableARN,+ Format: resp.Format,+ CreatedAt: resp.CreatedAt,+ ModifiedAt: resp.ModifiedAt,+ MetadataLocation: resp.MetadataLocation,+ }++ applyIcebergMetadata(resp.Metadata, &details)+ return details, nil+}++type icebergFullMetadata struct {+ FormatVersion int `json:"format-version"`+ TableUUID string `json:"table-uuid"`+ Location string `json:"location"`+ LastUpdatedMs int64 `json:"last-updated-ms"`+ Schemas []icebergSchema `json:"schemas"`+ Schema *icebergSchema `json:"schema"`+ CurrentSchemaID int `json:"current-schema-id"`+ PartitionSpecs []icebergPartitionSpec `json:"partition-specs"`+ PartitionSpec *icebergPartitionSpec `json:"partition-spec"`+ DefaultSpecID int `json:"default-spec-id"`+ Properties map[string]string `json:"properties"`+ Snapshots []icebergSnapshot `json:"snapshots"`+ CurrentSnapshotID int64 `json:"current-snapshot-id"`+}++type icebergSchema struct {+ SchemaID int `json:"schema-id"`+ Fields []icebergSchemaField `json:"fields"`+}++type icebergSchemaField struct {+ ID int `json:"id"`+ Name string `json:"name"`+ Type string `json:"type"`+ Required bool `json:"required"`+}++type icebergPartitionSpec struct {+ SpecID int `json:"spec-id"`+ Fields []icebergPartitionField `json:"fields"`+}++type icebergPartitionField struct {+ SourceID int `json:"source-id"`+ FieldID int `json:"field-id"`+ Name string `json:"name"`+ Transform string `json:"transform"`+}++type icebergSnapshot struct {+ SnapshotID int64 `json:"snapshot-id"`+ TimestampMs int64 `json:"timestamp-ms"`+ ManifestList string `json:"manifest-list"`+ Summary map[string]string `json:"summary"`+}++func applyIcebergMetadata(metadata *s3tables.TableMetadata, details *IcebergTableDetailsData) {+ if details == nil || metadata == nil {+ return+ }+ if len(metadata.FullMetadata) == 0 {+ details.SchemaFields = schemaFieldsFromIceberg(metadata.Iceberg)+ return+ }++ var full icebergFullMetadata+ if err := json.Unmarshal(metadata.FullMetadata, &full); err != nil {+ glog.V(1).Infof("iceberg metadata parse failed: %v", err)+ details.MetadataError = fmt.Sprintf("Failed to parse Iceberg metadata: %v", err)+ details.SchemaFields = schemaFieldsFromIceberg(metadata.Iceberg)+ return+ }++ details.TableLocation = full.Location+ details.SchemaFields = schemaFieldsFromFullMetadata(full, metadata.Iceberg)+ details.PartitionFields = partitionFieldsFromFullMetadata(full)+ details.Properties = propertiesFromFullMetadata(full.Properties)+ details.Snapshots = snapshotsFromFullMetadata(full.Snapshots)+ details.SnapshotCount = len(full.Snapshots)+ details.HasSnapshotCount = true+ if metricsSnapshot := selectSnapshotForMetrics(full); metricsSnapshot != nil {+ if value, ok := parseSummaryInt(metricsSnapshot.Summary, "total-data-files", "total-data-file-count", "total-files", "total-file-count"); ok {+ details.DataFileCount = value+ details.HasDataFileCount = true+ }+ if value, ok := parseSummaryInt(metricsSnapshot.Summary, "total-files-size", "total-data-files-size", "total-file-size", "total-data-file-size", "total-data-size", "total-size"); ok {+ details.TotalSizeBytes = value+ details.HasTotalSize = true+ }+ }+}++func schemaFieldsFromFullMetadata(full icebergFullMetadata, fallback *s3tables.IcebergMetadata) []IcebergSchemaFieldInfo {+ if schema := selectSchema(full); schema != nil {+ fields := make([]IcebergSchemaFieldInfo, 0, len(schema.Fields))+ for _, field := range schema.Fields {+ fields = append(fields, IcebergSchemaFieldInfo{+ ID: field.ID,+ Name: field.Name,+ Type: field.Type,+ Required: field.Required,+ })+ }+ return fields+ }+ return schemaFieldsFromIceberg(fallback)+}++func schemaFieldsFromIceberg(metadata *s3tables.IcebergMetadata) []IcebergSchemaFieldInfo {+ if metadata == nil {+ return nil+ }+ fields := make([]IcebergSchemaFieldInfo, 0, len(metadata.Schema.Fields))+ for _, field := range metadata.Schema.Fields {+ fields = append(fields, IcebergSchemaFieldInfo{+ Name: field.Name,+ Type: field.Type,+ Required: field.Required,+ })+ }+ return fields+}++func selectSchema(full icebergFullMetadata) *icebergSchema {+ if len(full.Schemas) == 0 && full.Schema == nil {+ return nil+ }+ if len(full.Schemas) == 0 {+ return full.Schema+ }+ if full.CurrentSchemaID != 0 {+ for i := range full.Schemas {+ if full.Schemas[i].SchemaID == full.CurrentSchemaID {+ return &full.Schemas[i]+ }+ }+ }+ return &full.Schemas[0]+}++func partitionFieldsFromFullMetadata(full icebergFullMetadata) []IcebergPartitionFieldInfo {+ var spec *icebergPartitionSpec+ if len(full.PartitionSpecs) == 0 && full.PartitionSpec == nil {+ return nil+ }+ if len(full.PartitionSpecs) == 0 {+ spec = full.PartitionSpec+ } else {+ if full.DefaultSpecID != 0 {+ for i := range full.PartitionSpecs {+ if full.PartitionSpecs[i].SpecID == full.DefaultSpecID {+ spec = &full.PartitionSpecs[i]+ break+ }+ }+ }+ if spec == nil {+ spec = &full.PartitionSpecs[0]+ }+ }+ if spec == nil {+ return nil+ }+ fields := make([]IcebergPartitionFieldInfo, 0, len(spec.Fields))+ for _, field := range spec.Fields {+ fields = append(fields, IcebergPartitionFieldInfo{+ Name: field.Name,+ Transform: field.Transform,+ SourceID: field.SourceID,+ FieldID: field.FieldID,+ })+ }+ return fields+}++func propertiesFromFullMetadata(properties map[string]string) []IcebergPropertyInfo {+ if len(properties) == 0 {+ return nil+ }+ keys := make([]string, 0, len(properties))+ for key := range properties {+ keys = append(keys, key)+ }+ sort.Strings(keys)+ entries := make([]IcebergPropertyInfo, 0, len(keys))+ for _, key := range keys {+ entries = append(entries, IcebergPropertyInfo{Key: key, Value: properties[key]})+ }+ return entries+}++func snapshotsFromFullMetadata(snapshots []icebergSnapshot) []IcebergSnapshotInfo {+ if len(snapshots) == 0 {+ return nil+ }+ sort.Slice(snapshots, func(i, j int) bool {+ return snapshots[i].TimestampMs > snapshots[j].TimestampMs+ })+ info := make([]IcebergSnapshotInfo, 0, len(snapshots))+ for _, snapshot := range snapshots {+ operation := ""+ if snapshot.Summary != nil {+ operation = snapshot.Summary["operation"]+ }+ timestamp := time.Time{}+ if snapshot.TimestampMs > 0 {+ timestamp = time.Unix(0, snapshot.TimestampMs*int64(time.Millisecond))+ }+ info = append(info, IcebergSnapshotInfo{+ SnapshotID: snapshot.SnapshotID,+ Timestamp: timestamp,+ Operation: operation,+ ManifestList: snapshot.ManifestList,+ })+ }+ return info+}++func selectSnapshotForMetrics(full icebergFullMetadata) *icebergSnapshot {+ if len(full.Snapshots) == 0 {+ return nil+ }+ if full.CurrentSnapshotID != 0 {+ for i := range full.Snapshots {+ if full.Snapshots[i].SnapshotID == full.CurrentSnapshotID {+ return &full.Snapshots[i]+ }+ }+ }+ latest := full.Snapshots[0]+ for _, snapshot := range full.Snapshots[1:] {+ if snapshot.TimestampMs > latest.TimestampMs {+ latest = snapshot+ }+ }+ return &latest+}++func parseSummaryInt(summary map[string]string, keys ...string) (int64, bool) {+ if len(summary) == 0 {+ return 0, false+ }+ for _, key := range keys {+ value, ok := summary[key]+ if !ok || value == "" {+ continue+ }+ parsed, err := strconv.ParseInt(value, 10, 64)+ if err != nil {+ continue+ }+ return parsed, true+ }+ return 0, false+}+// API handlersfunc (s *AdminServer) ListS3TablesBucketsAPI(c *gin.Context) {diff --git a/weed/admin/dash/types.go b/weed/admin/dash/types.goindex 49483d5f52..9f230db40a 100644--- a/weed/admin/dash/types.go+++ b/weed/admin/dash/types.go@@ -621,6 +621,7 @@ type IcebergNamespaceInfo struct {type IcebergNamespacesData struct {Username string `json:"username"`CatalogName string `json:"catalog_name"`+ BucketARN string `json:"bucket_arn"`Namespaces []IcebergNamespaceInfo `json:"namespaces"`TotalNamespaces int `json:"total_namespaces"`LastUpdated time.Time `json:"last_updated"`@@ -635,7 +636,59 @@ type IcebergTablesData struct {Username string `json:"username"`CatalogName string `json:"catalog_name"`NamespaceName string `json:"namespace_name"`+ BucketARN string `json:"bucket_arn"`Tables []IcebergTableInfo `json:"tables"`TotalTables int `json:"total_tables"`LastUpdated time.Time `json:"last_updated"`}++type IcebergSchemaFieldInfo struct {+ ID int `json:"id"`+ Name string `json:"name"`+ Type string `json:"type"`+ Required bool `json:"required"`+}++type IcebergPartitionFieldInfo struct {+ Name string `json:"name"`+ Transform string `json:"transform"`+ SourceID int `json:"source_id"`+ FieldID int `json:"field_id"`+}++type IcebergPropertyInfo struct {+ Key string `json:"key"`+ Value string `json:"value"`+}++type IcebergSnapshotInfo struct {+ SnapshotID int64 `json:"snapshot_id"`+ Timestamp time.Time `json:"timestamp"`+ Operation string `json:"operation"`+ ManifestList string `json:"manifest_list"`+}++type IcebergTableDetailsData struct {+ Username string `json:"username"`+ CatalogName string `json:"catalog_name"`+ NamespaceName string `json:"namespace_name"`+ TableName string `json:"table_name"`+ BucketARN string `json:"bucket_arn"`+ TableARN string `json:"table_arn"`+ Format string `json:"format"`+ CreatedAt time.Time `json:"created_at"`+ ModifiedAt time.Time `json:"modified_at"`+ MetadataLocation string `json:"metadata_location"`+ TableLocation string `json:"table_location"`+ SchemaFields []IcebergSchemaFieldInfo `json:"schema_fields"`+ PartitionFields []IcebergPartitionFieldInfo `json:"partition_fields"`+ Properties []IcebergPropertyInfo `json:"properties"`+ Snapshots []IcebergSnapshotInfo `json:"snapshots"`+ SnapshotCount int `json:"snapshot_count"`+ HasSnapshotCount bool `json:"has_snapshot_count"`+ DataFileCount int64 `json:"data_file_count"`+ HasDataFileCount bool `json:"has_data_file_count"`+ TotalSizeBytes int64 `json:"total_size_bytes"`+ HasTotalSize bool `json:"has_total_size"`+ MetadataError string `json:"metadata_error,omitempty"`+}diff --git a/weed/admin/handlers/admin_handlers.go b/weed/admin/handlers/admin_handlers.goindex 564a509f48..79d69bcefd 100644--- a/weed/admin/handlers/admin_handlers.go+++ b/weed/admin/handlers/admin_handlers.go@@ -94,6 +94,7 @@ func (h *AdminHandlers) SetupRoutes(r *gin.Engine, authRequired bool, adminUser,protected.GET("/object-store/iceberg", h.ShowIcebergCatalog)protected.GET("/object-store/iceberg/:catalog/namespaces", h.ShowIcebergNamespaces)protected.GET("/object-store/iceberg/:catalog/namespaces/:namespace/tables", h.ShowIcebergTables)+ protected.GET("/object-store/iceberg/:catalog/namespaces/:namespace/tables/:table", h.ShowIcebergTableDetails)// File browser routesprotected.GET("/files", h.fileBrowserHandlers.ShowFileBrowser)@@ -265,6 +266,7 @@ func (h *AdminHandlers) SetupRoutes(r *gin.Engine, authRequired bool, adminUser,r.GET("/object-store/iceberg", h.ShowIcebergCatalog)r.GET("/object-store/iceberg/:catalog/namespaces", h.ShowIcebergNamespaces)r.GET("/object-store/iceberg/:catalog/namespaces/:namespace/tables", h.ShowIcebergTables)+ r.GET("/object-store/iceberg/:catalog/namespaces/:namespace/tables/:table", h.ShowIcebergTableDetails)// File browser routesr.GET("/files", h.fileBrowserHandlers.ShowFileBrowser)@@ -609,6 +611,32 @@ func (h *AdminHandlers) ShowIcebergTables(c *gin.Context) {}}+// ShowIcebergTableDetails renders the table metadata and snapshot details view.+func (h *AdminHandlers) ShowIcebergTableDetails(c *gin.Context) {+ catalogName := c.Param("catalog")+ namespace := c.Param("namespace")+ tableName := c.Param("table")+ arn, err := buildS3TablesBucketArn(catalogName)+ if err != nil {+ c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})+ return+ }++ data, err := h.adminServer.GetIcebergTableDetailsData(c.Request.Context(), catalogName, arn, namespace, tableName)+ if err != nil {+ c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to get Iceberg table details: " + err.Error()})+ return+ }+ data.Username = h.getUsername(c)++ c.Header("Content-Type", "text/html")+ component := app.IcebergTableDetails(data)+ layoutComponent := layout.Layout(c, component)+ if err := layoutComponent.Render(c.Request.Context(), c.Writer); err != nil {+ c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to render template: " + err.Error()})+ }+}+// ShowBucketDetails returns detailed information about a specific bucketfunc (h *AdminHandlers) ShowBucketDetails(c *gin.Context) {bucketName := c.Param("bucket")diff --git a/weed/admin/static/js/s3tables.js b/weed/admin/static/js/s3tables.jsindex 4c484bce5e..148b1e3650 100644--- a/weed/admin/static/js/s3tables.js+++ b/weed/admin/static/js/s3tables.js@@ -9,6 +9,7 @@ let s3tablesNamespaceDeleteModal = null;let s3tablesTableDeleteModal = null;let s3tablesTablePolicyModal = null;let s3tablesTagsModal = null;+let icebergTableDeleteModal = null;/*** Initialize S3 Tables Buckets Page@@ -261,6 +262,173 @@ function initS3TablesTables() {}}+/**+ * Initialize Iceberg Namespaces Page+ */+function initIcebergNamespaces() {+ const container = document.getElementById('iceberg-namespaces-content');+ if (!container) return;+ const bucketArn = container.dataset.bucketArn || '';+ const catalogName = container.dataset.catalogName || '';++ const createForm = document.getElementById('createIcebergNamespaceForm');+ if (createForm) {+ createForm.addEventListener('submit', async function (e) {+ e.preventDefault();+ const name = document.getElementById('icebergNamespaceName').value.trim();+ if (!name) {+ alert('Namespace name is required');+ return;+ }+ try {+ const response = await fetch('/api/s3tables/namespaces', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ bucket_arn: bucketArn, name: name })+ });+ const data = await response.json();+ if (!response.ok) {+ alert(data.error || 'Failed to create namespace');+ return;+ }+ alert('Namespace created');+ location.reload();+ } catch (error) {+ alert('Failed to create namespace: ' + error.message);+ }+ });+ }++ initIcebergNamespaceTree(container, bucketArn, catalogName);+}++function initIcebergNamespaceTree(container, bucketArn, catalogName) {+ const nodes = container.querySelectorAll('.iceberg-namespace-collapse');+ nodes.forEach(node => {+ node.addEventListener('show.bs.collapse', async function () {+ if (node.dataset.loaded === 'true') return;+ node.dataset.loaded = 'true';+ node.innerHTML = '<div class="text-muted small">Loading...</div>';+ await loadIcebergNamespaceTables(node, bucketArn, catalogName);+ });+ });+}++async function loadIcebergNamespaceTables(node, bucketArn, catalogName) {+ const namespace = node.dataset.namespace || '';+ if (!bucketArn || !namespace) {+ node.innerHTML = '<div class="text-muted small">No namespace data available.</div>';+ return;+ }+ try {+ const query = new URLSearchParams({ bucket: bucketArn, namespace: namespace });+ const response = await fetch(`/api/s3tables/tables?${query.toString()}`);+ const data = await response.json();+ if (!response.ok) {+ node.innerHTML = `<div class="text-danger small">${data.error || 'Failed to load tables'}</div>`;+ return;+ }+ const tables = data.tables || [];+ if (tables.length === 0) {+ node.innerHTML = '<div class="text-muted small ms-3">No tables found.</div>';+ return;+ }+ const list = document.createElement('ul');+ list.className = 'list-group list-group-flush ms-3';+ tables.forEach(table => {+ const item = document.createElement('li');+ item.className = 'list-group-item py-1';+ const link = document.createElement('a');+ link.className = 'text-decoration-none';+ link.href = `/object-store/iceberg/${encodeURIComponent(catalogName)}/namespaces/${encodeURIComponent(namespace)}/tables/${encodeURIComponent(table.name)}`;+ link.innerHTML = `<i class="fas fa-table text-primary me-2"></i>${table.name}`;+ item.appendChild(link);+ list.appendChild(item);+ });+ node.innerHTML = '';+ node.appendChild(list);+ } catch (error) {+ node.innerHTML = `<div class="text-danger small">${error.message}</div>`;+ }+}++/**+ * Initialize Iceberg Tables Page+ */+function initIcebergTables() {+ const container = document.getElementById('iceberg-tables-content');+ if (!container) return;+ const bucketArn = container.dataset.bucketArn || '';+ const namespace = container.dataset.namespace || '';++ initIcebergDeleteModal();++ const createForm = document.getElementById('createIcebergTableForm');+ if (createForm) {+ createForm.addEventListener('submit', async function (e) {+ e.preventDefault();+ const name = document.getElementById('icebergTableName').value.trim();+ const format = document.getElementById('icebergTableFormat').value;+ const metadataText = document.getElementById('icebergTableMetadata').value.trim();+ const tagsInput = document.getElementById('icebergTableTags').value.trim();+ const tags = parseTagsInput(tagsInput);+ if (tags === null) return;+ let metadata = null;+ if (metadataText) {+ try {+ metadata = JSON.parse(metadataText);+ } catch (error) {+ alert('Invalid metadata JSON');+ return;+ }+ }+ const payload = { bucket_arn: bucketArn, namespace: namespace, name: name, format: format, tags: tags };+ if (metadata) {+ payload.metadata = metadata;+ }+ try {+ const response = await fetch('/api/s3tables/tables', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify(payload)+ });+ const data = await response.json();+ if (!response.ok) {+ alert(data.error || 'Failed to create table');+ return;+ }+ alert('Table created');+ location.reload();+ } catch (error) {+ alert('Failed to create table: ' + error.message);+ }+ });+ }+}++/**+ * Initialize Iceberg Table Details Page+ */+function initIcebergTableDetails() {+ initIcebergDeleteModal();+}++function initIcebergDeleteModal() {+ const modalEl = document.getElementById('deleteIcebergTableModal');+ if (!modalEl) return;+ icebergTableDeleteModal = new bootstrap.Modal(modalEl);+ document.querySelectorAll('.iceberg-delete-table-btn').forEach(button => {+ button.addEventListener('click', function () {+ modalEl.dataset.bucketArn = this.dataset.bucketArn || '';+ modalEl.dataset.namespace = this.dataset.namespace || '';+ modalEl.dataset.tableName = this.dataset.tableName || '';+ document.getElementById('deleteIcebergTableName').textContent = this.dataset.tableName || '';+ document.getElementById('deleteIcebergTableVersion').value = '';+ icebergTableDeleteModal.show();+ });+ });+}+// Global scope functions used by onclick handlersasync function deleteS3TablesBucket() {@@ -340,6 +508,36 @@ async function deleteS3TablesTable() {}}+async function deleteIcebergTable() {+ const modalEl = document.getElementById('deleteIcebergTableModal');+ if (!modalEl) return;+ const bucketArn = modalEl.dataset.bucketArn || '';+ const namespace = modalEl.dataset.namespace || '';+ const tableName = modalEl.dataset.tableName || '';+ const versionToken = document.getElementById('deleteIcebergTableVersion').value.trim();+ if (!bucketArn || !namespace || !tableName) return;+ const query = new URLSearchParams({+ bucket: bucketArn,+ namespace: namespace,+ name: tableName+ });+ if (versionToken) {+ query.set('version', versionToken);+ }+ try {+ const response = await fetch(`/api/s3tables/tables?${query.toString()}`, { method: 'DELETE' });+ const data = await response.json();+ if (!response.ok) {+ alert(data.error || 'Failed to drop table');+ return;+ }+ alert('Table dropped');+ location.reload();+ } catch (error) {+ alert('Failed to drop table: ' + error.message);+ }+}+async function loadS3TablesTablePolicy(bucketArn, namespace, name) {document.getElementById('s3tablesTablePolicyText').value = '';if (!bucketArn || !namespace || !name) return;diff --git a/weed/admin/view/app/file_browser_templ.go b/weed/admin/view/app/file_browser_templ.goindex 230471fc1d..8a7be7142a 100644--- a/weed/admin/view/app/file_browser_templ.go+++ b/weed/admin/view/app/file_browser_templ.go@@ -58,7 +58,7 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {var templ_7745c5c3_Var2 stringtempl_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.TableBucketName)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 18, Col: 72}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 18, Col: 71}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))if templ_7745c5c3_Err != nil {@@ -72,7 +72,7 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {var templ_7745c5c3_Var3 stringtempl_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.BucketName)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 20, Col: 63}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 20, Col: 62}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))if templ_7745c5c3_Err != nil {@@ -189,38 +189,38 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {return templ_7745c5c3_Err}} else {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<a href=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<a href=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var8 templ.SafeURLtempl_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/files?path=%s", data.CurrentPath)))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 94, Col: 76}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 89, Col: 76}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\" class=\"text-decoration-none text-primary\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\" class=\"text-decoration-none text-primary\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var9 stringtempl_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(filepath.Base(data.CurrentPath))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 94, Col: 154}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 89, Col: 154}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</a>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</a>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</h6><!-- Compact pagination controls --><div class=\"d-flex align-items-center gap-2 ms-auto\"><div class=\"d-flex align-items-center\"><label class=\"me-1 mb-0 small text-muted\">Show:</label> ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</h6><!-- Compact pagination controls --><div class=\"d-flex align-items-center gap-2 ms-auto\"><div class=\"d-flex align-items-center\"><label class=\"me-1 mb-0 small text-muted\">Show:</label> ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -228,7 +228,7 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<select class=\"form-select form-select-sm\" style=\"width: 70px; font-size: 0.875rem;\" onchange=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<select class=\"form-select form-select-sm\" style=\"width: 70px; font-size: 0.875rem;\" onchange=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -237,148 +237,148 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\"><option value=\"20\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"><option value=\"20\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 20 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, ">20</option> <option value=\"50\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, ">20</option> <option value=\"50\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 50 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, ">50</option> <option value=\"100\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, ">50</option> <option value=\"100\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 100 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, ">100</option> <option value=\"200\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, ">100</option> <option value=\"200\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 200 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, ">200</option></select></div><div class=\"btn-group btn-group-sm\" role=\"group\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, ">200</option></select></div><div class=\"btn-group btn-group-sm\" role=\"group\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.HasNextPage {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<a href=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<a href=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var11 templ.SafeURLtempl_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/files?path=%s&lastFileName=%s&limit=%d", data.CurrentPath, data.LastFileName, data.PageSize)))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 111, Col: 137}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 106, Col: 137}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\" class=\"btn btn-outline-primary\" title=\"Next page\">Next <i class=\"fas fa-angle-right\"></i></a> ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\" class=\"btn btn-outline-primary\" title=\"Next page\">Next <i class=\"fas fa-angle-right\"></i></a> ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}} else {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<button class=\"btn btn-outline-secondary\" disabled title=\"Next page\">Next <i class=\"fas fa-angle-right\"></i></button> ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<button class=\"btn btn-outline-secondary\" disabled title=\"Next page\">Next <i class=\"fas fa-angle-right\"></i></button> ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}if data.ParentPath != data.CurrentPath {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<a href=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<a href=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var12 templ.SafeURLtempl_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/files?path=%s", data.ParentPath)))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 120, Col: 77}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 115, Col: 77}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\" class=\"btn btn-outline-secondary\" title=\"Go up one directory\"><i class=\"fas fa-arrow-up\"></i> Up</a>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\" class=\"btn btn-outline-secondary\" title=\"Go up one directory\"><i class=\"fas fa-arrow-up\"></i> Up</a>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</div></div></div><div class=\"card-body\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</div></div></div><div class=\"card-body\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if len(data.Entries) > 0 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div class=\"table-responsive\"><table class=\"table table-hover\" id=\"fileTable\"><thead><tr><th width=\"40px\"><input type=\"checkbox\" id=\"selectAll\" onchange=\"toggleSelectAll()\"></th><th>Name</th><th>Size</th><th>Type</th><th>Modified</th><th>Permissions</th><th>Actions</th></tr></thead> <tbody>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<div class=\"table-responsive\"><table class=\"table table-hover\" id=\"fileTable\"><thead><tr><th width=\"40px\"><input type=\"checkbox\" id=\"selectAll\" onchange=\"toggleSelectAll()\"></th><th>Name</th><th>Size</th><th>Type</th><th>Modified</th><th>Permissions</th><th>Actions</th></tr></thead> <tbody>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}for _, entry := range data.Entries {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<tr><td><input type=\"checkbox\" class=\"file-checkbox\" value=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<tr><td><input type=\"checkbox\" class=\"file-checkbox\" value=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var13 stringtempl_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(entry.FullPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 148, Col: 77}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 143, Col: 77}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\"></td><td><div class=\"d-flex align-items-center\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\"></td><td><div class=\"d-flex align-items-center\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if entry.IsDirectory {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<i class=\"fas fa-folder text-warning me-2\"></i> <a href=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<i class=\"fas fa-folder text-warning me-2\"></i> <a href=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var14 templ.SafeURLtempl_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/files?path=%s", entry.FullPath)))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 154, Col: 82}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 149, Col: 82}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "\" class=\"text-decoration-none\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "\" class=\"text-decoration-none\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var15 stringtempl_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(entry.Name)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 155, Col: 25}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 150, Col: 25}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</a>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</a>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -388,7 +388,7 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<i class=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<i class=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -401,30 +401,30 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "\"></i> <span>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\"></i> <span>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var18 stringtempl_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(entry.Name)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 159, Col: 30}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 154, Col: 30}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</span>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</span>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</div></td><td>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</div></td><td>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if entry.IsDirectory {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<span class=\"text-muted\">—</span>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<span class=\"text-muted\">—</span>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -432,19 +432,19 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {var templ_7745c5c3_Var19 stringtempl_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(entry.Size))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 167, Col: 36}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 162, Col: 36}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</td><td><span class=\"badge bg-light text-dark\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</td><td><span class=\"badge bg-light text-dark\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if entry.IsDirectory {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "Directory")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "Directory")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -452,14 +452,14 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {var templ_7745c5c3_Var20 stringtempl_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(getMimeDisplayName(entry.Mime))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 175, Col: 44}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 170, Col: 44}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</span></td><td>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</span></td><td>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -467,135 +467,135 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {var templ_7745c5c3_Var21 stringtempl_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(entry.ModTime.Format("2006-01-02 15:04"))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 181, Col: 53}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 176, Col: 53}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}} else {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<span class=\"text-muted\">—</span>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<span class=\"text-muted\">—</span>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</td><td><code class=\"small permissions-display\" data-mode=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</td><td><code class=\"small permissions-display\" data-mode=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var22 stringtempl_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(entry.Mode)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 187, Col: 72}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 182, Col: 72}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "\" data-is-directory=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\" data-is-directory=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var23 stringtempl_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%t", entry.IsDirectory))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 187, Col: 131}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 182, Col: 131}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var24 stringtempl_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(entry.Mode)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 187, Col: 146}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 182, Col: 146}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</code></td><td><div class=\"btn-group btn-group-sm\" role=\"group\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</code></td><td><div class=\"btn-group btn-group-sm\" role=\"group\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if !entry.IsDirectory {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<button type=\"button\" class=\"btn btn-outline-primary btn-sm\" title=\"Download\" data-action=\"download\" data-path=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<button type=\"button\" class=\"btn btn-outline-primary btn-sm\" title=\"Download\" data-action=\"download\" data-path=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var25 stringtempl_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(entry.FullPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 192, Col: 139}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 187, Col: 139}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\"><i class=\"fas fa-download\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm\" title=\"View\" data-action=\"view\" data-path=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "\"><i class=\"fas fa-download\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm\" title=\"View\" data-action=\"view\" data-path=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var26 stringtempl_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(entry.FullPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 195, Col: 128}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 190, Col: 128}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "\"><i class=\"fas fa-eye\"></i></button> ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\"><i class=\"fas fa-eye\"></i></button> ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" title=\"Properties\" data-action=\"properties\" data-path=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "<button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" title=\"Properties\" data-action=\"properties\" data-path=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var27 stringtempl_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(entry.FullPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 199, Col: 144}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 194, Col: 144}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\"><i class=\"fas fa-info-circle\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger btn-sm\" title=\"Delete\" data-action=\"delete\" data-path=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\"><i class=\"fas fa-info-circle\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger btn-sm\" title=\"Delete\" data-action=\"delete\" data-path=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var28 stringtempl_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(entry.FullPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 202, Col: 133}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 197, Col: 133}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\"><i class=\"fas fa-trash\"></i></button></div></td></tr>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\"><i class=\"fas fa-trash\"></i></button></div></td></tr>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</tbody></table></div>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</tbody></table></div>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}} else {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<div class=\"text-center py-5\"><i class=\"fas fa-folder-open fa-3x text-muted mb-3\"></i><h5 class=\"text-muted\">Empty Directory</h5><p class=\"text-muted\">This directory contains no files or subdirectories.</p></div>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<div class=\"text-center py-5\"><i class=\"fas fa-folder-open fa-3x text-muted mb-3\"></i><h5 class=\"text-muted\">Empty Directory</h5><p class=\"text-muted\">This directory contains no files or subdirectories.</p></div>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</div></div><!-- Last Updated --><!-- Pagination Controls (Bottom) --><div class=\"row mb-3\"><div class=\"col-md-6\"><div class=\"d-flex align-items-center\"><label class=\"me-2 mb-0\">Show:</label> ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "</div></div><!-- Last Updated --><!-- Pagination Controls (Bottom) --><div class=\"row mb-3\"><div class=\"col-md-6\"><div class=\"d-flex align-items-center\"><label class=\"me-2 mb-0\">Show:</label> ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -603,7 +603,7 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<select class=\"form-select form-select-sm\" style=\"width: auto;\" onchange=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "<select class=\"form-select form-select-sm\" style=\"width: auto;\" onchange=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}@@ -612,114 +612,114 @@ func FileBrowser(data dash.FileBrowserData) templ.Component {if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\"><option value=\"20\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\"><option value=\"20\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 20 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, ">20</option> <option value=\"50\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, ">20</option> <option value=\"50\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 50 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, ">50</option> <option value=\"100\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, ">50</option> <option value=\"100\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 100 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, ">100</option> <option value=\"200\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, ">100</option> <option value=\"200\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.PageSize == 200 {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, " selected")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " selected")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, ">200</option></select> <span class=\"ms-2 text-muted\">entries per page</span></div></div><div class=\"col-md-6 text-end\"><div class=\"btn-group btn-group-sm\" role=\"group\">")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, ">200</option></select> <span class=\"ms-2 text-muted\">entries per page</span></div></div><div class=\"col-md-6 text-end\"><div class=\"btn-group btn-group-sm\" role=\"group\">")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}if data.HasNextPage {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<a href=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "<a href=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var30 templ.SafeURLtempl_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/files?path=%s&lastFileName=%s&limit=%d", data.CurrentPath, data.LastFileName, data.PageSize)))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 242, Col: 137}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 237, Col: 137}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "\" class=\"btn btn-outline-primary\">Next <i class=\"fas fa-angle-right ms-1\"></i></a>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "\" class=\"btn btn-outline-primary\">Next <i class=\"fas fa-angle-right ms-1\"></i></a>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}} else {- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "<button class=\"btn btn-outline-secondary\" disabled>Next <i class=\"fas fa-angle-right ms-1\"></i></button>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<button class=\"btn btn-outline-secondary\" disabled>Next <i class=\"fas fa-angle-right ms-1\"></i></button>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</div></div></div><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"fas fa-clock me-1\"></i> Last updated: ")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</div></div></div><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"fas fa-clock me-1\"></i> Last updated: ")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var31 stringtempl_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 257, Col: 66}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 252, Col: 66}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "</small></div></div><!-- Create Folder Modal --><div class=\"modal fade\" id=\"createFolderModal\" tabindex=\"-1\" aria-labelledby=\"createFolderModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"createFolderModalLabel\"><i class=\"fas fa-folder-plus me-2\"></i>Create New Folder</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><form id=\"createFolderForm\"><div class=\"mb-3\"><label for=\"folderName\" class=\"form-label\">Folder Name</label> <input type=\"text\" class=\"form-control\" id=\"folderName\" name=\"folderName\" required placeholder=\"Enter folder name\" maxlength=\"255\"><div class=\"form-text\">Folder names cannot contain / or \\ characters.</div></div><input type=\"hidden\" id=\"currentPath\" name=\"currentPath\" value=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</small></div></div><!-- Create Folder Modal --><div class=\"modal fade\" id=\"createFolderModal\" tabindex=\"-1\" aria-labelledby=\"createFolderModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"createFolderModalLabel\"><i class=\"fas fa-folder-plus me-2\"></i>Create New Folder</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><form id=\"createFolderForm\"><div class=\"mb-3\"><label for=\"folderName\" class=\"form-label\">Folder Name</label> <input type=\"text\" class=\"form-control\" id=\"folderName\" name=\"folderName\" required placeholder=\"Enter folder name\" maxlength=\"255\"><div class=\"form-text\">Folder names cannot contain / or \\ characters.</div></div><input type=\"hidden\" id=\"currentPath\" name=\"currentPath\" value=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var32 stringtempl_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(data.CurrentPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 282, Col: 87}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 277, Col: 87}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "\"></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"submitCreateFolder()\"><i class=\"fas fa-folder-plus me-1\"></i>Create Folder</button></div></div></div></div><!-- Upload File Modal --><div class=\"modal fade\" id=\"uploadFileModal\" tabindex=\"-1\" aria-labelledby=\"uploadFileModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-lg\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"uploadFileModalLabel\"><i class=\"fas fa-upload me-2\"></i>Upload Files</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><form id=\"uploadFileForm\" enctype=\"multipart/form-data\"><div class=\"mb-3\"><label for=\"fileInput\" class=\"form-label\">Select Files</label> <input type=\"file\" class=\"form-control\" id=\"fileInput\" name=\"files\" multiple required><div class=\"form-text\">Choose one or more files to upload to the current directory. You can select multiple files by holding Ctrl (Cmd on Mac) while clicking.</div></div><input type=\"hidden\" id=\"uploadPath\" name=\"path\" value=\"")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "\"></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"submitCreateFolder()\"><i class=\"fas fa-folder-plus me-1\"></i>Create Folder</button></div></div></div></div><!-- Upload File Modal --><div class=\"modal fade\" id=\"uploadFileModal\" tabindex=\"-1\" aria-labelledby=\"uploadFileModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-lg\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"uploadFileModalLabel\"><i class=\"fas fa-upload me-2\"></i>Upload Files</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><form id=\"uploadFileForm\" enctype=\"multipart/form-data\"><div class=\"mb-3\"><label for=\"fileInput\" class=\"form-label\">Select Files</label> <input type=\"file\" class=\"form-control\" id=\"fileInput\" name=\"files\" multiple required><div class=\"form-text\">Choose one or more files to upload to the current directory. You can select multiple files by holding Ctrl (Cmd on Mac) while clicking.</div></div><input type=\"hidden\" id=\"uploadPath\" name=\"path\" value=\"")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}var templ_7745c5c3_Var33 stringtempl_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(data.CurrentPath)if templ_7745c5c3_Err != nil {- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 314, Col: 79}+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/file_browser.templ`, Line: 309, Col: 79}}_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "\"><!-- File List Preview --><div id=\"fileListPreview\" class=\"mb-3\" style=\"display: none;\"><label class=\"form-label\">Selected Files:</label><div id=\"selectedFilesList\" class=\"border rounded p-2 bg-light\"><!-- Files will be listed here --></div></div><!-- Upload Progress --><div class=\"mb-3\" id=\"uploadProgress\" style=\"display: none;\"><label class=\"form-label\">Upload Progress:</label><div class=\"progress mb-2\"><div class=\"progress-bar progress-bar-striped progress-bar-animated\" role=\"progressbar\" style=\"width: 0%\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\">0%</div></div><div id=\"uploadStatus\" class=\"small text-muted\">Preparing upload...</div></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"submitUploadFile()\"><i class=\"fas fa-upload me-1\"></i>Upload Files</button></div></div></div></div><!-- JavaScript for file browser functionality --><script>\n\tdocument.addEventListener('DOMContentLoaded', function() {\n\t\t// Format permissions in the main table\n\t\tdocument.querySelectorAll('.permissions-display').forEach(element => {\n\t\t\tconst mode = element.getAttribute('data-mode');\n\t\t\tconst isDirectory = element.getAttribute('data-is-directory') === 'true';\n\t\t\tif (mode) {\n\t\t\t\telement.textContent = formatPermissions(mode, isDirectory);\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Handle file browser action buttons (download, view, properties, delete)\n\t\tdocument.addEventListener('click', function(e) {\n\t\t\tconst button = e.target.closest('[data-action]');\n\t\t\tif (!button) return;\n\t\t\t\n\t\t\tconst action = button.getAttribute('data-action');\n\t\t\tconst path = button.getAttribute('data-path');\n\t\t\t\n\t\t\tif (!path) return;\n\t\t\t\n\t\t\tswitch(action) {\n\t\t\t\tcase 'download':\n\t\t\t\t\tdownloadFile(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'view':\n\t\t\t\t\tviewFile(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'properties':\n\t\t\t\t\tshowFileProperties(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'delete':\n\t\t\t\t\tconst fileName = path.split('/').pop();\n\t\t\t\t\tshowDeleteConfirm(fileName, function() {\n\t\t\t\t\t\tdeleteFile(path);\n\t\t\t\t\t}, `Are you sure you want to delete \"${fileName}\"? This action cannot be undone.`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Initialize file manager event handlers from admin.js\n\t\tif (typeof setupFileManagerEventHandlers === 'function') {\n\t\t\tsetupFileManagerEventHandlers();\n\t\t}\n\t});\n\t\n\t// File browser specific functions\n\tfunction downloadFile(path) {\n\t\t// Open download URL in new tab\n\t\twindow.open('/api/files/download?path=' + encodeURIComponent(path), '_blank');\n\t}\n\t\n\tfunction viewFile(path) {\n\t\t// Open file viewer in new tab\n\t\twindow.open('/api/files/view?path=' + encodeURIComponent(path), '_blank');\n\t}\n\t\n\tfunction showFileProperties(path) {\n\t\t// Fetch file properties and show in modal\n\t\tfetch('/api/files/properties?path=' + encodeURIComponent(path))\n\t\t\t.then(response => response.json())\n\t\t\t.then(data => {\n\t\t\t\tif (data.error) {\n\t\t\t\t\tshowAlert('Error loading file properties: ' + data.error, 'error');\n\t\t\t\t} else {\n\t\t\t\t\tdisplayFileProperties(data);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error('Error fetching file properties:', error);\n\t\t\t\tshowAlert('Error loading file properties: ' + error.message, 'error');\n\t\t\t});\n\t}\n\t\n\tfunction displayFileProperties(data) {\n\t\t// Create a comprehensive modal for file properties\n\t\tconst modalHtml = '<div class=\"modal fade\" id=\"filePropertiesModal\" tabindex=\"-1\">' +\n\t\t\t'<div class=\"modal-dialog modal-lg\">' +\n\t\t\t'<div class=\"modal-content\">' +\n\t\t\t'<div class=\"modal-header\">' +\n\t\t\t'<h5 class=\"modal-title\"><i class=\"fas fa-info-circle me-2\"></i>Properties: ' + (data.name || 'Unknown') + '</h5>' +\n\t\t\t'<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"modal-body\">' +\n\t\t\tcreateFilePropertiesContent(data) +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"modal-footer\">' +\n\t\t\t'<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Remove existing modal if present\n\t\tconst existingModal = document.getElementById('filePropertiesModal');\n\t\tif (existingModal) {\n\t\t\texistingModal.remove();\n\t\t}\n\t\t\n\t\t// Add modal to body and show\n\t\tdocument.body.insertAdjacentHTML('beforeend', modalHtml);\n\t\tconst modal = new bootstrap.Modal(document.getElementById('filePropertiesModal'));\n\t\tmodal.show();\n\t\t\n\t\t// Remove modal when hidden\n\t\tdocument.getElementById('filePropertiesModal').addEventListener('hidden.bs.modal', function() {\n\t\t\tthis.remove();\n\t\t});\n\t}\n\t\n\tfunction createFilePropertiesContent(data) {\n\t\tlet html = '<div class=\"row\">' +\n\t\t\t'<div class=\"col-12\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-file me-1\"></i>Basic Information</h6>' +\n\t\t\t'<table class=\"table table-sm\">' +\n\t\t\t'<tr><td style=\"width: 120px;\"><strong>Name:</strong></td><td>' + (data.name || 'N/A') + '</td></tr>' +\n\t\t\t'<tr><td><strong>Full Path:</strong></td><td><code class=\"text-break\">' + (data.full_path || 'N/A') + '</code></td></tr>' +\n\t\t\t'<tr><td><strong>Type:</strong></td><td>' + (data.is_directory ? 'Directory' : 'File') + '</td></tr>';\n\t\t\n\t\tif (!data.is_directory) {\n\t\t\thtml += '<tr><td><strong>Size:</strong></td><td>' + (data.size_formatted || (data.size ? formatBytes(data.size) : 'N/A')) + '</td></tr>' +\n\t\t\t\t'<tr><td><strong>MIME Type:</strong></td><td>' + (data.mime_type || 'N/A') + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"row\">' +\n\t\t\t'<div class=\"col-md-6\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-clock me-1\"></i>Timestamps</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.modified_time) {\n\t\t\thtml += '<tr><td><strong>Modified:</strong></td><td>' + data.modified_time + '</td></tr>';\n\t\t}\n\t\tif (data.created_time) {\n\t\t\thtml += '<tr><td><strong>Created:</strong></td><td>' + data.created_time + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"col-md-6\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-shield-alt me-1\"></i>Permissions</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.file_mode) {\n\t\t\tconst rwxPermissions = formatPermissions(data.file_mode, data.is_directory);\n\t\t\thtml += '<tr><td><strong>Permissions:</strong></td><td><code>' + rwxPermissions + '</code></td></tr>';\n\t\t}\n\t\tif (data.uid !== undefined) {\n\t\t\thtml += '<tr><td><strong>User ID:</strong></td><td>' + data.uid + '</td></tr>';\n\t\t}\n\t\tif (data.gid !== undefined) {\n\t\t\thtml += '<tr><td><strong>Group ID:</strong></td><td>' + data.gid + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Add advanced info\n\t\thtml += '<div class=\"row\">' +\n\t\t\t'<div class=\"col-12\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-cog me-1\"></i>Advanced</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.chunk_count) {\n\t\t\thtml += '<tr><td style=\"width: 120px;\"><strong>Chunks:</strong></td><td>' + data.chunk_count + '</td></tr>';\n\t\t}\n\t\tif (data.ttl_formatted) {\n\t\t\thtml += '<tr><td><strong>TTL:</strong></td><td>' + data.ttl_formatted + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Add chunk details if available (show top 5)\n\t\tif (data.chunks && data.chunks.length > 0) {\n\t\t\tconst chunksToShow = data.chunks.slice(0, 5);\n\t\t\thtml += '<div class=\"row mt-3\">' +\n\t\t\t\t'<div class=\"col-12\">' +\n\t\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-puzzle-piece me-1\"></i>Chunk Details' +\n\t\t\t\t(data.chunk_count > 5 ? ' (Top 5 of ' + data.chunk_count + ')' : ' (' + data.chunk_count + ')') +\n\t\t\t\t'</h6>' +\n\t\t\t\t'<div class=\"table-responsive\" style=\"max-height: 200px; overflow-y: auto;\">' +\n\t\t\t\t'<table class=\"table table-sm table-striped\">' +\n\t\t\t\t'<thead>' +\n\t\t\t\t'<tr>' +\n\t\t\t\t'<th>File ID</th>' +\n\t\t\t\t'<th>Offset</th>' +\n\t\t\t\t'<th>Size</th>' +\n\t\t\t\t'<th>ETag</th>' +\n\t\t\t\t'</tr>' +\n\t\t\t\t'</thead>' +\n\t\t\t\t'<tbody>';\n\t\t\t\n\t\t\tchunksToShow.forEach(chunk => {\n\t\t\t\thtml += '<tr>' +\n\t\t\t\t\t'<td><code class=\"small\">' + (chunk.file_id || 'N/A') + '</code></td>' +\n\t\t\t\t\t'<td>' + formatBytes(chunk.offset || 0) + '</td>' +\n\t\t\t\t\t'<td>' + formatBytes(chunk.size || 0) + '</td>' +\n\t\t\t\t\t'<td><code class=\"small\">' + (chunk.e_tag || 'N/A') + '</code></td>' +\n\t\t\t\t\t'</tr>';\n\t\t\t});\n\t\t\t\n\t\t\thtml += '</tbody>' +\n\t\t\t\t'</table>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\t\t}\n\t\t\n\t\t// Add extended attributes if present\n\t\tif (data.extended && Object.keys(data.extended).length > 0) {\n\t\t\thtml += '<div class=\"row\">' +\n\t\t\t\t'<div class=\"col-12\">' +\n\t\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-tags me-1\"></i>Extended Attributes</h6>' +\n\t\t\t\t'<table class=\"table table-sm\">';\n\t\t\t\n\t\t\tfor (const [key, value] of Object.entries(data.extended)) {\n\t\t\t\thtml += '<tr><td><strong>' + key + ':</strong></td><td>' + value + '</td></tr>';\n\t\t\t}\n\t\t\t\n\t\t\thtml += '</table>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\t\t}\n\t\t\n\t\treturn html;\n\t}\n\t\n\tfunction uploadFile() {\n\t\tconst modal = new bootstrap.Modal(document.getElementById('uploadFileModal'));\n\t\tmodal.show();\n\t}\n\t\n\tfunction toggleSelectAll() {\n\t\tconst selectAllCheckbox = document.getElementById('selectAll');\n\t\tconst checkboxes = document.querySelectorAll('.file-checkbox');\n\t\t\n\t\tcheckboxes.forEach(checkbox => {\n\t\t\tcheckbox.checked = selectAllCheckbox.checked;\n\t\t});\n\t\t\n\t\tupdateDeleteSelectedButton();\n\t}\n\t\n\tfunction updateDeleteSelectedButton() {\n\t\tconst checkboxes = document.querySelectorAll('.file-checkbox:checked');\n\t\tconst deleteBtn = document.getElementById('deleteSelectedBtn');\n\t\t\n\t\tif (checkboxes.length > 0) {\n\t\t\tdeleteBtn.style.display = 'inline-block';\n\t\t} else {\n\t\t\tdeleteBtn.style.display = 'none';\n\t\t}\n\t}\n\t\n\t// Helper function to format bytes\n\tfunction formatBytes(bytes) {\n\t\tif (bytes === 0) return '0 Bytes';\n\t\tconst k = 1024;\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\t\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n\t}\n\t\n\t// Helper function to format permissions in rwxrwxrwx format\n\tfunction formatPermissions(mode, isDirectory) {\n\t\t// Check if mode is already in rwxrwxrwx format (e.g., \"drwxr-xr-x\" or \"-rw-r--r--\")\n\t\tif (mode && (mode.startsWith('d') || mode.startsWith('-') || mode.startsWith('l')) && mode.length === 10) {\n\t\t\treturn mode; // Already formatted\n\t\t}\n\t\t\n\t\t// Convert to number - could be octal string or decimal\n\t\tlet permissions;\n\t\tif (typeof mode === 'string') {\n\t\t\t// Try parsing as octal first, then decimal\n\t\t\tif (mode.startsWith('0') && mode.length <= 4) {\n\t\t\t\tpermissions = parseInt(mode, 8);\n\t\t\t} else {\n\t\t\t\tpermissions = parseInt(mode, 10);\n\t\t\t}\n\t\t} else {\n\t\t\tpermissions = parseInt(mode, 10);\n\t\t}\n\t\t\n\t\tif (isNaN(permissions)) {\n\t\t\treturn isDirectory ? 'drwxr-xr-x' : '-rw-r--r--'; // Default fallback\n\t\t}\n\t\t\n\t\t// Handle Go's os.ModeDir conversion\n\t\t// Go's os.ModeDir is 0x80000000 (2147483648), but Unix S_IFDIR is 0o40000 (16384)\n\t\tlet fileType = '-';\n\t\t\n\t\t// Check for Go's os.ModeDir flag\n\t\tif (permissions & 0x80000000) {\n\t\t\tfileType = 'd';\n\t\t}\n\t\t// Check for standard Unix file type bits\n\t\telse if ((permissions & 0xF000) === 0x4000) { // S_IFDIR (0o40000)\n\t\t\tfileType = 'd';\n\t\t} else if ((permissions & 0xF000) === 0x8000) { // S_IFREG (0o100000)\n\t\t\tfileType = '-';\n\t\t} else if ((permissions & 0xF000) === 0xA000) { // S_IFLNK (0o120000)\n\t\t\tfileType = 'l';\n\t\t} else if ((permissions & 0xF000) === 0x2000) { // S_IFCHR (0o020000)\n\t\t\tfileType = 'c';\n\t\t} else if ((permissions & 0xF000) === 0x6000) { // S_IFBLK (0o060000)\n\t\t\tfileType = 'b';\n\t\t} else if ((permissions & 0xF000) === 0x1000) { // S_IFIFO (0o010000)\n\t\t\tfileType = 'p';\n\t\t} else if ((permissions & 0xF000) === 0xC000) { // S_IFSOCK (0o140000)\n\t\t\tfileType = 's';\n\t\t}\n\t\t// Fallback to isDirectory parameter if file type detection fails\n\t\telse if (isDirectory) {\n\t\t\tfileType = 'd';\n\t\t}\n\t\t\n\t\t// Permission bits (always use the lower 12 bits for permissions)\n\t\tconst owner = (permissions >> 6) & 7;\n\t\tconst group = (permissions >> 3) & 7;\n\t\tconst others = permissions & 7;\n\t\t\n\t\t// Convert number to rwx format\n\t\tfunction numToRwx(num) {\n\t\t\tconst r = (num & 4) ? 'r' : '-';\n\t\t\tconst w = (num & 2) ? 'w' : '-';\n\t\t\tconst x = (num & 1) ? 'x' : '-';\n\t\t\treturn r + w + x;\n\t\t}\n\t\t\n\t\treturn fileType + numToRwx(owner) + numToRwx(group) + numToRwx(others);\n\t}\n\t\n\tfunction exportFileList() {\n\t\t// Simple CSV export of file list\n\t\tconst rows = Array.from(document.querySelectorAll('#fileTable tbody tr')).map(row => {\n\t\t\tconst cells = row.querySelectorAll('td');\n\t\t\tif (cells.length > 1) {\n\t\t\t\treturn {\n\t\t\t\t\tname: cells[1].textContent.trim(),\n\t\t\t\t\tsize: cells[2].textContent.trim(),\n\t\t\t\t\ttype: cells[3].textContent.trim(),\n\t\t\t\t\tmodified: cells[4].textContent.trim(),\n\t\t\t\t\tpermissions: cells[5].textContent.trim()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn null;\n\t\t}).filter(row => row !== null);\n\t\t\n\t\tconst csvContent = \"data:text/csv;charset=utf-8,\" + \n\t\t\t\"Name,Size,Type,Modified,Permissions\\n\" +\n\t\t\trows.map(r => '\"' + r.name + '\",\"' + r.size + '\",\"' + r.type + '\",\"' + r.modified + '\",\"' + r.permissions + '\"').join(\"\\n\");\n\t\t\n\t\tconst encodedUri = encodeURI(csvContent);\n\t\tconst link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\", encodedUri);\n\t\tlink.setAttribute(\"download\", \"files.csv\");\n\t\tdocument.body.appendChild(link);\n\t\tlink.click();\n\t\tdocument.body.removeChild(link);\n\t}\n\t\n\t// Handle file checkbox changes\n\tdocument.addEventListener('change', function(e) {\n\t\tif (e.target.classList.contains('file-checkbox')) {\n\t\t\tupdateDeleteSelectedButton();\n\t\t}\n\t});\n\t</script>")+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "\"><!-- File List Preview --><div id=\"fileListPreview\" class=\"mb-3\" style=\"display: none;\"><label class=\"form-label\">Selected Files:</label><div id=\"selectedFilesList\" class=\"border rounded p-2 bg-light\"><!-- Files will be listed here --></div></div><!-- Upload Progress --><div class=\"mb-3\" id=\"uploadProgress\" style=\"display: none;\"><label class=\"form-label\">Upload Progress:</label><div class=\"progress mb-2\"><div class=\"progress-bar progress-bar-striped progress-bar-animated\" role=\"progressbar\" style=\"width: 0%\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\">0%</div></div><div id=\"uploadStatus\" class=\"small text-muted\">Preparing upload...</div></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"submitUploadFile()\"><i class=\"fas fa-upload me-1\"></i>Upload Files</button></div></div></div></div><!-- JavaScript for file browser functionality --><script>\n\tdocument.addEventListener('DOMContentLoaded', function() {\n\t\t// Format permissions in the main table\n\t\tdocument.querySelectorAll('.permissions-display').forEach(element => {\n\t\t\tconst mode = element.getAttribute('data-mode');\n\t\t\tconst isDirectory = element.getAttribute('data-is-directory') === 'true';\n\t\t\tif (mode) {\n\t\t\t\telement.textContent = formatPermissions(mode, isDirectory);\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Handle file browser action buttons (download, view, properties, delete)\n\t\tdocument.addEventListener('click', function(e) {\n\t\t\tconst button = e.target.closest('[data-action]');\n\t\t\tif (!button) return;\n\t\t\t\n\t\t\tconst action = button.getAttribute('data-action');\n\t\t\tconst path = button.getAttribute('data-path');\n\t\t\t\n\t\t\tif (!path) return;\n\t\t\t\n\t\t\tswitch(action) {\n\t\t\t\tcase 'download':\n\t\t\t\t\tdownloadFile(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'view':\n\t\t\t\t\tviewFile(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'properties':\n\t\t\t\t\tshowFileProperties(path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'delete':\n\t\t\t\t\tconst fileName = path.split('/').pop();\n\t\t\t\t\tshowDeleteConfirm(fileName, function() {\n\t\t\t\t\t\tdeleteFile(path);\n\t\t\t\t\t}, `Are you sure you want to delete \"${fileName}\"? This action cannot be undone.`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Initialize file manager event handlers from admin.js\n\t\tif (typeof setupFileManagerEventHandlers === 'function') {\n\t\t\tsetupFileManagerEventHandlers();\n\t\t}\n\t});\n\t\n\t// File browser specific functions\n\tfunction downloadFile(path) {\n\t\t// Open download URL in new tab\n\t\twindow.open('/api/files/download?path=' + encodeURIComponent(path), '_blank');\n\t}\n\t\n\tfunction viewFile(path) {\n\t\t// Open file viewer in new tab\n\t\twindow.open('/api/files/view?path=' + encodeURIComponent(path), '_blank');\n\t}\n\t\n\tfunction showFileProperties(path) {\n\t\t// Fetch file properties and show in modal\n\t\tfetch('/api/files/properties?path=' + encodeURIComponent(path))\n\t\t\t.then(response => response.json())\n\t\t\t.then(data => {\n\t\t\t\tif (data.error) {\n\t\t\t\t\tshowAlert('Error loading file properties: ' + data.error, 'error');\n\t\t\t\t} else {\n\t\t\t\t\tdisplayFileProperties(data);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error('Error fetching file properties:', error);\n\t\t\t\tshowAlert('Error loading file properties: ' + error.message, 'error');\n\t\t\t});\n\t}\n\t\n\tfunction displayFileProperties(data) {\n\t\t// Create a comprehensive modal for file properties\n\t\tconst modalHtml = '<div class=\"modal fade\" id=\"filePropertiesModal\" tabindex=\"-1\">' +\n\t\t\t'<div class=\"modal-dialog modal-lg\">' +\n\t\t\t'<div class=\"modal-content\">' +\n\t\t\t'<div class=\"modal-header\">' +\n\t\t\t'<h5 class=\"modal-title\"><i class=\"fas fa-info-circle me-2\"></i>Properties: ' + (data.name || 'Unknown') + '</h5>' +\n\t\t\t'<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"modal-body\">' +\n\t\t\tcreateFilePropertiesContent(data) +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"modal-footer\">' +\n\t\t\t'<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Remove existing modal if present\n\t\tconst existingModal = document.getElementById('filePropertiesModal');\n\t\tif (existingModal) {\n\t\t\texistingModal.remove();\n\t\t}\n\t\t\n\t\t// Add modal to body and show\n\t\tdocument.body.insertAdjacentHTML('beforeend', modalHtml);\n\t\tconst modal = new bootstrap.Modal(document.getElementById('filePropertiesModal'));\n\t\tmodal.show();\n\t\t\n\t\t// Remove modal when hidden\n\t\tdocument.getElementById('filePropertiesModal').addEventListener('hidden.bs.modal', function() {\n\t\t\tthis.remove();\n\t\t});\n\t}\n\t\n\tfunction createFilePropertiesContent(data) {\n\t\tlet html = '<div class=\"row\">' +\n\t\t\t'<div class=\"col-12\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-file me-1\"></i>Basic Information</h6>' +\n\t\t\t'<table class=\"table table-sm\">' +\n\t\t\t'<tr><td style=\"width: 120px;\"><strong>Name:</strong></td><td>' + (data.name || 'N/A') + '</td></tr>' +\n\t\t\t'<tr><td><strong>Full Path:</strong></td><td><code class=\"text-break\">' + (data.full_path || 'N/A') + '</code></td></tr>' +\n\t\t\t'<tr><td><strong>Type:</strong></td><td>' + (data.is_directory ? 'Directory' : 'File') + '</td></tr>';\n\t\t\n\t\tif (!data.is_directory) {\n\t\t\thtml += '<tr><td><strong>Size:</strong></td><td>' + (data.size_formatted || (data.size ? formatBytes(data.size) : 'N/A')) + '</td></tr>' +\n\t\t\t\t'<tr><td><strong>MIME Type:</strong></td><td>' + (data.mime_type || 'N/A') + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"row\">' +\n\t\t\t'<div class=\"col-md-6\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-clock me-1\"></i>Timestamps</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.modified_time) {\n\t\t\thtml += '<tr><td><strong>Modified:</strong></td><td>' + data.modified_time + '</td></tr>';\n\t\t}\n\t\tif (data.created_time) {\n\t\t\thtml += '<tr><td><strong>Created:</strong></td><td>' + data.created_time + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"col-md-6\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-shield-alt me-1\"></i>Permissions</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.file_mode) {\n\t\t\tconst rwxPermissions = formatPermissions(data.file_mode, data.is_directory);\n\t\t\thtml += '<tr><td><strong>Permissions:</strong></td><td><code>' + rwxPermissions + '</code></td></tr>';\n\t\t}\n\t\tif (data.uid !== undefined) {\n\t\t\thtml += '<tr><td><strong>User ID:</strong></td><td>' + data.uid + '</td></tr>';\n\t\t}\n\t\tif (data.gid !== undefined) {\n\t\t\thtml += '<tr><td><strong>Group ID:</strong></td><td>' + data.gid + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Add advanced info\n\t\thtml += '<div class=\"row\">' +\n\t\t\t'<div class=\"col-12\">' +\n\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-cog me-1\"></i>Advanced</h6>' +\n\t\t\t'<table class=\"table table-sm\">';\n\t\t\n\t\tif (data.chunk_count) {\n\t\t\thtml += '<tr><td style=\"width: 120px;\"><strong>Chunks:</strong></td><td>' + data.chunk_count + '</td></tr>';\n\t\t}\n\t\tif (data.ttl_formatted) {\n\t\t\thtml += '<tr><td><strong>TTL:</strong></td><td>' + data.ttl_formatted + '</td></tr>';\n\t\t}\n\t\t\n\t\thtml += '</table>' +\n\t\t\t'</div>' +\n\t\t\t'</div>';\n\t\t\n\t\t// Add chunk details if available (show top 5)\n\t\tif (data.chunks && data.chunks.length > 0) {\n\t\t\tconst chunksToShow = data.chunks.slice(0, 5);\n\t\t\thtml += '<div class=\"row mt-3\">' +\n\t\t\t\t'<div class=\"col-12\">' +\n\t\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-puzzle-piece me-1\"></i>Chunk Details' +\n\t\t\t\t(data.chunk_count > 5 ? ' (Top 5 of ' + data.chunk_count + ')' : ' (' + data.chunk_count + ')') +\n\t\t\t\t'</h6>' +\n\t\t\t\t'<div class=\"table-responsive\" style=\"max-height: 200px; overflow-y: auto;\">' +\n\t\t\t\t'<table class=\"table table-sm table-striped\">' +\n\t\t\t\t'<thead>' +\n\t\t\t\t'<tr>' +\n\t\t\t\t'<th>File ID</th>' +\n\t\t\t\t'<th>Offset</th>' +\n\t\t\t\t'<th>Size</th>' +\n\t\t\t\t'<th>ETag</th>' +\n\t\t\t\t'</tr>' +\n\t\t\t\t'</thead>' +\n\t\t\t\t'<tbody>';\n\t\t\t\n\t\t\tchunksToShow.forEach(chunk => {\n\t\t\t\thtml += '<tr>' +\n\t\t\t\t\t'<td><code class=\"small\">' + (chunk.file_id || 'N/A') + '</code></td>' +\n\t\t\t\t\t'<td>' + formatBytes(chunk.offset || 0) + '</td>' +\n\t\t\t\t\t'<td>' + formatBytes(chunk.size || 0) + '</td>' +\n\t\t\t\t\t'<td><code class=\"small\">' + (chunk.e_tag || 'N/A') + '</code></td>' +\n\t\t\t\t\t'</tr>';\n\t\t\t});\n\t\t\t\n\t\t\thtml += '</tbody>' +\n\t\t\t\t'</table>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\t\t}\n\t\t\n\t\t// Add extended attributes if present\n\t\tif (data.extended && Object.keys(data.extended).length > 0) {\n\t\t\thtml += '<div class=\"row\">' +\n\t\t\t\t'<div class=\"col-12\">' +\n\t\t\t\t'<h6 class=\"text-primary\"><i class=\"fas fa-tags me-1\"></i>Extended Attributes</h6>' +\n\t\t\t\t'<table class=\"table table-sm\">';\n\t\t\t\n\t\t\tfor (const [key, value] of Object.entries(data.extended)) {\n\t\t\t\thtml += '<tr><td><strong>' + key + ':</strong></td><td>' + value + '</td></tr>';\n\t\t\t}\n\t\t\t\n\t\t\thtml += '</table>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\t\t}\n\t\t\n\t\treturn html;\n\t}\n\t\n\tfunction uploadFile() {\n\t\tconst modal = new bootstrap.Modal(document.getElementById('uploadFileModal'));\n\t\tmodal.show();\n\t}\n\t\n\tfunction toggleSelectAll() {\n\t\tconst selectAllCheckbox = document.getElementById('selectAll');\n\t\tconst checkboxes = document.querySelectorAll('.file-checkbox');\n\t\t\n\t\tcheckboxes.forEach(checkbox => {\n\t\t\tcheckbox.checked = selectAllCheckbox.checked;\n\t\t});\n\t\t\n\t\tupdateDeleteSelectedButton();\n\t}\n\t\n\tfunction updateDeleteSelectedButton() {\n\t\tconst checkboxes = document.querySelectorAll('.file-checkbox:checked');\n\t\tconst deleteBtn = document.getElementById('deleteSelectedBtn');\n\t\t\n\t\tif (checkboxes.length > 0) {\n\t\t\tdeleteBtn.style.display = 'inline-block';\n\t\t} else {\n\t\t\tdeleteBtn.style.display = 'none';\n\t\t}\n\t}\n\t\n\t// Helper function to format bytes\n\tfunction formatBytes(bytes) {\n\t\tif (bytes === 0) return '0 Bytes';\n\t\tconst k = 1024;\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\t\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n\t}\n\t\n\t// Helper function to format permissions in rwxrwxrwx format\n\tfunction formatPermissions(mode, isDirectory) {\n\t\t// Check if mode is already in rwxrwxrwx format (e.g., \"drwxr-xr-x\" or \"-rw-r--r--\")\n\t\tif (mode && (mode.startsWith('d') || mode.startsWith('-') || mode.startsWith('l')) && mode.length === 10) {\n\t\t\treturn mode; // Already formatted\n\t\t}\n\t\t\n\t\t// Convert to number - could be octal string or decimal\n\t\tlet permissions;\n\t\tif (typeof mode === 'string') {\n\t\t\t// Try parsing as octal first, then decimal\n\t\t\tif (mode.startsWith('0') && mode.length <= 4) {\n\t\t\t\tpermissions = parseInt(mode, 8);\n\t\t\t} else {\n\t\t\t\tpermissions = parseInt(mode, 10);\n\t\t\t}\n\t\t} else {\n\t\t\tpermissions = parseInt(mode, 10);\n\t\t}\n\t\t\n\t\tif (isNaN(permissions)) {\n\t\t\treturn isDirectory ? 'drwxr-xr-x' : '-rw-r--r--'; // Default fallback\n\t\t}\n\t\t\n\t\t// Handle Go's os.ModeDir conversion\n\t\t// Go's os.ModeDir is 0x80000000 (2147483648), but Unix S_IFDIR is 0o40000 (16384)\n\t\tlet fileType = '-';\n\t\t\n\t\t// Check for Go's os.ModeDir flag\n\t\tif (permissions & 0x80000000) {\n\t\t\tfileType = 'd';\n\t\t}\n\t\t// Check for standard Unix file type bits\n\t\telse if ((permissions & 0xF000) === 0x4000) { // S_IFDIR (0o40000)\n\t\t\tfileType = 'd';\n\t\t} else if ((permissions & 0xF000) === 0x8000) { // S_IFREG (0o100000)\n\t\t\tfileType = '-';\n\t\t} else if ((permissions & 0xF000) === 0xA000) { // S_IFLNK (0o120000)\n\t\t\tfileType = 'l';\n\t\t} else if ((permissions & 0xF000) === 0x2000) { // S_IFCHR (0o020000)\n\t\t\tfileType = 'c';\n\t\t} else if ((permissions & 0xF000) === 0x6000) { // S_IFBLK (0o060000)\n\t\t\tfileType = 'b';\n\t\t} else if ((permissions & 0xF000) === 0x1000) { // S_IFIFO (0o010000)\n\t\t\tfileType = 'p';\n\t\t} else if ((permissions & 0xF000) === 0xC000) { // S_IFSOCK (0o140000)\n\t\t\tfileType = 's';\n\t\t}\n\t\t// Fallback to isDirectory parameter if file type detection fails\n\t\telse if (isDirectory) {\n\t\t\tfileType = 'd';\n\t\t}\n\t\t\n\t\t// Permission bits (always use the lower 12 bits for permissions)\n\t\tconst owner = (permissions >> 6) & 7;\n\t\tconst group = (permissions >> 3) & 7;\n\t\tconst others = permissions & 7;\n\t\t\n\t\t// Convert number to rwx format\n\t\tfunction numToRwx(num) {\n\t\t\tconst r = (num & 4) ? 'r' : '-';\n\t\t\tconst w = (num & 2) ? 'w' : '-';\n\t\t\tconst x = (num & 1) ? 'x' : '-';\n\t\t\treturn r + w + x;\n\t\t}\n\t\t\n\t\treturn fileType + numToRwx(owner) + numToRwx(group) + numToRwx(others);\n\t}\n\t\n\tfunction exportFileList() {\n\t\t// Simple CSV export of file list\n\t\tconst rows = Array.from(document.querySelectorAll('#fileTable tbody tr')).map(row => {\n\t\t\tconst cells = row.querySelectorAll('td');\n\t\t\tif (cells.length > 1) {\n\t\t\t\treturn {\n\t\t\t\t\tname: cells[1].textContent.trim(),\n\t\t\t\t\tsize: cells[2].textContent.trim(),\n\t\t\t\t\ttype: cells[3].textContent.trim(),\n\t\t\t\t\tmodified: cells[4].textContent.trim(),\n\t\t\t\t\tpermissions: cells[5].textContent.trim()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn null;\n\t\t}).filter(row => row !== null);\n\t\t\n\t\tconst csvContent = \"data:text/csv;charset=utf-8,\" + \n\t\t\t\"Name,Size,Type,Modified,Permissions\\n\" +\n\t\t\trows.map(r => '\"' + r.name + '\",\"' + r.size + '\",\"' + r.type + '\",\"' + r.modified + '\",\"' + r.permissions + '\"').join(\"\\n\");\n\t\t\n\t\tconst encodedUri = encodeURI(csvContent);\n\t\tconst link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\", encodedUri);\n\t\tlink.setAttribute(\"download\", \"files.csv\");\n\t\tdocument.body.appendChild(link);\n\t\tlink.click();\n\t\tdocument.body.removeChild(link);\n\t}\n\t\n\t// Handle file checkbox changes\n\tdocument.addEventListener('change', function(e) {\n\t\tif (e.target.classList.contains('file-checkbox')) {\n\t\t\tupdateDeleteSelectedButton();\n\t\t}\n\t});\n\t</script>")if templ_7745c5c3_Err != nil {return templ_7745c5c3_Err}diff --git a/weed/admin/view/app/iceberg_table_details.templ b/weed/admin/view/app/iceberg_table_details.templnew file mode 100644index 0000000000..cb4378027d--- /dev/null+++ b/weed/admin/view/app/iceberg_table_details.templ@@ -0,0 +1,376 @@+package app++import (+ "fmt"++ "github.com/seaweedfs/seaweedfs/weed/admin/dash"+)++templ IcebergTableDetails(data dash.IcebergTableDetailsData) {+ <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">+ <h1 class="h2">+ <nav aria-label="breadcrumb">+ <ol class="breadcrumb mb-0">+ <li class="breadcrumb-item">+ <a href="/object-store/iceberg">+ <i class="fas fa-snowflake me-1"></i>Iceberg Catalog+ </a>+ </li>+ <li class="breadcrumb-item">+ <a href={ templ.SafeURL(fmt.Sprintf("/object-store/iceberg/%s/namespaces", data.CatalogName)) }>+ { data.CatalogName }+ </a>+ </li>+ <li class="breadcrumb-item">+ <a href={ templ.SafeURL(fmt.Sprintf("/object-store/iceberg/%s/namespaces/%s/tables", data.CatalogName, data.NamespaceName)) }>+ { data.NamespaceName }+ </a>+ </li>+ <li class="breadcrumb-item active">{ data.TableName }</li>+ </ol>+ </nav>+ </h1>+ <div class="btn-toolbar mb-2 mb-md-0">+ <div class="btn-group me-2">+ <button type="button" class="btn btn-sm btn-danger iceberg-delete-table-btn" data-bucket-arn={ data.BucketARN } data-namespace={ data.NamespaceName } data-table-name={ data.TableName }>+ <i class="fas fa-trash me-1"></i>Drop Table+ </button>+ </div>+ </div>+ </div>+ if data.MetadataError != "" {+ <div class="alert alert-warning">+ <i class="fas fa-exclamation-triangle me-2"></i>{ data.MetadataError }+ </div>+ }+ <div class="row mb-4">+ <div class="col-xl-4 col-md-6 mb-4">+ <div class="card border-left-primary shadow h-100 py-2">+ <div class="card-body">+ <div class="row no-gutters align-items-center">+ <div class="col mr-2">+ <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">+ Data Files+ </div>+ <div class="h5 mb-0 font-weight-bold text-gray-800">+ if data.HasDataFileCount {+ { formatNumber(data.DataFileCount) }+ } else {+ -+ }+ </div>+ </div>+ <div class="col-auto">+ <i class="fas fa-copy fa-2x text-gray-300"></i>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="col-xl-4 col-md-6 mb-4">+ <div class="card border-left-success shadow h-100 py-2">+ <div class="card-body">+ <div class="row no-gutters align-items-center">+ <div class="col mr-2">+ <div class="text-xs font-weight-bold text-success text-uppercase mb-1">+ Total Size+ </div>+ <div class="h5 mb-0 font-weight-bold text-gray-800">+ if data.HasTotalSize {+ { formatBytes(data.TotalSizeBytes) }+ } else {+ -+ }+ </div>+ </div>+ <div class="col-auto">+ <i class="fas fa-database fa-2x text-gray-300"></i>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="col-xl-4 col-md-6 mb-4">+ <div class="card border-left-info shadow h-100 py-2">+ <div class="card-body">+ <div class="row no-gutters align-items-center">+ <div class="col mr-2">+ <div class="text-xs font-weight-bold text-info text-uppercase mb-1">+ Snapshots+ </div>+ <div class="h5 mb-0 font-weight-bold text-gray-800">+ if data.HasSnapshotCount {+ { formatNumber(int64(data.SnapshotCount)) }+ } else {+ -+ }+ </div>+ </div>+ <div class="col-auto">+ <i class="fas fa-history fa-2x text-gray-300"></i>+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="row">+ <div class="col-lg-6 mb-4">+ <div class="card shadow h-100">+ <div class="card-header py-3">+ <h6 class="m-0 font-weight-bold text-primary">+ <i class="fas fa-info-circle me-2"></i>Table Metadata+ </h6>+ </div>+ <div class="card-body">+ <table class="table table-sm">+ <tbody>+ <tr>+ <th>Table ARN</th>+ <td class="text-muted small">{ data.TableARN }</td>+ </tr>+ <tr>+ <th>Format</th>+ <td>{ data.Format }</td>+ </tr>+ <tr>+ <th>Table Location</th>+ <td>+ if data.TableLocation != "" {+ <code class="small">{ data.TableLocation }</code>+ } else {+ <span class="text-muted">-</span>+ }+ </td>+ </tr>+ <tr>+ <th>Metadata Location</th>+ <td>+ if data.MetadataLocation != "" {+ <code class="small">{ data.MetadataLocation }</code>+ } else {+ <span class="text-muted">-</span>+ }+ </td>+ </tr>+ <tr>+ <th>Created</th>+ <td>{ data.CreatedAt.Format("2006-01-02 15:04") }</td>+ </tr>+ <tr>+ <th>Modified</th>+ <td>{ data.ModifiedAt.Format("2006-01-02 15:04") }</td>+ </tr>+ </tbody>+ </table>+ </div>+ </div>+ </div>+ <div class="col-lg-6 mb-4">+ <div class="card shadow h-100">+ <div class="card-header py-3">+ <h6 class="m-0 font-weight-bold text-primary">+ <i class="fas fa-sliders-h me-2"></i>Properties+ </h6>+ </div>+ <div class="card-body">+ <table class="table table-sm">+ <thead>+ <tr>+ <th>Key</th>+ <th>Value</th>+ </tr>+ </thead>+ <tbody>+ for _, prop := range data.Properties {+ <tr>+ <td>{ prop.Key }</td>+ <td>{ prop.Value }</td>+ </tr>+ }+ if len(data.Properties) == 0 {+ <tr>+ <td colspan="2" class="text-center text-muted">No properties available.</td>+ </tr>+ }+ </tbody>+ </table>+ </div>+ </div>+ </div>+ </div>+ <div class="row">+ <div class="col-12 mb-4">+ <div class="card shadow">+ <div class="card-header py-3">+ <h6 class="m-0 font-weight-bold text-primary">+ <i class="fas fa-list me-2"></i>Schema+ </h6>+ </div>+ <div class="card-body">+ <div class="table-responsive">+ <table class="table table-hover">+ <thead>+ <tr>+ <th>ID</th>+ <th>Name</th>+ <th>Type</th>+ <th>Required</th>+ </tr>+ </thead>+ <tbody>+ for _, field := range data.SchemaFields {+ <tr>+ <td>{ fmt.Sprintf("%d", field.ID) }</td>+ <td>{ field.Name }</td>+ <td><code>{ field.Type }</code></td>+ <td>+ if field.Required {+ <span class="badge bg-success">Yes</span>+ } else {+ <span class="badge bg-secondary">No</span>+ }+ </td>+ </tr>+ }+ if len(data.SchemaFields) == 0 {+ <tr>+ <td colspan="4" class="text-center text-muted">No schema available.</td>+ </tr>+ }+ </tbody>+ </table>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="row">+ <div class="col-12 mb-4">+ <div class="card shadow">+ <div class="card-header py-3">+ <h6 class="m-0 font-weight-bold text-primary">+ <i class="fas fa-layer-group me-2"></i>Partitions+ </h6>+ </div>+ <div class="card-body">+ <div class="table-responsive">+ <table class="table table-hover">+ <thead>+ <tr>+ <th>Name</th>+ <th>Transform</th>+ <th>Source ID</th>+ <th>Field ID</th>+ </tr>+ </thead>+ <tbody>+ for _, field := range data.PartitionFields {+ <tr>+ <td>{ field.Name }</td>+ <td>{ field.Transform }</td>+ <td>{ fmt.Sprintf("%d", field.SourceID) }</td>+ <td>{ fmt.Sprintf("%d", field.FieldID) }</td>+ </tr>+ }+ if len(data.PartitionFields) == 0 {+ <tr>+ <td colspan="4" class="text-center text-muted">No partitions defined.</td>+ </tr>+ }+ </tbody>+ </table>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="row">+ <div class="col-12">+ <div class="card shadow mb-4">+ <div class="card-header py-3">+ <h6 class="m-0 font-weight-bold text-primary">+ <i class="fas fa-history me-2"></i>Snapshot History+ </h6>+ </div>+ <div class="card-body">+ <div class="table-responsive">+ <table class="table table-hover">+ <thead>+ <tr>+ <th>Snapshot ID</th>+ <th>Timestamp</th>+ <th>Operation</th>+ <th>Manifest List</th>+ </tr>+ </thead>+ <tbody>+ for _, snapshot := range data.Snapshots {+ <tr>+ <td>{ fmt.Sprintf("%d", snapshot.SnapshotID) }</td>+ <td>+ if snapshot.Timestamp.IsZero() {+ <span class="text-muted">-</span>+ } else {+ { snapshot.Timestamp.Format("2006-01-02 15:04") }+ }+ </td>+ <td>+ if snapshot.Operation != "" {+ { snapshot.Operation }+ } else {+ <span class="text-muted">-</span>+ }+ </td>+ <td>+ if snapshot.ManifestList != "" {+ <code class="small">{ snapshot.ManifestList }</code>+ } else {+ <span class="text-muted">-</span>+ }+ </td>+ </tr>+ }+ if len(data.Snapshots) == 0 {+ <tr>+ <td colspan="4" class="text-center text-muted">No snapshots available.</td>+ </tr>+ }+ </tbody>+ </table>+ </div>+ </div>+ </div>+ </div>+ </div>+ <div class="modal fade" id="deleteIcebergTableModal" tabindex="-1" aria-labelledby="deleteIcebergTableModalLabel" aria-hidden="true">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <h5 class="modal-title" id="deleteIcebergTableModalLabel">+ <i class="fas fa-exclamation-triangle me-2 text-warning"></i>Drop Table+ </h5>+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>+ </div>+ <div class="modal-body">+ <p>Are you sure you want to drop the table <strong id="deleteIcebergTableName"></strong>?</p>+ <div class="mb-3">+ <label for="deleteIcebergTableVersion" class="form-label">Version Token (optional)</label>+ <input type="text" class="form-control" id="deleteIcebergTableVersion" placeholder="Version token"/>+ </div>+ </div>+ <div class="modal-footer">+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>+ <button type="button" class="btn btn-danger" onclick="deleteIcebergTable()">+ <i class="fas fa-trash me-1"></i>Drop Table+ </button>+ </div>+ </div>+ </div>+ </div>+ <script>+ document.addEventListener('DOMContentLoaded', function() {+ initIcebergTableDetails();+ });+ </script>+}diff --git a/weed/admin/view/app/iceberg_table_details_templ.go b/weed/admin/view/app/iceberg_table_details_templ.gonew file mode 100644index 0000000000..991e8c4e7a--- /dev/null+++ b/weed/admin/view/app/iceberg_table_details_templ.go@@ -0,0 +1,618 @@+// Code generated by templ - DO NOT EDIT.++// templ: version: v0.3.977+package app++//lint:file-ignore SA4006 This context is only used if a nested component is present.++import "github.com/a-h/templ"+import templruntime "github.com/a-h/templ/runtime"++import (+ "fmt"++ "github.com/seaweedfs/seaweedfs/weed/admin/dash"+)++func IcebergTableDetails(data dash.IcebergTableDetailsData) templ.Component {+ return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {+ templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context+ if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {+ return templ_7745c5c3_CtxErr+ }+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)+ if !templ_7745c5c3_IsBuffer {+ defer func() {+ templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)+ if templ_7745c5c3_Err == nil {+ templ_7745c5c3_Err = templ_7745c5c3_BufErr+ }+ }()+ }+ ctx = templ.InitializeContext(ctx)+ templ_7745c5c3_Var1 := templ.GetChildren(ctx)+ if templ_7745c5c3_Var1 == nil {+ templ_7745c5c3_Var1 = templ.NopComponent+ }+ ctx = templ.ClearChildren(ctx)+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom\"><h1 class=\"h2\"><nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb mb-0\"><li class=\"breadcrumb-item\"><a href=\"/object-store/iceberg\"><i class=\"fas fa-snowflake me-1\"></i>Iceberg Catalog</a></li><li class=\"breadcrumb-item\"><a href=\"")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var2 templ.SafeURL+ templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/object-store/iceberg/%s/namespaces", data.CatalogName)))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 20, Col: 99}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var3 string+ templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.CatalogName)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 21, Col: 25}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</a></li><li class=\"breadcrumb-item\"><a href=\"")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var4 templ.SafeURL+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/object-store/iceberg/%s/namespaces/%s/tables", data.CatalogName, data.NamespaceName)))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 25, Col: 129}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var5 string+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.NamespaceName)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 26, Col: 27}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</a></li><li class=\"breadcrumb-item active\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var6 string+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.TableName)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 29, Col: 56}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</li></ol></nav></h1><div class=\"btn-toolbar mb-2 mb-md-0\"><div class=\"btn-group me-2\"><button type=\"button\" class=\"btn btn-sm btn-danger iceberg-delete-table-btn\" data-bucket-arn=\"")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var7 string+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.BucketARN)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 35, Col: 113}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\" data-namespace=\"")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var8 string+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.NamespaceName)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 35, Col: 151}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\" data-table-name=\"")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var9 string+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.TableName)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 35, Col: 186}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"><i class=\"fas fa-trash me-1\"></i>Drop Table</button></div></div></div>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.MetadataError != "" {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<div class=\"alert alert-warning\"><i class=\"fas fa-exclamation-triangle me-2\"></i>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var10 string+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.MetadataError)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 43, Col: 71}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<div class=\"row mb-4\"><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Data Files</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.HasDataFileCount {+ var templ_7745c5c3_Var11 string+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(formatNumber(data.DataFileCount))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 57, Col: 43}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "-")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</div></div><div class=\"col-auto\"><i class=\"fas fa-copy fa-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-success shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-success text-uppercase mb-1\">Total Size</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.HasTotalSize {+ var templ_7745c5c3_Var12 string+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(data.TotalSizeBytes))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 80, Col: 43}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "-")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</div></div><div class=\"col-auto\"><i class=\"fas fa-database fa-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Snapshots</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.HasSnapshotCount {+ var templ_7745c5c3_Var13 string+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(formatNumber(int64(data.SnapshotCount)))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 103, Col: 50}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "-")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div></div><div class=\"col-auto\"><i class=\"fas fa-history fa-2x text-gray-300\"></i></div></div></div></div></div></div><div class=\"row\"><div class=\"col-lg-6 mb-4\"><div class=\"card shadow h-100\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"fas fa-info-circle me-2\"></i>Table Metadata</h6></div><div class=\"card-body\"><table class=\"table table-sm\"><tbody><tr><th>Table ARN</th><td class=\"text-muted small\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var14 string+ templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(data.TableARN)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 130, Col: 52}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</td></tr><tr><th>Format</th><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var15 string+ templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(data.Format)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 134, Col: 25}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</td></tr><tr><th>Table Location</th><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.TableLocation != "" {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<code class=\"small\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var16 string+ templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(data.TableLocation)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 140, Col: 50}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</code>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<span class=\"text-muted\">-</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</td></tr><tr><th>Metadata Location</th><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if data.MetadataLocation != "" {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<code class=\"small\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var17 string+ templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(data.MetadataLocation)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 150, Col: 53}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</code>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<span class=\"text-muted\">-</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</td></tr><tr><th>Created</th><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var18 string+ templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(data.CreatedAt.Format("2006-01-02 15:04"))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 158, Col: 55}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</td></tr><tr><th>Modified</th><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var19 string+ templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(data.ModifiedAt.Format("2006-01-02 15:04"))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 162, Col: 56}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</td></tr></tbody></table></div></div></div><div class=\"col-lg-6 mb-4\"><div class=\"card shadow h-100\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"fas fa-sliders-h me-2\"></i>Properties</h6></div><div class=\"card-body\"><table class=\"table table-sm\"><thead><tr><th>Key</th><th>Value</th></tr></thead> <tbody>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ for _, prop := range data.Properties {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<tr><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var20 string+ templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(prop.Key)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 187, Col: 23}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var21 string+ templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(prop.Value)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 188, Col: 25}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ if len(data.Properties) == 0 {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<tr><td colspan=\"2\" class=\"text-center text-muted\">No properties available.</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</tbody></table></div></div></div></div><div class=\"row\"><div class=\"col-12 mb-4\"><div class=\"card shadow\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"fas fa-list me-2\"></i>Schema</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\"><thead><tr><th>ID</th><th>Name</th><th>Type</th><th>Required</th></tr></thead> <tbody>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ for _, field := range data.SchemaFields {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<tr><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var22 string+ templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", field.ID))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 224, Col: 43}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var23 string+ templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(field.Name)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 225, Col: 26}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</td><td><code>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var24 string+ templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(field.Type)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 226, Col: 32}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</code></td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if field.Required {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<span class=\"badge bg-success\">Yes</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<span class=\"badge bg-secondary\">No</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ if len(data.SchemaFields) == 0 {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<tr><td colspan=\"4\" class=\"text-center text-muted\">No schema available.</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</tbody></table></div></div></div></div></div><div class=\"row\"><div class=\"col-12 mb-4\"><div class=\"card shadow\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"fas fa-layer-group me-2\"></i>Partitions</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\"><thead><tr><th>Name</th><th>Transform</th><th>Source ID</th><th>Field ID</th></tr></thead> <tbody>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ for _, field := range data.PartitionFields {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<tr><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var25 string+ templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(field.Name)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 270, Col: 26}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var26 string+ templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(field.Transform)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 271, Col: 31}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var27 string+ templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", field.SourceID))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 272, Col: 49}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var28 string+ templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", field.FieldID))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 273, Col: 48}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ if len(data.PartitionFields) == 0 {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<tr><td colspan=\"4\" class=\"text-center text-muted\">No partitions defined.</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</tbody></table></div></div></div></div></div><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"fas fa-history me-2\"></i>Snapshot History</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\"><thead><tr><th>Snapshot ID</th><th>Timestamp</th><th>Operation</th><th>Manifest List</th></tr></thead> <tbody>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ for _, snapshot := range data.Snapshots {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<tr><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var29 string+ templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", snapshot.SnapshotID))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 310, Col: 54}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if snapshot.Timestamp.IsZero() {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<span class=\"text-muted\">-</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ var templ_7745c5c3_Var30 string+ templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(snapshot.Timestamp.Format("2006-01-02 15:04"))+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 315, Col: 59}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if snapshot.Operation != "" {+ var templ_7745c5c3_Var31 string+ templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(snapshot.Operation)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 320, Col: 32}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<span class=\"text-muted\">-</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</td><td>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ if snapshot.ManifestList != "" {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<code class=\"small\">")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ var templ_7745c5c3_Var32 string+ templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(snapshot.ManifestList)+ if templ_7745c5c3_Err != nil {+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_table_details.templ`, Line: 327, Col: 55}+ }+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</code>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ } else {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<span class=\"text-muted\">-</span>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ if len(data.Snapshots) == 0 {+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<tr><td colspan=\"4\" class=\"text-center text-muted\">No snapshots available.</td></tr>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ }+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</tbody></table></div></div></div></div></div><div class=\"modal fade\" id=\"deleteIcebergTableModal\" tabindex=\"-1\" aria-labelledby=\"deleteIcebergTableModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"deleteIcebergTableModalLabel\"><i class=\"fas fa-exclamation-triangle me-2 text-warning\"></i>Drop Table</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><p>Are you sure you want to drop the table <strong id=\"deleteIcebergTableName\"></strong>?</p><div class=\"mb-3\"><label for=\"deleteIcebergTableVersion\" class=\"form-label\">Version Token (optional)</label> <input type=\"text\" class=\"form-control\" id=\"deleteIcebergTableVersion\" placeholder=\"Version token\"></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-danger\" onclick=\"deleteIcebergTable()\"><i class=\"fas fa-trash me-1\"></i>Drop Table</button></div></div></div></div><script>\n\t\tdocument.addEventListener('DOMContentLoaded', function() {\n\t\t\tinitIcebergTableDetails();\n\t\t});\n\t</script>")+ if templ_7745c5c3_Err != nil {+ return templ_7745c5c3_Err+ }+ return nil+ })+}++var _ = templruntime.GeneratedTemplate