-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path580c7169.6ab17a2b.js
1 lines (1 loc) · 17.8 KB
/
580c7169.6ab17a2b.js
1
"use strict";(self.webpackChunkadminforth=self.webpackChunkadminforth||[]).push([[2260],{360:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>a,frontMatter:()=>o,metadata:()=>s,toc:()=>t});const s=JSON.parse('{"id":"api/Back/interfaces/AdminForthConfig","title":"AdminForthConfig","description":"Extends","source":"@site/docs/api/Back/interfaces/AdminForthConfig.md","sourceDirName":"api/Back/interfaces","slug":"/api/Back/interfaces/AdminForthConfig","permalink":"/docs/api/Back/interfaces/AdminForthConfig","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"apiSidebar","previous":{"title":"AdminForthBulkAction","permalink":"/docs/api/Back/interfaces/AdminForthBulkAction"},"next":{"title":"AdminForthConfigCustomization","permalink":"/docs/api/Back/interfaces/AdminForthConfigCustomization"}}');var r=i(4848),d=i(8453);const o={},l="AdminForthConfig",c={},t=[{value:"Extends",id:"extends",level:2},{value:"Properties",id:"properties",level:2},{value:"auth?",id:"auth",level:3},{value:"beforeLoginConfirmation?",id:"beforeloginconfirmation",level:4},{value:"clientIpHeader?",id:"clientipheader",level:4},{value:"demoCredentials?",id:"democredentials",level:4},{value:"loginBackgroundImage?",id:"loginbackgroundimage",level:4},{value:"loginBackgroundPosition?",id:"loginbackgroundposition",level:4},{value:"loginPromptHTML?",id:"loginprompthtml",level:4},{value:"passwordHashField",id:"passwordhashfield",level:4},{value:"rememberMeDays?",id:"remembermedays",level:4},{value:"resourceId?",id:"resourceid",level:4},{value:"userFullNameField?",id:"userfullnamefield",level:4},{value:"usernameField",id:"usernamefield",level:4},{value:"usersResourceId?",id:"usersresourceid",level:4},{value:"websocketSubscribed()?",id:"websocketsubscribed",level:4},{value:"Parameters",id:"parameters",level:5},{value:"Returns",id:"returns",level:5},{value:"websocketTopicAuth()?",id:"websockettopicauth",level:4},{value:"Parameters",id:"parameters-1",level:5},{value:"Returns",id:"returns-1",level:5},{value:"Inherited from",id:"inherited-from",level:4},{value:"baseUrl",id:"baseurl",level:3},{value:"Overrides",id:"overrides",level:4},{value:"baseUrlSlashed",id:"baseurlslashed",level:3},{value:"customization",id:"customization",level:3},{value:"dataSources",id:"datasources",level:3},{value:"Inherited from",id:"inherited-from-1",level:4},{value:"databaseConnectors?",id:"databaseconnectors",level:3},{value:"Index signature",id:"index-signature",level:4},{value:"Inherited from",id:"inherited-from-2",level:4},{value:"menu",id:"menu",level:3},{value:"Inherited from",id:"inherited-from-3",level:4},{value:"resources",id:"resources",level:3}];function h(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"adminforthconfig",children:"AdminForthConfig"})}),"\n",(0,r.jsx)(n.h2,{id:"extends",children:"Extends"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Omit"})," <",(0,r.jsx)(n.a,{href:"/docs/api/Back/interfaces/AdminForthInputConfig",children:(0,r.jsx)(n.code,{children:"AdminForthInputConfig"})}),", ",(0,r.jsx)(n.code,{children:'"customization"'})," | ",(0,r.jsx)(n.code,{children:'"resources"'}),">"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,r.jsx)(n.h3,{id:"auth",children:"auth?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"auth"}),": ",(0,r.jsx)(n.code,{children:"object"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Authorization module configuration"}),"\n",(0,r.jsx)(n.h4,{id:"beforeloginconfirmation",children:"beforeLoginConfirmation?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"beforeLoginConfirmation"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/Back/type-aliases/BeforeLoginConfirmationFunction",children:(0,r.jsx)(n.code,{children:"BeforeLoginConfirmationFunction"})})," | ",(0,r.jsx)(n.a,{href:"/docs/api/Back/type-aliases/BeforeLoginConfirmationFunction",children:(0,r.jsx)(n.code,{children:"BeforeLoginConfirmationFunction"})}),"[]"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Function or functions which will be called before user try to login.\nEach function will resive User object as an argument"}),"\n",(0,r.jsx)(n.h4,{id:"clientipheader",children:"clientIpHeader?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"clientIpHeader"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Client IP header name. If set, AdminForth will use this header to get client IP address.\nOtherwise it will use first IP address from X-Forwarded-For header.\nIf you are using Cloudflare, set this to 'CF-Connecting-IP'. Case-insensitive."}),"\n",(0,r.jsx)(n.h4,{id:"democredentials",children:"demoCredentials?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"demoCredentials"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Pair of login and pass substitution for demo mode. Split by ':'\n! This option is for demo purposes only, never use it for your projects"}),"\n",(0,r.jsx)(n.h4,{id:"loginbackgroundimage",children:"loginBackgroundImage?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"loginBackgroundImage"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["File path to custom background image for login page\nExample:\nPlace file ",(0,r.jsx)(n.code,{children:"login-background.jpg"})," to ",(0,r.jsx)(n.code,{children:"./custom"})," folder and set this option:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"loginBackgroundImage: '@@/login-background.jpg',\n"})}),"\n",(0,r.jsx)(n.h4,{id:"loginbackgroundposition",children:"loginBackgroundPosition?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"loginBackgroundPosition"}),": ",(0,r.jsx)(n.code,{children:'"over"'})," | ",(0,r.jsx)(n.code,{children:'"1/2"'})," | ",(0,r.jsx)(n.code,{children:'"1/3"'})," | ",(0,r.jsx)(n.code,{children:'"2/3"'})," | ",(0,r.jsx)(n.code,{children:'"3/4"'})," | ",(0,r.jsx)(n.code,{children:'"2/5"'})," | ",(0,r.jsx)(n.code,{children:'"3/5"'})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Position of background image on login page\n'over' - image will be displayed over full login page under login form\n'1/2' - image will be displayed on left 1/2 of login page"}),"\n",(0,r.jsx)(n.p,{children:"Default: '1/2'"}),"\n",(0,r.jsx)(n.h4,{id:"loginprompthtml",children:"loginPromptHTML?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"loginPromptHTML"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Any prompt to show users on login. Supports HTML."}),"\n",(0,r.jsx)(n.h4,{id:"passwordhashfield",children:"passwordHashField"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"passwordHashField"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Field name (column name) in user resource which will be used to get hash of password.\nCan be e.g. 'passwordHash'"}),"\n",(0,r.jsx)(n.h4,{id:"remembermedays",children:"rememberMeDays?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"rememberMeDays"}),": ",(0,r.jsx)(n.code,{children:"number"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:'Remember me days for "Remember Me" checkbox on login page.\nIf not set or set to null/0/undefined, "Remember Me" checkbox will not be displayed.\nIf rememberMeDays is set, then users who check "Remember Me" will be staying logged in for this amount of days.'}),"\n",(0,r.jsx)(n.h4,{id:"resourceid",children:"resourceId?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"resourceId"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Legacy field left for backward compatibility. Use usersResourceId instead."}),"\n",(0,r.jsx)(n.h4,{id:"userfullnamefield",children:"userFullNameField?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"userFullNameField"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Optionally if your users table has a field(column) with full name, you can set it here.\nThis field will be used to display user name in the top right corner of the admin panel."}),"\n",(0,r.jsx)(n.h4,{id:"usernamefield",children:"usernameField"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"usernameField"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Field name (column name) in user resource which will be used as username for searching user in database during login.\nCan be e.g. 'email' or 'username'"}),"\n",(0,r.jsx)(n.h4,{id:"usersresourceid",children:"usersResourceId?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"usersResourceId"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Resource ID for resource which stores user table.\nResource is a table in database where users will be stored and fetched from. Resources and their ids are defined in resources section of the config.\nIn other words this setting is a reference to a table in database where users will be fetched from on login."}),"\n",(0,r.jsx)(n.h4,{id:"websocketsubscribed",children:"websocketSubscribed()?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"websocketSubscribed"}),": (",(0,r.jsx)(n.code,{children:"topic"}),", ",(0,r.jsx)(n.code,{children:"user"}),") => ",(0,r.jsx)(n.code,{children:"void"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"callback which will be called after user subscribes to websocket topic"}),"\n",(0,r.jsx)(n.h5,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Parameter"}),(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Type"}),(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"topic"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:"topic on which user subscribed"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"user"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.a,{href:"/docs/api/Common/interfaces/AdminUser",children:(0,r.jsx)(n.code,{children:"AdminUser"})})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:"user object"})]})]})]}),"\n",(0,r.jsx)(n.h5,{id:"returns",children:"Returns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"void"})}),"\n",(0,r.jsx)(n.h4,{id:"websockettopicauth",children:"websocketTopicAuth()?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"websocketTopicAuth"}),": (",(0,r.jsx)(n.code,{children:"topic"}),", ",(0,r.jsx)(n.code,{children:"user"}),") => ",(0,r.jsx)(n.code,{children:"Promise"}),"<",(0,r.jsx)(n.code,{children:"boolean"}),">"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Can be used to limit user access when subscribing from frontend to websocket topics."}),"\n",(0,r.jsx)(n.h5,{id:"parameters-1",children:"Parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Parameter"}),(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Type"}),(0,r.jsx)(n.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"topic"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:"topic where user is trying to subscribe"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.code,{children:"user"})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:(0,r.jsx)(n.a,{href:"/docs/api/Common/interfaces/AdminUser",children:(0,r.jsx)(n.code,{children:"AdminUser"})})}),(0,r.jsx)(n.td,{style:{textAlign:"left"},children:"user object"})]})]})]}),"\n",(0,r.jsx)(n.h5,{id:"returns-1",children:"Returns"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Promise"}),"<",(0,r.jsx)(n.code,{children:"boolean"}),">"]}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from",children:"Inherited from"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Omit.auth"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"baseurl",children:"baseUrl"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"baseUrl"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"overrides",children:"Overrides"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Omit.baseUrl"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"baseurlslashed",children:"baseUrlSlashed"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"baseUrlSlashed"}),": ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"customization",children:"customization"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"customization"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/Back/interfaces/AdminForthConfigCustomization",children:(0,r.jsx)(n.code,{children:"AdminForthConfigCustomization"})})]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"datasources",children:"dataSources"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"dataSources"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/Back/type-aliases/AdminForthDataSource",children:(0,r.jsx)(n.code,{children:"AdminForthDataSource"})}),"[]"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"List of data sources which will be used to fetch data for resources.\nDatasource is one database connection"}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from-1",children:"Inherited from"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Omit.dataSources"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"databaseconnectors",children:"databaseConnectors?"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"optional"})," ",(0,r.jsx)(n.strong,{children:"databaseConnectors"}),": ",(0,r.jsx)(n.code,{children:"object"})]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"If you want use custom DataSource which is not supported by AdminForth yet, you can define it's class here"}),"\n",(0,r.jsx)(n.h4,{id:"index-signature",children:"Index signature"}),"\n",(0,r.jsxs)(n.p,{children:["[",(0,r.jsx)(n.code,{children:"key"}),": ",(0,r.jsx)(n.code,{children:"string"}),"]: ",(0,r.jsx)(n.a,{href:"/docs/api/Back/interfaces/IAdminForthDataSourceConnectorConstructor",children:(0,r.jsx)(n.code,{children:"IAdminForthDataSourceConnectorConstructor"})})]}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from-2",children:"Inherited from"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Omit.databaseConnectors"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"menu",children:"menu"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"menu"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/Common/interfaces/AdminForthConfigMenuItem",children:(0,r.jsx)(n.code,{children:"AdminForthConfigMenuItem"})}),"[]"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Array of left sidebar menu items which will be displayed in the admin panel.\nMenu items can be links to resources or custom pages.\nMenu items can be grouped."}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from-3",children:"Inherited from"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Omit.menu"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"resources",children:"resources"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"resources"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/Back/interfaces/AdminForthResource",children:(0,r.jsx)(n.code,{children:"AdminForthResource"})}),"[]"]}),"\n"]})]})}function a(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>l});var s=i(6540);const r={},d=s.createContext(r);function o(e){const n=s.useContext(d);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(d.Provider,{value:n},e.children)}}}]);