github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/vdb/Table.html.go (about)

     1  // Code generated by qtc from "Table.html". DO NOT EDIT.
     2  // See https://github.com/valyala/quicktemplate for details.
     3  
     4  // <!-- Content managed by Project Forge, see [projectforge.md] for details. -->
     5  
     6  //line views/vdb/Table.html:2
     7  package vdb
     8  
     9  //line views/vdb/Table.html:2
    10  import (
    11  	"github.com/kyleu/dbaudit/app"
    12  	"github.com/kyleu/dbaudit/app/controller/cutil"
    13  	"github.com/kyleu/dbaudit/app/db"
    14  	"github.com/kyleu/dbaudit/app/lib/filter"
    15  	"github.com/kyleu/dbaudit/views/components"
    16  	"github.com/kyleu/dbaudit/views/components/view"
    17  )
    18  
    19  //line views/vdb/Table.html:11
    20  import (
    21  	qtio422016 "io"
    22  
    23  	qt422016 "github.com/valyala/quicktemplate"
    24  )
    25  
    26  //line views/vdb/Table.html:11
    27  var (
    28  	_ = qtio422016.Copy
    29  	_ = qt422016.AcquireByteBuffer
    30  )
    31  
    32  //line views/vdb/Table.html:11
    33  func StreamTable(qw422016 *qt422016.Writer, models db.Connections, params filter.ParamSet, as *app.State, ps *cutil.PageState) {
    34  //line views/vdb/Table.html:11
    35  	qw422016.N().S(`
    36  `)
    37  //line views/vdb/Table.html:12
    38  	prms := params.Get("db", nil, ps.Logger).Sanitize("db")
    39  
    40  //line views/vdb/Table.html:12
    41  	qw422016.N().S(`  <table>
    42      <thead>
    43        <tr>
    44          `)
    45  //line views/vdb/Table.html:16
    46  	components.StreamTableHeaderSimple(qw422016, "db", "id", "ID", "UUID in format (00000000-0000-0000-0000-000000000000)", prms, ps.URI, ps)
    47  //line views/vdb/Table.html:16
    48  	qw422016.N().S(`
    49          `)
    50  //line views/vdb/Table.html:17
    51  	components.StreamTableHeaderSimple(qw422016, "db", "name", "Name", "String text", prms, ps.URI, ps)
    52  //line views/vdb/Table.html:17
    53  	qw422016.N().S(`
    54          `)
    55  //line views/vdb/Table.html:18
    56  	components.StreamTableHeaderSimple(qw422016, "db", "icon", "Icon", "String text", prms, ps.URI, ps)
    57  //line views/vdb/Table.html:18
    58  	qw422016.N().S(`
    59          `)
    60  //line views/vdb/Table.html:19
    61  	components.StreamTableHeaderSimple(qw422016, "db", "engine", "Engine", db.AllEngines.Help(), prms, ps.URI, ps)
    62  //line views/vdb/Table.html:19
    63  	qw422016.N().S(`
    64          `)
    65  //line views/vdb/Table.html:20
    66  	components.StreamTableHeaderSimple(qw422016, "db", "server", "Server", "String text", prms, ps.URI, ps)
    67  //line views/vdb/Table.html:20
    68  	qw422016.N().S(`
    69          `)
    70  //line views/vdb/Table.html:21
    71  	components.StreamTableHeaderSimple(qw422016, "db", "database", "Database", "String text", prms, ps.URI, ps)
    72  //line views/vdb/Table.html:21
    73  	qw422016.N().S(`
    74        </tr>
    75      </thead>
    76      <tbody>
    77  `)
    78  //line views/vdb/Table.html:25
    79  	for _, model := range models {
    80  //line views/vdb/Table.html:25
    81  		qw422016.N().S(`      <tr>
    82          <td><a href="/db/`)
    83  //line views/vdb/Table.html:27
    84  		view.StreamUUID(qw422016, &model.ID)
    85  //line views/vdb/Table.html:27
    86  		qw422016.N().S(`">`)
    87  //line views/vdb/Table.html:27
    88  		view.StreamUUID(qw422016, &model.ID)
    89  //line views/vdb/Table.html:27
    90  		qw422016.N().S(`</a></td>
    91          <td><strong>`)
    92  //line views/vdb/Table.html:28
    93  		view.StreamString(qw422016, model.Name)
    94  //line views/vdb/Table.html:28
    95  		qw422016.N().S(`</strong></td>
    96          <td>`)
    97  //line views/vdb/Table.html:29
    98  		view.StreamString(qw422016, model.Icon)
    99  //line views/vdb/Table.html:29
   100  		qw422016.N().S(`</td>
   101          <td>`)
   102  //line views/vdb/Table.html:30
   103  		qw422016.E().S(model.Engine.String())
   104  //line views/vdb/Table.html:30
   105  		qw422016.N().S(`</td>
   106          <td>`)
   107  //line views/vdb/Table.html:31
   108  		view.StreamString(qw422016, model.Server)
   109  //line views/vdb/Table.html:31
   110  		qw422016.N().S(`</td>
   111          <td>`)
   112  //line views/vdb/Table.html:32
   113  		view.StreamString(qw422016, model.Database)
   114  //line views/vdb/Table.html:32
   115  		qw422016.N().S(`</td>
   116        </tr>
   117  `)
   118  //line views/vdb/Table.html:34
   119  	}
   120  //line views/vdb/Table.html:35
   121  	if prms.HasNextPage(len(models)+prms.Offset) || prms.HasPreviousPage() {
   122  //line views/vdb/Table.html:35
   123  		qw422016.N().S(`      <tr>
   124          <td colspan="6">`)
   125  //line views/vdb/Table.html:37
   126  		components.StreamPagination(qw422016, len(models)+prms.Offset, prms, ps.URI)
   127  //line views/vdb/Table.html:37
   128  		qw422016.N().S(`</td>
   129        </tr>
   130  `)
   131  //line views/vdb/Table.html:39
   132  	}
   133  //line views/vdb/Table.html:39
   134  	qw422016.N().S(`    </tbody>
   135    </table>
   136  `)
   137  //line views/vdb/Table.html:42
   138  }
   139  
   140  //line views/vdb/Table.html:42
   141  func WriteTable(qq422016 qtio422016.Writer, models db.Connections, params filter.ParamSet, as *app.State, ps *cutil.PageState) {
   142  //line views/vdb/Table.html:42
   143  	qw422016 := qt422016.AcquireWriter(qq422016)
   144  //line views/vdb/Table.html:42
   145  	StreamTable(qw422016, models, params, as, ps)
   146  //line views/vdb/Table.html:42
   147  	qt422016.ReleaseWriter(qw422016)
   148  //line views/vdb/Table.html:42
   149  }
   150  
   151  //line views/vdb/Table.html:42
   152  func Table(models db.Connections, params filter.ParamSet, as *app.State, ps *cutil.PageState) string {
   153  //line views/vdb/Table.html:42
   154  	qb422016 := qt422016.AcquireByteBuffer()
   155  //line views/vdb/Table.html:42
   156  	WriteTable(qb422016, models, params, as, ps)
   157  //line views/vdb/Table.html:42
   158  	qs422016 := string(qb422016.B)
   159  //line views/vdb/Table.html:42
   160  	qt422016.ReleaseByteBuffer(qb422016)
   161  //line views/vdb/Table.html:42
   162  	return qs422016
   163  //line views/vdb/Table.html:42
   164  }