Skip to content

Commit

Permalink
Remove auth frame (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Sep 18, 2024
1 parent 3ec591a commit b3940e9
Show file tree
Hide file tree
Showing 28 changed files with 173 additions and 642 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// url: "https://cdn.dos.zone/custom/dos/QB45.jsdos", // qbasic
// url: decodeURIComponent("https%3A%2F%2Fcdn.dos.zone%2Fcustom%2Fdos%2Fdoom_dm.jsdos"),
// url: decodeURIComponent("https%3A%2F%2Fcdn.dos.zone%2Fcustom%2Fdos%2Fhomm2_netbios.jsdos"),
// url: "https://cdn.dos.zone/original/2X/2/24b00b14f118580763440ecaddcc948f8cb94f14.jsdos", // digger
url: "https://cdn.dos.zone/original/2X/2/24b00b14f118580763440ecaddcc948f8cb94f14.jsdos", // digger
// url: "https://cdn.dos.zone/custom/dos/doom.jsdos",
// url: "https://cdn.dos.zone/custom/dos/duke3d_ipx.jsdos",
// url: "https://br.cdn.dos.zone/ipx/duke3d/duke3d_ipx.jsdos",
Expand Down
182 changes: 0 additions & 182 deletions src/frame/account-frame.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/frame/editor/editor-conf-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export function EditorConf() {
const [myDrives, setMyDrives] = useState<{ name: string, owner: string }[]>([]);

useEffect(() => {
if (!account || !account.token) {
if (!account) {
setMyDrives([]);
} else {
fetch(sockdriveEndpoint + "/list/drives/" + account.token.access_token)
fetch(sockdriveEndpoint + "/list/drives/" + account.token)
.then((r) => r.json())
.then(setMyDrives)
.catch(console.error);
Expand Down
6 changes: 3 additions & 3 deletions src/frame/fat-drives-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function FatDrivesFrame() {
setBusy(false);
} else {
setBusy(true);
fetch(sockdriveEndpoint + "/list/drives/" + account.token.access_token)
fetch(sockdriveEndpoint + "/list/drives/" + account.token)
.then((r) => r.json())
.then((drives: Drive[]) => {
setMyDrives(drives.sort((a, b) => a.name.localeCompare(b.name)));
Expand Down Expand Up @@ -179,7 +179,7 @@ export function FatDrivesFrame() {
setDialogIndex(-1);
setBusy(true);
// eslint-disable-next-line max-len
fetch(`${sockdriveEndpoint}/fork/drive/${myDrives[dialogIndex].owner}/${myDrives[dialogIndex].name}/${forkName}/${account.token.access_token}`, {
fetch(`${sockdriveEndpoint}/fork/drive/${myDrives[dialogIndex].owner}/${myDrives[dialogIndex].name}/${forkName}/${account.token}`, {
method: "POST",
})
.then((r) => r.json())
Expand Down Expand Up @@ -220,7 +220,7 @@ export function FatDrivesFrame() {
setDialogIndex(-1);
setBusy(true);
// eslint-disable-next-line max-len
fetch(`${sockdriveEndpoint}/fork/delete/${myDrives[dialogIndex].owner}/${myDrives[dialogIndex].name}/${account.token.access_token}`, { method: "POST" })
fetch(`${sockdriveEndpoint}/fork/delete/${myDrives[dialogIndex].owner}/${myDrives[dialogIndex].name}/${account.token}`, { method: "POST" })
.then((r) => r.json())
.then((response) => {
if (response.error) {
Expand Down
11 changes: 0 additions & 11 deletions src/frame/frame.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@
}
}

.account-frame {
@apply px-6 mt-4;
.account-img {
@apply w-24 h-24 my-8 rounded-full;
}

.account-email {
@apply text-xs mt-4;
}
}

.network-frame {
@apply w-full;

Expand Down
2 changes: 0 additions & 2 deletions src/frame/frame.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useSelector } from "react-redux";
import { State } from "../store";
import { AccountFrame } from "./account-frame";
import { EditorConf } from "./editor/editor-conf-frame";
import { EditorFsFrame } from "./editor/editor-fs-frame";
import { FatDrivesFrame } from "./fat-drives-frame";
Expand All @@ -20,7 +19,6 @@ export function Frame(props: {}) {

return <div class={"frame " + (frameXs ? " frame-xs " : "") +
(frameXs || wideScreen ? "" : " frame-md")}>
{ frame === "account" && <AccountFrame /> }
{ frame === "settings" && <SettingsFrame /> }
{ frame === "editor-conf" && <EditorConf /> }
{ frame === "editor-fs" && <EditorFsFrame /> }
Expand Down
16 changes: 10 additions & 6 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { State } from "./store";

const translations: {[lang: string]: {[key: string]: string} } = {
ru: {
hello: "Привет",
hello_guest: "Привет, гость!",
mobile_controls: "Моибльное управление",
mirrored_controls: "Отразить управление",
scale_controls: "Масштаб управления",
Expand Down Expand Up @@ -62,7 +64,6 @@ const translations: {[lang: string]: {[key: string]: string} } = {
editor: "Редактор",
download: "Скачать",
changes: "Сохранения",
account_not_ready: "Пропустить загрузку сохранений",
loading_saves: "Загрузка сохранений",
success: "Успешно",
success_save: "Сохранено в облаке",
Expand All @@ -84,10 +85,13 @@ const translations: {[lang: string]: {[key: string]: string} } = {
fat_write: "FAT запись",
play: "Запустить",
system_cursor: "Системный курсор",
no_cloud_access: "Войдите что бы использовать",
cloud_storage: "облачное хранилище",
no_cloud_access: "Введите",
no_cloud_access2: "что бы использовать облачное хранилище",
key: "Ваш ключ",
},
en: {
hello: "Hello",
hello_guest: "Hello, guest!",
play: "Start",
system_cursor: "System cursor",
mobile_controls: "Mobile controls",
Expand Down Expand Up @@ -148,7 +152,6 @@ const translations: {[lang: string]: {[key: string]: string} } = {
editor: "Editor",
download: "Download",
changes: "Saves",
account_not_ready: "Skip loading saves",
loading_saves: "Loading saves",
success: "Success",
success_save: "Saved in cloud",
Expand All @@ -168,8 +171,9 @@ const translations: {[lang: string]: {[key: string]: string} } = {
hardware: "Hardware acceleration",
net_drives: "Net drives",
fat_write: "Writeable FAT",
no_cloud_access: "Please login to use",
cloud_storage: "cloud storage",
no_cloud_access: "Please enter",
no_cloud_access2: "to use cloud storage",
key: "your key",
},
};

Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@import "./app.css";
@import "./components/components.css";
@import "./sidebar/sidebar.css";
@import "./login/login.css";
@import "./window/window.css";
@import "./frame/frame.css";
@import "./layers/layers.css";
9 changes: 0 additions & 9 deletions src/login/login.css

This file was deleted.

Loading

0 comments on commit b3940e9

Please sign in to comment.