openfree commited on
Commit
d6aea1c
ยท
verified ยท
1 Parent(s): 292bb51

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +41 -67
index.html CHANGED
@@ -1483,73 +1483,47 @@
1483
  let componentDetails = [];
1484
 
1485
  // ์„œ๋น„์Šค ๋น„์šฉ ๊ณ„์‚ฐ
1486
- selectedComponents.service.forEach(serviceId => {
1487
- const card = document.querySelector(`[data-id="${serviceId}"]`);
1488
- const cost = parseFloat(card.dataset.cost);
1489
- const time = parseFloat(card.dataset.time);
1490
- const resource = parseFloat(card.dataset.resource) || 0;
1491
- const name = card.querySelector('.option-name').textContent;
1492
-
1493
- totalInitialCost += cost;
1494
- totalResourceCost += resource;
1495
- maxTime = Math.max(maxTime, time);
1496
-
1497
- componentDetails.push({
1498
- name: name,
1499
- cost: cost,
1500
- type: 'service'
1501
- });
1502
- });
1503
-
1504
- // ๊ธฐํƒ€ ๊ตฌ์„ฑ ์š”์†Œ ๋น„์šฉ ๊ณ„์‚ฐ
1505
- ['db', 'auth', 'credit', 'payment', 'marketing', 'monitoring'].forEach(category => {
1506
- if (selectedComponents[category]) {
1507
- const card = document.querySelector(`[data-category="${category}"][data-id="${selectedComponents[category]}"]`);
1508
- const cost = parseFloat(card.dataset.cost);
1509
- const time = parseFloat(card.dataset.time);
1510
- const name = card.querySelector('.option-name').textContent;
1511
-
1512
- totalInitialCost += cost;
1513
- maxTime = Math.max(maxTime, time);
1514
-
1515
- componentDetails.push({
1516
- name: name,
1517
- cost: cost,
1518
- type: category
1519
- });
1520
- }
1521
- });
1522
-
1523
- // ์ง€์› ์„œ๋น„์Šค (์›”๊ฐ„ ๋น„์šฉ)
1524
- let monthlySupport = 0;
1525
- if (selectedComponents.support) {
1526
- const card = document.querySelector(`[data-category="support"][data-id="${selectedComponents.support]}"]`);
1527
- monthlySupport = parseFloat(card.dataset.cost);
1528
- const name = card.querySelector('.option-name').textContent;
1529
-
1530
- componentDetails.push({
1531
- name: name,
1532
- cost: monthlySupport,
1533
- type: 'monthly'
1534
- });
1535
- }
1536
-
1537
- // ์ถ”๊ฐ€ ๊ธฐ๋Šฅ ๋น„์šฉ ๊ณ„์‚ฐ
1538
- selectedComponents.additional.forEach(additionalId => {
1539
- const card = document.querySelector(`[data-category="additional"][data-id="${additionalId}"]`);
1540
- const cost = parseFloat(card.dataset.cost);
1541
- const time = parseFloat(card.dataset.time);
1542
- const name = card.querySelector('.option-name').textContent;
1543
-
1544
- totalInitialCost += cost;
1545
- maxTime = Math.max(maxTime, time);
1546
-
1547
- componentDetails.push({
1548
- name: name,
1549
- cost: cost,
1550
- type: 'additional'
1551
- });
1552
- });
1553
 
1554
  // ์›”๊ฐ„ ์šด์˜ ๋น„์šฉ ๊ณ„์‚ฐ
1555
  const serverCost = totalInitialCost > 100 ? 5 : totalInitialCost > 50 ? 3 : totalInitialCost > 20 ? 2 : 1;
 
1483
  let componentDetails = [];
1484
 
1485
  // ์„œ๋น„์Šค ๋น„์šฉ ๊ณ„์‚ฐ
1486
+ // ์„œ๋น„์Šค ๋น„์šฉ ๊ณ„์‚ฐ ๋ถ€๋ถ„์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •
1487
+ selectedComponents.service.forEach(serviceId => {
1488
+ const card = document.querySelector(`[data-category="service"][data-id="${serviceId}"]`);
1489
+ if (!card) return; // ์นด๋“œ๊ฐ€ ์—†์œผ๋ฉด ๊ฑด๋„ˆ๋›ฐ๊ธฐ
1490
+
1491
+ const cost = parseFloat(card.dataset.cost);
1492
+ const time = parseFloat(card.dataset.time);
1493
+ const resource = parseFloat(card.dataset.resource) || 0;
1494
+ const name = card.querySelector('.option-name').textContent;
1495
+
1496
+ totalInitialCost += cost;
1497
+ totalResourceCost += resource;
1498
+ maxTime = Math.max(maxTime, time);
1499
+
1500
+ componentDetails.push({
1501
+ name: name,
1502
+ cost: cost,
1503
+ type: 'service'
1504
+ });
1505
+ });
1506
+
1507
+ // ์ถ”๊ฐ€ ๊ธฐ๋Šฅ ๋น„์šฉ ๊ณ„์‚ฐ ๋ถ€๋ถ„๋„ ๋™์ผํ•˜๊ฒŒ ์ˆ˜์ •
1508
+ selectedComponents.additional.forEach(additionalId => {
1509
+ const card = document.querySelector(`[data-category="additional"][data-id="${additionalId}"]`);
1510
+ if (!card) return; // ์นด๋“œ๊ฐ€ ์—†์œผ๋ฉด ๊ฑด๋„ˆ๋›ฐ๊ธฐ
1511
+
1512
+ const cost = parseFloat(card.dataset.cost);
1513
+ const time = parseFloat(card.dataset.time);
1514
+ const name = card.querySelector('.option-name').textContent;
1515
+
1516
+ totalInitialCost += cost;
1517
+ maxTime = Math.max(maxTime, time);
1518
+
1519
+ componentDetails.push({
1520
+ name: name,
1521
+ cost: cost,
1522
+ type: 'additional'
1523
+ });
1524
+ });
1525
+
1526
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1527
 
1528
  // ์›”๊ฐ„ ์šด์˜ ๋น„์šฉ ๊ณ„์‚ฐ
1529
  const serverCost = totalInitialCost > 100 ? 5 : totalInitialCost > 50 ? 3 : totalInitialCost > 20 ? 2 : 1;