diff --git a/src/components/icon-font/iconfont/iconfont.css b/src/components/icon-font/iconfont/iconfont.css index b864e9ab..0bebf006 100644 --- a/src/components/icon-font/iconfont/iconfont.css +++ b/src/components/icon-font/iconfont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: iconfont; /* Project id 4613488 */ - src: url('iconfont.woff2?t=1752112673765') format('woff2'), - url('iconfont.woff?t=1752112673765') format('woff'), - url('iconfont.ttf?t=1752112673765') format('truetype'); + src: url('iconfont.woff2?t=1755160439217') format('woff2'), + url('iconfont.woff?t=1755160439217') format('woff'), + url('iconfont.ttf?t=1755160439217') format('truetype'); } .iconfont { @@ -13,6 +13,50 @@ -moz-osx-font-smoothing: grayscale; } +.icon-admin-user::before { + content: "\e69d"; +} + +.icon-user::before { + content: "\e69e"; +} + +.icon-quick_reference_24dp_1F1F1F_FILL0_wght300_GRAD0_op::before { + content: "\e69b"; +} + +.icon-docker::before { + content: "\e69c"; +} + +.icon-digitalocean::before { + content: "\eb79"; +} + +.icon-rocket-launch1::before { + content: "\e699"; +} + +.icon-rocket-launch-fill::before { + content: "\e69a"; +} + +.icon-credential-filled::before { + content: "\e697"; +} + +.icon-credential-outline::before { + content: "\e698"; +} + +.icon-k8s-filled::before { + content: "\e63e"; +} + +.icon-k8s-outline::before { + content: "\e64b"; +} + .icon-huggingface1::before { content: "\e605"; } diff --git a/src/components/icon-font/iconfont/iconfont.js b/src/components/icon-font/iconfont/iconfont.js index 1959bdb9..3565fd8b 100644 --- a/src/components/icon-font/iconfont/iconfont.js +++ b/src/components/icon-font/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_4613488='',(a=>{var l=(h=(h=document.getElementsByTagName("script"))[h.length-1]).getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var v,c,z,t,m,o=function(l,h){h.parentNode.insertBefore(l,h)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}v=function(){var l,h=document.createElement("div");h.innerHTML=a._iconfont_svg_string_4613488,(h=h.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",h=h,(l=document.body).firstChild?o(h,l.firstChild):l.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(v,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),v()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(z=v,t=a.document,m=!1,p(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,i())})}function i(){m||(m=!0,z())}function p(){try{t.documentElement.doScroll("left")}catch(l){return void setTimeout(p,50)}i()}})(window); \ No newline at end of file +window._iconfont_svg_string_4613488='',(a=>{var l=(h=(h=document.getElementsByTagName("script"))[h.length-1]).getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var v,c,z,m,t,o=function(l,h){h.parentNode.insertBefore(l,h)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}v=function(){var l,h=document.createElement("div");h.innerHTML=a._iconfont_svg_string_4613488,(h=h.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",h=h,(l=document.body).firstChild?o(h,l.firstChild):l.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(v,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),v()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(z=v,m=a.document,t=!1,p(),m.onreadystatechange=function(){"complete"==m.readyState&&(m.onreadystatechange=null,i())})}function i(){t||(t=!0,z())}function p(){try{m.documentElement.doScroll("left")}catch(l){return void setTimeout(p,50)}i()}})(window); \ No newline at end of file diff --git a/src/components/icon-font/iconfont/iconfont.json b/src/components/icon-font/iconfont/iconfont.json index 6994ed45..e6729bc8 100644 --- a/src/components/icon-font/iconfont/iconfont.json +++ b/src/components/icon-font/iconfont/iconfont.json @@ -5,6 +5,83 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "45240470", + "name": "admin-user", + "font_class": "admin-user", + "unicode": "e69d", + "unicode_decimal": 59037 + }, + { + "icon_id": "45240469", + "name": "user", + "font_class": "user", + "unicode": "e69e", + "unicode_decimal": 59038 + }, + { + "icon_id": "45221182", + "name": "quick_reference_24dp_1F1F1F_FILL0_wght300_GRAD0_op", + "font_class": "quick_reference_24dp_1F1F1F_FILL0_wght300_GRAD0_op", + "unicode": "e69b", + "unicode_decimal": 59035 + }, + { + "icon_id": "45102077", + "name": "Docker", + "font_class": "docker", + "unicode": "e69c", + "unicode_decimal": 59036 + }, + { + "icon_id": "15378290", + "name": "digitalocean", + "font_class": "digitalocean", + "unicode": "eb79", + "unicode_decimal": 60281 + }, + { + "icon_id": "45040302", + "name": "rocket-launch", + "font_class": "rocket-launch1", + "unicode": "e699", + "unicode_decimal": 59033 + }, + { + "icon_id": "45040301", + "name": "rocket-launch-fill", + "font_class": "rocket-launch-fill", + "unicode": "e69a", + "unicode_decimal": 59034 + }, + { + "icon_id": "45028316", + "name": "credential", + "font_class": "credential-filled", + "unicode": "e697", + "unicode_decimal": 59031 + }, + { + "icon_id": "45028315", + "name": "credential", + "font_class": "credential-outline", + "unicode": "e698", + "unicode_decimal": 59032 + }, + { + "icon_id": "37601405", + "name": "k8s", + "font_class": "k8s-filled", + "unicode": "e63e", + "unicode_decimal": 58942 + }, + { + "icon_id": "41673174", + "name": "k8s", + "font_class": "k8s-outline", + "unicode": "e64b", + "unicode_decimal": 58955 + }, { "icon_id": "40865292", "name": "huggingface", diff --git a/src/components/icon-font/iconfont/iconfont.ttf b/src/components/icon-font/iconfont/iconfont.ttf index 4dc1ee26..d6697345 100644 Binary files a/src/components/icon-font/iconfont/iconfont.ttf and b/src/components/icon-font/iconfont/iconfont.ttf differ diff --git a/src/components/icon-font/iconfont/iconfont.woff b/src/components/icon-font/iconfont/iconfont.woff index bd293859..a8185f86 100644 Binary files a/src/components/icon-font/iconfont/iconfont.woff and b/src/components/icon-font/iconfont/iconfont.woff differ diff --git a/src/components/icon-font/iconfont/iconfont.woff2 b/src/components/icon-font/iconfont/iconfont.woff2 index e92051a7..045dbfec 100644 Binary files a/src/components/icon-font/iconfont/iconfont.woff2 and b/src/components/icon-font/iconfont/iconfont.woff2 differ diff --git a/src/config/global.d.ts b/src/config/global.d.ts index 597a2bbf..11fe3b36 100644 --- a/src/config/global.d.ts +++ b/src/config/global.d.ts @@ -21,6 +21,7 @@ declare namespace Global { require_password_change: boolean; id: number; source: string; + avatar_url?: string; } interface BaseListItem { diff --git a/src/layouts/rightRender.tsx b/src/layouts/rightRender.tsx index 45f17c27..7271ebdc 100644 --- a/src/layouts/rightRender.tsx +++ b/src/layouts/rightRender.tsx @@ -267,6 +267,7 @@ export const getRightRenderContent = (opts: { { {intl.formatMessage( { id: 'common.external.login' }, - { type: 'OIDC' } + { type: 'SSO' } )} @@ -202,7 +202,7 @@ const LoginForm = () => { {intl.formatMessage( { id: 'common.external.login' }, - { type: 'SAML' } + { type: 'SSO' } )} @@ -239,7 +239,7 @@ const LoginForm = () => { {intl.formatMessage( { id: 'common.external.login' }, - { type: SSOAuth.options.oidc ? 'OIDC' : 'SAML' } + { type: 'SSO' } )} )} diff --git a/src/pages/users/config/types.ts b/src/pages/users/config/types.ts index 22d83a6b..136a55e1 100644 --- a/src/pages/users/config/types.ts +++ b/src/pages/users/config/types.ts @@ -3,6 +3,8 @@ export interface ListItem { is_admin: boolean; full_name: string; id: number; + source: string; + avatar_url: string; username: string; created_at: string; updated_at: string; diff --git a/src/pages/users/index.tsx b/src/pages/users/index.tsx index cda22594..06905f0e 100644 --- a/src/pages/users/index.tsx +++ b/src/pages/users/index.tsx @@ -1,6 +1,7 @@ import AutoTooltip from '@/components/auto-tooltip'; import DeleteModal from '@/components/delete-modal'; import DropdownButtons from '@/components/drop-down-buttons'; +import IconFont from '@/components/icon-font'; import PageTools from '@/components/page-tools'; import { PageAction } from '@/config'; import HotKeys from '@/config/hotkeys'; @@ -10,13 +11,12 @@ import { DeleteOutlined, EditOutlined, PlusOutlined, - SyncOutlined, - UserOutlined, - UserSwitchOutlined + SyncOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-components'; import { useIntl } from '@umijs/max'; import { + Avatar, Button, ConfigProvider, Empty, @@ -231,9 +231,14 @@ const Users: React.FC = () => { }} render={(text, record) => { return ( - - {text} - + + {record.avatar_url && ( + + )} + + {text} + + ); }} /> @@ -247,14 +252,17 @@ const Users: React.FC = () => { render={(text, record: ListItem) => { return record.is_admin ? ( - + {intl.formatMessage({ id: 'users.form.admin' })} ) : ( - + {intl.formatMessage({ id: 'users.form.user' })} diff --git a/src/services/profile/apis.ts b/src/services/profile/apis.ts index 98b826e9..c3678708 100644 --- a/src/services/profile/apis.ts +++ b/src/services/profile/apis.ts @@ -1,7 +1,7 @@ import { request } from '@umijs/max'; export async function queryCurrentUserState(opts?: Record) { - return request(`/users/me`, { + return request(`/users/me`, { method: 'GET', ...opts });