mirror of https://github.com/BRAVO68WEB/shx.git
integrated sys info api
This commit is contained in:
parent
3fe8be6725
commit
f6f612e899
|
@ -15,8 +15,11 @@ export class Settings {
|
|||
return res
|
||||
}
|
||||
async getInstanceInfo(){
|
||||
|
||||
}
|
||||
const res = await this.axios.get('/info/sys');
|
||||
delete res.data.data.cpuUsage
|
||||
delete res.data.data.memoryUsage
|
||||
return res.data.data as ISysSettings
|
||||
}
|
||||
}
|
||||
|
||||
export default Settings;
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import api from '@/api';
|
||||
import React from 'react';
|
||||
|
||||
function Page() {
|
||||
const urls = [
|
||||
{
|
||||
id: 'afdas',
|
||||
originalURL: 'https://www.google.com',
|
||||
shortenedURL: 'https://www.google.com',
|
||||
},
|
||||
];
|
||||
async function Page() {
|
||||
const res = await api.settings.getInstanceInfo();
|
||||
const data = Object.entries(res);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -29,19 +25,13 @@ function Page() {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y p-2">
|
||||
{urls.map(({ originalURL, shortenedURL, id }) => (
|
||||
{data.map((val, id) => (
|
||||
<tr className="bg-gray-900 rounded" key={id}>
|
||||
<td className="whitespace-nowrap py-5 pl-4 pr-20 text-sm font-medium text-white">
|
||||
<div className="flex items-center gap-3">
|
||||
{originalURL}
|
||||
|
||||
</div>
|
||||
<div className="flex items-center gap-3">{val[0]}</div>
|
||||
</td>
|
||||
<td className="whitespace-nowrap pl-4 text-sm font-medium text-white">
|
||||
<div className="flex items-center gap-3">
|
||||
{shortenedURL}
|
||||
|
||||
</div>
|
||||
<div className="flex items-center gap-3">{val[1]}</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
|
|
@ -3,4 +3,13 @@ interface ISettings {
|
|||
language: string;
|
||||
imageExtensions: string[];
|
||||
fileExtensions: string[];
|
||||
}
|
||||
}
|
||||
|
||||
interface ISysSettings {
|
||||
platform: string;
|
||||
arch: string;
|
||||
nodeVersion: string;
|
||||
uptime: string;
|
||||
kernelVersion: string;
|
||||
hostname: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue