From dc00adc86e417130fd3f06d11efebb676958293f Mon Sep 17 00:00:00 2001 From: Kload Date: Tue, 29 Oct 2013 09:16:30 +0000 Subject: [PATCH] Iframe panel --- access.lua | 11 +++++++++-- portal/assets/css/panel.css | 27 +++++++++++++++++++++++++++ portal/panel.ms | 21 ++++++++++++++++++++- 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/access.lua b/access.lua index 1202f69..cd60087 100644 --- a/access.lua +++ b/access.lua @@ -163,7 +163,7 @@ function set_headers (user) ngx.req.set_header("Authorization", "Basic "..ngx.encode_base64( user..":"..cache:get(user.."-password") )) - + -- Set Additional headers for k, v in pairs(conf["additional_headers"]) do ngx.req.set_header(k, cache:get(user.."-"..v)) @@ -247,7 +247,8 @@ function serve(uri) rendered = rendered..hige.render(content, data) content = rendered..hige.render(read_file(script_path.."portal/footer.ms"), data) elseif ext == "ms" then - content = hige.render(content, {}) + local data = get_data_for(file) + content = hige.render(content, data) end -- Reset flash messages @@ -303,6 +304,12 @@ function get_data_for(view) mailalias = mails["mailalias"], maildrop = mails["maildrop"] } + + elseif view == "panel.ms" then + data = { app = {} } + for url, name in pairs(conf["users"][user]) do + table.insert(data["app"], { url = url, name = name }) + end end data['flash_fail'] = {flashs["fail"]} diff --git a/portal/assets/css/panel.css b/portal/assets/css/panel.css index bd934b9..d47970d 100644 --- a/portal/assets/css/panel.css +++ b/portal/assets/css/panel.css @@ -39,3 +39,30 @@ iframe { #ynhtoggle:hover { text-decoration: none; } +.ynhapp { + float: left; + margin: 5px 15px; + padding: 5px; + width: 70px; + height: 100px; + color: white; + text-align: center; + cursor: pointer; + text-decoration: none; +} +.ynhapp.active .ynhappsquare { + border: 1px dotted white; +} +.ynhappcaption { + color: white; + font-size: 13px; + text-decoration: none; +} +.ynhappsquare { + height: 50px; + width: 64px; + padding-top: 14px; + vertical-align: middle; + font-size: 35px; + border: 1px solid white; +} diff --git a/portal/panel.ms b/portal/panel.ms index e117d03..23dfa03 100644 --- a/portal/panel.ms +++ b/portal/panel.ms @@ -13,7 +13,7 @@ - +