Skip to content

Commit

Permalink
Remove directus info
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Jul 30, 2023
1 parent 0fd8f7a commit fa060e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
37 changes: 2 additions & 35 deletions web/components/admin/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ const domain =
env('DOMAIN') || (typeof window !== 'undefined' && window.location.host);
const chatwootUrl = env('CHATWOOT_URL');

export default function Settings({
jobs,
settings,
refreshSettings,
directusInfo,
}) {
export default function Settings({ jobs, settings, refreshSettings }) {
const theme = useTheme();
const { formatMessage, formatRelativeTime } = useIntl();
const { formatMessage } = useIntl();

const chatwootIsSetup =
settings.chatwoot_website_token && settings.chatwoot_hmac_token;
Expand Down Expand Up @@ -179,34 +174,6 @@ export default function Settings({
{directusUrl}
</Link>
</Box>
<Box>
<Text fontWeight="bold">
{formatMessage({ id: 'version' })}
</Text>
<Text>{directusInfo.directus.version}</Text>
</Box>
<Box>
<Text fontWeight="bold">
{formatMessage({ id: 'launched' })}
</Text>
<Text
sx={{
'::first-letter': {
textTransform: 'uppercase',
},
}}
>
{formatRelativeTime(
Math.floor(directusInfo.node.uptime / 3600) > 24
? -Math.floor(directusInfo.node.uptime / (3600 * 24))
: -Math.floor(directusInfo.node.uptime / 3600),
Math.floor(directusInfo.node.uptime / 3600) > 24
? 'days'
: 'hours',
{ numeric: 'auto' },
)}
</Text>
</Box>
</Stack>
</AccordionPanel>
</AccordionItem>
Expand Down
5 changes: 0 additions & 5 deletions web/pages/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default function Admin() {
const [docs, setDocs] = useState({});
const [dates, setDates] = useState([]);
const [settings, setSettings] = useState({});
const [directusInfo, setDirectusInfo] = useState({});
const user = AuthStore.useState((s) => s.user);

async function getJobs() {
Expand Down Expand Up @@ -95,9 +94,6 @@ export default function Admin() {
setDates(dates.data);

await getSettings();

setDirectusInfo(await directus.server.info());

setLoading({ state: false });
} catch (error) {
setLoading({ state: true, error: error });
Expand Down Expand Up @@ -231,7 +227,6 @@ export default function Admin() {
<TabPanel>
<Settings
jobs={jobs}
directusInfo={directusInfo}
settings={settings}
refreshSettings={getSettings}
/>
Expand Down

0 comments on commit fa060e7

Please sign in to comment.