Skip to content

Commit

Permalink
dashboard using real data
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed May 22, 2024
1 parent 64e8d50 commit 0db1b11
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
5 changes: 5 additions & 0 deletions blocks/ecc-dashboard/ecc-dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@
border-bottom: 2px solid var(--color-gray-300);
}

.ecc-dashboard table .event-row .event-title-link {
font-weight: 700;
text-decoration: none;
}

.ecc-dashboard table .event-row .thumbnail-container img {
display: block;
height: 90px;
Expand Down
2 changes: 1 addition & 1 deletion blocks/event-format-component/event-format-component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getLibs } from '../../scripts/utils.js';
import { generateToolTip } from '../../utils/utils.js';
import { getClouds, getSeries } from '../../scripts/esp-controller.js';
import { getClouds, getSeries } from '../../utils/esp-controller.js';

const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { decorateButtons } = await import(`${getLibs()}/utils/decorate.js`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createVenue } from '../../../scripts/esp-controller.js';
import { createVenue } from '../../../utils/esp-controller.js';

function loadGoogleMapsAPI(callback) {
const script = document.createElement('script');
Expand Down
2 changes: 1 addition & 1 deletion blocks/form-handler/form-handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getLibs } from '../../scripts/utils.js';
import { getIcon, buildNoAccessScreen, yieldToMain } from '../../utils/utils.js';
import { createEvent, updateEvent, publishEvent } from '../../scripts/esp-controller.js';
import { createEvent, updateEvent, publishEvent } from '../../utils/esp-controller.js';

const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { decorateButtons } = await import(`${getLibs()}/utils/decorate.js`);
Expand Down
18 changes: 16 additions & 2 deletions scripts/esp-controller.js → utils/esp-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export async function updateEvent(eventId, payload) {
body: raw,
};

const resp = fetch(`http://localhost:8500/v1/events${eventId}`, requestOptions).then((res) => res.json()).catch((error) => console.log(error));
const resp = fetch(`http://localhost:8500/v1/events/${eventId}`, requestOptions).then((res) => res.json()).catch((error) => console.log(error));
console.log(payload, resp);
return resp;
}
Expand All @@ -146,7 +146,7 @@ export async function publishEvent(eventId, payload) {
body: raw,
};

const resp = fetch(`http://localhost:8500/v1/events${eventId}`, requestOptions).then((res) => res.json()).catch((error) => console.log(error));
const resp = fetch(`http://localhost:8500/v1/events/${eventId}`, requestOptions).then((res) => res.json()).catch((error) => console.log(error));
return resp;
}

Expand All @@ -164,6 +164,20 @@ export async function getEvents() {
return resp;
}

export async function getVenue(venueId) {
const myHeaders = new Headers();
myHeaders.append('Authorization', 'Bearer');
myHeaders.append('content-type', 'application/json');

const requestOptions = {
method: 'GET',
headers: myHeaders,
};

const resp = fetch(`http://localhost:8500/v1/venues/${venueId}`, requestOptions).then((res) => res.json()).catch((error) => console.log(error));
return resp;
}

export async function getClouds() {
const resp = await fetch('https://www.adobe.com/chimera-api/tags').then((res) => res.json()).catch((error) => error);

Expand Down
2 changes: 1 addition & 1 deletion utils/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getLibs } from '../scripts/utils.js';
import { handleImageFiles } from '../scripts/esp-controller.js';
import { handleImageFiles } from './esp-controller.js';

function createTag(tag, attributes, html, options = {}) {
const el = document.createElement(tag);
Expand Down

0 comments on commit 0db1b11

Please sign in to comment.