Compare commits

...

66 Commits
HEAD ... master

Author SHA1 Message Date
Chris Cromer 40b04e4cfa
Merge pull request #4 from Kasdrath/master
fix api url
2023-03-02 00:00:26 -03:00
Martin Araneda 5e0eca4b1e fix api url 2023-03-01 23:56:39 -03:00
Chris Cromer e82f78485d
Merge pull request #3 from Kasdrath/master
Fix landing, api urls
2023-03-01 23:37:09 -03:00
Martin Araneda 630ad3a94f Fix landing, api urls 2023-03-01 23:35:23 -03:00
Chris Cromer 52ab27bd5c
Merge pull request #2 from Kasdrath/master
Union
2023-03-01 22:59:27 -03:00
Chris Cromer 67e0d5559b
Merge branch 'master' into master 2023-03-01 22:59:08 -03:00
Martin Araneda 7c48fb9de5 project build fix 2023-02-28 21:50:09 -03:00
Martin Araneda bbd884d80c reformat usercrud 2023-02-20 13:07:31 -03:00
Martin Araneda be7707d5f7 fix to login screen 2023-02-18 01:10:24 -03:00
Martin Araneda 8ddd866e49 fixes to pswrd change, token and chart 2023-02-16 23:11:58 -03:00
Martin Araneda 674c8b5f0a Chart dropdown finished 2023-02-15 15:31:17 -03:00
Martin Araneda 3b03b4ba31 minor fixes to Users,OS crud 2023-02-14 18:23:22 -03:00
Chris Cromer e26ed450fa increase hard limit of rows to 10000 2023-02-12 16:35:15 -03:00
Chris Cromer 8aed669d57 optimize the amount data sent from the backend 2023-02-12 16:35:15 -03:00
Martin Araneda 776b9b70e2 minor fixes to topbar, chart 2023-02-12 16:34:03 -03:00
Chris Cromer c040b8a75c fix bug with password change 2023-02-10 22:38:11 -03:00
Martin Araneda bff04407e0 minor changes 2023-02-10 22:37:00 -03:00
Chris Cromer 9d37814bc5 add the id of the user into the token 2023-02-10 22:12:41 -03:00
Martin Araneda 5ef43e88b0 minor changes password verif 2023-02-10 22:11:42 -03:00
Chris Cromer a79709e1ac allow user to change their password 2023-02-09 23:50:39 -03:00
Martin Araneda e9d63a63d0 Change password dialog layout finished 2023-02-09 23:38:39 -03:00
Chris Cromer 0f1bff66dc fix incorrect json variable name 2023-02-07 23:33:25 -03:00
Martin Araneda a15bcebbc7 OS and user crud done 2023-02-07 23:32:16 -03:00
Chris Cromer 9d23af5579 permanent delete rows 2023-02-06 22:42:07 -03:00
Martin Araneda 36f9f0183f minor fixes to login 2023-02-06 22:28:38 -03:00
Chris Cromer c56f3abf88 refactor the limit and offset code 2023-02-01 23:52:04 -03:00
Chris Cromer bb735afe33 add filters for each table 2023-02-01 23:52:04 -03:00
Chris Cromer dbad5ed64b separate the auth routes from the user routes 2023-02-01 23:52:03 -03:00
Chris Cromer 071ba0a986 add limits to list endpoints 2023-02-01 23:52:03 -03:00
Chris Cromer 41d5fc2d4b add update and delete endpoints to game controller and router 2023-02-01 23:52:03 -03:00
Chris Cromer 6ea3e89741 reorganize controllers 2023-02-01 23:52:03 -03:00
Chris Cromer e7bed8124c don't join the other tables, let the client ask the API in the other endpoints 2023-02-01 23:52:03 -03:00
Chris Cromer 3f931f5ef8 simplify the game controller 2023-02-01 23:52:03 -03:00
Chris Cromer 038eefa72a add object routes 2023-02-01 23:52:03 -03:00
Chris Cromer 4042e28939 add object state routes 2023-02-01 23:52:03 -03:00
Chris Cromer 162fbd0404 add object name routes 2023-02-01 23:52:03 -03:00
Chris Cromer 88af722686 add godot version routes 2023-02-01 23:52:03 -03:00
Chris Cromer 8f1f18de8b add frame routes 2023-02-01 23:52:03 -03:00
Chris Cromer 9ebce5f1d9 make game and user use the same structure for all of its endpoints 2023-02-01 23:52:03 -03:00
Chris Cromer e2f3a26c88 fix incorrect variable name 2023-02-01 23:52:03 -03:00
Chris Cromer 8caec6a46d protect the player endpoints behind authentication 2023-02-01 23:52:03 -03:00
Chris Cromer 48cd36d0a8 add level routes 2023-02-01 23:52:03 -03:00
Martin Araneda c17ac0f579 basic crud layout in progress 2023-02-01 23:51:02 -03:00
Chris Cromer ffb82c9db6 add vite preview port 2023-01-31 23:44:34 -03:00
Chris Cromer 2749da6df9 add cors allow methods and headers 2023-01-31 23:35:13 -03:00
Chris Cromer 1bd42249ce run the next middleware in the chain 2023-01-31 23:23:03 -03:00
Chris Cromer 0f3cbd6f05 add cors middleware 2023-01-31 23:12:05 -03:00
Chris Cromer b2000331ce fix player endpoints 2023-01-31 23:12:05 -03:00
Chris Cromer 69cc898fd7 add player routes 2023-01-31 23:12:05 -03:00
Martin Araneda 8e9288f7f1 Login finished 2023-01-31 23:10:19 -03:00
Chris Cromer 0726a31ad5 remove unused themes 2023-01-31 23:10:19 -03:00
Chris Cromer 9cc410006a gofmt format fixes 2023-01-31 23:10:19 -03:00
Chris Cromer 00b620f229 use json instead of form body 2023-01-31 23:10:19 -03:00
Chris Cromer 7c3e6e5809 extend the token lifetime 2023-01-31 23:10:18 -03:00
Chris Cromer 4d2e91e48c fix controllers used in OS routes 2023-01-31 23:10:18 -03:00
Chris Cromer 4d198eef62 add os routes and conterollers 2023-01-31 23:10:18 -03:00
Chris Cromer 99dc5515bc ignore the test coverage results 2023-01-31 23:10:18 -03:00
Chris Cromer a8a7cd99a5 remove unused images 2023-01-31 23:10:18 -03:00
Chris Cromer 81e32aad29 rename the env example file so it isn't hidden 2023-01-31 23:10:18 -03:00
Chris Cromer 4117e1faad ignore debug binary 2023-01-31 23:10:18 -03:00
Chris Cromer 505fce9848 improve http status responses and funcion names in game controller 2023-01-31 23:10:18 -03:00
Chris Cromer 489e5e60b9 improve user controller http responses and error checking 2023-01-31 23:10:18 -03:00
Chris Cromer b9b88eaf0e organize user routes 2023-01-31 23:10:18 -03:00
Chris Cromer c4880480ec update dependency versions 2023-01-31 23:10:18 -03:00
Martin Araneda 8626368af2 Login page finished 2023-01-30 21:32:32 -03:00
Martin Araneda d82eb440e8 basic chart menu finished 2023-01-30 12:48:37 -03:00
9 changed files with 32 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -7,6 +7,8 @@ import axios from 'axios';
import jwt_decode from 'jwt-decode';
import auth from '../utils/Auth';
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
const { onMenuToggle } = useLayout();
const outsideClickListener = ref(null);
const topbarMenuActive = ref(false);
@ -69,7 +71,7 @@ async function savePassword(pass) {
var token = localStorage.getItem("token");
var decoded = jwt_decode(token);
try {
const response = await axios.patch(`http://localhost:3001/user/` + decoded.id, pass, auth.getTokenHeader());
const response = await axios.patch(api + `/user/` + decoded.id, pass, auth.getTokenHeader());
if (response.status !== 204) {
console.error(response);
}

View File

@ -13,7 +13,7 @@ var auth = {
},
checkToken(redirect = true, callback = null) {
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
const config = this.getTokenHeader();

View File

@ -24,10 +24,13 @@ const setColorOptions = () => {
textColorSecondary = documentStyle.getPropertyValue('--text-color-secondary');
surfaceBorder = documentStyle.getPropertyValue('--surface-border');
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function getGames() {
try {
const response = await axios.get(`http://localhost:3001/game?limit=5000`);
const response = await axios.get(api + `/game?limit=5000`);
games.value = response.data.map(game_id => {
return game_id.ID;
});
@ -42,7 +45,7 @@ async function getFrames() {
if (selectedGame.value === undefined) {
return;
}
const response = await axios.get(`http://localhost:3001/frame?limit=5000&game_id=` + selectedGame.value);
const response = await axios.get(api + `/frame?limit=5000&game_id=` + selectedGame.value);
if (response.data[response.data.length - 1].elapsed_time >= 10000) {
ms.value = false;
}

View File

@ -41,12 +41,6 @@ const onClickLinux = () => {
<span>Features</span>
</a>
</li>
<li>
<a @click="smoothScroll('#moreinfo')"
class="flex m-0 md:ml-5 px-0 py-3 text-900 font-medium line-height-3 p-ripple" v-ripple>
<span>More info</span>
</a>
</li>
<li>
<a @click="smoothScroll('#downloads')"
class="flex m-0 md:ml-5 px-0 py-3 text-900 font-medium line-height-3 p-ripple" v-ripple>
@ -88,7 +82,7 @@ const onClickLinux = () => {
<div class="grid mt-8 pb-2 md:pb-8">
<div class="flex justify-content-center col-12 lg:col-6 p-0 flex-order-1 lg:flex-order-0"
style="border-radius: 8px">
<img src="public/images/alai.png" class="w-11" alt="alai screenshot" />
<img src="@/assets/images/alai.png" class="w-11" alt="alai screenshot" />
</div>
<div class="col-12 lg:col-6 my-auto flex flex-column lg:align-items-end text-center lg:text-right">
@ -118,7 +112,7 @@ const onClickLinux = () => {
<div class="flex align-items-center justify-content-end flex-order-1 sm:flex-order-2 col-12 lg:col-6 p-0"
style="border-radius: 8px">
<img src="public/images/obelisk.jpg" class="flex w-11" alt="obelisk" width="100" height="100" />
<img src="@/assets/images/obelisk.jpg" class="flex w-11" alt="obelisk" width="100" height="100" />
</div>
</div>
</div>

View File

@ -7,6 +7,8 @@ const username = ref('');
const password = ref('');
const router = useRouter();
const toast = useToast();
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function onLoginClick() {
var login =
@ -15,7 +17,7 @@ async function onLoginClick() {
password: password.value
};
try {
const response = await axios.post(`http://localhost:3001/login`, login);
const response = await axios.post(api + `/login`, login);
if (response.status === 200) {
localStorage.setItem('token', response.data.token);
router.push('/home');

View File

@ -19,10 +19,12 @@ const submitted = ref(false);
const checkAuth = () => {
auth.checkToken(true);
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function showTable() {
try {
const response = await axios.get(`http://localhost:3001/os`);
const response = await axios.get(api + `/os`);
console.log(response.data);
users.value = response.data;
}
@ -41,7 +43,7 @@ async function onCreateClick() {
name: os.value.name
};
try {
const response = await axios.post(`http://localhost:3001/os`, newOS, auth.getTokenHeader());
const response = await axios.post(api + `/os`, newOS, auth.getTokenHeader());
if (response.status === 204) {
toast.add({ severity: 'success', summary: 'Successful', detail: 'OS Created', life: 3000 });
@ -94,7 +96,7 @@ async function onChangeOS() {
};
console.log(os.value.ID);
try {
const response = await axios.patch(`http://localhost:3001/os/` + os.value.ID, changeOS, auth.getTokenHeader());
const response = await axios.patch(api + `/os/` + os.value.ID, changeOS, auth.getTokenHeader());
if (response.status === 204) {
toast.add({ severity: 'success', summary: 'Successful', detail: 'OS Modified', life: 3000 });
@ -117,7 +119,7 @@ const confirmDeleteUser = (editUser) => {
async function deleteUser() {
try {
const response = await axios.delete(`http://localhost:3001/os/` + os.value.ID, auth.getTokenHeader());
const response = await axios.delete(api + `/os/` + os.value.ID, auth.getTokenHeader());
if (response.status !== 204) {
console.error(response);
}
@ -139,7 +141,7 @@ const confirmDeleteSelected = () => {
const deleteSelectedUsers = () => {
selectedUsers.value.forEach(element => {
try {
const response = axios.delete(`http://localhost:3001/os/` + element.ID, auth.getTokenHeader());
const response = axios.delete(api + `/os/` + element.ID, auth.getTokenHeader());
if (response.status !== 204) {
console.error(response);
}
@ -173,8 +175,8 @@ const initFilters = () => {
<template v-slot:start>
<div class="my-2">
<Button label="New" icon="pi pi-plus" class="p-button-success mr-2" @click="openNew" />
<Button label="Delete" icon="pi pi-trash" class="p-button-danger"
@click="confirmDeleteSelected" :disabled="!selectedUsers || !selectedUsers.length" />
<Button label="Delete" icon="pi pi-trash" class="p-button-danger" @click="confirmDeleteSelected"
:disabled="!selectedUsers || !selectedUsers.length" />
</div>
</template>
@ -185,8 +187,7 @@ const initFilters = () => {
:rows="10" :filters="filters"
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown"
:rowsPerPageOptions="[5, 10, 25]"
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} users"
responsiveLayout="scroll">
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} users" responsiveLayout="scroll">
<template #header>
<div class="flex flex-column md:flex-row md:justify-content-between md:align-items-center">
<h5 class="m-0">Manage Users</h5>
@ -258,8 +259,7 @@ const initFilters = () => {
<span v-if="os">Are you sure you want to delete the selected users?</span>
</div>
<template #footer>
<Button label="No" icon="pi pi-times" class="p-button-text"
@click="deleteUsersDialog = false" />
<Button label="No" icon="pi pi-times" class="p-button-text" @click="deleteUsersDialog = false" />
<Button label="Yes" icon="pi pi-check" class="p-button-text" @click="deleteSelectedUsers" />
</template>
</Dialog>

View File

@ -19,10 +19,12 @@ const userDialogChange = ref(false);
const checkAuth = () => {
auth.checkToken(true);
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function showTable() {
try {
const response = await axios.get(`http://localhost:3001/user`, auth.getTokenHeader());
const response = await axios.get(api + `/user`, auth.getTokenHeader());
users.value = response.data;
}
catch (error) {
@ -48,7 +50,7 @@ async function onCreateClick() {
email: user.value.email
};
try {
const response = await axios.post(`http://localhost:3001/user`, newUser, auth.getTokenHeader());
const response = await axios.post(api + `/user`, newUser, auth.getTokenHeader());
if (response.status === 204) {
toast.add({ severity: 'success', summary: 'Successful', detail: 'User Created', life: 3000 });
@ -104,7 +106,7 @@ async function onChangeUser() {
email: user.value.email
};
try {
const response = await axios.patch(`http://localhost:3001/user/` + user.value.ID, changeUser, auth.getTokenHeader());
const response = await axios.patch(api + `/user/` + user.value.ID, changeUser, auth.getTokenHeader());
if (response.status === 204) {
toast.add({ severity: 'success', summary: 'Successful', detail: 'User Modified', life: 3000 });
@ -127,7 +129,7 @@ const confirmDeleteUser = (editUser) => {
async function deleteUser() {
try {
const response = await axios.delete(`http://localhost:3001/user/` + user.value.ID, auth.getTokenHeader());
const response = await axios.delete(api + `/user/` + user.value.ID, auth.getTokenHeader());
if (response.status !== 204) {
console.error(response);
}
@ -149,7 +151,7 @@ const confirmDeleteSelected = () => {
const deleteSelectedUsers = () => {
selectedUsers.value.forEach(element => {
try {
const response = axios.delete(`http://localhost:3001/user/` + element.ID, auth.getTokenHeader());
const response = axios.delete(api + `/user/` + element.ID, auth.getTokenHeader());
if (response.status !== 204) {
console.error(response);
}