feat: 소프트웨어 자산 관리 기능 고도화 및 대시보드 누적 비용 분석 기능 추가

This commit is contained in:
2026-04-23 19:47:07 +09:00
parent d125de1902
commit 9fcecd4bf5
13 changed files with 649 additions and 324 deletions

View File

@@ -51,16 +51,16 @@ export const state: AppState = {
export async function loadMasterDataFromDB() {
try {
const endpoints = [
{ key: 'pc', url: 'http://172.16.40.100:3000/api/pc' },
{ key: 'server', url: 'http://172.16.40.100:3000/api/server' },
{ key: 'storage', url: 'http://172.16.40.100:3000/api/storage' },
{ key: 'equip', url: 'http://172.16.40.100:3000/api/equip' },
{ key: 'mobile', url: 'http://172.16.40.100:3000/api/mobile' },
{ key: 'subSw', url: 'http://172.16.40.100:3000/api/sw/sub' },
{ key: 'permSw', url: 'http://172.16.40.100:3000/api/sw/perm' },
{ key: 'cloud', url: 'http://172.16.40.100:3000/api/cloud' },
{ key: 'swUsers', url: 'http://172.16.40.100:3000/api/sw-users' },
{ key: 'logs', url: 'http://172.16.40.100:3000/api/logs' }
{ key: 'pc', url: `http://${location.hostname}:3000/api/pc` },
{ key: 'server', url: `http://${location.hostname}:3000/api/server` },
{ key: 'storage', url: `http://${location.hostname}:3000/api/storage` },
{ key: 'equip', url: `http://${location.hostname}:3000/api/equip` },
{ key: 'mobile', url: `http://${location.hostname}:3000/api/mobile` },
{ key: 'subSw', url: `http://${location.hostname}:3000/api/sw/sub` },
{ key: 'permSw', url: `http://${location.hostname}:3000/api/sw/perm` },
{ key: 'cloud', url: `http://${location.hostname}:3000/api/cloud` },
{ key: 'swUsers', url: `http://${location.hostname}:3000/api/sw-users` },
{ key: 'logs', url: `http://${location.hostname}:3000/api/logs` }
];
const results = await Promise.all(endpoints.map(e => fetch(e.url)));
@@ -195,7 +195,7 @@ export function deleteHardwareAsset(assetId: string) {
*/
export async function saveSoftwareAsset(asset: SoftwareAsset) {
try {
const response = await fetch('http://172.16.40.100:3000/api/software/save', {
const response = await fetch(`http://${location.hostname}:3000/api/software/save`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(asset)
@@ -224,7 +224,7 @@ export async function saveSoftwareAsset(asset: SoftwareAsset) {
*/
export async function deleteSoftwareAsset(type: string, id: string) {
try {
const response = await fetch(`http://172.16.40.100:3000/api/asset/${type}/${id}`, {
const response = await fetch(`http://${location.hostname}:3000/api/asset/${type}/${id}`, {
method: 'DELETE'
});