diff --git a/resources/assets/scripts/api/http.ts b/resources/assets/scripts/api/http.ts deleted file mode 100644 index 6648a63db..000000000 --- a/resources/assets/scripts/api/http.ts +++ /dev/null @@ -1,55 +0,0 @@ -import axios, {AxiosError, AxiosInstance} from 'axios'; -import {ServerApplicationCredentials} from "@/store/types"; - -// This token is set in the bootstrap.js file at the beginning of the request -// and is carried through from there. -// const token: string = ''; - -const http: AxiosInstance = axios.create({ - headers: { - 'X-Requested-With': 'XMLHttpRequest', - 'Accept': 'application/json', - 'Content-Type': 'application/json', - }, -}); - -// If we have a phpdebugbar instance registered at this point in time go -// ahead and route the response data through to it so things show up. -// @ts-ignore -if (typeof window.phpdebugbar !== 'undefined') { - http.interceptors.response.use(response => { - // @ts-ignore - window.phpdebugbar.ajaxHandler.handle(response.request); - - return response; - }); -} - -export default http; - -/** - * Creates a request object for the node that uses the server UUID and connection - * credentials. Basically just a tiny wrapper to set this quickly. - */ -export function withCredentials(server: string, credentials: ServerApplicationCredentials): AxiosInstance { - http.defaults.baseURL = credentials.node; - http.defaults.headers['X-Access-Server'] = server; - http.defaults.headers['X-Access-Token'] = credentials.key; - - return http; -} - -/** - * Converts an error into a human readable response. Mostly just a generic helper to - * make sure we display the message from the server back to the user if we can. - */ -export function httpErrorToHuman(error: any): string { - if (error.response && error.response.data) { - const { data } = error.response; - if (data.errors && data.errors[0] && data.errors[0].detail) { - return data.errors[0].detail; - } - } - - return error.message; -} diff --git a/resources/assets/scripts/api/server/createDatabase.ts b/resources/assets/scripts/api/server/createDatabase.ts deleted file mode 100644 index 927a328b8..000000000 --- a/resources/assets/scripts/api/server/createDatabase.ts +++ /dev/null @@ -1,30 +0,0 @@ -import http from '@/api/http'; -// @ts-ignore -import route from '../../../../../vendor/tightenco/ziggy/src/js/route'; -import {AxiosError} from "axios"; -import {ServerDatabase} from "@/api/server/types"; - -/** - * Creates a new database on the system for the currently active server. - */ -export function createDatabase(server: string, database: string, remote: string): Promise { - return new Promise((resolve, reject) => { - http.post(route('api.client.servers.databases', {server}), {database, remote}) - .then(response => { - const copy: any = response.data.attributes; - copy.password = copy.relationships.password.attributes.password; - copy.showPassword = false; - - delete copy.relationships; - - resolve(copy); - }) - .catch((err: AxiosError) => { - if (err.response && err.response.data && Array.isArray(err.response.data.errors)) { - return reject(err.response.data.errors[0].detail); - } - - return reject(err); - }); - }); -} diff --git a/resources/assets/scripts/api/server/files/copyFile.ts b/resources/assets/scripts/api/server/files/copyFile.ts deleted file mode 100644 index ab13d53b0..000000000 --- a/resources/assets/scripts/api/server/files/copyFile.ts +++ /dev/null @@ -1,13 +0,0 @@ -import http from "@/api/http"; - -/** - * Creates a copy of the given file or directory on the Daemon. Expects a fully resolved path - * to be passed through for both data arguments. - */ -export function copyFile(server: string, location: string): Promise { - return new Promise((resolve, reject) => { - http.post(`/api/client/servers/${server}/files/copy`, {location}) - .then(() => resolve()) - .catch(reject); - }); -} diff --git a/resources/assets/scripts/api/server/files/createFolder.ts b/resources/assets/scripts/api/server/files/createFolder.ts deleted file mode 100644 index 91c85e12c..000000000 --- a/resources/assets/scripts/api/server/files/createFolder.ts +++ /dev/null @@ -1,14 +0,0 @@ -import http from "@/api/http"; - -/** - * Connects to the remote daemon and creates a new folder on the server. - */ -export function createFolder(server: string, directory: string, name: string): Promise { - return new Promise((resolve, reject) => { - http.post(`/api/client/servers/${server}/files/create-folder`, { - directory, name, - }) - .then(() => resolve()) - .catch(reject); - }); -} diff --git a/resources/assets/scripts/api/server/files/deleteFile.ts b/resources/assets/scripts/api/server/files/deleteFile.ts deleted file mode 100644 index f7e9ef927..000000000 --- a/resources/assets/scripts/api/server/files/deleteFile.ts +++ /dev/null @@ -1,13 +0,0 @@ -import http from "@/api/http"; - -/** - * Deletes files and/or folders from the server. You should pass through an array of - * file or folder paths to be deleted. - */ -export function deleteFile(server: string, location: string): Promise { - return new Promise((resolve, reject) => { - http.post(`/api/client/servers/${server}/files/delete`, {location}) - .then(() => resolve()) - .catch(reject); - }) -} diff --git a/resources/assets/scripts/api/server/files/getDownloadToken.ts b/resources/assets/scripts/api/server/files/getDownloadToken.ts deleted file mode 100644 index 4e784195d..000000000 --- a/resources/assets/scripts/api/server/files/getDownloadToken.ts +++ /dev/null @@ -1,14 +0,0 @@ -import http from "@/api/http"; -// @ts-ignore -import route from '../../../../../../vendor/tightenco/ziggy/src/js/route'; - -/** - * Gets a download token for a file on the server. - */ -export function getDownloadToken(server: string, file: string): Promise { - return new Promise((resolve, reject) => { - http.post(route('api.client.servers.files.download', { server, file })) - .then(response => resolve(response.data ? response.data.token || null : null)) - .catch(reject); - }); -} diff --git a/resources/assets/scripts/api/server/files/getFileContents.ts b/resources/assets/scripts/api/server/files/getFileContents.ts deleted file mode 100644 index f3a1f3d36..000000000 --- a/resources/assets/scripts/api/server/files/getFileContents.ts +++ /dev/null @@ -1,20 +0,0 @@ -import http from "@/api/http"; -import {AxiosError} from "axios"; - -export default (server: string, file: string): Promise => { - return new Promise((resolve, reject) => { - http.get(`/api/client/servers/${server}/files/contents`, { - params: { file }, - responseType: 'text', - transformResponse: res => res, - }) - .then(response => resolve(response.data || '')) - .catch((error: AxiosError) => { - if (error.response && error.response.data) { - error.response.data = JSON.parse(error.response.data); - } - - reject(error); - }); - }); -} diff --git a/resources/assets/scripts/api/server/files/renameFile.ts b/resources/assets/scripts/api/server/files/renameFile.ts deleted file mode 100644 index 75c9c3026..000000000 --- a/resources/assets/scripts/api/server/files/renameFile.ts +++ /dev/null @@ -1,12 +0,0 @@ -import http from "@/api/http"; - -export function renameFile(server: string, renameFrom: string, renameTo: string): Promise { - return new Promise((resolve, reject) => { - http.put(`/api/client/servers/${server}/files/rename`, { - rename_from: renameFrom, - rename_to: renameTo, - }) - .then(() => resolve()) - .catch(reject); - }); -} diff --git a/resources/assets/scripts/api/server/files/writeFileContents.ts b/resources/assets/scripts/api/server/files/writeFileContents.ts deleted file mode 100644 index 065c4a8db..000000000 --- a/resources/assets/scripts/api/server/files/writeFileContents.ts +++ /dev/null @@ -1,14 +0,0 @@ -import http from "@/api/http"; - -export default (server: string, file: string, content: string): Promise => { - return new Promise((resolve, reject) => { - http.post(`/api/client/servers/${server}/files/write`, content, { - params: { file }, - headers: { - 'Content-Type': 'text/plain; charset=utf-8', - }, - }) - .then(() => resolve()) - .catch(reject); - }); -} diff --git a/resources/assets/scripts/api/server/getDirectoryContents.ts b/resources/assets/scripts/api/server/getDirectoryContents.ts deleted file mode 100644 index 6138fd62f..000000000 --- a/resources/assets/scripts/api/server/getDirectoryContents.ts +++ /dev/null @@ -1,40 +0,0 @@ -import http from '../http'; -import {filter, isObject} from 'lodash'; -import {DirectoryContentObject, DirectoryContents} from "./types"; - -/** - * Get the contents of a specific directory for a given server. - */ -export function getDirectoryContents(server: string, directory: string): Promise { - return new Promise((resolve, reject) => { - http.get(`/api/client/servers/${server}/files/list`, { - params: {directory} - }) - .then((response) => { - return resolve({ - files: filter(response.data.contents, function (o: DirectoryContentObject) { - return o.file; - }), - directories: filter(response.data.contents, function (o: DirectoryContentObject) { - return o.directory; - }), - editable: response.data.editable, - }); - }) - .catch(err => { - if (err.response && err.response.status === 404) { - return reject('The directory you requested could not be located on the server'); - } - - if (err.response.data && isObject(err.response.data.errors)) { - err.response.data.errors.forEach((error: any) => { - return reject(error.detail); - }); - } - - return reject(err); - }); - }); -} - -export default getDirectoryContents; diff --git a/resources/assets/scripts/api/server/types.ts b/resources/assets/scripts/api/server/types.ts deleted file mode 100644 index 300153897..000000000 --- a/resources/assets/scripts/api/server/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -export type DirectoryContents = { - files: Array, - directories: Array, - editable: Array -} - -export type DirectoryContentObject = { - name: string, - created: string, - modified: string, - mode: string, - size: number, - directory: boolean, - file: boolean, - symlink: boolean, - mime: string, -} - -export type ServerDatabase = { - id: string, - name: string, - connections_from: string, - username: string, - host: { - address: string, - port: number, - }, - password: string, - showPassword: boolean, -} diff --git a/resources/assets/scripts/app.ts b/resources/assets/scripts/app.ts deleted file mode 100644 index 147e312d5..000000000 --- a/resources/assets/scripts/app.ts +++ /dev/null @@ -1,41 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import VueI18n from 'vue-i18n'; -import VueRouter from 'vue-router'; -import VeeValidate from 'vee-validate'; -// Helpers -// @ts-ignore -import {Ziggy} from './helpers/ziggy'; -// @ts-ignore -import Locales from './../../../resources/lang/locales'; - -import {FlashMixin} from './mixins/flash'; -import store from './store/index'; -import router from './router'; - -Vue.config.productionTip = false; -require('./bootstrap'); - -window.events = new Vue(); -window.Ziggy = Ziggy; - -Vue.use(Vuex); -Vue.use(VueRouter); -Vue.use(VeeValidate); -Vue.use(VueI18n); - -const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default; - -Vue.mixin({methods: {route}}); -Vue.mixin(FlashMixin); - -const i18n = new VueI18n({ - locale: 'en', - messages: {...Locales}, -}); - -if (module.hot) { - module.hot.accept(); -} - -new Vue({store, router, i18n}).$mount('#pterodactyl'); diff --git a/resources/assets/scripts/bootstrap.ts b/resources/assets/scripts/bootstrap.ts deleted file mode 100644 index 905ad5faf..000000000 --- a/resources/assets/scripts/bootstrap.ts +++ /dev/null @@ -1,33 +0,0 @@ -import axios from './api/http'; - -window._ = require('lodash'); - -/** - * We'll load jQuery and the Bootstrap jQuery plugin which provides support - * for JavaScript based Bootstrap features such as modals and tabs. This - * code may be modified to fit the specific needs of your application. - */ - -try { - window.$ = window.jQuery = require('jquery'); -} catch (e) { -} - -window.axios = axios; - -/** - * Next we will register the CSRF Token as a common header with Axios so that - * all outgoing HTTP requests automatically have it attached. This is just - * a simple convenience so we don't have to attach every token manually. - */ - -let token = document.head.querySelector('meta[name="csrf-token"]'); - -if (token) { - // @ts-ignore - window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; - // @ts-ignore - window.X_CSRF_TOKEN = token.content; -} else { - console.error('CSRF token not found in document.'); -} diff --git a/resources/assets/scripts/components/Flash.vue b/resources/assets/scripts/components/Flash.vue deleted file mode 100644 index fad2821e6..000000000 --- a/resources/assets/scripts/components/Flash.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/MessageBox.vue b/resources/assets/scripts/components/MessageBox.vue deleted file mode 100644 index 02a07aa22..000000000 --- a/resources/assets/scripts/components/MessageBox.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/auth/ForgotPassword.vue b/resources/assets/scripts/components/auth/ForgotPassword.vue deleted file mode 100644 index 8489c0ec1..000000000 --- a/resources/assets/scripts/components/auth/ForgotPassword.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/auth/Login.vue b/resources/assets/scripts/components/auth/Login.vue deleted file mode 100644 index 9ce85b1ee..000000000 --- a/resources/assets/scripts/components/auth/Login.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/auth/LoginForm.vue b/resources/assets/scripts/components/auth/LoginForm.vue deleted file mode 100644 index b021a3915..000000000 --- a/resources/assets/scripts/components/auth/LoginForm.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/auth/ResetPassword.vue b/resources/assets/scripts/components/auth/ResetPassword.vue deleted file mode 100644 index 4a41e3650..000000000 --- a/resources/assets/scripts/components/auth/ResetPassword.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/auth/TwoFactorForm.vue b/resources/assets/scripts/components/auth/TwoFactorForm.vue deleted file mode 100644 index 248235298..000000000 --- a/resources/assets/scripts/components/auth/TwoFactorForm.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/core/Icon.vue b/resources/assets/scripts/components/core/Icon.vue deleted file mode 100644 index 6b928d065..000000000 --- a/resources/assets/scripts/components/core/Icon.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/core/Modal.vue b/resources/assets/scripts/components/core/Modal.vue deleted file mode 100644 index eb1f5b283..000000000 --- a/resources/assets/scripts/components/core/Modal.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/core/Navigation.vue b/resources/assets/scripts/components/core/Navigation.vue deleted file mode 100644 index 0942afc98..000000000 --- a/resources/assets/scripts/components/core/Navigation.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/core/SpinnerModal.vue b/resources/assets/scripts/components/core/SpinnerModal.vue deleted file mode 100644 index 5c19115da..000000000 --- a/resources/assets/scripts/components/core/SpinnerModal.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/Account.vue b/resources/assets/scripts/components/dashboard/Account.vue deleted file mode 100644 index ed7486540..000000000 --- a/resources/assets/scripts/components/dashboard/Account.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/Dashboard.vue b/resources/assets/scripts/components/dashboard/Dashboard.vue deleted file mode 100644 index 3c1c174cb..000000000 --- a/resources/assets/scripts/components/dashboard/Dashboard.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/ServerBox.vue b/resources/assets/scripts/components/dashboard/ServerBox.vue deleted file mode 100644 index 5aeca1f42..000000000 --- a/resources/assets/scripts/components/dashboard/ServerBox.vue +++ /dev/null @@ -1,200 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/account/ChangePassword.vue b/resources/assets/scripts/components/dashboard/account/ChangePassword.vue deleted file mode 100644 index a544749a2..000000000 --- a/resources/assets/scripts/components/dashboard/account/ChangePassword.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/account/TwoFactorAuthentication.vue b/resources/assets/scripts/components/dashboard/account/TwoFactorAuthentication.vue deleted file mode 100644 index c70868038..000000000 --- a/resources/assets/scripts/components/dashboard/account/TwoFactorAuthentication.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/dashboard/account/UpdateEmail.vue b/resources/assets/scripts/components/dashboard/account/UpdateEmail.vue deleted file mode 100644 index 815a09697..000000000 --- a/resources/assets/scripts/components/dashboard/account/UpdateEmail.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/forms/CSRF.vue b/resources/assets/scripts/components/forms/CSRF.vue deleted file mode 100644 index f0e830f03..000000000 --- a/resources/assets/scripts/components/forms/CSRF.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/Server.vue b/resources/assets/scripts/components/server/Server.vue deleted file mode 100644 index 12243a8f0..000000000 --- a/resources/assets/scripts/components/server/Server.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/PowerButtons.vue b/resources/assets/scripts/components/server/components/PowerButtons.vue deleted file mode 100644 index 131c332e4..000000000 --- a/resources/assets/scripts/components/server/components/PowerButtons.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/database/CreateDatabaseModal.vue b/resources/assets/scripts/components/server/components/database/CreateDatabaseModal.vue deleted file mode 100644 index 9636565ef..000000000 --- a/resources/assets/scripts/components/server/components/database/CreateDatabaseModal.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/database/DatabaseRow.vue b/resources/assets/scripts/components/server/components/database/DatabaseRow.vue deleted file mode 100644 index 35c34573d..000000000 --- a/resources/assets/scripts/components/server/components/database/DatabaseRow.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/database/DeleteDatabaseModal.vue b/resources/assets/scripts/components/server/components/database/DeleteDatabaseModal.vue deleted file mode 100644 index 12a135b33..000000000 --- a/resources/assets/scripts/components/server/components/database/DeleteDatabaseModal.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/FileContextMenu.vue b/resources/assets/scripts/components/server/components/filemanager/FileContextMenu.vue deleted file mode 100644 index af317622b..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/FileContextMenu.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/FileRow.vue b/resources/assets/scripts/components/server/components/filemanager/FileRow.vue deleted file mode 100644 index e447483c4..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/FileRow.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/CopyFileModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/CopyFileModal.vue deleted file mode 100644 index c60690d75..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/CopyFileModal.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/CreateFolderModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/CreateFolderModal.vue deleted file mode 100644 index 912b3b5bd..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/CreateFolderModal.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/DeleteFileModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/DeleteFileModal.vue deleted file mode 100644 index bfe08f4b7..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/DeleteFileModal.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/DownloadFileModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/DownloadFileModal.vue deleted file mode 100644 index a669f45a8..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/DownloadFileModal.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/EditFileModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/EditFileModal.vue deleted file mode 100644 index 1a01912fc..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/EditFileModal.vue +++ /dev/null @@ -1,298 +0,0 @@ - - - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/MoveFileModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/MoveFileModal.vue deleted file mode 100644 index 7166046ce..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/MoveFileModal.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/components/filemanager/modals/RenameModal.vue b/resources/assets/scripts/components/server/components/filemanager/modals/RenameModal.vue deleted file mode 100644 index c87b0dcfd..000000000 --- a/resources/assets/scripts/components/server/components/filemanager/modals/RenameModal.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/subpages/Console.vue b/resources/assets/scripts/components/server/subpages/Console.vue deleted file mode 100644 index b4adad664..000000000 --- a/resources/assets/scripts/components/server/subpages/Console.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/subpages/Databases.vue b/resources/assets/scripts/components/server/subpages/Databases.vue deleted file mode 100644 index 95372ccf8..000000000 --- a/resources/assets/scripts/components/server/subpages/Databases.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - diff --git a/resources/assets/scripts/components/server/subpages/FileManager.vue b/resources/assets/scripts/components/server/subpages/FileManager.vue deleted file mode 100644 index 0b89c4f7e..000000000 --- a/resources/assets/scripts/components/server/subpages/FileManager.vue +++ /dev/null @@ -1,200 +0,0 @@ - - - diff --git a/resources/assets/scripts/helpers/.gitignore b/resources/assets/scripts/helpers/.gitignore deleted file mode 100644 index 232ae1dd0..000000000 --- a/resources/assets/scripts/helpers/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ziggy.js diff --git a/resources/assets/scripts/helpers/axios.ts b/resources/assets/scripts/helpers/axios.ts deleted file mode 100644 index 5a0c76f06..000000000 --- a/resources/assets/scripts/helpers/axios.ts +++ /dev/null @@ -1,22 +0,0 @@ -import axios, {AxiosResponse} from 'axios'; - -/** - * We'll load the axios HTTP library which allows us to easily issue requests - * to our Laravel back-end. This library automatically handles sending the - * CSRF token as a header based on the value of the "XSRF" token cookie. - */ -axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -axios.defaults.headers.common['Accept'] = 'application/json'; - -// Attach the response data to phpdebugbar so that we can see everything happening. -// @ts-ignore -if (typeof phpdebugbar !== 'undefined') { - axios.interceptors.response.use(function (response: AxiosResponse) { - // @ts-ignore - phpdebugbar.ajaxHandler.handle(response.request); - - return response; - }); -} - -export default axios; diff --git a/resources/assets/scripts/helpers/index.ts b/resources/assets/scripts/helpers/index.ts deleted file mode 100644 index 4768c4da8..000000000 --- a/resources/assets/scripts/helpers/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {format} from 'date-fns'; - -/** - * Return the human readable filesize for a given number of bytes. This - * uses 1024 as the base, so the response is denoted accordingly. - */ -export function readableSize(bytes: number): string { - if (Math.abs(bytes) < 1024) { - return `${bytes} Bytes`; - } - - let u: number = -1; - const units: Array = ['KiB', 'MiB', 'GiB', 'TiB']; - - do { - bytes /= 1024; - u++; - } while (Math.abs(bytes) >= 1024 && u < units.length - 1); - - return `${bytes.toFixed(1)} ${units[u]}`; -} - -/** - * Format the given date as a human readable string. - */ -export function formatDate(date: string): string { - return format(date, 'MMM D, YYYY [at] HH:MM'); -} diff --git a/resources/assets/scripts/helpers/statuses.ts b/resources/assets/scripts/helpers/statuses.ts deleted file mode 100644 index 662a3a6fb..000000000 --- a/resources/assets/scripts/helpers/statuses.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - STATUS_OFF: 'offline', - STATUS_ON: 'running', - STATUS_STARTING: 'starting', - STATUS_STOPPING: 'stopping', -}; diff --git a/resources/assets/scripts/helpers/ziggy.js b/resources/assets/scripts/helpers/ziggy.js deleted file mode 100644 index b1a521065..000000000 --- a/resources/assets/scripts/helpers/ziggy.js +++ /dev/null @@ -1,11 +0,0 @@ - var Ziggy = { - namedRoutes: JSON.parse('{"debugbar.openhandler":{"uri":"_debugbar\/open","methods":["GET","HEAD"],"domain":null},"debugbar.clockwork":{"uri":"_debugbar\/clockwork\/{id}","methods":["GET","HEAD"],"domain":null},"debugbar.assets.css":{"uri":"_debugbar\/assets\/stylesheets","methods":["GET","HEAD"],"domain":null},"debugbar.assets.js":{"uri":"_debugbar\/assets\/javascript","methods":["GET","HEAD"],"domain":null},"debugbar.cache.delete":{"uri":"_debugbar\/cache\/{key}\/{tags?}","methods":["DELETE"],"domain":null},"index":{"uri":"\/","methods":["GET","HEAD"],"domain":null},"account":{"uri":"account","methods":["GET","HEAD"],"domain":null},"account.api":{"uri":"account\/api","methods":["GET","HEAD"],"domain":null},"account.api.new":{"uri":"account\/api\/new","methods":["GET","HEAD"],"domain":null},"account.api.revoke":{"uri":"account\/api\/revoke\/{identifier}","methods":["DELETE"],"domain":null},"account.two_factor":{"uri":"account\/two_factor","methods":["GET","HEAD"],"domain":null},"account.two_factor.enable":{"uri":"account\/two_factor\/totp","methods":["POST"],"domain":null},"account.two_factor.disable":{"uri":"account\/two_factor\/totp\/disable","methods":["POST"],"domain":null},"admin.index":{"uri":"admin","methods":["GET","HEAD"],"domain":null},"admin.statistics":{"uri":"admin\/statistics","methods":["GET","HEAD"],"domain":null},"admin.api.index":{"uri":"admin\/api","methods":["GET","HEAD"],"domain":null},"admin.api.new":{"uri":"admin\/api\/new","methods":["GET","HEAD"],"domain":null},"admin.api.delete":{"uri":"admin\/api\/revoke\/{identifier}","methods":["DELETE"],"domain":null},"admin.locations":{"uri":"admin\/locations","methods":["GET","HEAD"],"domain":null},"admin.locations.view":{"uri":"admin\/locations\/view\/{location}","methods":["GET","HEAD"],"domain":null},"admin.databases":{"uri":"admin\/databases","methods":["GET","HEAD"],"domain":null},"admin.databases.view":{"uri":"admin\/databases\/view\/{host}","methods":["GET","HEAD"],"domain":null},"admin.settings":{"uri":"admin\/settings","methods":["GET","HEAD"],"domain":null},"admin.settings.mail":{"uri":"admin\/settings\/mail","methods":["GET","HEAD"],"domain":null},"admin.settings.mail.test":{"uri":"admin\/settings\/mail\/test","methods":["GET","HEAD"],"domain":null},"admin.settings.advanced":{"uri":"admin\/settings\/advanced","methods":["GET","HEAD"],"domain":null},"admin.users":{"uri":"admin\/users","methods":["GET","HEAD"],"domain":null},"admin.users.json":{"uri":"admin\/users\/accounts.json","methods":["GET","HEAD"],"domain":null},"admin.users.new":{"uri":"admin\/users\/new","methods":["GET","HEAD"],"domain":null},"admin.users.view":{"uri":"admin\/users\/view\/{user}","methods":["GET","HEAD"],"domain":null},"admin.servers":{"uri":"admin\/servers","methods":["GET","HEAD"],"domain":null},"admin.servers.new":{"uri":"admin\/servers\/new","methods":["GET","HEAD"],"domain":null},"admin.servers.view":{"uri":"admin\/servers\/view\/{server}","methods":["GET","HEAD"],"domain":null},"admin.servers.view.details":{"uri":"admin\/servers\/view\/{server}\/details","methods":["GET","HEAD"],"domain":null},"admin.servers.view.build":{"uri":"admin\/servers\/view\/{server}\/build","methods":["GET","HEAD"],"domain":null},"admin.servers.view.startup":{"uri":"admin\/servers\/view\/{server}\/startup","methods":["GET","HEAD"],"domain":null},"admin.servers.view.database":{"uri":"admin\/servers\/view\/{server}\/database","methods":["GET","HEAD"],"domain":null},"admin.servers.view.manage":{"uri":"admin\/servers\/view\/{server}\/manage","methods":["GET","HEAD"],"domain":null},"admin.servers.view.delete":{"uri":"admin\/servers\/view\/{server}\/delete","methods":["GET","HEAD"],"domain":null},"admin.servers.view.manage.toggle":{"uri":"admin\/servers\/view\/{server}\/manage\/toggle","methods":["POST"],"domain":null},"admin.servers.view.manage.rebuild":{"uri":"admin\/servers\/view\/{server}\/manage\/rebuild","methods":["POST"],"domain":null},"admin.servers.view.manage.suspension":{"uri":"admin\/servers\/view\/{server}\/manage\/suspension","methods":["POST"],"domain":null},"admin.servers.view.manage.reinstall":{"uri":"admin\/servers\/view\/{server}\/manage\/reinstall","methods":["POST"],"domain":null},"admin.servers.view.database.delete":{"uri":"admin\/servers\/view\/{server}\/database\/{database}\/delete","methods":["DELETE"],"domain":null},"admin.nodes":{"uri":"admin\/nodes","methods":["GET","HEAD"],"domain":null},"admin.nodes.new":{"uri":"admin\/nodes\/new","methods":["GET","HEAD"],"domain":null},"admin.nodes.view":{"uri":"admin\/nodes\/view\/{node}","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.settings":{"uri":"admin\/nodes\/view\/{node}\/settings","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.configuration":{"uri":"admin\/nodes\/view\/{node}\/configuration","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.allocation":{"uri":"admin\/nodes\/view\/{node}\/allocation","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.servers":{"uri":"admin\/nodes\/view\/{node}\/servers","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.configuration.token":{"uri":"admin\/nodes\/view\/{node}\/settings\/token","methods":["GET","HEAD"],"domain":null},"admin.nodes.view.allocation.removeBlock":{"uri":"admin\/nodes\/view\/{node}\/allocation\/remove","methods":["POST"],"domain":null},"admin.nodes.view.allocation.setAlias":{"uri":"admin\/nodes\/view\/{node}\/allocation\/alias","methods":["POST"],"domain":null},"admin.nodes.view.delete":{"uri":"admin\/nodes\/view\/{node}\/delete","methods":["DELETE"],"domain":null},"admin.nodes.view.allocation.removeSingle":{"uri":"admin\/nodes\/view\/{node}\/allocation\/remove\/{allocation}","methods":["DELETE"],"domain":null},"admin.nodes.view.allocation.removeMultiple":{"uri":"admin\/nodes\/view\/{node}\/allocations","methods":["DELETE"],"domain":null},"admin.nests":{"uri":"admin\/nests","methods":["GET","HEAD"],"domain":null},"admin.nests.new":{"uri":"admin\/nests\/new","methods":["GET","HEAD"],"domain":null},"admin.nests.view":{"uri":"admin\/nests\/view\/{nest}","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.new":{"uri":"admin\/nests\/egg\/new","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.view":{"uri":"admin\/nests\/egg\/{egg}","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.export":{"uri":"admin\/nests\/egg\/{egg}\/export","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.variables":{"uri":"admin\/nests\/egg\/{egg}\/variables","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.scripts":{"uri":"admin\/nests\/egg\/{egg}\/scripts","methods":["GET","HEAD"],"domain":null},"admin.nests.egg.import":{"uri":"admin\/nests\/import","methods":["POST"],"domain":null},"admin.nests.egg.variables.edit":{"uri":"admin\/nests\/egg\/{egg}\/variables\/{variable}","methods":["PATCH"],"domain":null},"admin.packs":{"uri":"admin\/packs","methods":["GET","HEAD"],"domain":null},"admin.packs.new":{"uri":"admin\/packs\/new","methods":["GET","HEAD"],"domain":null},"admin.packs.new.template":{"uri":"admin\/packs\/new\/template","methods":["GET","HEAD"],"domain":null},"admin.packs.view":{"uri":"admin\/packs\/view\/{pack}","methods":["GET","HEAD"],"domain":null},"admin.packs.view.export":{"uri":"admin\/packs\/view\/{pack}\/export\/{files?}","methods":["POST"],"domain":null},"auth.login":{"uri":"auth\/login","methods":["GET","HEAD"],"domain":null},"auth.forgot-password":{"uri":"auth\/password","methods":["GET","HEAD"],"domain":null},"auth.reset":{"uri":"auth\/password\/reset\/{token}","methods":["GET","HEAD"],"domain":null},"auth.login-checkpoint":{"uri":"auth\/login\/checkpoint","methods":["POST"],"domain":null},"auth.reset-password":{"uri":"auth\/password\/reset","methods":["POST"],"domain":null},"auth.logout":{"uri":"auth\/logout","methods":["GET","HEAD"],"domain":null},"server.credentials":{"uri":"api\/server\/{server}\/credentials","methods":["GET","HEAD"],"domain":null},"server.files":{"uri":"api\/server\/{server}\/files\/{directory?}","methods":["GET","HEAD"],"domain":null},"server.index":{"uri":"api\/server\/{server}","methods":["GET","HEAD"],"domain":null},"server.console":{"uri":"api\/server\/{server}\/console","methods":["GET","HEAD"],"domain":null},"api.application.users":{"uri":"api\/application\/users","methods":["GET","HEAD"],"domain":null},"api.application.users.view":{"uri":"api\/application\/users\/{user}","methods":["GET","HEAD"],"domain":null},"api.application.users.external":{"uri":"api\/application\/users\/external\/{external_id}","methods":["GET","HEAD"],"domain":null},"api.application.nodes":{"uri":"api\/application\/nodes","methods":["GET","HEAD"],"domain":null},"api.application.nodes.view":{"uri":"api\/application\/nodes\/{node}","methods":["GET","HEAD"],"domain":null},"api.application.allocations":{"uri":"api\/application\/nodes\/{node}\/allocations","methods":["GET","HEAD"],"domain":null},"api.application.allocations.view":{"uri":"api\/application\/nodes\/{node}\/allocations\/{allocation}","methods":["DELETE"],"domain":null},"api.applications.locations":{"uri":"api\/application\/locations","methods":["GET","HEAD"],"domain":null},"api.application.locations.view":{"uri":"api\/application\/locations\/{location}","methods":["GET","HEAD"],"domain":null},"api.application.servers":{"uri":"api\/application\/servers","methods":["GET","HEAD"],"domain":null},"api.application.servers.view":{"uri":"api\/application\/servers\/{server}","methods":["GET","HEAD"],"domain":null},"api.application.servers.external":{"uri":"api\/application\/servers\/external\/{external_id}","methods":["GET","HEAD"],"domain":null},"api.application.servers.details":{"uri":"api\/application\/servers\/{server}\/details","methods":["PATCH"],"domain":null},"api.application.servers.build":{"uri":"api\/application\/servers\/{server}\/build","methods":["PATCH"],"domain":null},"api.application.servers.startup":{"uri":"api\/application\/servers\/{server}\/startup","methods":["PATCH"],"domain":null},"api.application.servers.suspend":{"uri":"api\/application\/servers\/{server}\/suspend","methods":["POST"],"domain":null},"api.application.servers.unsuspend":{"uri":"api\/application\/servers\/{server}\/unsuspend","methods":["POST"],"domain":null},"api.application.servers.reinstall":{"uri":"api\/application\/servers\/{server}\/reinstall","methods":["POST"],"domain":null},"api.application.servers.rebuild":{"uri":"api\/application\/servers\/{server}\/rebuild","methods":["POST"],"domain":null},"api.application.servers.databases":{"uri":"api\/application\/servers\/{server}\/databases","methods":["GET","HEAD"],"domain":null},"api.application.servers.databases.view":{"uri":"api\/application\/servers\/{server}\/databases\/{database}","methods":["GET","HEAD"],"domain":null},"api.application.nests":{"uri":"api\/application\/nests","methods":["GET","HEAD"],"domain":null},"api.application.nests.view":{"uri":"api\/application\/nests\/{nest}","methods":["GET","HEAD"],"domain":null},"api.application.nests.eggs":{"uri":"api\/application\/nests\/{nest}\/eggs","methods":["GET","HEAD"],"domain":null},"api.application.nests.eggs.view":{"uri":"api\/application\/nests\/{nest}\/eggs\/{egg}","methods":["GET","HEAD"],"domain":null},"api.client.index":{"uri":"api\/client","methods":["GET","HEAD"],"domain":null},"api.client.account":{"uri":"api\/client\/account","methods":["GET","HEAD"],"domain":null},"api.client.account.update-email":{"uri":"api\/client\/account\/email","methods":["PUT"],"domain":null},"api.client.account.update-password":{"uri":"api\/client\/account\/password","methods":["PUT"],"domain":null},"api.client.servers.view":{"uri":"api\/client\/servers\/{server}","methods":["GET","HEAD"],"domain":null},"api.client.servers.resources":{"uri":"api\/client\/servers\/{server}\/utilization","methods":["GET","HEAD"],"domain":null},"api.client.servers.command":{"uri":"api\/client\/servers\/{server}\/command","methods":["POST"],"domain":null},"api.client.servers.power":{"uri":"api\/client\/servers\/{server}\/power","methods":["POST"],"domain":null},"api.client.servers.databases":{"uri":"api\/client\/servers\/{server}\/databases","methods":["GET","HEAD"],"domain":null},"api.client.servers.databases.delete":{"uri":"api\/client\/servers\/{server}\/databases\/{database}","methods":["DELETE"],"domain":null},"api.client.servers.files.list":{"uri":"api\/client\/servers\/{server}\/files\/list","methods":["GET","HEAD"],"domain":null},"api.client.servers.files.contents":{"uri":"api\/client\/servers\/{server}\/files\/contents","methods":["GET","HEAD"],"domain":null},"api.client.servers.files.rename":{"uri":"api\/client\/servers\/{server}\/files\/rename","methods":["PUT"],"domain":null},"api.client.servers.files.copy":{"uri":"api\/client\/servers\/{server}\/files\/copy","methods":["POST"],"domain":null},"api.client.servers.files.write":{"uri":"api\/client\/servers\/{server}\/files\/write","methods":["POST"],"domain":null},"api.client.servers.files.delete":{"uri":"api\/client\/servers\/{server}\/files\/delete","methods":["POST"],"domain":null},"api.client.servers.files.create-folder":{"uri":"api\/client\/servers\/{server}\/files\/create-folder","methods":["POST"],"domain":null},"api.client.servers.files.download":{"uri":"api\/client\/servers\/{server}\/files\/download\/{file}","methods":["POST"],"domain":null},"api.client.servers.network":{"uri":"api\/client\/servers\/{server}\/network","methods":["GET","HEAD"],"domain":null},"api.remote.authenticate":{"uri":"api\/remote\/authenticate\/{token}","methods":["GET","HEAD"],"domain":null},"api.remote.download_file":{"uri":"api\/remote\/download-file","methods":["POST"],"domain":null},"api.remote.eggs":{"uri":"api\/remote\/eggs","methods":["GET","HEAD"],"domain":null},"api.remote.eggs.download":{"uri":"api\/remote\/eggs\/{uuid}","methods":["GET","HEAD"],"domain":null},"api.remote.scripts":{"uri":"api\/remote\/scripts\/{uuid}","methods":["GET","HEAD"],"domain":null},"api.remote.sftp":{"uri":"api\/remote\/sftp","methods":["POST"],"domain":null},"daemon.pack.pull":{"uri":"daemon\/packs\/pull\/{uuid}","methods":["GET","HEAD"],"domain":null},"daemon.pack.hash":{"uri":"daemon\/packs\/pull\/{uuid}\/hash","methods":["GET","HEAD"],"domain":null},"daemon.configuration":{"uri":"daemon\/configure\/{token}","methods":["GET","HEAD"],"domain":null},"daemon.install":{"uri":"daemon\/install","methods":["POST"],"domain":null}}'), - baseUrl: 'http://pterodactyl.test/', - baseProtocol: 'http', - baseDomain: 'pterodactyl.test', - basePort: false - }; - - export { - Ziggy - } diff --git a/resources/assets/scripts/mixins/flash.ts b/resources/assets/scripts/mixins/flash.ts deleted file mode 100644 index c90b98641..000000000 --- a/resources/assets/scripts/mixins/flash.ts +++ /dev/null @@ -1,58 +0,0 @@ -import {ComponentOptions} from "vue"; -import {Vue} from "vue/types/vue"; -import {TranslateResult} from "vue-i18n"; - -export interface FlashInterface { - flash(message: string | TranslateResult, title: string, severity: string): void; - - clear(): void, - - success(message: string | TranslateResult): void, - - info(message: string | TranslateResult): void, - - warning(message: string | TranslateResult): void, - - error(message: string | TranslateResult): void, -} - -class Flash implements FlashInterface { - flash(message: string, title: string, severity: string = 'info'): void { - severity = severity || 'info'; - if (['danger', 'fatal', 'error'].includes(severity)) { - severity = 'error'; - } - - // @ts-ignore - window.events.$emit('flash', {message, title, severity}); - } - - clear(): void { - // @ts-ignore - window.events.$emit('clear-flashes'); - } - - success(message: string): void { - this.flash(message, 'Success', 'success'); - } - - info(message: string): void { - this.flash(message, 'Info', 'info'); - } - - warning(message: string): void { - this.flash(message, 'Warning', 'warning'); - } - - error(message: string): void { - this.flash(message, 'Error', 'error'); - } -} - -export const FlashMixin: ComponentOptions = { - computed: { - '$flash': function () { - return new Flash(); - } - }, -}; diff --git a/resources/assets/scripts/mixins/socketio/connector.ts b/resources/assets/scripts/mixins/socketio/connector.ts deleted file mode 100644 index 84804836c..000000000 --- a/resources/assets/scripts/mixins/socketio/connector.ts +++ /dev/null @@ -1,228 +0,0 @@ -import {camelCase} from 'lodash'; -import SocketEmitter from './emitter'; -import {Store} from "vuex"; - -const SOCKET_CONNECT = 'connect'; -const SOCKET_ERROR = 'error'; -const SOCKET_DISCONNECT = 'disconnect'; - -// This is defined in the wings daemon code and referenced here so that it is obvious -// where we are pulling these random data objects from. -type WingsWebsocketResponse = { - event: string, - args: Array -} - -export default class SocketioConnector { - /** - * The socket instance. - */ - socket: null | WebSocket; - - /** - * The vuex store being used to persist data and socket state. - */ - store: Store | undefined; - - /** - * Tracks a reconnect attempt for the websocket. Will gradually back off on attempts - * after a certain period of time has elapsed. - */ - private reconnectTimeout: any; - - /** - * Tracks the number of reconnect attempts which is used to determine the backoff - * throttle for connections. - */ - private reconnectAttempts: number = 0; - - private socketProtocol?: string; - private socketUrl?: string; - - constructor(store: Store | undefined) { - this.socket = null; - this.store = store; - } - - /** - * Initialize a new Socket connection. - */ - public connect(url: string, protocol?: string): void { - this.socketUrl = url; - this.socketProtocol = protocol; - - this.connectToSocket() - .then(socket => { - this.socket = socket; - this.emitAndPassToStore(SOCKET_CONNECT); - this.registerEventListeners(); - }) - .catch(() => this.reconnectToSocket()); - } - - /** - * Return the socket instance we are working with. - */ - public instance(): WebSocket | null { - return this.socket; - } - - /** - * Sends an event along to the websocket. If there is no active connection, a void - * result is returned. - */ - public emit(event: string, payload?: string | Array): void | false { - if (!this.socket) { - return false - } - - this.socket.send(JSON.stringify({ - event, args: typeof payload === 'string' ? [payload] : payload - })); - } - - /** - * Register the event listeners for this socket including user-defined ones in the store as - * well as global system events from Socekt.io. - */ - protected registerEventListeners() { - if (!this.socket) { - return; - } - - this.socket.onclose = () => { - this.reconnectToSocket(); - this.emitAndPassToStore(SOCKET_DISCONNECT); - }; - - this.socket.onerror = () => { - if (this.socket && this.socket.readyState !== WebSocket.OPEN) { - this.emitAndPassToStore(SOCKET_ERROR, ['Failed to connect to websocket.']); - } - }; - - this.socket.onmessage = (wse): void => { - try { - let {event, args}: WingsWebsocketResponse = JSON.parse(wse.data); - - this.emitAndPassToStore(event, args); - } catch (ex) { - // do nothing, bad JSON response - console.error(ex); - return - } - }; - } - - /** - * Performs an actual socket connection, wrapped as a Promise for an easier interface. - */ - protected connectToSocket(): Promise { - return new Promise((resolve, reject) => { - let hasReturned = false; - const socket = new WebSocket(this.socketUrl!, this.socketProtocol); - - socket.onopen = () => { - if (hasReturned) { - socket && socket.close(); - } - - hasReturned = true; - this.resetConnectionAttempts(); - resolve(socket); - }; - - const rejectFunc = () => { - if (!hasReturned) { - hasReturned = true; - this.emitAndPassToStore(SOCKET_ERROR, ['Failed to connect to websocket.']); - reject(); - } - }; - - socket.onerror = rejectFunc; - socket.onclose = rejectFunc; - }); - } - - - /** - * Attempts to reconnect to the socket instance if it becomes disconnected. - */ - private reconnectToSocket() { - const { socket } = this; - if (!socket) { - return; - } - - // Clear the existing timeout if one exists for some reason. - this.reconnectTimeout && clearTimeout(this.reconnectTimeout); - - this.reconnectTimeout = setTimeout(() => { - console.warn(`Attempting to reconnect to websocket [${this.reconnectAttempts}]...`); - - this.reconnectAttempts++; - this.connect(this.socketUrl!, this.socketProtocol); - }, this.getIntervalTimeout()); - } - - private resetConnectionAttempts() { - this.reconnectTimeout && clearTimeout(this.reconnectTimeout); - this.reconnectAttempts = 0; - } - - /** - * Determine the amount of time we should wait before attempting to reconnect to the socket. - */ - private getIntervalTimeout(): number { - if (this.reconnectAttempts < 10) { - return 50; - } else if (this.reconnectAttempts < 25) { - return 500; - } else if (this.reconnectAttempts < 50) { - return 1000; - } - - return 2500; - } - - - /** - * Emits the event over the event emitter and also passes it along to the vuex store. - */ - private emitAndPassToStore(event: string, payload?: Array) { - payload ? SocketEmitter.emit(event, ...payload) : SocketEmitter.emit(event); - this.passToStore(event, payload); - } - - /** - * Pass event calls off to the Vuex store if there is a corresponding function. - */ - private passToStore(event: string, payload?: Array) { - if (!this.store) { - return; - } - - const s: Store = this.store; - const mutation = `SOCKET_${event.toUpperCase()}`; - const action = `socket_${camelCase(event)}`; - - // @ts-ignore - Object.keys(this.store._mutations).filter((namespaced: string): boolean => { - return namespaced.split('/').pop() === mutation; - }).forEach((namespaced: string): void => { - s.commit(namespaced, payload ? this.unwrap(payload) : null); - }); - - // @ts-ignore - Object.keys(this.store._actions).filter((namespaced: string): boolean => { - return namespaced.split('/').pop() === action; - }).forEach((namespaced: string): void => { - s.dispatch(namespaced, payload ? this.unwrap(payload) : null).catch(console.error); - }); - } - - private unwrap(args: Array) { - return (args && args.length <= 1) ? args[0] : args; - } -} diff --git a/resources/assets/scripts/mixins/socketio/emitter.ts b/resources/assets/scripts/mixins/socketio/emitter.ts deleted file mode 100644 index 8a97772e8..000000000 --- a/resources/assets/scripts/mixins/socketio/emitter.ts +++ /dev/null @@ -1,60 +0,0 @@ -import {isFunction} from 'lodash'; -import {ComponentOptions} from "vue"; -import {Vue} from "vue/types/vue"; - -export default new class SocketEmitter { - listeners: Map) => void, - vm: ComponentOptions, - }>>; - - constructor() { - this.listeners = new Map(); - } - - /** - * Add an event listener for socket events. - */ - addListener(event: string | number, callback: (...data: any[]) => void, vm: ComponentOptions) { - if (!isFunction(callback)) { - return; - } - - if (!this.listeners.has(event)) { - this.listeners.set(event, []); - } - - // @ts-ignore - this.listeners.get(event).push({callback, vm}); - } - - /** - * Remove an event listener for socket events based on the context passed through. - */ - removeListener(event: string | number, callback: (...data: any[]) => void, vm: ComponentOptions) { - if (!isFunction(callback) || !this.listeners.has(event)) { - return; - } - - // @ts-ignore - const filtered = this.listeners.get(event).filter((listener) => { - return listener.callback !== callback || listener.vm !== vm; - }); - - if (filtered.length > 0) { - this.listeners.set(event, filtered); - } else { - this.listeners.delete(event); - } - } - - /** - * Emit a socket event. - */ - emit(event: string | number, ...args: any) { - (this.listeners.get(event) || []).forEach((listener) => { - // @ts-ignore - listener.callback.call(listener.vm, ...args); - }); - } -} diff --git a/resources/assets/scripts/mixins/socketio/index.ts b/resources/assets/scripts/mixins/socketio/index.ts deleted file mode 100644 index 118bccf95..000000000 --- a/resources/assets/scripts/mixins/socketio/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import SocketEmitter from './emitter'; -import SocketioConnector from './connector'; -import {ComponentOptions} from 'vue'; -import {Vue} from "vue/types/vue"; - -let connector: SocketioConnector | null = null; - -export const Socketio: ComponentOptions = { - /** - * Setup the socket when we create the first component using the mixin. This is the Server.vue - * file, unless you mess up all of this code. Subsequent components to use this mixin will - * receive the existing connector instance, so it is very important that the top-most component - * calls the connectors destroy function when it is destroyed. - */ - created: function () { - if (!connector) { - connector = new SocketioConnector(this.$store); - } - - const sockets = (this.$options || {}).sockets || {}; - Object.keys(sockets).forEach((event) => { - SocketEmitter.addListener(event, sockets[event], this); - }); - }, - - /** - * Before destroying the component we need to remove any event listeners registered for it. - */ - beforeDestroy: function () { - const sockets = (this.$options || {}).sockets || {}; - Object.keys(sockets).forEach((event) => { - SocketEmitter.removeListener(event, sockets[event], this); - }); - }, - - methods: { - '$socket': function (): SocketioConnector | null { - return connector; - }, - - /** - * Disconnects from the active socket and sets the connector to null. - */ - removeSocket: function () { - if (!connector) { - return; - } - - const instance = connector.instance(); - if (instance) { - instance.close(); - } - - connector = null; - }, - }, -}; diff --git a/resources/assets/scripts/models/server.ts b/resources/assets/scripts/models/server.ts deleted file mode 100644 index f3b85d0f4..000000000 --- a/resources/assets/scripts/models/server.ts +++ /dev/null @@ -1,87 +0,0 @@ -type ServerAllocation = { - ip: string, - port: number, -}; - -type ServerLimits = { - memory: number, - swap: number, - disk: number, - io: number, - cpu: number, -} - -type ServerFeatureLimits = { - databases: number, - allocations: number, -}; - -export type ServerData = { - identifier: string, - uuid: string, - name: string, - node: string, - description: string, - allocation: ServerAllocation, - limits: ServerLimits, - feature_limits: ServerFeatureLimits, -}; - -/** - * A model representing a server returned by the client API. - */ -export default class Server { - /** - * The server identifier, generally the 8-character representation of the server UUID. - */ - identifier: string; - - /** - * The long form identifier for this server. - */ - uuid: string; - - /** - * The human friendy name for this server. - */ - name: string; - - /** - * The name of the node that this server belongs to. - */ - node: string; - - /** - * A description of this server. - */ - description: string; - - /** - * The primary allocation details for this server. - */ - allocation: ServerAllocation; - - /** - * The base limits for this server when it comes to the actual docker container. - */ - limits: ServerLimits; - - /** - * The feature limits for this server, database & allocations currently. - */ - featureLimits: ServerFeatureLimits; - - /** - * Construct a new server model instance. - */ - constructor(data: ServerData) { - this.identifier = data.identifier; - this.uuid = data.uuid; - this.name = data.name; - this.node = data.node; - this.description = data.description; - this.allocation = data.allocation; - this.limits = data.limits; - this.featureLimits = data.feature_limits; - } -} diff --git a/resources/assets/scripts/models/user.ts b/resources/assets/scripts/models/user.ts deleted file mode 100644 index 930536817..000000000 --- a/resources/assets/scripts/models/user.ts +++ /dev/null @@ -1,53 +0,0 @@ -export type UserData = { - root_admin: boolean, - username: string, - email: string, - first_name: string, - last_name: string, - language: string, -}; - -/** - * A user model that represents an user in Pterodactyl. - */ -export default class User { - /** - * Determines wether or not the user is an admin. - */ - admin: boolean; - - /** - * The username for the currently authenticated user. - */ - username: string; - - /** - * The currently authenticated users email address. - */ - email: string; - - /** - * The full name of the logged in user. - */ - name: string; - first_name: string; - last_name: string; - - /** - * The language the user has selected to use. - */ - language: string; - - /** - * Create a new user model. - */ - constructor(data: UserData) { - this.admin = data.root_admin; - this.username = data.username; - this.email = data.email; - this.name = `${data.first_name} ${data.last_name}`; - this.first_name = data.first_name; - this.last_name = data.last_name; - this.language = data.language; - } -} diff --git a/resources/assets/scripts/pterodactyl-shims.d.ts b/resources/assets/scripts/pterodactyl-shims.d.ts deleted file mode 100644 index ea89db124..000000000 --- a/resources/assets/scripts/pterodactyl-shims.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import Vue from "vue"; -import {Store} from "vuex"; -import {FlashInterface} from "./mixins/flash"; -import {AxiosInstance} from "axios"; -import {Vue as VueType} from "vue/types/vue"; -import {ApplicationState} from "./store/types"; -import {Route} from "vue-router"; -// @ts-ignore -import {Ziggy} from './helpers/ziggy'; - -declare global { - interface Window { - X_CSRF_TOKEN: string, - _: any, - $: any, - jQuery: any, - axios: AxiosInstance, - events: VueType, - Ziggy: Ziggy, - } -} - -declare module 'vue/types/options' { - interface ComponentOptions { - $store?: Store, - $options?: { - sockets?: { - [s: string]: (data: any) => void, - } - }, - sockets?: { - [s: string]: (data: any) => void, - } - } -} - -declare module 'vue/types/vue' { - interface Vue { - $route: Route, - $store: Store, - $flash: FlashInterface, - route: (name: string, params?: object, absolute?: boolean) => string, - } -} diff --git a/resources/assets/scripts/router.ts b/resources/assets/scripts/router.ts deleted file mode 100644 index e5dedd594..000000000 --- a/resources/assets/scripts/router.ts +++ /dev/null @@ -1,80 +0,0 @@ -import VueRouter, {Route} from 'vue-router'; -import store from './store/index'; -import User from './models/user'; -// Base Vuejs Templates -import Login from './components/auth/Login.vue'; -import Dashboard from './components/dashboard/Dashboard.vue'; -import Account from './components/dashboard/Account.vue'; -import ResetPassword from './components/auth/ResetPassword.vue'; -import LoginForm from "@/components/auth/LoginForm.vue"; -import ForgotPassword from "@/components/auth/ForgotPassword.vue"; -import TwoFactorForm from "@/components/auth/TwoFactorForm.vue"; -import Server from "@/components/server/Server.vue"; -import ConsolePage from "@/components/server/subpages/Console.vue"; -import FileManagerPage from "@/components/server/subpages/FileManager.vue"; -import DatabasesPage from "@/components/server/subpages/Databases.vue"; - -const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default; - -const routes = [ - { - path: '/auth', component: Login, - children: [ - {name: 'login', path: 'login', component: LoginForm}, - {name: 'forgot-password', path: 'password', component: ForgotPassword}, - {name: 'checkpoint', path: 'checkpoint', component: TwoFactorForm}, - ] - }, - - { - name: 'reset-password', - path: '/auth/password/reset/:token', - component: ResetPassword, - props: function (route: Route) { - return {token: route.params.token, email: route.query.email || ''}; - }, - }, - - {name: 'dashboard', path: '/', component: Dashboard}, - {name: 'account', path: '/account', component: Account}, - {name: 'account.api', path: '/account/api', component: Account}, - {name: 'account.security', path: '/account/security', component: Account}, - - { - path: '/server/:id', component: Server, - children: [ - {name: 'server', path: '', component: ConsolePage}, - {name: 'server-files', path: 'files/:path(.*)?', component: FileManagerPage}, - // {name: 'server-subusers', path: 'subusers', component: ServerSubusers}, - // {name: 'server-schedules', path: 'schedules', component: ServerSchedules}, - {name: 'server-databases', path: 'databases', component: DatabasesPage}, - // {name: 'server-allocations', path: 'allocations', component: ServerAllocations}, - // {name: 'server-settings', path: 'settings', component: ServerSettings}, - ], - }, -]; - -const router = new VueRouter({ - mode: 'history', routes, -}); - -// Redirect the user to the login page if they try to access a protected route and -// have no JWT or the JWT is expired and wouldn't be accepted by the Panel. -router.beforeEach((to, from, next) => { - if (to.path === route('auth.logout')) { - return window.location = route('auth.logout'); - } - - const user = store.getters['auth/getUser']; - - // Check that if we're accessing a non-auth route that a user exists on the page. - if (!to.path.startsWith('/auth') && !(user instanceof User)) { - store.commit('auth/logout'); - return window.location = route('auth.logout'); - } - - // Continue on through the pipeline. - return next(); -}); - -export default router; diff --git a/resources/assets/scripts/store/index.ts b/resources/assets/scripts/store/index.ts deleted file mode 100644 index 045785fd4..000000000 --- a/resources/assets/scripts/store/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import auth from './modules/auth'; -import dashboard from './modules/dashboard'; -import server from './modules/server'; -import socket from './modules/socket'; -import {ApplicationState} from "./types"; - -Vue.use(Vuex); - -const store = new Vuex.Store({ - strict: process.env.NODE_ENV !== 'production', - modules: {auth, dashboard, server, socket}, -}); - -if (module.hot) { - module.hot.accept(['./modules/auth'], () => { - const newAuthModule = require('./modules/auth').default; - const newDashboardModule = require('./modules/dashboard').default; - const newServerModule = require('./modules/server').default; - const newSocketModule = require('./modules/socket').default; - - store.hotUpdate({ - modules: { - auth: newAuthModule, - dashboard: newDashboardModule, - server: newServerModule, - socket: newSocketModule - }, - }); - }); -} - -export default store; diff --git a/resources/assets/scripts/store/modules/auth.ts b/resources/assets/scripts/store/modules/auth.ts deleted file mode 100644 index 6fba4ec93..000000000 --- a/resources/assets/scripts/store/modules/auth.ts +++ /dev/null @@ -1,106 +0,0 @@ -import User, {UserData} from '../../models/user'; -import {ActionContext} from "vuex"; -import {AuthenticationState} from "../types"; - -const route = require('./../../../../../vendor/tightenco/ziggy/src/js/route').default; - -type LoginAction = { - user: string, - password: string, -} - -type UpdateEmailAction = { - email: string, - password: string, -} - -export default { - namespaced: true, - state: { - // @ts-ignore - user: typeof window.PterodactylUser === 'object' ? new User(window.PterodactylUser) : null, - }, - getters: { - /** - * Return the currently authenticated user. - */ - getUser: function (state: AuthenticationState): null | User { - return state.user; - }, - }, - setters: {}, - actions: { - /** - * Log a user into the Panel. - */ - login: ({commit}: ActionContext, {user, password}: LoginAction): Promise<{ - complete: boolean, - intended?: string, - token?: string, - }> => { - return new Promise((resolve, reject) => { - // @ts-ignore - window.axios.post(route('auth.login'), {user, password}) - // @ts-ignore - .then(response => { - commit('logout'); - - // If there is a 302 redirect or some other odd behavior (basically, response that isnt - // in JSON format) throw an error and don't try to continue with the login. - if (!(response.data instanceof Object)) { - return reject(new Error('An error was encountered while processing this request.')); - } - - if (response.data.complete) { - commit('login', response.data.user); - return resolve({ - complete: true, - intended: response.data.intended, - }); - } - - return resolve({ - complete: false, - token: response.data.login_token, - }); - }) - .catch(reject); - }); - }, - - /** - * Update a user's email address on the Panel and store the updated result in Vuex. - */ - updateEmail: function ({commit}: ActionContext, {email, password}: UpdateEmailAction): Promise { - return new Promise((resolve, reject) => { - // @ts-ignore - window.axios.put(route('api.client.account.update-email'), {email, password}) - // @ts-ignore - .then(response => { - // If there is a 302 redirect or some other odd behavior (basically, response that isnt - // in JSON format) throw an error and don't try to continue with the login. - if (!(response.data instanceof Object) && response.status !== 201) { - return reject(new Error('An error was encountered while processing this request.')); - } - - commit('setEmail', email); - return resolve(); - }) - .catch(reject); - }); - }, - }, - mutations: { - setEmail: function (state: AuthenticationState, email: string) { - if (state.user) { - state.user.email = email; - } - }, - login: function (state: AuthenticationState, data: UserData) { - state.user = new User(data); - }, - logout: function (state: AuthenticationState) { - state.user = null; - }, - }, -}; diff --git a/resources/assets/scripts/store/modules/dashboard.ts b/resources/assets/scripts/store/modules/dashboard.ts deleted file mode 100644 index 1ea907ea5..000000000 --- a/resources/assets/scripts/store/modules/dashboard.ts +++ /dev/null @@ -1,66 +0,0 @@ -import Server, {ServerData} from '../../models/server'; -import {ActionContext} from "vuex"; -import {DashboardState} from "../types"; - -const route = require('./../../../../../vendor/tightenco/ziggy/src/js/route').default; - -export default { - namespaced: true, - state: { - servers: [], - searchTerm: '', - }, - getters: { - getSearchTerm: function (state: DashboardState): string { - return state.searchTerm; - }, - }, - actions: { - /** - * Retrieve all of the servers for a user matching the query. - */ - loadServers: ({commit, state}: ActionContext): Promise => { - return new Promise((resolve, reject) => { - // @ts-ignore - window.axios.get(route('api.client.index'), { - params: {query: state.searchTerm}, - }) - // @ts-ignore - .then(response => { - // If there is a 302 redirect or some other odd behavior (basically, response that isnt - // in JSON format) throw an error and don't try to continue with the request processing. - if (!(response.data instanceof Object)) { - return reject(new Error('An error was encountered while processing this request.')); - } - - // Remove all of the existing servers. - commit('clearServers'); - - response.data.data.forEach((obj: { attributes: ServerData }) => { - commit('addServer', obj.attributes); - }); - - resolve(); - }) - .catch(reject); - }); - }, - - setSearchTerm: ({commit}: ActionContext, term: string) => { - commit('setSearchTerm', term); - }, - }, - mutations: { - addServer: function (state: DashboardState, data: ServerData) { - state.servers.push( - new Server(data) - ); - }, - clearServers: function (state: DashboardState) { - state.servers = []; - }, - setSearchTerm: function (state: DashboardState, term: string) { - state.searchTerm = term; - }, - }, -}; diff --git a/resources/assets/scripts/store/modules/server.ts b/resources/assets/scripts/store/modules/server.ts deleted file mode 100644 index abe435056..000000000 --- a/resources/assets/scripts/store/modules/server.ts +++ /dev/null @@ -1,93 +0,0 @@ -// @ts-ignore -import route from '../../../../../vendor/tightenco/ziggy/src/js/route'; -import {ActionContext} from "vuex"; -import {ServerData} from "@/models/server"; -import {ServerApplicationCredentials, ServerState} from "../types"; - -export default { - namespaced: true, - state: { - server: {}, - credentials: {node: '', key: ''}, - console: [], - fm: { - currentDirectory: '/', - }, - }, - getters: {}, - actions: { - /** - * Fetches the active server from the API and stores it in vuex. - */ - getServer: ({commit}: ActionContext, {server}: { server: string }): Promise => { - return new Promise((resolve, reject) => { - // @ts-ignore - window.axios.get(route('api.client.servers.view', {server})) - // @ts-ignore - .then(response => { - // If there is a 302 redirect or some other odd behavior (basically, response that isnt - // in JSON format) throw an error and don't try to continue with the login. - if (!(response.data instanceof Object)) { - return reject(new Error('An error was encountered while processing this request.')); - } - - if (response.data.object === 'server' && response.data.attributes) { - commit('SERVER_DATA', response.data.attributes) - } - - return resolve(); - }) - .catch(reject); - }); - }, - - /** - * Get authentication credentials that the client should use when connecting to the daemon to - * retrieve server information. - */ - getCredentials: ({commit}: ActionContext, {server}: { server: string }) => { - return new Promise((resolve, reject) => { - // @ts-ignore - window.axios.get(route('server.credentials', {server})) - // @ts-ignore - .then(response => { - // If there is a 302 redirect or some other odd behavior (basically, response that isnt - // in JSON format) throw an error and don't try to continue with the login. - if (!(response.data instanceof Object)) { - return reject(new Error('An error was encountered while processing this request.')); - } - - if (response.data.key) { - commit('SERVER_CREDENTIALS', response.data) - } - - return resolve(); - }) - .catch(reject); - }); - }, - - /** - * Update the last viewed directory for the server the user is currently viewing. This allows - * us to quickly navigate back to that directory, as well as ensure that actions taken are - * performed aganist the correct directory without having to pass that mess everywhere. - */ - updateCurrentDirectory: ({commit}: ActionContext, directory: string) => { - commit('SET_CURRENT_DIRECTORY', directory); - }, - }, - mutations: { - SET_CURRENT_DIRECTORY: function (state: ServerState, directory: string) { - state.fm.currentDirectory = directory; - }, - SERVER_DATA: function (state: ServerState, data: ServerData) { - state.server = data; - }, - SERVER_CREDENTIALS: function (state: ServerState, credentials: ServerApplicationCredentials) { - state.credentials = credentials; - }, - CONSOLE_DATA: function (state: ServerState, data: string) { - state.console.push(data); - }, - }, -} diff --git a/resources/assets/scripts/store/modules/socket.ts b/resources/assets/scripts/store/modules/socket.ts deleted file mode 100644 index a12e83d92..000000000 --- a/resources/assets/scripts/store/modules/socket.ts +++ /dev/null @@ -1,47 +0,0 @@ -import Status from '../../helpers/statuses'; -import {SocketState} from "../types"; - -export default { - namespaced: true, - state: { - connected: false, - connectionError: false, - status: Status.STATUS_OFF, - outputBuffer: [], - }, - mutations: { - SOCKET_CONNECT: (state: SocketState) => { - state.connected = true; - state.connectionError = false; - }, - - SOCKET_ERROR: (state: SocketState, err: Error) => { - state.connected = false; - state.connectionError = err; - }, - - 'SOCKET_INITIAL STATUS': (state: SocketState, data: string) => { - state.status = data; - }, - - SOCKET_STATUS: (state: SocketState, data: string) => { - state.status = data; - }, - - 'SOCKET_CONSOLE OUTPUT': (state: SocketState, data: string) => { - const { outputBuffer } = state; - - if (outputBuffer.length >= 500) { - // Pop all of the output buffer items off the front until we only have 499 - // items in the array. - for (let i = 0; i <= (outputBuffer.length - 500); i++) { - outputBuffer.shift(); - i++; - } - } - - outputBuffer.push(data); - state.outputBuffer = outputBuffer; - }, - }, -}; diff --git a/resources/assets/scripts/store/types.ts b/resources/assets/scripts/store/types.ts deleted file mode 100644 index 505c68b51..000000000 --- a/resources/assets/scripts/store/types.ts +++ /dev/null @@ -1,42 +0,0 @@ -import Server, {ServerData} from "../models/server"; -import User from "../models/user"; - -export type ApplicationState = { - socket: SocketState, - server: ServerState, - auth: AuthenticationState, - dashboard: DashboardState, -} - -export type SocketState = { - connected: boolean, - connectionError: boolean | Error, - status: string, - outputBuffer: string[], -} - -export type ServerApplicationCredentials = { - node: string, - key: string, -}; - -export type FileManagerState = { - currentDirectory: string, -} - -export type ServerState = { - server: ServerData, - credentials: ServerApplicationCredentials, - console: Array, - fm: FileManagerState, -}; - -export type DashboardState = { - searchTerm: string, - servers: Array, -}; - - -export type AuthenticationState = { - user: null | User, -} diff --git a/resources/assets/scripts/vue-shims.d.ts b/resources/assets/scripts/vue-shims.d.ts deleted file mode 100644 index b93ce2227..000000000 --- a/resources/assets/scripts/vue-shims.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module '*.vue' { - import Vue from 'vue' - export default Vue -} diff --git a/resources/assets/styles/components/animations.css b/resources/styles/components/animations.css similarity index 100% rename from resources/assets/styles/components/animations.css rename to resources/styles/components/animations.css diff --git a/resources/assets/styles/components/authentication.css b/resources/styles/components/authentication.css similarity index 100% rename from resources/assets/styles/components/authentication.css rename to resources/styles/components/authentication.css diff --git a/resources/assets/styles/components/filemanager.css b/resources/styles/components/filemanager.css similarity index 100% rename from resources/assets/styles/components/filemanager.css rename to resources/styles/components/filemanager.css diff --git a/resources/assets/styles/components/forms.css b/resources/styles/components/forms.css similarity index 100% rename from resources/assets/styles/components/forms.css rename to resources/styles/components/forms.css diff --git a/resources/assets/styles/components/miscellaneous.css b/resources/styles/components/miscellaneous.css similarity index 100% rename from resources/assets/styles/components/miscellaneous.css rename to resources/styles/components/miscellaneous.css diff --git a/resources/assets/styles/components/modal.css b/resources/styles/components/modal.css similarity index 100% rename from resources/assets/styles/components/modal.css rename to resources/styles/components/modal.css diff --git a/resources/assets/styles/components/navigation.css b/resources/styles/components/navigation.css similarity index 100% rename from resources/assets/styles/components/navigation.css rename to resources/styles/components/navigation.css diff --git a/resources/assets/styles/components/notifications.css b/resources/styles/components/notifications.css similarity index 100% rename from resources/assets/styles/components/notifications.css rename to resources/styles/components/notifications.css diff --git a/resources/assets/styles/components/spinners.css b/resources/styles/components/spinners.css similarity index 100% rename from resources/assets/styles/components/spinners.css rename to resources/styles/components/spinners.css diff --git a/resources/assets/styles/components/typography.css b/resources/styles/components/typography.css similarity index 100% rename from resources/assets/styles/components/typography.css rename to resources/styles/components/typography.css diff --git a/resources/assets/styles/main.css b/resources/styles/main.css similarity index 100% rename from resources/assets/styles/main.css rename to resources/styles/main.css diff --git a/webpack.config.js b/webpack.config.js index 95138b14d..bd0774b65 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const _ = require('lodash'); const path = require('path'); const tailwind = require('tailwindcss'); @@ -52,7 +53,7 @@ module.exports = { performance: { hints: false, }, - entry: ['./resources/assets/styles/main.css', './resources/scripts/index.tsx'], + entry: ['./resources/styles/main.css', './resources/scripts/index.tsx'], output: { path: path.resolve(__dirname, 'public/assets'), filename: isProduction ? 'bundle.[chunkhash:8].js' : 'bundle.[hash:8].js',