Software / code / prosody
Comparison
plugins/mod_admin_shell.lua @ 11887:b043e1bb8e8e
mod_admin_shell: Allow passing columns as a string for convenience
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 10 Nov 2021 16:28:54 +0100 |
| parent | 11886:b0b258e092da |
| child | 11888:050c515fe9aa |
comparison
equal
deleted
inserted
replaced
| 11886:b0b258e092da | 11887:b043e1bb8e8e |
|---|---|
| 807 end | 807 end |
| 808 }; | 808 }; |
| 809 }; | 809 }; |
| 810 | 810 |
| 811 local function get_colspec(colspec, default) | 811 local function get_colspec(colspec, default) |
| 812 if type(colspec) == "string" then colspec = array(colspec:gmatch("%S+")); end | |
| 812 local columns = {}; | 813 local columns = {}; |
| 813 for i, col in pairs(colspec or default) do | 814 for i, col in pairs(colspec or default) do |
| 814 if type(col) == "string" then | 815 if type(col) == "string" then |
| 815 columns[i] = available_columns[col] or { title = capitalize(col); width = 20; key = col }; | 816 columns[i] = available_columns[col] or { title = capitalize(col); width = 20; key = col }; |
| 816 elseif type(col) ~= "table" then | 817 elseif type(col) ~= "table" then |