Compare commits
4 Commits
8b6d38768b
...
5104dd8e2d
Author | SHA1 | Date | |
---|---|---|---|
5104dd8e2d | |||
5b5fdfb943 | |||
cda83d354f | |||
ddf7d49560 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.DS_Store
|
BIN
assets/images/generic-user.webp
Normal file
BIN
assets/images/generic-user.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
52
assets/js/app.js
Normal file
52
assets/js/app.js
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
async function getJson(url,headers={}) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(url);
|
||||||
|
return await response.json();
|
||||||
|
} catch {
|
||||||
|
return ({
|
||||||
|
status: 0,
|
||||||
|
body: {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getText(url, headers={}) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(url);
|
||||||
|
return ({
|
||||||
|
status: response.status,
|
||||||
|
body: await response.text()
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
return ({
|
||||||
|
status: 0,
|
||||||
|
body: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function postJson(url,data = {},headers={}) {
|
||||||
|
try {
|
||||||
|
headers["content-type"] = "application/json";
|
||||||
|
const response = await fetch(url,{method: "post", headers: headers,body: JSON.stringify(data)});
|
||||||
|
return await response.json();
|
||||||
|
} catch {
|
||||||
|
return ({
|
||||||
|
status: 0,
|
||||||
|
body: {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function postText(url,data = {},headers={}) {
|
||||||
|
try {
|
||||||
|
headers["content-type"] = "application/json";
|
||||||
|
const response = await fetch(url,{method: "post", headers: headers,body: JSON.stringify(data)});
|
||||||
|
return ({
|
||||||
|
status: response.status,
|
||||||
|
body: await response.text()
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
return ({
|
||||||
|
status: 0,
|
||||||
|
body: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,15 @@
|
|||||||
<html lang="id">
|
<html lang="id">
|
||||||
<head>
|
<head>
|
||||||
<title>Agen Perubahan</title>
|
<title>Agen Perubahan</title>
|
||||||
|
<script src="/assets/js/app.js"
|
||||||
|
></script>
|
||||||
|
<style>
|
||||||
|
html
|
||||||
|
{
|
||||||
|
background-color: dimgray;
|
||||||
|
color: lightgray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
Agen Perubahan
|
Agen Perubahan
|
||||||
|
Loading…
x
Reference in New Issue
Block a user