Merge branch 'bugfixes' of https://github.com/Sir3lit/panel into bugfixes
This commit is contained in:
commit
98ed96d08a
25 changed files with 382 additions and 909 deletions
|
@ -1,84 +0,0 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import ace, { Editor } from 'brace';
|
||||
import styled from 'styled-components/macro';
|
||||
import tw from 'twin.macro';
|
||||
import modes from '@/modes';
|
||||
|
||||
// @ts-ignore
|
||||
require('brace/ext/modelist');
|
||||
require('ayu-ace/mirage');
|
||||
|
||||
const EditorContainer = styled.div`
|
||||
min-height: 16rem;
|
||||
height: calc(100vh - 20rem);
|
||||
${tw`relative`};
|
||||
|
||||
#editor {
|
||||
${tw`rounded h-full`};
|
||||
}
|
||||
`;
|
||||
|
||||
Object.keys(modes).forEach(mode => require(`brace/mode/${mode}`));
|
||||
const modelist = ace.acequire('ace/ext/modelist');
|
||||
|
||||
export interface Props {
|
||||
style?: React.CSSProperties;
|
||||
initialContent?: string;
|
||||
mode: string;
|
||||
filename?: string;
|
||||
onModeChanged: (mode: string) => void;
|
||||
fetchContent: (callback: () => Promise<string>) => void;
|
||||
onContentSaved: () => void;
|
||||
}
|
||||
|
||||
export default ({ style, initialContent, filename, mode, fetchContent, onContentSaved, onModeChanged }: Props) => {
|
||||
const [ editor, setEditor ] = useState<Editor>();
|
||||
const ref = useCallback(node => {
|
||||
if (node) setEditor(ace.edit('editor'));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (modelist && filename) {
|
||||
onModeChanged(modelist.getModeForPath(filename).mode.replace(/^ace\/mode\//, ''));
|
||||
}
|
||||
}, [ filename ]);
|
||||
|
||||
useEffect(() => {
|
||||
editor && editor.session.setMode(`ace/mode/${mode}`);
|
||||
}, [ editor, mode ]);
|
||||
|
||||
useEffect(() => {
|
||||
editor && editor.session.setValue(initialContent || '');
|
||||
}, [ editor, initialContent ]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor) {
|
||||
fetchContent(() => Promise.reject(new Error('no editor session has been configured')));
|
||||
return;
|
||||
}
|
||||
|
||||
editor.setTheme('ace/theme/ayu-mirage');
|
||||
|
||||
editor.$blockScrolling = Infinity;
|
||||
editor.container.style.lineHeight = '1.375rem';
|
||||
editor.container.style.fontWeight = '500';
|
||||
editor.renderer.updateFontSize();
|
||||
editor.renderer.setShowPrintMargin(false);
|
||||
editor.session.setTabSize(4);
|
||||
editor.session.setUseSoftTabs(true);
|
||||
|
||||
editor.commands.addCommand({
|
||||
name: 'Save',
|
||||
bindKey: { win: 'Ctrl-s', mac: 'Command-s' },
|
||||
exec: () => onContentSaved(),
|
||||
});
|
||||
|
||||
fetchContent(() => Promise.resolve(editor.session.getValue()));
|
||||
}, [ editor, fetchContent, onContentSaved ]);
|
||||
|
||||
return (
|
||||
<EditorContainer style={style}>
|
||||
<div id={'editor'} ref={ref}/>
|
||||
</EditorContainer>
|
||||
);
|
||||
};
|
217
resources/scripts/components/elements/CodemirrorEditor.tsx
Normal file
217
resources/scripts/components/elements/CodemirrorEditor.tsx
Normal file
|
@ -0,0 +1,217 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import CodeMirror from 'codemirror';
|
||||
import styled from 'styled-components/macro';
|
||||
import tw from 'twin.macro';
|
||||
import modes, { Mode } from '@/modes';
|
||||
|
||||
require('codemirror/lib/codemirror.css');
|
||||
require('codemirror/theme/ayu-mirage.css');
|
||||
require('codemirror/addon/edit/closebrackets');
|
||||
require('codemirror/addon/edit/closetag');
|
||||
require('codemirror/addon/edit/matchbrackets');
|
||||
require('codemirror/addon/edit/matchtags');
|
||||
require('codemirror/addon/edit/trailingspace');
|
||||
require('codemirror/addon/fold/foldcode');
|
||||
require('codemirror/addon/fold/foldgutter.css');
|
||||
require('codemirror/addon/fold/foldgutter');
|
||||
require('codemirror/addon/fold/brace-fold');
|
||||
require('codemirror/addon/fold/comment-fold');
|
||||
require('codemirror/addon/fold/indent-fold');
|
||||
require('codemirror/addon/fold/markdown-fold');
|
||||
require('codemirror/addon/fold/xml-fold');
|
||||
require('codemirror/addon/hint/css-hint');
|
||||
require('codemirror/addon/hint/html-hint');
|
||||
require('codemirror/addon/hint/javascript-hint');
|
||||
require('codemirror/addon/hint/show-hint.css');
|
||||
require('codemirror/addon/hint/show-hint');
|
||||
require('codemirror/addon/hint/sql-hint');
|
||||
require('codemirror/addon/hint/xml-hint');
|
||||
require('codemirror/addon/mode/simple');
|
||||
require('codemirror/addon/dialog/dialog.css');
|
||||
require('codemirror/addon/dialog/dialog');
|
||||
require('codemirror/addon/scroll/annotatescrollbar');
|
||||
require('codemirror/addon/scroll/scrollpastend');
|
||||
require('codemirror/addon/scroll/simplescrollbars.css');
|
||||
require('codemirror/addon/scroll/simplescrollbars');
|
||||
require('codemirror/addon/search/jump-to-line');
|
||||
require('codemirror/addon/search/match-highlighter');
|
||||
require('codemirror/addon/search/matchesonscrollbar.css');
|
||||
require('codemirror/addon/search/matchesonscrollbar');
|
||||
require('codemirror/addon/search/search');
|
||||
require('codemirror/addon/search/searchcursor');
|
||||
|
||||
require('codemirror/mode/brainfuck/brainfuck');
|
||||
require('codemirror/mode/clike/clike');
|
||||
require('codemirror/mode/css/css');
|
||||
require('codemirror/mode/dart/dart');
|
||||
require('codemirror/mode/diff/diff');
|
||||
require('codemirror/mode/dockerfile/dockerfile');
|
||||
require('codemirror/mode/erlang/erlang');
|
||||
require('codemirror/mode/gfm/gfm');
|
||||
require('codemirror/mode/go/go');
|
||||
require('codemirror/mode/handlebars/handlebars');
|
||||
require('codemirror/mode/htmlembedded/htmlembedded');
|
||||
require('codemirror/mode/htmlmixed/htmlmixed');
|
||||
require('codemirror/mode/http/http');
|
||||
require('codemirror/mode/javascript/javascript');
|
||||
require('codemirror/mode/jsx/jsx');
|
||||
require('codemirror/mode/julia/julia');
|
||||
require('codemirror/mode/lua/lua');
|
||||
require('codemirror/mode/markdown/markdown');
|
||||
require('codemirror/mode/nginx/nginx');
|
||||
require('codemirror/mode/perl/perl');
|
||||
require('codemirror/mode/php/php');
|
||||
require('codemirror/mode/properties/properties');
|
||||
require('codemirror/mode/protobuf/protobuf');
|
||||
require('codemirror/mode/pug/pug');
|
||||
require('codemirror/mode/python/python');
|
||||
require('codemirror/mode/rpm/rpm');
|
||||
require('codemirror/mode/ruby/ruby');
|
||||
require('codemirror/mode/rust/rust');
|
||||
require('codemirror/mode/sass/sass');
|
||||
require('codemirror/mode/shell/shell');
|
||||
require('codemirror/mode/smarty/smarty');
|
||||
require('codemirror/mode/sql/sql');
|
||||
require('codemirror/mode/swift/swift');
|
||||
require('codemirror/mode/toml/toml');
|
||||
require('codemirror/mode/twig/twig');
|
||||
require('codemirror/mode/vue/vue');
|
||||
require('codemirror/mode/xml/xml');
|
||||
require('codemirror/mode/yaml/yaml');
|
||||
|
||||
const EditorContainer = styled.div`
|
||||
min-height: 16rem;
|
||||
height: calc(100vh - 20rem);
|
||||
${tw`relative`};
|
||||
|
||||
> div {
|
||||
${tw`rounded h-full`};
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
font-size: 12px;
|
||||
line-height: 1.375rem;
|
||||
}
|
||||
|
||||
.CodeMirror-linenumber {
|
||||
padding: 1px 12px 0 12px !important;
|
||||
}
|
||||
|
||||
.CodeMirror-foldmarker {
|
||||
color: #CBCCC6;
|
||||
text-shadow: none;
|
||||
margin-left: 0.25rem;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
`;
|
||||
|
||||
export interface Props {
|
||||
style?: React.CSSProperties;
|
||||
initialContent?: string;
|
||||
mode: string;
|
||||
filename?: string;
|
||||
onModeChanged: (mode: string) => void;
|
||||
fetchContent: (callback: () => Promise<string>) => void;
|
||||
onContentSaved: () => void;
|
||||
}
|
||||
|
||||
const findModeByFilename = (filename: string) => {
|
||||
for (let i = 0; i < modes.length; i++) {
|
||||
const info = modes[i];
|
||||
|
||||
if (info.file && info.file.test(filename)) {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
const dot = filename.lastIndexOf('.');
|
||||
const ext = dot > -1 && filename.substring(dot + 1, filename.length);
|
||||
|
||||
if (ext) {
|
||||
for (let i = 0; i < modes.length; i++) {
|
||||
const info = modes[i];
|
||||
if (info.ext) {
|
||||
for (let j = 0; j < info.ext.length; j++) {
|
||||
if (info.ext[j] === ext) {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export default ({ style, initialContent, filename, mode, fetchContent, onContentSaved, onModeChanged }: Props) => {
|
||||
const [ editor, setEditor ] = useState<CodeMirror.Editor>();
|
||||
|
||||
const ref = useCallback((node) => {
|
||||
if (!node) return;
|
||||
|
||||
const e = CodeMirror.fromTextArea(node, {
|
||||
mode: 'text/plain',
|
||||
theme: 'ayu-mirage',
|
||||
indentUnit: 4,
|
||||
smartIndent: true,
|
||||
tabSize: 4,
|
||||
indentWithTabs: false,
|
||||
lineWrapping: true,
|
||||
lineNumbers: true,
|
||||
foldGutter: true,
|
||||
fixedGutter: true,
|
||||
scrollbarStyle: 'overlay',
|
||||
coverGutterNextToScrollbar: false,
|
||||
readOnly: false,
|
||||
showCursorWhenSelecting: false,
|
||||
autofocus: false,
|
||||
spellcheck: true,
|
||||
autocorrect: false,
|
||||
autocapitalize: false,
|
||||
lint: false,
|
||||
// This property is actually used, the d.ts file for CodeMirror is incorrect.
|
||||
// @ts-ignore
|
||||
autoCloseBrackets: true,
|
||||
matchBrackets: true,
|
||||
gutters: [ 'CodeMirror-linenumbers', 'CodeMirror-foldgutter' ],
|
||||
});
|
||||
|
||||
setEditor(e);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (filename === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
onModeChanged(findModeByFilename(filename)?.mime || 'text/plain');
|
||||
}, [ filename ]);
|
||||
|
||||
useEffect(() => {
|
||||
editor && editor.setOption('mode', mode);
|
||||
}, [ editor, mode ]);
|
||||
|
||||
useEffect(() => {
|
||||
editor && editor.setValue(initialContent || '');
|
||||
}, [ editor, initialContent ]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor) {
|
||||
fetchContent(() => Promise.reject(new Error('no editor session has been configured')));
|
||||
return;
|
||||
}
|
||||
|
||||
editor.addKeyMap({
|
||||
'Ctrl-S': () => onContentSaved(),
|
||||
'Cmd-S': () => onContentSaved(),
|
||||
});
|
||||
|
||||
fetchContent(() => Promise.resolve(editor.getValue()));
|
||||
}, [ editor, fetchContent, onContentSaved ]);
|
||||
|
||||
return (
|
||||
<EditorContainer style={style}>
|
||||
<textarea ref={ref}/>
|
||||
</EditorContainer>
|
||||
);
|
||||
};
|
|
@ -12,6 +12,7 @@ import tw from 'twin.macro';
|
|||
import { Textarea } from '@/components/elements/Input';
|
||||
import getServerBackups from '@/api/swr/getServerBackups';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import styled from 'styled-components/macro';
|
||||
|
||||
interface Values {
|
||||
name: string;
|
||||
|
@ -44,7 +45,7 @@ const ModalContent = ({ ...props }: RequiredModalProps) => {
|
|||
prefixing the path with an exclamation point.
|
||||
`}
|
||||
>
|
||||
<FormikField as={Textarea} name={'ignored'} css={tw`h-32`}/>
|
||||
<FormikField as={Textarea} name={'ignored'} rows={6}/>
|
||||
</FormikFieldWrapper>
|
||||
</div>
|
||||
<div css={tw`flex justify-end`}>
|
||||
|
|
|
@ -171,7 +171,9 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
<Row onClick={doArchive} icon={faFileArchive} title={'Archive'}/>
|
||||
</Can>
|
||||
}
|
||||
<Row onClick={doDownload} icon={faFileDownload} title={'Download'}/>
|
||||
{file.isFile &&
|
||||
<Row onClick={doDownload} icon={faFileDownload} title={'Download'}/>
|
||||
}
|
||||
<Can action={'file.delete'}>
|
||||
<Row onClick={() => setShowConfirmation(true)} icon={faTrashAlt} title={'Delete'} $danger/>
|
||||
</Can>
|
||||
|
|
|
@ -17,7 +17,7 @@ import modes from '@/modes';
|
|||
import useFlash from '@/plugins/useFlash';
|
||||
import { ServerContext } from '@/state/server';
|
||||
|
||||
const LazyAceEditor = lazy(() => import(/* webpackChunkName: "editor" */'@/components/elements/AceEditor'));
|
||||
const LazyCodemirrorEditor = lazy(() => import(/* webpackChunkName: "editor" */'@/components/elements/CodemirrorEditor'));
|
||||
|
||||
export default () => {
|
||||
const [ error, setError ] = useState('');
|
||||
|
@ -25,7 +25,7 @@ export default () => {
|
|||
const [ loading, setLoading ] = useState(action === 'edit');
|
||||
const [ content, setContent ] = useState('');
|
||||
const [ modalVisible, setModalVisible ] = useState(false);
|
||||
const [ mode, setMode ] = useState('plain_text');
|
||||
const [ mode, setMode ] = useState('text/plain');
|
||||
|
||||
const history = useHistory();
|
||||
const { hash } = useLocation();
|
||||
|
@ -108,7 +108,7 @@ export default () => {
|
|||
/>
|
||||
<div css={tw`relative`}>
|
||||
<SpinnerOverlay visible={loading}/>
|
||||
<LazyAceEditor
|
||||
<LazyCodemirrorEditor
|
||||
mode={mode}
|
||||
filename={hash.replace(/^#/, '')}
|
||||
onModeChanged={setMode}
|
||||
|
@ -122,8 +122,10 @@ export default () => {
|
|||
<div css={tw`flex justify-end mt-4`}>
|
||||
<div css={tw`flex-1 sm:flex-none rounded bg-neutral-900 mr-4`}>
|
||||
<Select value={mode} onChange={e => setMode(e.currentTarget.value)}>
|
||||
{Object.keys(modes).map(key => (
|
||||
<option key={key} value={key}>{modes[key]}</option>
|
||||
{modes.map(mode => (
|
||||
<option key={`${mode.name}_${mode.mime}`} value={mode.mime}>
|
||||
{mode.name}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</div>
|
||||
|
|
3
resources/scripts/modes.d.ts
vendored
3
resources/scripts/modes.d.ts
vendored
|
@ -1,3 +0,0 @@
|
|||
declare const modes: Record<string, string>;
|
||||
|
||||
export default modes;
|
|
@ -1,26 +0,0 @@
|
|||
// This file must be plain Javascript since we're using it within Webpack.
|
||||
module.exports = {
|
||||
assembly_x86: 'Assembly (x86)',
|
||||
c_cpp: 'C++',
|
||||
coffee: 'Coffeescript',
|
||||
css: 'CSS',
|
||||
dockerfile: 'Dockerfile',
|
||||
golang: 'Go',
|
||||
html: 'HTML',
|
||||
ini: 'Ini',
|
||||
java: 'Java',
|
||||
javascript: 'Javascript',
|
||||
json: 'JSON',
|
||||
kotlin: 'Kotlin',
|
||||
lua: 'Luascript',
|
||||
perl: 'Perl',
|
||||
php: 'PHP',
|
||||
properties: 'Properties',
|
||||
python: 'Python',
|
||||
ruby: 'Ruby',
|
||||
plain_text: 'Plaintext',
|
||||
toml: 'TOML',
|
||||
typescript: 'Typescript',
|
||||
xml: 'XML',
|
||||
yaml: 'YAML',
|
||||
};
|
122
resources/scripts/modes.ts
Normal file
122
resources/scripts/modes.ts
Normal file
|
@ -0,0 +1,122 @@
|
|||
export interface Mode {
|
||||
name: string,
|
||||
mime: string,
|
||||
mimes?: string[],
|
||||
mode: string,
|
||||
ext?: string[],
|
||||
alias?: string[],
|
||||
file?: RegExp,
|
||||
}
|
||||
|
||||
const modes: Mode[] = [
|
||||
{ name: 'C', mime: 'text/x-csrc', mode: 'clike', ext: [ 'c', 'h', 'ino' ] },
|
||||
{
|
||||
name: 'C++',
|
||||
mime: 'text/x-c++src',
|
||||
mode: 'clike',
|
||||
ext: [ 'cpp', 'c++', 'cc', 'cxx', 'hpp', 'h++', 'hh', 'hxx' ],
|
||||
alias: [ 'cpp' ],
|
||||
},
|
||||
{ name: 'C#', mime: 'text/x-csharp', mode: 'clike', ext: [ 'cs' ], alias: [ 'csharp', 'cs' ] },
|
||||
{ name: 'CSS', mime: 'text/css', mode: 'css', ext: [ 'css' ] },
|
||||
{ name: 'CQL', mime: 'text/x-cassandra', mode: 'sql', ext: [ 'cql' ] },
|
||||
{ name: 'Diff', mime: 'text/x-diff', mode: 'diff', ext: [ 'diff', 'patch' ] },
|
||||
{ name: 'Dockerfile', mime: 'text/x-dockerfile', mode: 'dockerfile', file: /^Dockerfile$/ },
|
||||
{ name: 'Git Markdown', mime: 'text/x-gfm', mode: 'gfm', file: /^(readme|contributing|history|license).md$/i },
|
||||
{ name: 'Golang', mime: 'text/x-go', mode: 'go', ext: [ 'go' ] },
|
||||
{
|
||||
name: 'HTML',
|
||||
mime: 'text/html',
|
||||
mode: 'htmlmixed',
|
||||
ext: [ 'html', 'htm', 'handlebars', 'hbs' ],
|
||||
alias: [ 'xhtml' ],
|
||||
},
|
||||
{ name: 'HTTP', mime: 'message/http', mode: 'http' },
|
||||
{
|
||||
name: 'JavaScript',
|
||||
mime: 'text/javascript',
|
||||
mimes: [ 'text/javascript', 'text/ecmascript', 'application/javascript', 'application/x-javascript', 'application/ecmascript' ],
|
||||
mode: 'javascript',
|
||||
ext: [ 'js' ],
|
||||
alias: [ 'ecmascript', 'js', 'node' ],
|
||||
},
|
||||
{
|
||||
name: 'JSON',
|
||||
mime: 'application/json',
|
||||
mimes: [ 'application/json', 'application/x-json' ],
|
||||
mode: 'javascript',
|
||||
ext: [ 'json', 'map' ],
|
||||
alias: [ 'json5' ],
|
||||
},
|
||||
{ name: 'Lua', mime: 'text/x-lua', mode: 'lua', ext: [ 'lua' ] },
|
||||
{ name: 'Markdown', mime: 'text/x-markdown', mode: 'markdown', ext: [ 'markdown', 'md', 'mkd' ] },
|
||||
{ name: 'MariaDB', mime: 'text/x-mariadb', mode: 'sql' },
|
||||
{ name: 'MS SQL', mime: 'text/x-mssql', mode: 'sql' },
|
||||
{ name: 'MySQL', mime: 'text/x-mysql', mode: 'sql' },
|
||||
{ name: 'Nginx', mime: 'text/x-nginx-conf', mode: 'nginx', file: /nginx.*\.conf$/i },
|
||||
{
|
||||
name: 'PHP',
|
||||
mime: 'text/x-php',
|
||||
mimes: [ 'text/x-php', 'application/x-httpd-php', 'application/x-httpd-php-open' ],
|
||||
mode: 'php',
|
||||
ext: [ 'php', 'php3', 'php4', 'php5', 'php7', 'phtml' ],
|
||||
},
|
||||
{ name: 'Plain Text', mime: 'text/plain', mode: 'null', ext: [ 'txt', 'text', 'conf', 'def', 'list', 'log' ] },
|
||||
{ name: 'PostgreSQL', mime: 'text/x-pgsql', mode: 'sql' },
|
||||
{
|
||||
name: 'Properties',
|
||||
mime: 'text/x-properties',
|
||||
mode: 'properties',
|
||||
ext: [ 'properties', 'ini', 'in' ],
|
||||
alias: [ 'ini', 'properties' ],
|
||||
},
|
||||
{
|
||||
name: 'Python',
|
||||
mime: 'text/x-python',
|
||||
mode: 'python',
|
||||
ext: [ 'BUILD', 'bzl', 'py', 'pyw' ],
|
||||
file: /^(BUCK|BUILD)$/,
|
||||
},
|
||||
{
|
||||
name: 'Ruby',
|
||||
mime: 'text/x-ruby',
|
||||
mode: 'ruby',
|
||||
ext: [ 'rb' ],
|
||||
alias: [ 'jruby', 'macruby', 'rake', 'rb', 'rbx' ],
|
||||
},
|
||||
{ name: 'Rust', mime: 'text/x-rustsrc', mode: 'rust', ext: [ 'rs' ] },
|
||||
{ name: 'Sass', mime: 'text/x-sass', mode: 'sass', ext: [ 'sass' ] },
|
||||
{ name: 'SCSS', mime: 'text/x-scss', mode: 'css', ext: [ 'scss' ] },
|
||||
{
|
||||
name: 'Shell',
|
||||
mime: 'text/x-sh',
|
||||
mimes: [ 'text/x-sh', 'application/x-sh' ],
|
||||
mode: 'shell',
|
||||
ext: [ 'sh', 'ksh', 'bash' ],
|
||||
alias: [ 'bash', 'sh', 'zsh' ],
|
||||
file: /^PKGBUILD$/,
|
||||
},
|
||||
{ name: 'SQL', mime: 'text/x-sql', mode: 'sql', ext: [ 'sql' ] },
|
||||
{ name: 'SQLite', mime: 'text/x-sqlite', mode: 'sql' },
|
||||
{ name: 'TOML', mime: 'text/x-toml', mode: 'toml', ext: [ 'toml' ] },
|
||||
{ name: 'TypeScript', mime: 'application/typescript', mode: 'javascript', ext: [ 'ts' ], alias: [ 'ts' ] },
|
||||
{ name: 'Vue', mime: 'script/x-vue', mimes: [ 'script/x-vue', 'text/x-vue' ], mode: 'vue', ext: [ 'vue' ] },
|
||||
{
|
||||
name: 'XML',
|
||||
mime: 'application/xml',
|
||||
mimes: [ 'application/xml', 'text/xml' ],
|
||||
mode: 'xml',
|
||||
ext: [ 'xml', 'xsl', 'xsd', 'svg' ],
|
||||
alias: [ 'rss', 'wsdl', 'xsd' ],
|
||||
},
|
||||
{
|
||||
name: 'YAML',
|
||||
mime: 'text/x-yaml',
|
||||
mimes: [ 'text/x-yaml', 'text/yaml' ],
|
||||
mode: 'yaml',
|
||||
ext: [ 'yaml', 'yml' ],
|
||||
alias: [ 'yml' ],
|
||||
},
|
||||
];
|
||||
|
||||
export default modes;
|
|
@ -1,8 +1,3 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
|
@ -46,10 +41,6 @@
|
|||
<th>Server Name</th>
|
||||
<th>Owner</th>
|
||||
<th>Service</th>
|
||||
<th class="text-center">Memory</th>
|
||||
<th class="text-center">Disk</th>
|
||||
<th class="text-center">CPU</th>
|
||||
<th class="text-center">Status</th>
|
||||
</tr>
|
||||
@foreach($servers as $server)
|
||||
<tr data-server="{{ $server->uuid }}">
|
||||
|
@ -57,10 +48,6 @@
|
|||
<td><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></td>
|
||||
<td><a href="{{ route('admin.users.view', $server->owner_id) }}">{{ $server->user->username }}</a></td>
|
||||
<td>{{ $server->nest->name }} ({{ $server->egg->name }})</td>
|
||||
<td class="text-center"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '∞' : $server->memory }} MB</td>
|
||||
<td class="text-center"><span data-action="disk">--</span> / {{ $server->disk === 0 ? '∞' : $server->disk }} MB </td>
|
||||
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
|
||||
<td class="text-center" data-action="status">--</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
@ -74,8 +61,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
{!! Theme::js('js/admin/node/view-servers.js') !!}
|
||||
@endsection
|
|
@ -1,30 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.error')
|
||||
|
||||
@section('title')
|
||||
@lang('base.errors.403.header')
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12">
|
||||
<div class="box box-danger">
|
||||
<div class="box-body text-center">
|
||||
<h1 class="text-red" style="font-size: 160px !important;font-weight: 100 !important;">403</h1>
|
||||
<p class="text-muted">@lang('base.errors.403.desc')</p>
|
||||
</div>
|
||||
<div class="box-footer with-border">
|
||||
<a href="{{ URL::previous() }}"><button class="btn btn-danger">← @lang('base.errors.return')</button></a>
|
||||
<a href="/"><button class="btn btn-default">@lang('base.errors.home')</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,31 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.error')
|
||||
|
||||
@section('title')
|
||||
@lang('base.errors.404.header')
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<!-- This is why we don't let Pterodactyl's make links... fat fingered dinosaurs... -->
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12">
|
||||
<div class="box box-warning">
|
||||
<div class="box-body text-center">
|
||||
<h1 class="text-yellow" style="font-size: 160px !important;font-weight: 100 !important;">404</h1>
|
||||
<p class="text-muted">@lang('base.errors.404.desc')</p>
|
||||
</div>
|
||||
<div class="box-footer with-border">
|
||||
<a href="{{ URL::previous() }}"><button class="btn btn-warning">← @lang('base.errors.return')</button></a>
|
||||
<a href="/"><button class="btn btn-default">@lang('base.errors.home')</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Be right back.</title>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
color: #B0BEC5;
|
||||
display: table;
|
||||
font-weight: 100;
|
||||
font-family: 'Lato';
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 72px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="title">Be right back!</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.error')
|
||||
|
||||
@section('title')
|
||||
@lang('base.errors.installing.header')
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12">
|
||||
<div class="box box-info">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-info" style="width: 75%"></div>
|
||||
</div>
|
||||
<div class="box-body text-center">
|
||||
<p class="text-muted">@lang('base.errors.installing.desc')</p>
|
||||
</div>
|
||||
<div class="box-footer with-border">
|
||||
<a href="{{ URL::previous() }}"><button class="btn btn-info">← @lang('base.errors.return')</button></a>
|
||||
<a href="/"><button class="btn btn-default">@lang('base.errors.home')</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,30 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.error')
|
||||
|
||||
@section('title')
|
||||
@lang('base.errors.maintenance.header')
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12">
|
||||
<div class="box box-danger">
|
||||
<div class="box-body text-center">
|
||||
<h1 class="text-red" style="font-size: 3em !important;font-weight: 100 !important;">@lang('base.errors.maintenance.title')</h1>
|
||||
<p class="text-muted">@lang('base.errors.maintenance.desc')</p>
|
||||
</div>
|
||||
<div class="box-footer with-border">
|
||||
<a href="{{ URL::previous() }}"><button class="btn btn-danger">← @lang('base.errors.return')</button></a>
|
||||
<a href="/"><button class="btn btn-default">@lang('base.errors.home')</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,30 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
@extends('layouts.error')
|
||||
|
||||
@section('title')
|
||||
@lang('base.errors.suspended.header')
|
||||
@endsection
|
||||
|
||||
@section('content-header')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12">
|
||||
<div class="box box-danger">
|
||||
<div class="box-body text-center">
|
||||
<h1 class="text-red" style="font-size: 160px !important;font-weight: 100 !important;">403</h1>
|
||||
<p class="text-muted">@lang('base.errors.suspended.desc')</p>
|
||||
</div>
|
||||
<div class="box-footer with-border">
|
||||
<a href="{{ URL::previous() }}"><button class="btn btn-danger">← @lang('base.errors.return')</button></a>
|
||||
<a href="/"><button class="btn btn-default">@lang('base.errors.home')</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -176,7 +176,6 @@
|
|||
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/select2/select2.full.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('js/admin/functions.js?t={cache-version}') !!}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ config('app.name', 'Pterodactyl') }} - @yield('title')</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/favicons/manifest.json">
|
||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#bc6e3c">
|
||||
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
||||
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#0e4688">
|
||||
|
||||
@section('scripts')
|
||||
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
@show
|
||||
</head>
|
||||
<body id="particles-js" class="hold-transition login-page">
|
||||
<div class="container">
|
||||
<div id="login-position-elements">
|
||||
<div class="login-logo">
|
||||
{{ config('app.name', 'Pterodactyl') }}
|
||||
</div>
|
||||
@yield('content')
|
||||
<p class="small login-copyright text-center">
|
||||
Copyright © 2015 - {{ date('Y') }} <a href="https://pterodactyl.io/" target="_blank">Pterodactyl Software</a>.<br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-corner-info small">
|
||||
<strong><i class="fa fa-fw {{ $appIsGit ? 'fa-git-square' : 'fa-code-fork' }}"></i></strong> {{ $appVersion }}<br />
|
||||
<strong><i class="fa fa-fw fa-clock-o"></i></strong> {{ round(microtime(true) - LARAVEL_START, 3) }}s
|
||||
</div>
|
||||
|
||||
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
|
||||
<script src="/js/autocomplete.js" type="application/javascript"></script>
|
||||
{!! Theme::js('vendor/particlesjs/particles.min.js?t={cache-version}') !!}
|
||||
<script type="text/javascript">
|
||||
/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
|
||||
$(function () {
|
||||
particlesJS.load('particles-js', '{!! Theme::url('vendor/particlesjs/particles.json?t={cache-version}') !!}', function() {});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,69 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ config('app.name', 'Pterodactyl') }} - @yield('title')</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta name="_token" content="{{ csrf_token() }}">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/favicons/manifest.json">
|
||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#bc6e3c">
|
||||
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
||||
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#0e4688">
|
||||
|
||||
@section('scripts')
|
||||
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/sweetalert/sweetalert.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
@show
|
||||
</head>
|
||||
<body class="hold-transition skin-blue fixed sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<a href="{{ route('index') }}" class="logo">
|
||||
<span>{{ config('app.name', 'Pterodactyl') }}</span>
|
||||
</a>
|
||||
<nav class="navbar navbar-static-top"></nav>
|
||||
</header>
|
||||
<div class="content-wrapper" style="margin-left: 0;">
|
||||
<section class="content-header">
|
||||
@yield('content-header')
|
||||
</section>
|
||||
<section class="content">
|
||||
@yield('content')
|
||||
</section>
|
||||
</div>
|
||||
<footer class="main-footer" style="margin-left: 0;">
|
||||
<div class="pull-right hidden-xs small text-gray">
|
||||
<strong>v</strong> {{ config('app.version') }}
|
||||
</div>
|
||||
Copyright © 2015 - {{ date('Y') }} <a href="https://pterodactyl.io/">Pterodactyl Software</a>.
|
||||
</footer>
|
||||
</div>
|
||||
@section('footer-scripts')
|
||||
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
|
||||
@show
|
||||
</body>
|
||||
</html>
|
|
@ -1,310 +0,0 @@
|
|||
{{-- Pterodactyl - Panel --}}
|
||||
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- This software is licensed under the terms of the MIT license. --}}
|
||||
{{-- https://opensource.org/licenses/MIT --}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ config('app.name', 'Pterodactyl') }} - @yield('title')</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta name="_token" content="{{ csrf_token() }}">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/favicons/manifest.json">
|
||||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#bc6e3c">
|
||||
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
||||
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#0e4688">
|
||||
|
||||
@include('layouts.scripts')
|
||||
|
||||
@section('scripts')
|
||||
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/sweetalert/sweetalert.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('vendor/animate/animate.min.css?t={cache-version}') !!}
|
||||
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
@show
|
||||
</head>
|
||||
<body class="hold-transition skin-blue fixed sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<a href="{{ route('index') }}" class="logo">
|
||||
<span class="logo-lg">{{ config('app.name', 'Pterodactyl') }}</span>
|
||||
<span class="logo-mini"><img src="/favicons/android-chrome-192x192.png"></span>
|
||||
</a>
|
||||
<nav class="navbar navbar-static-top">
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="user-menu">
|
||||
<a href="{{ route('account') }}">
|
||||
<img src="https://www.gravatar.com/avatar/{{ md5(strtolower(Auth::user()->email)) }}?s=160" class="user-image" alt="User Image">
|
||||
<span class="hidden-xs">{{ Auth::user()->name_first }} {{ Auth::user()->name_last }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@if(isset($sidebarServerList))
|
||||
<li>
|
||||
<a href="#" data-toggle="control-sidebar">
|
||||
<i class="fa fa-server"></i>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->root_admin)
|
||||
<li>
|
||||
<li><a href="{{ route('admin.index') }}" data-toggle="tooltip" data-placement="bottom" title="@lang('strings.admin_cp')"><i class="fa fa-gears"></i></a></li>
|
||||
</li>
|
||||
@endif
|
||||
<li>
|
||||
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="@lang('strings.logout')"><i class="fa fa-sign-out"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<aside class="main-sidebar">
|
||||
<section class="sidebar">
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<div class="user-panel">
|
||||
<div class="info">
|
||||
<p>{{ $server->name }}</p>
|
||||
<a href="#" id="server_status_icon"><i class="fa fa-circle text-default"></i> Checking...</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<ul class="sidebar-menu tree" data-widget="tree">
|
||||
<li class="header">@lang('navigation.account.header')</li>
|
||||
<li class="{{ Route::currentRouteName() !== 'account' ?: 'active' }}">
|
||||
<a href="{{ route('account') }}">
|
||||
<i class="fa fa-user"></i> <span>@lang('navigation.account.my_account')</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Route::currentRouteName() !== 'account.security' ?: 'active' }}">
|
||||
<a href="{{ route('account.security')}}">
|
||||
<i class="fa fa-lock"></i> <span>@lang('navigation.account.security_controls')</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ (Route::currentRouteName() !== 'account.api' && Route::currentRouteName() !== 'account.api.new') ?: 'active' }}">
|
||||
<a href="{{ route('account.api')}}">
|
||||
<i class="fa fa-code"></i> <span>@lang('navigation.account.api_access')</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Route::currentRouteName() !== 'index' ?: 'active' }}">
|
||||
<a href="{{ route('index')}}">
|
||||
<i class="fa fa-server"></i> <span>@lang('navigation.account.my_servers')</span>
|
||||
</a>
|
||||
</li>
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<li class="header">@lang('navigation.server.header')</li>
|
||||
<li class="{{ Route::currentRouteName() !== 'server.index' ?: 'active' }}">
|
||||
<a href="{{ route('server.index', $server->uuidShort) }}">
|
||||
<i class="fa fa-terminal"></i> <span>@lang('navigation.server.console')</span>
|
||||
<span class="pull-right-container muted muted-hover" href="{{ route('server.console', $server->uuidShort) }}" id="console-popout">
|
||||
<span class="label label-default pull-right" style="padding: 3px 5px 2px 5px;">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@can('list-files', $server)
|
||||
<li
|
||||
@if(starts_with(Route::currentRouteName(), 'server.files'))
|
||||
class="active"
|
||||
@endif
|
||||
>
|
||||
<a href="{{ route('server.files.index', $server->uuidShort) }}">
|
||||
<i class="fa fa-files-o"></i> <span>@lang('navigation.server.file_management')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('list-subusers', $server)
|
||||
<li
|
||||
@if(starts_with(Route::currentRouteName(), 'server.subusers'))
|
||||
class="active"
|
||||
@endif
|
||||
>
|
||||
<a href="{{ route('server.subusers', $server->uuidShort)}}">
|
||||
<i class="fa fa-users"></i> <span>@lang('navigation.server.subusers')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('list-schedules', $server)
|
||||
<li
|
||||
@if(starts_with(Route::currentRouteName(), 'server.schedules'))
|
||||
class="active"
|
||||
@endif
|
||||
>
|
||||
<a href="{{ route('server.schedules', $server->uuidShort)}}">
|
||||
<i class="fa fa-clock-o"></i> <span>@lang('navigation.server.schedules')</span>
|
||||
<span class="pull-right-container">
|
||||
<span class="label label-primary pull-right">{{ \Pterodactyl\Models\Schedule::select('id')->where('server_id', $server->id)->where('is_active', 1)->count() }}</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('view-databases', $server)
|
||||
<li
|
||||
@if(starts_with(Route::currentRouteName(), 'server.databases'))
|
||||
class="active"
|
||||
@endif
|
||||
>
|
||||
<a href="{{ route('server.databases.index', $server->uuidShort)}}">
|
||||
<i class="fa fa-database"></i> <span>@lang('navigation.server.databases')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@if(Gate::allows('view-startup', $server) || Gate::allows('access-sftp', $server) || Gate::allows('view-allocations', $server))
|
||||
<li class="treeview
|
||||
@if(starts_with(Route::currentRouteName(), 'server.settings'))
|
||||
active
|
||||
@endif
|
||||
">
|
||||
<a href="#">
|
||||
<i class="fa fa-gears"></i>
|
||||
<span>@lang('navigation.server.configuration')</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
@can('view-name', $server)
|
||||
<li class="{{ Route::currentRouteName() !== 'server.settings.name' ?: 'active' }}"><a href="{{ route('server.settings.name', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.server_name')</a></li>
|
||||
@endcan
|
||||
@can('view-allocations', $server)
|
||||
<li class="{{ Route::currentRouteName() !== 'server.settings.allocation' ?: 'active' }}"><a href="{{ route('server.settings.allocation', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.port_allocations')</a></li>
|
||||
@endcan
|
||||
@can('access-sftp', $server)
|
||||
<li class="{{ Route::currentRouteName() !== 'server.settings.sftp' ?: 'active' }}"><a href="{{ route('server.settings.sftp', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.sftp_settings')</a></li>
|
||||
@endcan
|
||||
@can('view-startup', $server)
|
||||
<li class="{{ Route::currentRouteName() !== 'server.settings.startup' ?: 'active' }}"><a href="{{ route('server.settings.startup', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.startup_parameters')</a></li>
|
||||
@endcan
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->root_admin)
|
||||
<li class="header">@lang('navigation.server.admin_header')</li>
|
||||
<li>
|
||||
<a href="{{ route('admin.servers.view', $server->id) }}" target="_blank">
|
||||
<i class="fa fa-cog"></i> <span>@lang('navigation.server.admin')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
</ul>
|
||||
</section>
|
||||
</aside>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
@yield('content-header')
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
@if (count($errors) > 0)
|
||||
<div class="alert alert-danger">
|
||||
There was an error validating the data provided.<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@foreach (Alert::getMessages() as $type => $messages)
|
||||
@foreach ($messages as $message)
|
||||
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
|
||||
{!! $message !!}
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@yield('content')
|
||||
</section>
|
||||
</div>
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right small text-gray" style="margin-right:10px;margin-top:-7px;">
|
||||
<strong><i class="fa fa-fw {{ $appIsGit ? 'fa-git-square' : 'fa-code-fork' }}"></i></strong> {{ $appVersion }}<br />
|
||||
<strong><i class="fa fa-fw fa-clock-o"></i></strong> {{ round(microtime(true) - LARAVEL_START, 3) }}s
|
||||
</div>
|
||||
Copyright © 2015 - {{ date('Y') }} <a href="https://pterodactyl.io/">Pterodactyl Software</a>.
|
||||
</footer>
|
||||
@if(isset($sidebarServerList))
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<div class="tab-content">
|
||||
<ul class="control-sidebar-menu">
|
||||
@foreach($sidebarServerList as $sidebarServer)
|
||||
<li>
|
||||
<a href="{{ route('server.index', $sidebarServer->uuidShort) }}" @if(isset($server) && $sidebarServer->id === $server->id)class="active"@endif>
|
||||
@if($sidebarServer->owner_id === Auth::user()->id)
|
||||
<i class="menu-icon fa fa-user bg-blue"></i>
|
||||
@else
|
||||
<i class="menu-icon fa fa-user-o bg-gray"></i>
|
||||
@endif
|
||||
<div class="menu-info">
|
||||
<h4 class="control-sidebar-subheading">{{ str_limit($sidebarServer->name, 20) }}</h4>
|
||||
<p>{{ str_limit($sidebarServer->description, 20) }}</p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
@endif
|
||||
<div class="control-sidebar-bg"></div>
|
||||
</div>
|
||||
@section('footer-scripts')
|
||||
<script src="/js/keyboard.polyfill.js" type="application/javascript"></script>
|
||||
<script>keyboardeventKeyPolyfill.polyfill();</script>
|
||||
|
||||
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!}
|
||||
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!}
|
||||
<script src="/js/autocomplete.js" type="application/javascript"></script>
|
||||
|
||||
@if(Auth::user()->root_admin)
|
||||
<script>
|
||||
$('#logoutButton').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var that = this;
|
||||
swal({
|
||||
title: 'Do you want to log out?',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d9534f',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Log out'
|
||||
}, function () {
|
||||
window.location = $(that).attr('href');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@show
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue