refactor(dashboard): re-organize dashboard files

This commit is contained in:
Jake Fulmine 2022-11-26 13:23:59 +01:00
parent e0cde35b3d
commit 1b3f188997
41 changed files with 165 additions and 166 deletions

View File

@ -1,21 +1,21 @@
<script lang="ts">
import { Router, Route } from "svelte-navigator";
import Navigation from "./lib/Navigation.svelte";
import Dash from "./pages/Dash.svelte";
import Home from "./pages/Home.svelte";
import Settings from './pages/Settings.svelte';
import Public from "./pages/Public.svelte";
import Main from "./pages/Profile.svelte";
import Status from './pages/status.svelte';
import Member from './pages/Member.svelte';
import Group from './pages/Group.svelte';
import PageNotFound from './pages/PageNotFound.svelte';
import Navigation from "./components/common/Navigation.svelte";
import Dash from "./routes/dash/Dash.svelte";
import Home from "./routes/Home.svelte";
import Settings from './routes/settings/Settings.svelte';
import Public from "./routes/Public.svelte";
import Main from "./routes/dash/Profile.svelte";
import Status from './routes/status/Status.svelte';
import Member from './routes/dash/Member/Member.svelte';
import Group from './routes/dash/Group/Group.svelte';
import PageNotFound from './routes/PageNotFound.svelte';
import { Alert } from 'sveltestrap';
import DiscordLogin from "./pages/DiscordLogin.svelte";
import DiscordLogin from "./routes/DiscordLogin.svelte";
import { onMount } from 'svelte';
import BulkGroupPrivacy from "./pages/BulkGroupPrivacy.svelte";
import BulkMemberPrivacy from "./pages/BulkMemberPrivacy.svelte";
import Random from './pages/Random.svelte';
import BulkGroupPrivacy from "./routes/dash/System/BulkGroupPrivacy.svelte";
import BulkMemberPrivacy from "./routes/dash/System/BulkMemberPrivacy.svelte";
import Random from './routes/dash/Random.svelte';
// theme cdns (I might make some myself too)
// if there's a style already set, retrieve it

View File

@ -1,8 +1,8 @@
<script lang="ts">
import { tick } from 'svelte';
import { Modal, CardHeader, CardTitle, Image, Spinner } from 'sveltestrap';
import default_avatar from '../assets/default_avatar.png';
import resizeMedia from '../api/resize-media';
import { Modal, CardTitle} from 'sveltestrap';
import default_avatar from '../../assets/default_avatar.png';
import resizeMedia from '../../api/resize-media';
import { toHTML } from 'discord-markdown';
import twemoji from 'twemoji';

View File

@ -1,8 +1,7 @@
<script lang="ts">
import {Navbar, NavbarBrand, Nav, NavItem, NavLink, Collapse, NavbarToggler, Dropdown, DropdownItem, DropdownMenu, DropdownToggle, Button} from 'sveltestrap';
import { loggedIn } from '../stores';
import { loggedIn } from '../../stores';
import { Link, navigate } from 'svelte-navigator';
import { get } from 'svelte/store';
export let style: string;

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Row, Col, Button, Alert, ListGroup, ListGroupItem, Spinner } from 'sveltestrap';
import ListPagination from "../ListPagination.svelte";
import ListPagination from "../common/ListPagination.svelte";
import twemoji from "twemoji";
import FaUserPlus from 'svelte-icons/fa/FaUserPlus.svelte'
import FaUserFriends from 'svelte-icons/fa/FaUserFriends.svelte'

View File

@ -5,7 +5,7 @@
import NewMember from '../member/NewMember.svelte';
import NewGroup from '../group/NewGroup.svelte';
import ListPagination from '../ListPagination.svelte';
import ListPagination from '../common/ListPagination.svelte';
import ListControl from './ListControl.svelte';
import ListSearch from './ListSearch.svelte';
import ListView from './ListView.svelte';

View File

@ -9,7 +9,7 @@
import MemberBody from '../member/Body.svelte';
import GroupBody from '../group/Body.svelte';
import CardsHeader from '../CardsHeader.svelte';
import CardsHeader from '../common/CardsHeader.svelte';
let settings = JSON.parse(localStorage.getItem("pk-settings"));

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Row, Col, Button, Alert, ListGroup, ListGroupItem, Spinner } from 'sveltestrap';
import ListPagination from "../ListPagination.svelte";
import ListPagination from "../common/ListPagination.svelte";
import twemoji from "twemoji";
import Svelecte, { addFormatter } from 'svelecte';
import { toHTML } from 'discord-markdown';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { Card, CardBody, CardHeader, Tooltip } from 'sveltestrap';
import FaAddressCard from 'svelte-icons/fa/FaAddressCard.svelte'
import CardsHeader from '../CardsHeader.svelte';
import CardsHeader from '../common/CardsHeader.svelte';
import Body from './Body.svelte';
import Privacy from './Privacy.svelte';
import Edit from './Edit.svelte';

View File

@ -1,13 +1,13 @@
<script lang="ts">
import { Container, Col, Row, TabContent, TabPane } from 'sveltestrap';
import { navigate, useLocation } from "svelte-navigator";
import { currentUser, loggedIn } from '../stores';
import { currentUser, loggedIn } from '../../stores';
import SystemMain from '../lib/system/Main.svelte';
import List from '../lib/list/List.svelte';
import SystemMain from '../../components/system/Main.svelte';
import List from '../../components/list/List.svelte';
import { System } from '../api/types';
import api from '../api';
import { System } from '../../api/types';
import api from '../../api';
// get the state from the navigator so that we know which tab to start on
let location = useLocation();

View File

@ -1,16 +1,16 @@
<script lang="ts">
import { Container, Row, Col, Alert, Spinner, Card, CardHeader, CardBody, CardTitle, Tooltip } from "sveltestrap";
import Body from '../lib/group/Body.svelte';
import Body from '../../../components/group/Body.svelte';
import { useParams, Link, navigate, useLocation } from 'svelte-navigator';
import { onMount } from 'svelte';
import api from "../api";
import { Member, Group } from "../api/types";
import CardsHeader from "../lib/CardsHeader.svelte";
import api from "../../../api";
import { Member, Group } from "../../../api/types";
import CardsHeader from "../../../components/common/CardsHeader.svelte";
import FaUsers from 'svelte-icons/fa/FaUsers.svelte';
import FaList from 'svelte-icons/fa/FaList.svelte';
import ListPagination from '../lib/ListPagination.svelte';
import ListView from '../lib/list/ListView.svelte';
import CardView from '../lib/list/CardView.svelte';
import ListPagination from '../../../components/common/ListPagination.svelte';
import ListView from '../../../components/list/ListView.svelte';
import CardView from '../../../components/list/CardView.svelte';
// get the state from the navigator so that we know which tab to start on
let location = useLocation();

View File

@ -1,16 +1,16 @@
<script lang="ts">
import { Container, Row, Col, Alert, Spinner, Card, CardHeader, CardBody, CardTitle, Tooltip } from "sveltestrap";
import Body from '../lib/member/Body.svelte';
import ListView from '../lib/list/ListView.svelte';
import Body from '../../../components/member/Body.svelte';
import ListView from '../../../components/list/ListView.svelte';
import { useParams, Link, navigate, useLocation } from 'svelte-navigator';
import { onMount } from 'svelte';
import api from "../api";
import { Member, Group } from "../api/types";
import CardsHeader from "../lib/CardsHeader.svelte";
import api from "../../../api";
import { Member, Group } from "../../../api/types";
import CardsHeader from "../../../components/common/CardsHeader.svelte";
import FaAddressCard from 'svelte-icons/fa/FaAddressCard.svelte'
import FaList from 'svelte-icons/fa/FaList.svelte'
import ListPagination from '../lib/ListPagination.svelte';
import CardView from '../lib/list/CardView.svelte';
import ListPagination from '../../../components/common/ListPagination.svelte';
import CardView from '../../../components/list/CardView.svelte';
// get the state from the navigator so that we know which tab to start on
let location = useLocation();

View File

@ -3,11 +3,11 @@
import { useParams, useLocation, navigate } from "svelte-navigator";
import { onMount } from 'svelte';
import SystemMain from '../lib/system/Main.svelte';
import List from '../lib/list/List.svelte';
import SystemMain from '../../components/system/Main.svelte';
import List from '../../components/list/List.svelte';
import { System } from '../api/types';
import api from '../api';
import { System } from '../../api/types';
import api from '../../api';
let user: System = {};
let settings = JSON.parse(localStorage.getItem("pk-settings"));

View File

@ -4,9 +4,9 @@
import { Alert, Col, Container, Row, Card, CardBody, CardHeader, CardTitle, Input, Label, Button, Accordion, AccordionHeader, AccordionItem } from 'sveltestrap';
import FaRandom from 'svelte-icons/fa/FaRandom.svelte'
import CardsList from '../lib/list/ListView.svelte';
import api from '../api';
import { Group, Member } from '../api/types';
import CardsList from '../../components/list/ListView.svelte';
import api from '../../api';
import { Group, Member } from '../../api/types';
export let isPublic: boolean = false;
export let type: string = "member";

View File

@ -3,8 +3,8 @@
import { navigate } from 'svelte-navigator';
import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
import api from '../api';
import { GroupPrivacy, System } from '../api/types';
import api from '../../../api';
import { GroupPrivacy, System } from '../../../api/types';
const user: System = JSON.parse(localStorage.getItem("pk-user"));
if (!user) navigate('/');

View File

@ -3,8 +3,8 @@
import { navigate } from 'svelte-navigator';
import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
import api from '../api';
import { MemberPrivacy, System } from '../api/types';
import api from '../../../api';
import { MemberPrivacy, System } from '../../../api/types';
const user: System = JSON.parse(localStorage.getItem("pk-user"));
if (!user) navigate('/');

View File

@ -3,8 +3,8 @@
import Toggle from 'svelte-toggle';
import { autoresize } from 'svelte-textarea-autoresize';
import FaCogs from 'svelte-icons/fa/FaCogs.svelte'
import { Config } from '../api/types';
import api from '../api';
import { Config } from '../../api/types';
import api from '../../api';
let savedSettings = JSON.parse(localStorage.getItem("pk-settings"));
let apiConfig: Config = JSON.parse(localStorage.getItem("pk-config"));

View File

@ -1,9 +1,9 @@
<script lang="ts">
import { Container, Row, Col, Card, CardHeader, CardTitle, CardBody, Input, Button } from 'sveltestrap';
import FaInfoCircle from 'svelte-icons/fa/FaInfoCircle.svelte'
import ShardItem from '../lib/shard.svelte';
import ShardItem from '../../components/status/Shard.svelte';
import api from '../api';
import api from '../../api';
let message = "Loading...";
let shards = [];