Fix navbar: SVG logos, Settings menu, Logout handler
- Image handler now returns SVG placeholders for company logo and user avatars instead of broken 1x1 PNG (fixes yellow border in navbar) - Supports both query-param (?model=&field=) and path-style URLs (/web/image/res.partner/2/avatar_128) - Added Settings app menu with Users & Technical sub-menus - Added actions for Settings (company form), Users list, Sequences - Added /web/session/logout handler that clears session + cookie - Added logout to middleware whitelist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ func (s *Server) handleLoadMenus(w http.ResponseWriter, r *http.Request) {
|
||||
"root": map[string]interface{}{
|
||||
"id": "root",
|
||||
"name": "root",
|
||||
"children": []int{1, 2, 3, 4, 5, 6, 7, 8, 9},
|
||||
"children": []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 100},
|
||||
"appID": false,
|
||||
"xmlid": "",
|
||||
"actionID": false,
|
||||
@@ -330,6 +330,49 @@ func (s *Server) handleLoadMenus(w http.ResponseWriter, r *http.Request) {
|
||||
"webIconDataMimetype": nil,
|
||||
"backgroundImage": nil,
|
||||
},
|
||||
// Settings
|
||||
"100": map[string]interface{}{
|
||||
"id": 100,
|
||||
"name": "Settings",
|
||||
"children": []int{101, 102},
|
||||
"appID": 100,
|
||||
"xmlid": "base.menu_administration",
|
||||
"actionID": 100,
|
||||
"actionModel": "ir.actions.act_window",
|
||||
"actionPath": false,
|
||||
"webIcon": "fa-cog,#71639e,#FFFFFF",
|
||||
"webIconData": nil,
|
||||
"webIconDataMimetype": nil,
|
||||
"backgroundImage": nil,
|
||||
},
|
||||
"101": map[string]interface{}{
|
||||
"id": 101,
|
||||
"name": "Users & Companies",
|
||||
"children": []int{},
|
||||
"appID": 100,
|
||||
"xmlid": "base.menu_users",
|
||||
"actionID": 101,
|
||||
"actionModel": "ir.actions.act_window",
|
||||
"actionPath": false,
|
||||
"webIcon": nil,
|
||||
"webIconData": nil,
|
||||
"webIconDataMimetype": nil,
|
||||
"backgroundImage": nil,
|
||||
},
|
||||
"102": map[string]interface{}{
|
||||
"id": 102,
|
||||
"name": "Technical",
|
||||
"children": []int{},
|
||||
"appID": 100,
|
||||
"xmlid": "base.menu_custom",
|
||||
"actionID": 102,
|
||||
"actionModel": "ir.actions.act_window",
|
||||
"actionPath": false,
|
||||
"webIcon": nil,
|
||||
"webIconData": nil,
|
||||
"webIconDataMimetype": nil,
|
||||
"backgroundImage": nil,
|
||||
},
|
||||
}
|
||||
|
||||
json.NewEncoder(w).Encode(menus)
|
||||
|
||||
Reference in New Issue
Block a user