|
@@ -29,6 +29,8 @@ func (this *Modules) RegisterAction_FilesList() *Action {
|
|
|
str_dirs := ""
|
|
|
str_files := ""
|
|
|
|
|
|
+ nothing := true
|
|
|
+
|
|
|
if files, err := filepath.Glob(start_dir); err == nil {
|
|
|
for _, file := range files {
|
|
|
file_name := file
|
|
@@ -38,6 +40,9 @@ func (this *Modules) RegisterAction_FilesList() *Action {
|
|
|
}
|
|
|
|
|
|
if utils.IsDir(file) {
|
|
|
+ if nothing {
|
|
|
+ nothing = false
|
|
|
+ }
|
|
|
actions := builder.DataTableAction(&[]builder.DataTableActionRow{
|
|
|
{
|
|
|
Icon: assets.SysSvgIconView,
|
|
@@ -54,6 +59,9 @@ func (this *Modules) RegisterAction_FilesList() *Action {
|
|
|
})
|
|
|
str_dirs += `<tr class="dir"><td class="col_name"><a href="javascript:fave.FilesManagerLoadData(\'` + pf_path + file_name + `/` + `\');"><span class="text-dotted">` + html.EscapeString(file_name) + `</span></a></td><td class="col_type"><b>DIR</b></td><td class="col_action">` + actions + `</td></tr>`
|
|
|
} else {
|
|
|
+ if nothing {
|
|
|
+ nothing = false
|
|
|
+ }
|
|
|
actions := builder.DataTableAction(&[]builder.DataTableActionRow{
|
|
|
{
|
|
|
Icon: assets.SysSvgIconView,
|
|
@@ -95,7 +103,12 @@ func (this *Modules) RegisterAction_FilesList() *Action {
|
|
|
str_dirs = `<tr class="dir"><td class="col_name"><a href="javascript:fave.FilesManagerLoadDataUp(\'` + pf_path + `\');">..</a></td><td class="col_type"> </td><td class="col_action"> </td></tr>` + str_dirs
|
|
|
}
|
|
|
|
|
|
- table := `<table class="table data-table table-striped table-bordered table-hover table_fm_files"><thead><tr><th class="col_name">File name</th><th class="col_type">Size</th><th class="col_action">Action</th></tr></thead><tbody>` + str_dirs + str_files + `</tbody></table>`
|
|
|
+ str_nothing := ``
|
|
|
+ if nothing {
|
|
|
+ str_nothing = `<tr><td colspan="50">No data</td></tr>`
|
|
|
+ }
|
|
|
+
|
|
|
+ table := `<table class="table data-table table-striped table-bordered table-hover table_fm_files"><thead><tr><th class="col_name">File name</th><th class="col_type">Size</th><th class="col_action">Action</th></tr></thead><tbody>` + str_dirs + str_files + str_nothing + `</tbody></table>`
|
|
|
wrap.Write(`$('#sys-modal-files-manager .dialog-data').html('` + table + `');`)
|
|
|
|
|
|
// Enable buttons
|