This commit is contained in:
2021-05-19 11:57:16 +07:00
parent 93c32a66a2
commit ab2830f449
124 changed files with 8061 additions and 0 deletions

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

46
public/index.html Normal file
View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Chatngay - Chatboard</title>
<script>
window.admin_info = {
client_id : 'asSda67',
id : '01EEyUKqzYnTaQuD',
jwt : 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjaGF0bmdheS5jb20iLCJ1c2VyX2luZm8iOnsiaWQiOiIwMUVFeVVLcXpZblRhUXVEIiwiY2xpZW50IjoiYXNTZGE2NyIsIm5vZGUiOiJub2RlMSIsImlzX2FkbWluIjp0cnVlfSwiaWF0IjoxNjE2OTE0MjE5fQ.gzYEGMp-j4VETE-FKyeeKoeI_lkHQFV38V59JX92H4k',
name : "Nhật Minh",
group_id : "8",
greeting : 'Chào mừng quý khách',
avatar : 'https://chatngay-static.glee.vn/avatar/120_a1.jpg',
node: 'node1',
};
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

BIN
public/logo192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
public/logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

25
public/manifest.json Normal file
View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

3
public/robots.txt Normal file
View File

@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@@ -0,0 +1,49 @@
onmessage = function (event) {
handleMessage(event.data);
}
// message = {type: '', task_id: '', [key: string]: any}
function handleMessage(message) {
// console.log("new task from master " + JSON.stringify(message));
let type = message['type'];
if(type === 'fetch'){
fetchUrl(message.url).then(function (res) {
postMessage({
type: 'fetch',
task_id: message.task_id,
info: JSON.parse(res),
})
});
return;
}
}
function processDelay(timeout) {
setTimeout(function () {
postMessage({
type: 'delay',
info: 'Its done! ' + timeout,
})
}, timeout)
}
function fetchUrl(request_url) {
return new Promise(function (resolve, reject) {
let xhr = new XMLHttpRequest();
xhr.open('GET', request_url, true);
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 300) {
resolve(xhr.response);
} else {
reject('error');
}
};
xhr.onerror = function () {
reject('error');
};
xhr.send();
});
}