├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.jdt.launching.prefs ├── README.md ├── lib ├── commons-lang3-3.7.jar ├── commons-lang3-LICENSE.txt ├── ini4j-0.5.4.jar ├── ini4j-LICENSE.txt ├── jbcrypt-0.4.jar ├── jbcrypt-LICENSE.txt ├── nanohttpd-2.3.1.jar └── nanohttpd-LICENSE.txt ├── screenshots ├── create_server_form.png ├── server_console.png ├── server_files.png └── server_list.png └── src └── oniicode └── craftmgr ├── Lang.java ├── MCServer.java ├── Main.java ├── Util.java ├── html ├── assets │ ├── FontAwesome.otf │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── dargen-mgmt.js │ ├── font-awesome.min.css │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── jquery-3.2.1.min.js │ ├── jquery-3.2.1.slim.min.js │ ├── notify.min.js │ ├── popper.min.js │ └── style.css ├── login.html ├── server_backups.html ├── server_backups_entry.html ├── server_config.html ├── server_config_entry.html ├── server_console.html ├── server_files.html ├── server_files_entry.html ├── server_files_entry_icon_file.html ├── server_files_entry_icon_folder.html ├── serverlist.html └── wi_root.html ├── interfaces ├── CLI.java ├── HTTPD.java └── SQ.java └── lang ├── de_DE.lang ├── en_GB.lang └── en_US.lang /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /templates/ 3 | /servers/ 4 | /config.ini -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CraftMGR 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.builder.cleanOutputFolder=clean 3 | org.eclipse.jdt.core.builder.duplicateResourceTask=warning 4 | org.eclipse.jdt.core.builder.invalidClasspath=abort 5 | org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore 6 | org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch 7 | org.eclipse.jdt.core.circularClasspath=error 8 | org.eclipse.jdt.core.classpath.exclusionPatterns=enabled 9 | org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled 10 | org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error 11 | org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 12 | org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 13 | org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 14 | org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= 15 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 16 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= 17 | org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 18 | org.eclipse.jdt.core.compiler.annotation.nullable.secondary= 19 | org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 20 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 21 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 22 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 23 | org.eclipse.jdt.core.compiler.compliance=1.8 24 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 25 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 26 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 27 | org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 28 | org.eclipse.jdt.core.compiler.problem.APILeak=warning 29 | org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 30 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 31 | org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 32 | org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 33 | org.eclipse.jdt.core.compiler.problem.deadCode=warning 34 | org.eclipse.jdt.core.compiler.problem.deprecation=warning 35 | org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 36 | org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 37 | org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 38 | org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore 39 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 40 | org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 41 | org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 42 | org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 43 | org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore 44 | org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 45 | org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 46 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 47 | org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 48 | org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 49 | org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 50 | org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 51 | org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 52 | org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 53 | org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 54 | org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 55 | org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 56 | org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 57 | org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 58 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 59 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 60 | org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning 61 | org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 62 | org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 63 | org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 64 | org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 65 | org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 66 | org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning 67 | org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 68 | org.eclipse.jdt.core.compiler.problem.nullReference=warning 69 | org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 70 | org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 71 | org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 72 | org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 73 | org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning 74 | org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 75 | org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 76 | org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 77 | org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 78 | org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 79 | org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 80 | org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 81 | org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 82 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 83 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 84 | org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 85 | org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 86 | org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 87 | org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 88 | org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 89 | org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 90 | org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning 91 | org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 92 | org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 93 | org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 94 | org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 95 | org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 96 | org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 97 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning 98 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled 99 | org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info 100 | org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 101 | org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 102 | org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 103 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 104 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 105 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 106 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 107 | org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 108 | org.eclipse.jdt.core.compiler.problem.unusedImport=warning 109 | org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 110 | org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 111 | org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore 112 | org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 113 | org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 114 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 115 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 116 | org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 117 | org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 118 | org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 119 | org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 120 | org.eclipse.jdt.core.compiler.source=1.8 121 | org.eclipse.jdt.core.incompatibleJDKLevel=ignore 122 | org.eclipse.jdt.core.incompleteClasspath=error 123 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.launching.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CraftMGR 2 | The Open-Source Minecraft game server management solution. 3 | 4 | ### Features 5 | * Run as **many minecraft servers** as your system resources can hold 6 | * Beautiful Bootstrap 4 themed **web interface**, including a 7 | * Realtime list of all servers 8 | * Realtime server console view 9 | * Interactive **command line interface** 10 | * **TCP-Socket interface**, for communication with your own application. 11 | * **All server versions supported**, including: 12 | * CraftBukkit/Spigot 13 | * BungeeCord 14 | * Forge 15 | * User-defined **server templates** _(place server.jar or a *.zip archive containing server files into the ```templates``` directory)_ 16 | * .ini config files 17 | * BCrypt encrypted passwords 18 | 19 | ### Screenshots 20 | 21 | ![Main view](screenshots/server_list.png) 22 | ![Simple server creation](screenshots/create_server_form.png) 23 | ![Realtime console view](screenshots/server_console.png) 24 | ![Coming soon: Web based file and text viewer/editor](screenshots/server_files.png) 25 | 26 | ## Setup 27 | 1) Build or get CraftMGR.jar 28 | 2) Optional: For additional security, create system user to run it with. ```adduser minecraft``` 29 | 3) Place CraftMGR.jar into desired directory on your server. e.G. on linux ```/home/minecraft``` 30 | 4) Run it with ```java -jar CraftMGR.jar```. You may use ```screen``` or a init-script to run it in background 31 | 5) Connect via web browser to ```http://
:9000/``` 32 | Default password is: ```imnotgerman``` 33 | 6) Enjoy 34 | 35 | ### Dependencies 36 | 37 | Runtime: 38 | - Java 8 39 | - ```screen``` is not required to run :D 40 | 41 | Build: 42 | - \>= commons-lang3-3.7 43 | - \>= ini4j-0.5.4 44 | - \>= jbcrypt-0.4 45 | - \>= nanohttpd-2.3.1 46 | 47 | 48 | 49 | 50 | 51 | ## TODOs & planned features: 52 | - Command line interface translation (very sorryy for lack of this!) 53 | - Code comments translation (again, very sorry.) 54 | - Password change option in web UI 55 | - HTTPS support 56 | - FTP support 57 | - Multi-user support 58 | - Documentation 59 | -------------------------------------------------------------------------------- /lib/commons-lang3-3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/lib/commons-lang3-3.7.jar -------------------------------------------------------------------------------- /lib/commons-lang3-LICENSE.txt: -------------------------------------------------------------------------------- 1 | http://www.apache.org/licenses/LICENSE-2.0 -------------------------------------------------------------------------------- /lib/ini4j-0.5.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/lib/ini4j-0.5.4.jar -------------------------------------------------------------------------------- /lib/ini4j-LICENSE.txt: -------------------------------------------------------------------------------- 1 | from http://ini4j.sourceforge.net/license.html 2 | 3 | Apache License 4 | Version 2.0, January 2004 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, 12 | and distribution as defined by Sections 1 through 9 of this document. 13 | 14 | "Licensor" shall mean the copyright owner or entity authorized by 15 | the copyright owner that is granting the License. 16 | 17 | "Legal Entity" shall mean the union of the acting entity and all 18 | other entities that control, are controlled by, or are under common 19 | control with that entity. For the purposes of this definition, 20 | "control" means (i) the power, direct or indirect, to cause the 21 | direction or management of such entity, whether by contract or 22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 23 | outstanding shares, or (iii) beneficial ownership of such entity. 24 | 25 | "You" (or "Your") shall mean an individual or Legal Entity 26 | exercising permissions granted by this License. 27 | 28 | "Source" form shall mean the preferred form for making modifications, 29 | including but not limited to software source code, documentation 30 | source, and configuration files. 31 | 32 | "Object" form shall mean any form resulting from mechanical 33 | transformation or translation of a Source form, including but 34 | not limited to compiled object code, generated documentation, 35 | and conversions to other media types. 36 | 37 | "Work" shall mean the work of authorship, whether in Source or 38 | Object form, made available under the License, as indicated by a 39 | copyright notice that is included in or attached to the work 40 | (an example is provided in the Appendix below). 41 | 42 | "Derivative Works" shall mean any work, whether in Source or Object 43 | form, that is based on (or derived from) the Work and for which the 44 | editorial revisions, annotations, elaborations, or other modifications 45 | represent, as a whole, an original work of authorship. For the purposes 46 | of this License, Derivative Works shall not include works that remain 47 | separable from, or merely link (or bind by name) to the interfaces of, 48 | the Work and Derivative Works thereof. 49 | 50 | "Contribution" shall mean any work of authorship, including 51 | the original version of the Work and any modifications or additions 52 | to that Work or Derivative Works thereof, that is intentionally 53 | submitted to Licensor for inclusion in the Work by the copyright owner 54 | or by an individual or Legal Entity authorized to submit on behalf of 55 | the copyright owner. For the purposes of this definition, "submitted" 56 | means any form of electronic, verbal, or written communication sent 57 | to the Licensor or its representatives, including but not limited to 58 | communication on electronic mailing lists, source code control systems, 59 | and issue tracking systems that are managed by, or on behalf of, the 60 | Licensor for the purpose of discussing and improving the Work, but 61 | excluding communication that is conspicuously marked or otherwise 62 | designated in writing by the copyright owner as "Not a Contribution." 63 | 64 | "Contributor" shall mean Licensor and any individual or Legal Entity 65 | on behalf of whom a Contribution has been received by Licensor and 66 | subsequently incorporated within the Work. 67 | 68 | 2. Grant of Copyright License. Subject to the terms and conditions of 69 | this License, each Contributor hereby grants to You a perpetual, 70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 71 | copyright license to reproduce, prepare Derivative Works of, 72 | publicly display, publicly perform, sublicense, and distribute the 73 | Work and such Derivative Works in Source or Object form. 74 | 75 | 3. Grant of Patent License. Subject to the terms and conditions of 76 | this License, each Contributor hereby grants to You a perpetual, 77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 78 | (except as stated in this section) patent license to make, have made, 79 | use, offer to sell, sell, import, and otherwise transfer the Work, 80 | where such license applies only to those patent claims licensable 81 | by such Contributor that are necessarily infringed by their 82 | Contribution(s) alone or by combination of their Contribution(s) 83 | with the Work to which such Contribution(s) was submitted. If You 84 | institute patent litigation against any entity (including a 85 | cross-claim or counterclaim in a lawsuit) alleging that the Work 86 | or a Contribution incorporated within the Work constitutes direct 87 | or contributory patent infringement, then any patent licenses 88 | granted to You under this License for that Work shall terminate 89 | as of the date such litigation is filed. 90 | 91 | 4. Redistribution. You may reproduce and distribute copies of the 92 | Work or Derivative Works thereof in any medium, with or without 93 | modifications, and in Source or Object form, provided that You 94 | meet the following conditions: 95 | 96 | (a) You must give any other recipients of the Work or 97 | Derivative Works a copy of this License; and 98 | 99 | (b) You must cause any modified files to carry prominent notices 100 | stating that You changed the files; and 101 | 102 | (c) You must retain, in the Source form of any Derivative Works 103 | that You distribute, all copyright, patent, trademark, and 104 | attribution notices from the Source form of the Work, 105 | excluding those notices that do not pertain to any part of 106 | the Derivative Works; and 107 | 108 | (d) If the Work includes a "NOTICE" text file as part of its 109 | distribution, then any Derivative Works that You distribute must 110 | include a readable copy of the attribution notices contained 111 | within such NOTICE file, excluding those notices that do not 112 | pertain to any part of the Derivative Works, in at least one 113 | of the following places: within a NOTICE text file distributed 114 | as part of the Derivative Works; within the Source form or 115 | documentation, if provided along with the Derivative Works; or, 116 | within a display generated by the Derivative Works, if and 117 | wherever such third-party notices normally appear. The contents 118 | of the NOTICE file are for informational purposes only and 119 | do not modify the License. You may add Your own attribution 120 | notices within Derivative Works that You distribute, alongside 121 | or as an addendum to the NOTICE text from the Work, provided 122 | that such additional attribution notices cannot be construed 123 | as modifying the License. 124 | 125 | You may add Your own copyright statement to Your modifications and 126 | may provide additional or different license terms and conditions 127 | for use, reproduction, or distribution of Your modifications, or 128 | for any such Derivative Works as a whole, provided Your use, 129 | reproduction, and distribution of the Work otherwise complies with 130 | the conditions stated in this License. 131 | 132 | 5. Submission of Contributions. Unless You explicitly state otherwise, 133 | any Contribution intentionally submitted for inclusion in the Work 134 | by You to the Licensor shall be under the terms and conditions of 135 | this License, without any additional terms or conditions. 136 | Notwithstanding the above, nothing herein shall supersede or modify 137 | the terms of any separate license agreement you may have executed 138 | with Licensor regarding such Contributions. 139 | 140 | 6. Trademarks. This License does not grant permission to use the trade 141 | names, trademarks, service marks, or product names of the Licensor, 142 | except as required for reasonable and customary use in describing the 143 | origin of the Work and reproducing the content of the NOTICE file. 144 | 145 | 7. Disclaimer of Warranty. Unless required by applicable law or 146 | agreed to in writing, Licensor provides the Work (and each 147 | Contributor provides its Contributions) on an "AS IS" BASIS, 148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 149 | implied, including, without limitation, any warranties or conditions 150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 151 | PARTICULAR PURPOSE. You are solely responsible for determining the 152 | appropriateness of using or redistributing the Work and assume any 153 | risks associated with Your exercise of permissions under this License. 154 | 155 | 8. Limitation of Liability. In no event and under no legal theory, 156 | whether in tort (including negligence), contract, or otherwise, 157 | unless required by applicable law (such as deliberate and grossly 158 | negligent acts) or agreed to in writing, shall any Contributor be 159 | liable to You for damages, including any direct, indirect, special, 160 | incidental, or consequential damages of any character arising as a 161 | result of this License or out of the use or inability to use the 162 | Work (including but not limited to damages for loss of goodwill, 163 | work stoppage, computer failure or malfunction, or any and all 164 | other commercial damages or losses), even if such Contributor 165 | has been advised of the possibility of such damages. 166 | 167 | 9. Accepting Warranty or Additional Liability. While redistributing 168 | the Work or Derivative Works thereof, You may choose to offer, 169 | and charge a fee for, acceptance of support, warranty, indemnity, 170 | or other liability obligations and/or rights consistent with this 171 | License. However, in accepting such obligations, You may act only 172 | on Your own behalf and on Your sole responsibility, not on behalf 173 | of any other Contributor, and only if You agree to indemnify, 174 | defend, and hold each Contributor harmless for any liability 175 | incurred by, or claims asserted against, such Contributor by reason 176 | of your accepting any such warranty or additional liability. 177 | 178 | END OF TERMS AND CONDITIONS 179 | 180 | APPENDIX: How to apply the Apache License to your work. 181 | 182 | To apply the Apache License to your work, attach the following 183 | boilerplate notice, with the fields enclosed by brackets "[]" 184 | replaced with your own identifying information. (Don't include 185 | the brackets!) The text should be enclosed in the appropriate 186 | comment syntax for the file format. We also recommend that a 187 | file or class name and description of purpose be included on the 188 | same "printed page" as the copyright notice for easier 189 | identification within third-party archives. 190 | 191 | Copyright [yyyy] [name of copyright owner] 192 | 193 | Licensed under the Apache License, Version 2.0 (the "License"); 194 | you may not use this file except in compliance with the License. 195 | You may obtain a copy of the License at 196 | 197 | http://www.apache.org/licenses/LICENSE-2.0 198 | 199 | Unless required by applicable law or agreed to in writing, software 200 | distributed under the License is distributed on an "AS IS" BASIS, 201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 202 | See the License for the specific language governing permissions and 203 | limitations under the License. -------------------------------------------------------------------------------- /lib/jbcrypt-0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/lib/jbcrypt-0.4.jar -------------------------------------------------------------------------------- /lib/jbcrypt-LICENSE.txt: -------------------------------------------------------------------------------- 1 | from https://github.com/jeremyh/jBCrypt/blob/jbcrypt-0.4/LICENSE 2 | 3 | jBCrypt is subject to the following license: 4 | 5 | /* 6 | * Copyright (c) 2006 Damien Miller 7 | * 8 | * Permission to use, copy, modify, and distribute this software for any 9 | * purpose with or without fee is hereby granted, provided that the above 10 | * copyright notice and this permission notice appear in all copies. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | */ -------------------------------------------------------------------------------- /lib/nanohttpd-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/lib/nanohttpd-2.3.1.jar -------------------------------------------------------------------------------- /lib/nanohttpd-LICENSE.txt: -------------------------------------------------------------------------------- 1 | from https://github.com/NanoHttpd/nanohttpd/blob/master/LICENSE.md 2 | 3 | Copyright (c) 2012-2013 by Paul S. Hawke, 2001,2005-2013 by Jarno Elonen, 2010 by Konstantinos Togias 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 11 | 12 | * Neither the name of the NanoHttpd organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /screenshots/create_server_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/screenshots/create_server_form.png -------------------------------------------------------------------------------- /screenshots/server_console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/screenshots/server_console.png -------------------------------------------------------------------------------- /screenshots/server_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/screenshots/server_files.png -------------------------------------------------------------------------------- /screenshots/server_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/screenshots/server_list.png -------------------------------------------------------------------------------- /src/oniicode/craftmgr/Lang.java: -------------------------------------------------------------------------------- 1 | package oniicode.craftmgr; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.net.URL; 7 | import java.util.ArrayList; 8 | import java.util.HashMap; 9 | 10 | /** 11 | * UI Language Loader 12 | * @author Oniicode 13 | * 14 | */ 15 | public class Lang { 16 | 17 | public HashMap hashie; 18 | 19 | 20 | private String primary = "en_GB"; 21 | private String secondary = "en_US"; 22 | 23 | /** 24 | * @param primary Desired language. Entries from here override those from secondary language file. 25 | * @param secondary Secondary (Fallback) language file. Entries will be read from here, if not found in Primary. 26 | */ 27 | public Lang(String primary, String secondary) { 28 | this.primary = primary; 29 | this.secondary = secondary; 30 | } 31 | 32 | public Lang(String primary) { 33 | this.primary = primary; 34 | } 35 | 36 | /** 37 | * Constructor for default Language 38 | */ 39 | public Lang() {} 40 | 41 | 42 | /** 43 | * Builds Hashmap 44 | * @throws IOException on Error 45 | */ 46 | public void load() throws Exception { 47 | this.hashie = new HashMap(); 48 | // Load Secondary "Fallback" language file first 49 | ArrayList secondary = this.readLangfile(this.secondary); 50 | for(String s : secondary) { 51 | if(s.contains("=")) { 52 | String[] d = s.split("="); 53 | this.hashie.put(d[0], d[1]); 54 | } 55 | } 56 | 57 | ArrayList primary = this.readLangfile(this.primary); 58 | for(String s : primary) { 59 | if(s.contains("=")) { 60 | String[] d = s.split("=", 2); 61 | this.hashie.put(d[0], d[1]); 62 | } 63 | } 64 | } 65 | 66 | private ArrayList readLangfile(String lang) throws Exception { 67 | URL res = Util.getResource(Main.class, "lang/"+this.secondary+".lang"); 68 | BufferedReader r = new BufferedReader(new InputStreamReader(res.openStream())); 69 | ArrayList l = new ArrayList(); 70 | String s; 71 | while ((s = r.readLine()) != null) { 72 | l.add(s); 73 | } 74 | return l; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/MCServer.java: -------------------------------------------------------------------------------- 1 | package oniicode.craftmgr; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.BufferedWriter; 5 | import java.io.File; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStreamReader; 9 | import java.io.OutputStreamWriter; 10 | import java.nio.file.Files; 11 | import java.util.ArrayList; 12 | import java.util.Scanner; 13 | 14 | import org.ini4j.Ini; 15 | 16 | public class MCServer { 17 | 18 | public enum State{ 19 | ONLINE, 20 | OFFLINE, 21 | STARTING, 22 | ERROR 23 | } 24 | 25 | private Thread consoleThread; 26 | private Process process; //java-process of the server 27 | private String console; 28 | private BufferedWriter consoleWriter; 29 | 30 | private File dir; 31 | 32 | public MCServer(int id) { 33 | this.id = id; 34 | this.dir = new File(Main.deploymentDir.getPath() + File.separator + this.id); 35 | } 36 | 37 | public int pid = 0; 38 | private int id = -1; 39 | 40 | /** 41 | * 42 | * @return Server-ID des Servers :D 43 | */ 44 | public int getID() { 45 | return this.id; 46 | } 47 | 48 | /** 49 | * Installationsverzeichnis dieses Servers 50 | * @return 51 | */ 52 | public File getDir() { 53 | return this.dir; 54 | } 55 | 56 | //TODO: Bungeecord Port Detection 57 | public int getPort() { 58 | File f_server_properties = new File(this.dir.getPath() + File.separator + "files" + File.separator + "server.properties"); 59 | if (f_server_properties.exists()) { 60 | try { 61 | String[] lines = new String(Files.readAllBytes(f_server_properties.toPath())).split("[\\r\\n]+"); 62 | for (String s : lines) { 63 | if (s.contains("server-port")) { 64 | return Integer.parseInt(s.split("=")[1]); 65 | } 66 | } 67 | return -2; 68 | } catch (Throwable e) { 69 | e.printStackTrace(); 70 | return -1; 71 | } 72 | } 73 | return -1; 74 | } 75 | 76 | /** 77 | * 78 | * @return Beschreibung des Servers, "ERROR" bei Lesefehler. 79 | */ 80 | public String getDesc() { 81 | String s = this.getIni().get("Server", "Desc"); 82 | if(s!=null) 83 | return s; 84 | else { 85 | System.err.println("[Server #"+id+"] [!] Ung�ltige Desc-Angabe in server.ini ("+s+")"); 86 | return "ERROR"; 87 | } 88 | } 89 | 90 | /** 91 | * 92 | * @return Anzahl an zugewiesenem Arbeitsspeicher in MB. ("512" bei Fehler) 93 | */ 94 | public int getMemory() { 95 | String s = this.getIni().get("Server", "Memory").replace("M", ""); 96 | try { 97 | return Integer.parseInt(s); 98 | }catch (NumberFormatException e) { 99 | System.err.println("[Server #"+id+"] [!] Ung�ltige Memory-Angabe in server.ini ("+s+"). Benutze Fallback: 512M"); 100 | return 512; 101 | } 102 | 103 | } 104 | 105 | public Ini getIni() { 106 | File f = new File(this.dir.getPath() + File.separator + "server.ini"); 107 | try { 108 | return new Ini(f); 109 | } catch (Throwable t) { 110 | System.err.println("[Server #"+id+"] [!] Ein Fehler beim Lesen der server.ini ist aufgetreten. ("+f.getPath()+")"); 111 | t.printStackTrace(); 112 | return null; 113 | } 114 | } 115 | 116 | public MCServer.State getState() { 117 | if (process == null || !process.isAlive()) { 118 | return MCServer.State.OFFLINE; 119 | } else { 120 | return MCServer.State.ONLINE; 121 | } 122 | } 123 | 124 | public String getConsole() { 125 | return this.console; 126 | } 127 | 128 | public String[] getCmdline() { 129 | String s = "java-default"; 130 | try { 131 | s = this.getIni().get("Server", "Cmdline"); 132 | if(!s.equalsIgnoreCase("java-default")) 133 | return s.trim().split("\\s+"); 134 | }catch (Exception e) {} 135 | System.out.println("[Server #"+id+"] Cmdline: "+s); 136 | return new String[] {"java", "-Xmx"+this.getMemory()+"M", "-jar", "server.jar"}; 137 | } 138 | 139 | /** 140 | * Startet den Server. 141 | * @return true bei erfolg 142 | */ 143 | public boolean start() { 144 | if(this.process != null && process.isAlive()) 145 | return false; 146 | try { 147 | ProcessBuilder builder = new ProcessBuilder(this.getCmdline()); 148 | builder.redirectErrorStream(true); 149 | builder.directory(new File(this.dir.getPath()+File.separator+"files")); 150 | this.process = builder.start(); 151 | this.consoleThread = new Thread(processReader); 152 | this.consoleThread.start(); 153 | this.consoleWriter = new BufferedWriter(new OutputStreamWriter(process.getOutputStream())); 154 | Ini i = this.getIni(); 155 | i.put("Server", "Recently-Started", Util.curDate()); 156 | i.store(); 157 | return true; 158 | } catch (Throwable e) { 159 | e.printStackTrace(); 160 | return false; 161 | } 162 | 163 | } 164 | 165 | public boolean stop() { 166 | return this.sendCommand("stop"); 167 | } 168 | 169 | public boolean kill() { 170 | if(process != null && process.isAlive()) { 171 | System.out.println("[Server #"+id+"] wird zwangsbeendet . . ."); 172 | this.process.destroyForcibly(); 173 | return true; 174 | }else return false; 175 | } 176 | 177 | public boolean sendCommand(String cmd) { 178 | if(consoleWriter != null) try { 179 | this.consoleWriter.write(cmd+"\n"); 180 | this.consoleWriter.flush(); 181 | return true; 182 | } catch (IOException e) { 183 | e.printStackTrace(); 184 | return false; 185 | } else return false; 186 | } 187 | 188 | private Runnable processReader = new Runnable() { 189 | public void run() { 190 | try { 191 | System.out.println("[SERVER #"+id+"] Wird gestartet . . ."); 192 | consolePrintln("\n\n"+Main.lang.hashie.get("c_server_starting")); 193 | BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream())); 194 | String s; 195 | try { 196 | while ((s = br.readLine()) != null) { 197 | System.out.println("[SERVER #"+id+"]: " + s); 198 | consolePrintln(s); 199 | } 200 | }catch(IOException e) { 201 | System.err.println("[!] IOE"); 202 | } 203 | 204 | process.waitFor(); 205 | System.out.println("[SERVER #"+id+"] Beendet. (" + process.exitValue() + ")"); 206 | consolePrintln("\n\n"+Main.lang.hashie.get("c_server_exited").replace("%s", process.exitValue()+"")); 207 | consoleWriter.close(); 208 | consoleWriter = null; 209 | process.destroy(); 210 | } catch (Exception e) { 211 | e.printStackTrace(); 212 | } 213 | } 214 | }; 215 | private void consolePrintln(String x) { 216 | this.console += x + "\n"; 217 | } 218 | 219 | 220 | public File getFile(String path) { 221 | return new File(this.dir.getPath() + File.separator + "files" + File.separator + path); 222 | } 223 | 224 | /** 225 | * Erstellt einen Server im Deploymentverzeichnis und registriert ihn. 226 | * @param desc Serverbeschreibung. 227 | * @param port Port auf den der Server gelegt werden soll. 228 | * @param template Name der Template (*.jar oder *.zip) anhand welcher der Server erstellt werden soll. 229 | * @param memory Anzahl an RAM welche dem Server zugewiesen werden soll (in MB) 230 | * @param Soll der Server automatisch beim Starten des Systems mitgestartet werden? 231 | * @return ID des erstellten Servers, Bei error ein Negativer INT der den Errorcode darstellt. 232 | */ 233 | public static int Create(String desc, int port, String template, int memory, boolean autostart) { 234 | //Neue ID bestimmen 235 | int id = 0; 236 | for(String f : Main.deploymentDir.list()) { 237 | try { 238 | int i = Integer.parseInt(f); 239 | if(i > id) 240 | id = i; 241 | }catch (NumberFormatException e) { 242 | continue; 243 | } 244 | } 245 | id++; 246 | File serverdir; 247 | while(true) { 248 | serverdir = new File(Main.deploymentDir.getPath() + File.separator + id); 249 | if(serverdir.exists()) { 250 | id++; 251 | continue; 252 | }else break; 253 | } 254 | 255 | //Template check. 256 | if(!getTemplates().contains(template)) 257 | return -1; 258 | 259 | 260 | //Ordner erstellen. 261 | serverdir.mkdir(); 262 | File serverdir_files = new File(serverdir.getPath() + File.separator + "files"); 263 | serverdir_files.mkdir(); 264 | File serverdir_backups = new File(serverdir.getPath() + File.separator + "backups"); 265 | serverdir_backups.mkdir(); 266 | 267 | //server.ini erstellen. 268 | try { 269 | File inifile = new File(serverdir.getPath() + File.separator + "server.ini"); 270 | if(!inifile.createNewFile()) 271 | return -2; 272 | FileOutputStream f = new FileOutputStream(inifile); 273 | String defaultConfig = 274 | "[Server]\n" + 275 | "Desc="+desc.replace("\n", " ")+"\n" + 276 | "Memory="+memory+"M\n" + 277 | "Autostart="+Boolean.toString(autostart)+"\n" + 278 | "Cmdline=java-default\n" + 279 | "Time-Created="+Util.curDate()+"\n" + 280 | "\n"; 281 | f.write(defaultConfig.getBytes("UTF-8")); 282 | f.flush(); 283 | f.close(); 284 | } catch (Throwable e) { 285 | e.printStackTrace(); 286 | return -2; 287 | } 288 | 289 | //eula.txt erstellen. 290 | try { 291 | File fi = new File(serverdir_files.getPath() + File.separator + "eula.txt"); 292 | if(!fi.createNewFile()) 293 | return -3; 294 | FileOutputStream f = new FileOutputStream(fi); 295 | f.write("eula=true".getBytes("UTF-8")); 296 | f.flush(); 297 | f.close(); 298 | } catch (Throwable e) { 299 | e.printStackTrace(); 300 | return -3; 301 | } 302 | 303 | //server.properties erstellen. 304 | try { 305 | File fi = new File(serverdir_files.getPath() + File.separator + "server.properties"); 306 | if(!fi.createNewFile()) 307 | return -3; 308 | FileOutputStream f = new FileOutputStream(fi); 309 | String s = "server-port=" + port; 310 | f.write(s.getBytes("UTF-8")); 311 | f.flush(); 312 | f.close(); 313 | } catch (Throwable e) { 314 | e.printStackTrace(); 315 | return -3; 316 | } 317 | 318 | //Template kopieren. 319 | File f_template = new File("templates" + File.separator + template); 320 | if(f_template.getName().endsWith(".zip") || f_template.getName().endsWith(".ZIP")) { 321 | try { 322 | File dest = new File(serverdir_files.getPath() + File.separator + "server.zip"); 323 | Util.copy(f_template, dest); 324 | if(!Util.unzip(dest, serverdir_files)) 325 | return -6; 326 | else { 327 | File lin = new File(serverdir_files.getPath() + File.separator + "cmdline-temp.txt"); 328 | if(lin.exists() && lin.isFile() && !lin.isDirectory()) { 329 | Ini iniichan = new Ini(new File(serverdir.getPath() + File.separator + "server.ini")); 330 | Scanner sc = new Scanner(lin); 331 | if(sc.hasNextLine()) { 332 | iniichan.put("Server", "Cmdline", sc.nextLine()); 333 | iniichan.store(); 334 | } 335 | sc.close(); 336 | lin.delete(); 337 | } 338 | } 339 | } catch (Throwable e) { 340 | e.printStackTrace(); 341 | return -5; 342 | } 343 | }else if(f_template.getName().endsWith(".jar") || f_template.getName().endsWith(".jar")) { 344 | try { 345 | Util.copy(f_template, new File(serverdir_files.getPath() + File.separator + "server.jar")); 346 | } catch (Throwable e) { 347 | e.printStackTrace(); 348 | return -5; 349 | } 350 | }else if(f_template.isDirectory()){ 351 | try { 352 | Util.copy(f_template, serverdir_files); 353 | } catch (Throwable e) { 354 | e.printStackTrace(); 355 | return -5; 356 | } 357 | } 358 | 359 | System.out.println("[Server #"+id+"] Erfolgreich erstellt."); 360 | Main.servers.add(new MCServer(id)); 361 | return id; 362 | } 363 | 364 | /** 365 | * L�scht einen Server aus dem Deploymentverzeichnis und deregistriert ihn. 366 | * @param id ID des zu l�schenden Servers 367 | * @return true bei Erfolg. 368 | */ 369 | public static boolean Delete(int id) { 370 | try { 371 | MCServer srvr = MCServer.getByID(id); 372 | if(srvr != null) { 373 | srvr.kill(); 374 | Util.deleteFileOrFolder(new File(Main.deploymentDir.getPath() + File.separator + srvr.getID()).toPath()); 375 | Main.servers.remove(srvr); 376 | System.out.println("[Server #"+id+"] Deleted."); 377 | return true; 378 | } 379 | else { 380 | System.err.println("404: Server #"+id+" nicht gefunden."); 381 | return false; 382 | } 383 | }catch(Throwable t) { 384 | System.err.println("Fehler beim l�schen von Server #"+id); 385 | t.printStackTrace(); 386 | return false; 387 | } 388 | 389 | } 390 | 391 | /** 392 | * Sucht einen MCServer nach ID 393 | * 394 | * @param id Server-ID der gesuchten Servers 395 | * @return Der gefundene Server. NULL falls nicht gefunden 396 | */ 397 | public static MCServer getByID(int id) { 398 | for(MCServer srv : Main.servers) { 399 | if(srv.id == id) 400 | return srv; 401 | else continue; 402 | } 403 | return null; 404 | } 405 | 406 | public static ArrayList getTemplates() { 407 | ArrayList s = new ArrayList(); 408 | File f = Main.templatesDir; 409 | if(!f.exists()) { 410 | f.mkdir(); 411 | }else if(!f.isDirectory()) { 412 | System.err.println("[!] Fehler: Template-Verzeichnis nicht erstellbar."); 413 | return s; 414 | } 415 | for(String l : f.list()) 416 | s.add(l); 417 | return s; 418 | } 419 | 420 | public ArrayList getBackups() { 421 | ArrayList s = new ArrayList(); 422 | File f = new File(this.dir.getPath() + File.separator + "backups"); 423 | if(!f.exists()) { 424 | f.mkdir(); 425 | }else if(!f.isDirectory()) { 426 | System.err.println("[!] Fehler: Backups-Verzeichnis nicht erstellbar."); 427 | return s; 428 | } 429 | for(String l : f.list()) 430 | s.add(l); 431 | return s; 432 | } 433 | 434 | public boolean createBackup(String desc) { 435 | File zip = new File(this.dir.getPath() + File.separator + "backups" + File.separator + desc + ".zip"); 436 | if(zip.exists()) { 437 | System.err.println("[!] [Server #\"+this.id+\"] Fehleler beim Erstellen des Backups: Ein Backup mit der Beschreibung \""+desc+"\" existiert bereits."); 438 | return false; 439 | } 440 | 441 | try { 442 | if(!zip.createNewFile()) { 443 | System.err.println("[!] [Server #"+this.id+"] Fehler beim Erstellen des Backups \""+desc+".zip\". (Datei kann nicht erstellt werden)"); 444 | return false; 445 | } 446 | if(Util.mkzip(new File(this.dir.getPath() + File.separator + "files"), zip)) { 447 | System.out.println("[Server #"+this.id+"] Backup erstellt."); 448 | return true; 449 | }else { 450 | return false; 451 | } 452 | } catch (IOException e) { 453 | e.printStackTrace(); 454 | return false; 455 | } catch (SecurityException e) { 456 | System.err.println("[!] [Server #"+this.id+"] Fehler beim Erstellen des Backups \""+desc+".zip\". (Zugriff verweigert)"); 457 | return false; 458 | } 459 | } 460 | 461 | public boolean deleteBackup(String desc) { 462 | File zip = new File(this.dir.getPath() + File.separator + "backups" + File.separator + desc + ".zip"); 463 | if(zip.exists()) { 464 | if(zip.delete()) { 465 | System.out.println("[Server #"+this.id+"] Backup \""+desc+"\" gel�scht."); 466 | 467 | return true; 468 | }else { 469 | System.err.println("[!] [Server #"+this.id+"] Beim L�schen des Backups \""+desc+"\" ist ein Fehler aufgetreten."); 470 | return false; 471 | } 472 | }else { 473 | System.err.println("[!] Fehler: Zu l�schendes Backup existiert nicht."); 474 | return false; 475 | } 476 | } 477 | 478 | public boolean applyBackup(String desc) { 479 | if(this.getBackups().contains(desc+ ".zip")) { 480 | System.out.println("[Server #"+this.id+"] Backup \""+desc+"\" wird aufgespielt . . ."); 481 | 482 | File backup = new File(this.dir.getPath() + File.separator + "backups" + File.separator + desc + ".zip"); 483 | if(!backup.exists() || backup.isDirectory()) { 484 | System.err.println("[!] [Server #"+this.id+"] Beim Aufspielen des Backups \""+desc+"\" ist ein Fehler aufgetreten. (0)"); 485 | return false; 486 | } 487 | try { 488 | Util.deleteFileOrFolder(new File(this.dir.getPath() + File.separator + "files").toPath()); 489 | } catch (IOException e) { 490 | System.err.println("[!] [Server #"+this.id+"] Beim Aufspielen des Backups \""+desc+"\" ist ein Fehler aufgetreten. (1)"); 491 | e.printStackTrace(); 492 | return false; 493 | } 494 | File files_dir = new File(this.dir.getPath() + File.separator + "files"); 495 | if(!files_dir.exists() && !files_dir.mkdir()) { 496 | System.err.println("[!] [Server #"+this.id+"] Beim Aufspielen des Backups \""+desc+"\" ist ein Fehler aufgetreten. (2)"); 497 | return false; 498 | } 499 | if(!Util.unzip(backup, files_dir)) { 500 | System.err.println("[!] [Server #"+this.id+"] Beim Aufspielen des Backups \""+desc+"\" ist ein Fehler aufgetreten. (3)"); 501 | return false; 502 | } 503 | System.out.println("[Server #"+this.id+"] Backup erfolgreich geladen."); 504 | return true; 505 | }else { 506 | System.err.println("[!] Fehler: Konnte unbekanntes Backup \""+desc+"\" nicht aufspielen."); 507 | return false; 508 | } 509 | 510 | 511 | 512 | } 513 | 514 | 515 | 516 | 517 | } 518 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/Main.java: -------------------------------------------------------------------------------- 1 | package oniicode.craftmgr; 2 | 3 | import java.io.File; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.Arrays; 8 | import java.util.Scanner; 9 | 10 | import org.ini4j.Ini; 11 | 12 | import oniicode.craftmgr.interfaces.CLI; 13 | import oniicode.craftmgr.interfaces.HTTPD; 14 | import oniicode.craftmgr.interfaces.SQ; 15 | 16 | public class Main { 17 | 18 | public static String version = "v1.6pb"; 19 | public static String appname = "CraftMGR"; 20 | public static Ini config; 21 | public static Lang lang; 22 | 23 | public static File deploymentDir; 24 | public static File templatesDir; 25 | public static ArrayList servers; 26 | 27 | /* Interfaces ^_^ */ 28 | private static CLI cli; //Command line 29 | public static HTTPD httpd; //Web interface 30 | public static SQ sq; //ServerSocket 31 | 32 | public static String textheader = "C r a f t M G R\n(c) Oniicode 2018\n"; 33 | 34 | public static void main(String[] args) { 35 | System.out.println(textheader); 36 | System.out.println("Version: " + version); 37 | 38 | //Environment Check 39 | try { 40 | System.out.println("Deployment-Path: " + Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); 41 | } catch (Exception e1) { 42 | System.out.println("Deployment-Path: " + "ERROR"); 43 | return; 44 | } 45 | 46 | //Load Config 47 | if(!loadConfig())return; 48 | 49 | //Load Human Language 50 | lang = new Lang(config.get("Language", "language")); 51 | try { 52 | lang.load(); 53 | } catch (Exception e2) { 54 | System.err.println("[!] Error: Couldn't load human language file."); 55 | e2.printStackTrace(); 56 | return; 57 | } 58 | 59 | File templates = new File("templates"); 60 | if(!templates.exists()) if(!templates.mkdir()) { 61 | System.err.println("[!] Error: Couldn't create templates directory."); 62 | return; 63 | } 64 | 65 | 66 | 67 | //Init Dirs 68 | if(!loadDirs())return; 69 | 70 | //load MCServer 71 | loadServers(); 72 | 73 | //Try to start web interface until its running, if enabled. 74 | int trys = 3; 75 | while (trys>0) { 76 | if(!(config.get("HTTPD").get("enabled").equalsIgnoreCase("true"))) { 77 | System.out.println("Webserver-Port: "); 78 | break; 79 | } 80 | try { 81 | httpd = new HTTPD(config); 82 | httpd.Start(); 83 | } catch (Throwable e) { 84 | System.err.println("[!] Fehler beim Starten des Web Interface. (Versuche noch "+trys+" mal)"); 85 | e.printStackTrace(); 86 | try { 87 | Thread.sleep(1200L); 88 | } catch (InterruptedException e1) { 89 | System.out.println("Interrupted."); 90 | break; 91 | } 92 | trys--; 93 | continue; 94 | } 95 | break; 96 | } 97 | 98 | trys = 3; 99 | while (trys>0) { 100 | if(!(config.get("ServerQuery").get("enabled").equalsIgnoreCase("true"))) { 101 | System.out.println("Query-Port: "); 102 | break; 103 | } 104 | try { 105 | sq = new SQ(config); 106 | sq.Start(); 107 | } catch (Throwable e) { 108 | System.err.println("/!\\ Fehler beim Starten des ControlSocket Interface. (Versuche noch "+trys+" mal)"); 109 | e.printStackTrace(); 110 | try { 111 | Thread.sleep(1200L); 112 | } catch (InterruptedException e1) { 113 | System.out.println("Abgebrochen."); 114 | break; 115 | } 116 | trys--; 117 | continue; 118 | } 119 | break; 120 | } 121 | 122 | //Shutdown Hook 123 | Runtime.getRuntime().addShutdownHook(new Thread() 124 | { 125 | @Override 126 | public void run() 127 | { 128 | if(httpd != null) 129 | httpd.Stop(); 130 | for(MCServer srv : servers) 131 | srv.kill(); 132 | System.out.println("\n\nBye, Hacker-san :3"); 133 | } 134 | }); 135 | 136 | System.out.println("\nDone! Gib \"help\" ein, um Befehle aufzulisten"); 137 | 138 | //Finally, start the [C]ommand [L]ine [I]nterface 139 | cli = new CLI(); 140 | Scanner scan = new Scanner(System.in); 141 | while (scan.hasNext()){ 142 | String s = scan.nextLine(); 143 | String[] cmd = s.trim().split("\\s+"); 144 | 145 | if(cmd[0].equalsIgnoreCase("quit")) { 146 | break; 147 | }else { 148 | cli.command(cmd); 149 | } 150 | System.out.println(""); 151 | continue; 152 | } 153 | scan.close(); 154 | } 155 | 156 | /** 157 | * Initialisiert Einstellungsdatei 158 | * @return 159 | */ 160 | private static boolean loadConfig() { 161 | File inifile = new File("config.ini"); 162 | if(!inifile.exists()) { //Erstelle Default wenn nicht gefunden. 163 | System.out.println("Einstellungsdatei nicht gefunden, erstelle Default."); 164 | try { 165 | FileOutputStream f = new FileOutputStream(inifile); 166 | String defaultConfig = 167 | "[Language]\n"+ 168 | "language=en_GB\n"+ 169 | "[HTTPD]\n" + 170 | "enabled=true\n" + 171 | "port=9000\n" + 172 | "passwd=$2a$10$GKrVPAsVEFYYUS1di0iej.A8f2oimGTnoAo0xPBDX/TAugr9Rf5Na\n" + //Default: imnotgerman 173 | "\n" + 174 | "[ServerQuery]\n" + 175 | "enabled=false\n" + 176 | "port=9002\n" + 177 | "authkey=h1zZdasIsjfelAdfo93Ashj31erHeilSatan666asadsdfLolicon5\n" + 178 | "\n" + 179 | "[Dirs]\n" + 180 | "templates-dir=templates\n" + 181 | "deploymnt-dir=servers\n" + 182 | "\n" + 183 | "[Limits]\n" + 184 | "port-range=25000-25999"; 185 | f.write(defaultConfig.getBytes("UTF-8")); 186 | f.flush(); 187 | f.close(); 188 | } catch (IOException e) { 189 | System.err.println("/!\\_ Fehler beim erstellen der Default-Einstellungsdatei."); 190 | e.printStackTrace(); 191 | } 192 | } 193 | try { 194 | config = new Ini(inifile); 195 | } catch (IOException e) { 196 | System.err.println("/!\\_ Fehler beim Laden der Einstellungsdatei."); 197 | e.printStackTrace(); 198 | return false; 199 | } 200 | 201 | return true; 202 | } 203 | 204 | /** 205 | * Initialisiert alle Verzeichnisse nach Einstellungsdatei. 206 | * Obviously: Die Einstellungsdatei muss daf�r vorher geladen worden sein. 207 | * @return false bei Fehler 208 | */ 209 | private static boolean loadDirs() { 210 | //Server-Deployment-Verzeichnis 211 | if(config.get("Dirs", "deploymnt-dir") == null) { 212 | System.err.println("[!] Fehler: Einstellungsdatei ung�ltig. (deploymnt-dir = null !!!)"); 213 | return false; 214 | } 215 | deploymentDir = new File(config.get("Dirs", "deploymnt-dir")); 216 | if(!deploymentDir.exists()) { 217 | System.out.println("Deploymentverzeichnis nicht gefunden, erstelle Default."); 218 | deploymentDir.mkdir(); 219 | } 220 | else if(deploymentDir.isFile()) { 221 | System.err.println("[!] Fehler beim Erstellen des Deploymentverzeichnisses."); 222 | return false; 223 | } 224 | 225 | //Servervorlagen-Verzeichnis 226 | if(config.get("Dirs", "templates-dir") == null) { 227 | System.err.println("[!] Fehler: Einstellungsdatei ung�ltig. (templates-dir = null !!!)"); 228 | return false; 229 | } 230 | templatesDir = new File(config.get("Dirs", "templates-dir")); 231 | if(!deploymentDir.exists()) { 232 | System.out.println("Servervorlagenverzeichnis nicht gefunden, erstelle Default."); 233 | deploymentDir.mkdir(); 234 | } 235 | else if(deploymentDir.isFile()) { 236 | System.err.println("[!] Fehler beim Erstellen des Servervorlagenverzeichnisses."); 237 | return false; 238 | } 239 | 240 | return true; 241 | } 242 | 243 | /** 244 | * Initialisiert Server im Deploymentverzeichnis. 245 | */ 246 | private static void loadServers() { 247 | servers = new ArrayList(); 248 | for(File f : deploymentDir.listFiles()) { 249 | if(!f.isDirectory()) 250 | continue; 251 | if(!Arrays.asList(f.list()).contains("files")) 252 | continue; 253 | try { 254 | servers.add(new MCServer(Integer.parseInt(f.getName()))); 255 | }catch (NumberFormatException ex) { 256 | continue; 257 | } 258 | } 259 | } 260 | } 261 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/Util.java: -------------------------------------------------------------------------------- 1 | package oniicode.craftmgr; 2 | 3 | import java.io.BufferedInputStream; 4 | import java.io.BufferedOutputStream; 5 | import java.io.File; 6 | import java.io.FileInputStream; 7 | import java.io.FileNotFoundException; 8 | import java.io.FileOutputStream; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.io.OutputStream; 12 | import java.net.URL; 13 | import java.nio.file.FileSystemException; 14 | import java.nio.file.FileVisitResult; 15 | import java.nio.file.Files; 16 | import java.nio.file.Path; 17 | import java.nio.file.SimpleFileVisitor; 18 | import java.nio.file.attribute.BasicFileAttributes; 19 | import java.text.DecimalFormat; 20 | import java.text.ParseException; 21 | import java.text.SimpleDateFormat; 22 | import java.util.Date; 23 | import java.util.zip.ZipEntry; 24 | import java.util.zip.ZipInputStream; 25 | import java.util.zip.ZipOutputStream; 26 | 27 | public class Util { 28 | 29 | public static T firstNonNull(T first, T second) { 30 | if (first != null) { 31 | return first; 32 | } 33 | if (second != null) { 34 | return second; 35 | } 36 | throw new NullPointerException("Both parameters are null"); 37 | } 38 | 39 | public static URL getResource(Class contextClass, String resourceName) { 40 | URL url = contextClass.getResource(resourceName); 41 | if(url==null) 42 | throw new IllegalArgumentException("resource "+resourceName+" relative to "+contextClass.getName()+" not found."); 43 | return url; 44 | } 45 | 46 | 47 | /** 48 | * L�scht Datei oder Ordner samt Inhalt. 49 | * @param path 50 | * @throws IOException 51 | */ 52 | public static void deleteFileOrFolder(final Path path) throws IOException { 53 | System.out.println("L�sche: "+path.toString()+" .."); 54 | Files.walkFileTree(path, new SimpleFileVisitor() { 55 | @Override 56 | public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { 57 | Files.delete(file); 58 | return FileVisitResult.CONTINUE; 59 | } 60 | 61 | @Override 62 | public FileVisitResult visitFileFailed(final Path file, final IOException e) { 63 | return handleException(e); 64 | } 65 | 66 | private FileVisitResult handleException(final IOException e) { 67 | e.printStackTrace(); // replace with more robust error handling 68 | return FileVisitResult.TERMINATE; 69 | } 70 | 71 | @Override 72 | public FileVisitResult postVisitDirectory(final Path dir, final IOException e) throws IOException { 73 | if (e != null) 74 | return handleException(e); 75 | Files.delete(dir); 76 | return FileVisitResult.CONTINUE; 77 | } 78 | }); 79 | }; 80 | 81 | /** 82 | * Datei oder Ordner kopieren. 83 | * @param sourceLocation von 84 | * @param targetLocation nach 85 | * @throws IOException Bei Fehler 86 | */ 87 | public static void copy(File sourceLocation, File targetLocation) throws IOException { 88 | if (sourceLocation.isDirectory()) { 89 | copyDirectory(sourceLocation, targetLocation); 90 | } else { 91 | copyFile(sourceLocation, targetLocation); 92 | } 93 | } 94 | 95 | /** 96 | * Ordner samt Inhalten kopieren 97 | * @param source 98 | * @param target 99 | * @throws IOException 100 | */ 101 | private static void copyDirectory(File source, File target) throws IOException { 102 | if (!target.exists()) { 103 | target.mkdir(); 104 | } 105 | 106 | for (String f : source.list()) { 107 | copy(new File(source, f), new File(target, f)); 108 | } 109 | } 110 | 111 | /** 112 | * Datei Kopieren 113 | * @param source 114 | * @param target 115 | * @throws IOException 116 | */ 117 | private static void copyFile(File source, File target) throws IOException { 118 | try ( 119 | InputStream in = new FileInputStream(source); 120 | OutputStream out = new FileOutputStream(target) 121 | ) { 122 | byte[] buf = new byte[1024]; 123 | int length; 124 | while ((length = in.read(buf)) > 0) { 125 | out.write(buf, 0, length); 126 | } 127 | } 128 | } 129 | 130 | /** 131 | * Entpackt ZIP-Archiv 132 | * @param zip Zu entpackende ZIP-Datei 133 | * @param outputfolder Ordner in den die ZIP entpackt werden soll 134 | * @return 135 | */ 136 | public static boolean unzip(File zip, File outputfolder) { 137 | int BUFFER = 512; 138 | 139 | if(!outputfolder.exists() && !outputfolder.mkdirs() || !outputfolder.isDirectory()) { 140 | System.err.println("[!] Fehler beim Entpacken: Ung�ltiger Ausgabepfad."); 141 | return false; 142 | } 143 | 144 | FileInputStream fis; 145 | try { 146 | fis = new FileInputStream(zip); 147 | } catch (FileNotFoundException e) { 148 | System.err.println("[!] Fehler beim Entpacken: ZIP-Datei \""+zip.getPath()+"\" nicht gefunden."); 149 | e.printStackTrace(); 150 | return false; 151 | } 152 | ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); 153 | ZipEntry entry; 154 | try { 155 | while((entry = zis.getNextEntry()) != null) { 156 | 157 | System.out.println("Dekomprimiere: " + entry.getName() + " .."); 158 | int count; //U 159 | byte data[] = new byte[BUFFER]; 160 | File target_f = new File(outputfolder.getPath() + File.separator + entry.getName()); 161 | if(entry.isDirectory()) 162 | continue; 163 | else if(!target_f.getParentFile().exists() && !target_f.getParentFile().mkdirs()) { 164 | System.err.println("[!] Fehler beim Entpacken: Konnte Ordnerpfad \""+target_f.getParentFile()+"\" nicht erstellen"); 165 | return false; 166 | } 167 | FileOutputStream fos = new FileOutputStream(target_f); 168 | BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER); 169 | while ((count = zis.read(data, 0, BUFFER)) != -1) { 170 | dest.write(data, 0, count); 171 | } 172 | dest.flush(); 173 | dest.close(); 174 | zis.closeEntry(); 175 | fos.close(); 176 | } 177 | zis.close(); 178 | return true; 179 | } catch (IOException e) { 180 | System.err.println("[!] Fehler beim Dekomprimieren."); 181 | e.printStackTrace(); 182 | return false; 183 | } 184 | 185 | } 186 | 187 | /** 188 | * Gegenteil von unzip() 189 | * @param folder Ordner dessem Inhalt in die ZIP soll 190 | * @param zipfile Zu erstellende ZIP-Datei 191 | * @return true bei Erfolg 192 | */ 193 | public static boolean mkzip(File folder, File zipfile) { 194 | try { 195 | FileOutputStream fos = new FileOutputStream(zipfile); 196 | ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(fos)); 197 | 198 | writeDirToZip(folder, folder, zos); 199 | 200 | zos.close(); 201 | fos.close(); 202 | return true; 203 | } catch (FileNotFoundException e) { 204 | e.printStackTrace(); 205 | System.err.println("[!] Fehler beim Komprimieren. (Zipfile not found)"); 206 | return false; 207 | } catch (IOException e) { 208 | System.err.println("[!] Fehler beim Komprimieren. (IOException)"); 209 | e.printStackTrace(); 210 | return false; 211 | } 212 | } 213 | 214 | private static void writeDirToZip(File basedir, File dir, ZipOutputStream zos) throws IOException { 215 | int BUFFER = 512; 216 | for(File f : dir.listFiles()) { 217 | if(!f.isDirectory()) { 218 | System.out.println("Komprimiere: " + f.getPath() + " .."); 219 | FileInputStream fis = new FileInputStream(f); 220 | ZipEntry zipEntry = new ZipEntry(basedir.toURI().relativize(f.toURI()).getPath()); 221 | zos.putNextEntry(zipEntry); 222 | 223 | byte[] bytes = new byte[BUFFER]; 224 | int length; 225 | while ((length = fis.read(bytes)) >= 0) { 226 | zos.write(bytes, 0, length); 227 | } 228 | 229 | zos.closeEntry(); 230 | fis.close(); 231 | }else { 232 | writeDirToZip(basedir, f, zos); 233 | } 234 | } 235 | } 236 | 237 | public static String curDate() { 238 | return getDate(new Date()); 239 | } 240 | 241 | public static String getDate(Date date) { 242 | return new SimpleDateFormat("dd-MM-yyyy HH-mm-ss z").format(date); 243 | } 244 | 245 | public static Date getDate(String s) { 246 | try { 247 | return new SimpleDateFormat("dd-MM-yyyy HH-mm-ss z").parse(s); 248 | } catch (ParseException e) { 249 | return null; 250 | } 251 | } 252 | 253 | public static String readableFileSize(long size) { 254 | if(size <= 0) return "0"; 255 | final String[] units = new String[] { "B", "kB", "MB", "GB", "TB" }; 256 | int digitGroups = (int) (Math.log10(size)/Math.log10(1024)); 257 | return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups]; 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/src/oniicode/craftmgr/html/assets/FontAwesome.otf -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/dargen-mgmt.js: -------------------------------------------------------------------------------- 1 | 2 | Element.prototype.remove = function() { 3 | this.parentElement.removeChild(this); 4 | } 5 | NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { 6 | for(var i = this.length - 1; i >= 0; i--) { 7 | if(this[i] && this[i].parentElement) { 8 | this[i].parentElement.removeChild(this[i]); 9 | } 10 | } 11 | } 12 | 13 | function refresh_list() { 14 | 15 | 16 | var xhttp = new XMLHttpRequest(); 17 | xhttp.open("GET", "?list=servers", true); 18 | xhttp.onload = function() { 19 | var response = this.responseText.split("\n"); 20 | var set = ""; 21 | if(response[0].indexOf('') > -1){ 22 | set = "{lang:error_pls_refresh}"; 23 | window.location.reload(false); 24 | } 25 | else 26 | for(var i = 0;i < response.length;i++){ 27 | if(response[i]=="== REGISTERED SERVERS ==") 28 | continue; 29 | if(response[i]=="") 30 | continue; 31 | if(response[i]=="== END OF SERVERS LIST") 32 | break; 33 | 34 | var data = response[i].split("_"); 35 | 36 | set += ""; 37 | set += "#"+data[0]+""; //ID 38 | set += ""+data[1]+""; //PORT 39 | set += ""+data[2]+"" //STATUS 40 | set += ""+data[3]+""; //DESC 41 | if (data[2]=="OFFLINE") 42 | set += ` 43 | 44 | 47 | 50 | 51 | 52 | `; 53 | else 54 | set += ` 55 | 56 | 59 | 62 | 63 | `; 64 | set += ""; 65 | } 66 | document.getElementById("serverlist").innerHTML = set; 67 | }; 68 | xhttp.send(); 69 | 70 | } 71 | 72 | function serverview_refresh(id){ 73 | var xhttp = new XMLHttpRequest(); 74 | xhttp.open("GET", "?status="+id, true); 75 | xhttp.onload = function() { 76 | var response = this.responseText + ""; 77 | if(response.indexOf('') > -1){ 78 | document.getElementById("console").innerHTML = {lang:error_pls_refresh}; 79 | window.location.reload(false); 80 | } 81 | 82 | document.getElementById("sstatus").innerHTML = response; 83 | 84 | 85 | if(response == "OFFLINE"){ 86 | document.getElementById("btns").innerHTML = ` 87 | 88 | 89 | `; 90 | }else{ 91 | document.getElementById("btns").innerHTML = ` 92 | 93 | 94 | 95 | `; 96 | } 97 | }; 98 | xhttp.send(); 99 | 100 | 101 | } 102 | 103 | function refresh_console(id){ 104 | var xhttp = new XMLHttpRequest(); 105 | xhttp.open("GET", "?console="+id, true); 106 | xhttp.onload = function() { 107 | var response = this.responseText.replace(/(?:\r\n|\r|\n)/g, '
'); 108 | if(document.getElementById("console").innerHTML != response){ 109 | document.getElementById("console").innerHTML = response; 110 | document.getElementById("console").scrollTop = document.getElementById("console").scrollHeight; 111 | } 112 | }; 113 | xhttp.send(); 114 | 115 | } 116 | 117 | function server_command(id, cmd){ 118 | setTimeout(function() { 119 | var xhttp = new XMLHttpRequest(); 120 | xhttp.open("GET", "?cmd="+id+"&com="+cmd, false); 121 | xhttp.send(); 122 | var resp = xhttp.responseText; 123 | if(resp!="cmd "+id+" "+cmd+"\nSUCCESS"){ 124 | $.notify({lang:server_cmd_fail}, 'error', { 125 | style: 'bootstrap' 126 | }); 127 | refresh_list(); 128 | }else{ 129 | refresh_console(id); 130 | } 131 | }, 0); 132 | 133 | 134 | } 135 | 136 | function server_start(id) { 137 | $.notify({lang:server_start}, 'info', { 138 | style: 'bootstrap' 139 | }); 140 | var xhttp = new XMLHttpRequest(); 141 | xhttp.open("GET", "?start="+id, false); 142 | xhttp.send(); 143 | var resp = xhttp.responseText; 144 | if(resp=="start "+id+"\nSUCCESS"){ 145 | $.notify({lang:server_start_success}, 'success', { 146 | style: 'bootstrap' 147 | }); 148 | refresh_list(); 149 | }else{ 150 | $.notify({lang:server_start_fail}, 'error', { 151 | style: 'bootstrap' 152 | }); 153 | refresh_list(); 154 | } 155 | } 156 | 157 | function server_stop(id) { 158 | var xhttp = new XMLHttpRequest(); 159 | xhttp.open("GET", "?stop="+id, false); 160 | xhttp.send(); 161 | var resp = xhttp.responseText; 162 | if(resp=="stop "+id+"\nSUCCESS"){ 163 | $.notify({lang:server_stop}, 'success', { 164 | style: 'bootstrap' 165 | }); 166 | refresh_list(); 167 | }else{ 168 | $.notify({lang:server_stop_fail}, 'error', { 169 | style: 'bootstrap' 170 | }); 171 | refresh_list(); 172 | } 173 | } 174 | 175 | function server_kill(id) { 176 | var xhttp = new XMLHttpRequest(); 177 | xhttp.open("GET", "?kill="+id, false); 178 | xhttp.send(); 179 | var resp = xhttp.responseText; 180 | if(resp=="kill "+id+"\nSUCCESS"){ 181 | $.notify({lang:server_kill_success}, 'success', { 182 | style: 'bootstrap' 183 | }); 184 | refresh_list(); 185 | }else{ 186 | $.notify({lang:server_kill_fail}, 'error', { 187 | style: 'bootstrap' 188 | }); 189 | refresh_list(); 190 | } 191 | } 192 | 193 | function server_delete(id) { 194 | var xhttp = new XMLHttpRequest(); 195 | xhttp.open("GET", "?delete="+id, false); 196 | xhttp.send(); 197 | var resp = xhttp.responseText; 198 | if(resp=="delete "+id+"\nSUCCESS"){ 199 | $.notify({lang:server_del_sucess}, 'success', { 200 | style: 'bootstrap' 201 | }); 202 | refresh_list(); 203 | }else{ 204 | $.notify({lang:server_del_fail}, 'error', { 205 | style: 'bootstrap' 206 | }); 207 | refresh_list(); 208 | } 209 | } 210 | 211 | function server_create(port, name, ram, template, autostart) { 212 | if(template.endsWith(".zip")){ 213 | $.notify({lang:server_create}, 'info', { 214 | style: 'bootstrap' 215 | }); 216 | } 217 | var xhttp = new XMLHttpRequest(); 218 | xhttp.open("GET", "?create="+port+"&template="+template+"&desc="+name+"&memory="+ram+"&autostart="+autostart, true); 219 | xhttp.onload = function() { 220 | var resp = this.responseText; 221 | if(resp.startsWith("create SUCCESS")){ 222 | refresh_list(); 223 | $.notify({lang:server_create_success}, 'success', { 224 | style: 'bootstrap' 225 | }); 226 | }else{ 227 | refresh_list(); 228 | $.notify('[Debug]: '+resp, 'info', { 229 | style: 'bootstrap' 230 | }); 231 | } 232 | }; 233 | xhttp.send(); 234 | } 235 | 236 | function server_backup_apply(id, desc){ 237 | var xhttp = new XMLHttpRequest(); 238 | xhttp.open("GET", "?backup-apply="+id+"&desc="+desc, true); 239 | xhttp.onload = function() { 240 | var resp = this.responseText; 241 | if(resp=="backup-apply "+id+"\nSUCCESS"){ 242 | $.notify({lang:server_backup_apply_success}, 'success', { 243 | style: 'bootstrap' 244 | }); 245 | window.location.reload(false); 246 | }else{ 247 | $.notify({lang:server_backup_apply_fail}, 'error', { 248 | style: 'bootstrap' 249 | }); 250 | } 251 | } 252 | xhttp.send(); 253 | } 254 | 255 | function server_backup_delete(id, desc){ 256 | var xhttp = new XMLHttpRequest(); 257 | xhttp.open("GET", "?backup-delete="+id+"&desc="+desc, true); 258 | xhttp.onload = function() { 259 | var resp = this.responseText; 260 | if(resp=="backup-delete "+id+"\nSUCCESS"){ 261 | $.notify({lang:server_backup_delete_success}, 'success', { 262 | style: 'bootstrap' 263 | }); 264 | window.location.reload(false); 265 | }else{ 266 | $.notify({lang:server_backup_delete_fail}, 'error', { 267 | style: 'bootstrap' 268 | }); 269 | } 270 | } 271 | xhttp.send(); 272 | } 273 | 274 | function server_mkbackup(id, desc){ 275 | $.notify({lang:server_mkbackup}, 'info', { 276 | style: 'bootstrap' 277 | }); 278 | 279 | var xhttp = new XMLHttpRequest(); 280 | xhttp.open("GET", "?backup-create="+id+"&desc="+desc, true); 281 | xhttp.onload = function() { 282 | var resp = this.responseText; 283 | if(resp=="backup-create "+id+"\nSUCCESS"){ 284 | $.notify({lang:server_mkbackup_success}, 'success', { 285 | style: 'bootstrap' 286 | }); 287 | window.location.reload(false); 288 | }else{ 289 | $.notify({lang:server_mkbackup_fail}, 'error', { 290 | style: 'bootstrap' 291 | }); 292 | } 293 | } 294 | xhttp.send(); 295 | 296 | 297 | } -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('/assets/fontawesome-webfont.eot');src:url('/assets/fontawesome-webfont.eot') format('embedded-opentype'),url('/assets/fontawesome-webfont.woff2') format('woff2'),url('/assets/fontawesome-webfont.woff') format('woff'),url('/assets/fontawesome-webfont.ttf') format('truetype'),url('/assets/fontawesome-webfont.svg#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} 5 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/src/oniicode/craftmgr/html/assets/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/src/oniicode/craftmgr/html/assets/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/src/oniicode/craftmgr/html/assets/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oniicode/CraftMGR/183f7426a9490bb3e844a378aaeafc6557e78b84/src/oniicode/craftmgr/html/assets/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/notify.min.js: -------------------------------------------------------------------------------- 1 | (function(e){typeof define=="function"&&define.amd?define(["jquery"],e):typeof module=="object"&&module.exports?module.exports=function(t,n){return n===undefined&&(typeof window!="undefined"?n=require("jquery"):n=require("jquery")(t)),e(n),n}:e(jQuery)})(function(e){function A(t,n,i){typeof i=="string"&&(i={className:i}),this.options=E(w,e.isPlainObject(i)?i:{}),this.loadHTML(),this.wrapper=e(h.html),this.options.clickToHide&&this.wrapper.addClass(r+"-hidable"),this.wrapper.data(r,this),this.arrow=this.wrapper.find("."+r+"-arrow"),this.container=this.wrapper.find("."+r+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=N(t),this.elem.data(r,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(n)}var t=[].indexOf||function(e){for(var t=0,n=this.length;t\n
\n
\n',css:"."+r+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+r+"-corner ."+r+"-wrapper,\n."+r+"-corner ."+r+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+r+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+r+"-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n."+r+"-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n."+r+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},p={"border-radius":["-webkit-","-moz-"]},d=function(e){return c[e]},v=function(e){if(!e)throw"Missing Style name";c[e]&&delete c[e]},m=function(t,i){if(!t)throw"Missing Style name";if(!i)throw"Missing Style definition";if(!i.html)throw"Missing Style HTML";var s=c[t];s&&s.cssElem&&(window.console&&console.warn(n+": overwriting style '"+t+"'"),c[t].cssElem.remove()),i.name=t,c[t]=i;var o="";i.classes&&e.each(i.classes,function(t,n){return o+="."+r+"-"+i.name+"-"+t+" {\n",e.each(n,function(t,n){return p[t]&&e.each(p[t],function(e,r){return o+=" "+r+t+": "+n+";\n"}),o+=" "+t+": "+n+";\n"}),o+="}\n"}),i.css&&(o+="/* styles for "+i.name+" */\n"+i.css),o&&(i.cssElem=g(o),i.cssElem.attr("id","notify-"+i.name));var u={},a=e(i.html);y("html",a,u),y("text",a,u),i.fields=u},g=function(t){var n,r,i;r=x("style"),r.attr("type","text/css"),e("head").append(r);try{r.html(t)}catch(s){r[0].styleSheet.cssText=t}return r},y=function(t,n,r){var s;return t!=="html"&&(t="text"),s="data-notify-"+t,b(n,"["+s+"]").each(function(){var n;n=e(this).attr(s),n||(n=i),r[n]=t})},b=function(e,t){return e.is(t)?e:e.find(t)},w={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},E=function(t,n){var r;return r=function(){},r.prototype=t,e.extend(!0,new r,n)},S=function(t){return e.extend(w,t)},x=function(t){return e("<"+t+">")},T={},N=function(t){var n;return t.is("[type=radio]")&&(n=t.parents("form:first").find("[type=radio]").filter(function(n,r){return e(r).attr("name")===t.attr("name")}),t=n.first()),t},C=function(e,t,n){var r,i;if(typeof n=="string")n=parseInt(n,10);else if(typeof n!="number")return;if(isNaN(n))return;return r=s[f[t.charAt(0)]],i=t,e[r]!==undefined&&(t=s[r.charAt(0)],n=-n),e[t]===undefined?e[t]=n:e[t]+=n,null},k=function(e,t,n){if(e==="l"||e==="t")return 0;if(e==="c"||e==="m")return n/2-t/2;if(e==="r"||e==="b")return n-t;throw"Invalid alignment"},L=function(e){return L.e=L.e||x("div"),L.e.text(e).html()};A.prototype.loadHTML=function(){var t;t=this.getStyle(),this.userContainer=e(t.html),this.userFields=t.fields},A.prototype.show=function(e,t){var n,r,i,s,o;r=function(n){return function(){!e&&!n.elem&&n.destroy();if(t)return t()}}(this),o=this.container.parent().parents(":hidden").length>0,i=this.container.add(this.arrow),n=[];if(o&&e)s="show";else if(o&&!e)s="hide";else if(!o&&e)s=this.options.showAnimation,n.push(this.options.showDuration);else{if(!!o||!!e)return r();s=this.options.hideAnimation,n.push(this.options.hideDuration)}return n.push(r),i[s].apply(i,n)},A.prototype.setGlobalPosition=function(){var t=this.getPosition(),n=t[0],i=t[1],o=s[n],u=s[i],a=n+"|"+i,f=T[a];if(!f||!document.body.contains(f[0])){f=T[a]=x("div");var l={};l[o]=0,u==="middle"?l.top="45%":u==="center"?l.left="45%":l[u]=0,f.css(l).addClass(r+"-corner"),e("body").append(f)}return f.prepend(this.wrapper)},A.prototype.setElementPosition=function(){var n,r,i,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,L,A,O,M,_,D,P,H,B,j;H=this.getPosition(),_=H[0],O=H[1],M=H[2],g=this.elem.position(),d=this.elem.outerHeight(),y=this.elem.outerWidth(),v=this.elem.innerHeight(),m=this.elem.innerWidth(),j=this.wrapper.position(),c=this.container.height(),h=this.container.width(),T=s[_],L=f[_],A=s[L],p={},p[A]=_==="b"?d:_==="r"?y:0,C(p,"top",g.top-j.top),C(p,"left",g.left-j.left),B=["top","left"];for(w=0,S=B.length;w=0&&C(r,s[O],i*2)}t.call(u,_)>=0?(C(p,"left",k(O,h,y)),r&&C(r,"left",k(O,i,m))):t.call(o,_)>=0&&(C(p,"top",k(O,c,d)),r&&C(r,"top",k(O,i,v))),this.container.is(":visible")&&(p.display="block"),this.container.removeAttr("style").css(p);if(r)return this.arrow.removeAttr("style").css(r)},A.prototype.getPosition=function(){var e,n,r,i,s,f,c,h;h=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),e=l(h),e.length===0&&(e[0]="b");if(n=e[0],t.call(a,n)<0)throw"Must be one of ["+a+"]";if(e.length===1||(r=e[0],t.call(u,r)>=0)&&(i=e[1],t.call(o,i)<0)||(s=e[0],t.call(o,s)>=0)&&(f=e[1],t.call(u,f)<0))e[1]=(c=e[0],t.call(o,c)>=0)?"m":"l";return e.length===2&&(e[2]=e[1]),e},A.prototype.getStyle=function(e){var t;e||(e=this.options.style),e||(e="default"),t=c[e];if(!t)throw"Missing style: "+e;return t},A.prototype.updateClasses=function(){var t,n;return t=["base"],e.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),n=this.getStyle(),t=e.map(t,function(e){return r+"-"+n.name+"-"+e}).join(" "),this.userContainer.attr("class",t)},A.prototype.run=function(t,n){var r,s,o,u,a;e.isPlainObject(n)?e.extend(this.options,n):e.type(n)==="string"&&(this.options.className=n);if(this.container&&!t){this.show(!1);return}if(!this.container&&!t)return;s={},e.isPlainObject(t)?s=t:s[i]=t;for(o in s){r=s[o],u=this.userFields[o];if(!u)continue;u==="text"&&(r=L(r),this.options.breakNewLines&&(r=r.replace(/\n/g,"
"))),a=o===i?"":"="+o,b(this.userContainer,"[data-notify-"+u+a+"]").html(r)}this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide&&(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(this.show.bind(this,!1),this.options.autoHideDelay))},A.prototype.destroy=function(){this.wrapper.data(r,null),this.wrapper.remove()},e[n]=function(t,r,i){return t&&t.nodeName||t.jquery?e(t)[n](r,i):(i=r,r=t,new A(null,r,i)),t},e.fn[n]=function(t,n){return e(this).each(function(){var i=N(e(this)).data(r);i&&i.destroy();var s=new A(e(this),t,n)}),this},e.extend(e[n],{defaults:S,addStyle:m,removeStyle:v,pluginOptions:w,getStyle:d,insertCSS:g}),m("bootstrap",{html:"
\n\n
",classes:{base:{"font-weight":"bold",padding:"8px 15px 8px 14px","text-shadow":"0 1px 0 rgba(255, 255, 255, 0.5)","background-color":"#fcf8e3",border:"1px solid #fbeed5","border-radius":"4px","white-space":"nowrap","padding-left":"25px","background-repeat":"no-repeat","background-position":"3px 7px"},error:{color:"#B94A48","background-color":"#F2DEDE","border-color":"#EED3D7","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"},success:{color:"#468847","background-color":"#DFF0D8","border-color":"#D6E9C6","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"},info:{color:"#3A87AD","background-color":"#D9EDF7","border-color":"#BCE8F1","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"},warn:{color:"#C09853","background-color":"#FCF8E3","border-color":"#FBEED5","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"}}}),e(function(){g(h.css).attr("id","core-notify"),e(document).on("click","."+r+"-hidable",function(t){e(this).trigger("notify-hide")}),e(document).on("notify-hide","."+r+"-wrapper",function(t){var n=e(this).data(r);n&&n.show(!1)})})}) -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/assets/popper.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Federico Zivolo 2017 3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:e?e.ownerDocument.documentElement:document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n))return p(l)?l:r(l);var f=s(e);return f.host?d(f.host,t):d(e,s(t).host)}function a(e){var t=1=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference&&(n=_(p[o],i[e]-('right'===e?p.width:p.height))),pe({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=se({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=X,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var i;if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var n=o.element;if('string'==typeof n){if(n=e.instance.popper.querySelector(n),!n)return e;}else if(!e.instance.popper.contains(n))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',g=a?'bottom':'right',u=L(n)[l];d[g]-us[g]&&(e.offsets.popper[m]+=d[m]+u-s[g]),e.offsets.popper=c(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=J(_(s[l]-u,v),0),e.arrowElement=n,e.offsets.arrow=(i={},pe(i,m,Math.round(v)),pe(i,h,''),i),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(k(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=y(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=x(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case le.FLIP:p=[i,n];break;case le.CLOCKWISE:p=q(i);break;case le.COUNTERCLOCKWISE:p=q(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=x(i);var a=e.offsets.popper,l=e.offsets.reference,f=X,m='left'===i&&f(a.right)>f(l.left)||'right'===i&&f(a.left)f(l.top)||'bottom'===i&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===i&&h||'right'===i&&c||'top'===i&&g||'bottom'===i&&u,w=-1!==['top','bottom'].indexOf(i),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u);(m||b||y)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),y&&(r=K(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=se({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=C(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[o]-(s?n[p?'width':'height']:0),e.placement=x(t),e.offsets.popper=c(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right 2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 10 |

{wrongpasswd}

11 | 16 |
17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_backups.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 | 32 |
33 |
34 |
35 | 49 |
50 |
51 | 52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | {S_BACKUPS} 65 | 66 |
{lang:backups_date}{lang:backups_size}{lang:backups_desc}
67 |
68 |
69 |
70 |
71 | 72 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_backups_entry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {DATE} 4 | {SIZE} 5 | {NAME} 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_config.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 |
12 |
13 | 27 |
28 |
29 |
30 | 31 | {CONF} 32 |
33 |
34 |
35 | 36 | {SUCCESS} 37 | 42 |
43 |
44 |
45 |
46 |
47 |
48 | 49 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_config_entry.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_console.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 13 |
14 |
15 |
16 | 30 |
31 |
32 |
33 | 34 |
35 |
36 | 37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 |
45 |
46 | 47 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_files.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 |
12 |
13 | 27 |
28 |
29 | 39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {S_FILES} 52 | 53 |
{lang:f_name}{lang:f_date}{lang:f_type}{lang:f_size}
54 |
55 |
56 |
57 |
58 | 59 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_files_entry.html: -------------------------------------------------------------------------------- 1 | 2 | {I} 3 | {NAME} 4 | {DATE} 5 | {TYPE} 6 | {SIZE} 7 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_files_entry_icon_file.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/server_files_entry_icon_folder.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/serverlist.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 | 60 |
61 |
62 |
63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 91 | 92 |
#{lang:server_port}{lang:server_status}{lang:server_desc}
93 |
94 |
95 |
96 |
97 | 98 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/html/wi_root.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {app} {ver} 7 | 8 | 9 | 10 | 11 | 12 | {0} 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/oniicode/craftmgr/interfaces/CLI.java: -------------------------------------------------------------------------------- 1 | package oniicode.craftmgr.interfaces; 2 | 3 | import java.io.PrintStream; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | 7 | import org.ini4j.Ini; 8 | 9 | import oniicode.craftmgr.MCServer; 10 | import oniicode.craftmgr.Main; 11 | import oniicode.craftmgr.Util; 12 | 13 | /** 14 | * Command Line INTERFACE - bedient das System vom Terminal aus. 15 | * 16 | * Ausserdem: 17 | * Check mal wie viele zeilen diese Klasse hat :3 18 | * 19 | * @author Dargen_ 20 | * 21 | */ 22 | public class CLI { 23 | 24 | public PrintStream out; 25 | public PrintStream err; 26 | 27 | public abstract interface Command { 28 | 29 | public abstract String getName(); 30 | 31 | public abstract String getUsage(); 32 | 33 | public abstract String getDescription(); 34 | 35 | public abstract String[] getAliases(); 36 | 37 | public abstract boolean onCommand(String[] args, PrintStream out, PrintStream err); 38 | } 39 | 40 | private ArrayList commands = new ArrayList(); 41 | 42 | public CLI() { 43 | this(System.out, System.err); 44 | } 45 | 46 | public CLI(PrintStream out, PrintStream err) { 47 | this.out = out; 48 | this.err = err; 49 | this.commands.add(new CommandList()); 50 | this.commands.add(new CommandStart()); 51 | this.commands.add(new CommandStop()); 52 | this.commands.add(new CommandKill()); 53 | this.commands.add(new CommandHttpd()); 54 | this.commands.add(new CommandCommand()); 55 | this.commands.add(new CommandVersion()); 56 | this.commands.add(new CommandCreate()); 57 | this.commands.add(new CommandDelete()); 58 | this.commands.add(new CommandConfig()); 59 | this.commands.add(new CommandBackup()); 60 | } 61 | 62 | private Command getCommand(String name) { 63 | for(Command cmd : this.commands) 64 | if(cmd.getName().equalsIgnoreCase(name) || Arrays.asList(cmd.getAliases()).contains(name)) 65 | return cmd; 66 | return null; 67 | } 68 | 69 | public boolean command(String[] in) { 70 | Command cmd = this.getCommand(in[0]); 71 | if(in[0].equalsIgnoreCase("help") || in[0].equalsIgnoreCase("?")) { 72 | out.println("== COMMAND LIST =="); 73 | for(Command c : this.commands) { 74 | out.println(c.getName() + " - " + c.getDescription()); 75 | } 76 | out.println("quit - F�hrt alle Server herunter und so du weisst was ich mein"); 77 | return true; 78 | }else if(cmd==null){ 79 | err.println("Unbekannter Befehl. Benutze \"help\" oder \"?\" um alle Befehle aufzulisten."); 80 | return false; 81 | }else { 82 | String c; 83 | if(in.length > 1) { 84 | c = in[1]; 85 | for (int i = 2; i < in.length; i++) { 86 | c = c + " "+ in[i]; 87 | } 88 | }else { 89 | c = ""; 90 | } 91 | boolean b = cmd.onCommand(c.split("\\s+"), this.out, this.err); 92 | this.out.println(""); 93 | return b; 94 | } 95 | } 96 | 97 | /** 98 | * Command zum Auflisten von Servern oder Templates. 99 | * @author Dargen_ 100 | * 101 | */ 102 | public class CommandList implements Command { 103 | 104 | @Override 105 | public String getName() { return "list"; } 106 | 107 | @Override 108 | public String getUsage() { return "list [servers/templates]"; } 109 | 110 | @Override 111 | public String getDescription() { return "Listet alle regisrierten Server oder Templates auf."; } 112 | 113 | @Override 114 | public String[] getAliases() { 115 | return new String[] {"ls", "select"}; 116 | } 117 | 118 | @Override 119 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 120 | if(args.length == 1) { 121 | if(args[0].equalsIgnoreCase("servers") || args[0].equalsIgnoreCase("s")) { 122 | out.println("== SERVER DIRECTORY =="); 123 | if(Main.servers.size() == 0) 124 | out.println("None."); 125 | else 126 | for(MCServer srv : Main.servers) { 127 | out.println("#" + srv.getID()+" - "+srv.getPort()+" - "+srv.getState().toString()+" - "+srv.getDesc()); 128 | } 129 | return true; 130 | }else if(args[0].equalsIgnoreCase("templates") || args[0].equalsIgnoreCase("t")) { 131 | out.println("== TEMPLATE DIRECTORY =="); 132 | for(String s : MCServer.getTemplates()) { 133 | out.println(s); 134 | } 135 | return true; 136 | }else { 137 | err.println("Syntax: " + this.getUsage()); 138 | return false; 139 | } 140 | }else { 141 | err.println("Syntax: " + this.getUsage()); 142 | return false; 143 | } 144 | } 145 | 146 | } 147 | 148 | /** 149 | * Befehl zum Starten eines Servers. 150 | * @author Dargen_ 151 | * 152 | */ 153 | public class CommandStart implements Command { 154 | 155 | @Override 156 | public String getName() { return "start"; } 157 | 158 | @Override 159 | public String getUsage() { return "start [ID,ID,ID..]"; } 160 | 161 | @Override 162 | public String getDescription() { return "Startet Server mit gegebener/n ID/s"; } 163 | 164 | @Override 165 | public String[] getAliases() { 166 | return new String[] {"exec"}; 167 | } 168 | 169 | @Override 170 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 171 | if(args[0]=="") { 172 | err.println("Syntax: " + this.getUsage()); 173 | return false; 174 | } 175 | if(args.length == 1) { 176 | try { 177 | String[] ids = args[0].split(","); 178 | for(String sid : ids) { 179 | MCServer srvr = MCServer.getByID(Integer.parseInt(sid)); 180 | if(srvr != null) { 181 | srvr.start(); 182 | } 183 | else { 184 | err.println("404: Server #"+sid+" nicht gefunden."); 185 | } 186 | } 187 | return true; 188 | 189 | } catch (NumberFormatException e) { 190 | err.println("Ung�ltige Eingabe: \""+args[0]+"\"."); 191 | } catch (Throwable e) { 192 | err.println("[!] Fehler beim Starten von Server #"+args[0]); 193 | e.printStackTrace(); 194 | } 195 | return false; 196 | }else { 197 | err.println("Syntax: " + this.getUsage()); 198 | return false; 199 | } 200 | } 201 | 202 | } 203 | 204 | /** 205 | * Befehl zum starten eines Servers. 206 | * @author Dargen_ 207 | * 208 | */ 209 | public class CommandStop implements Command { 210 | 211 | @Override 212 | public String getName() { return "stop"; } 213 | 214 | @Override 215 | public String getUsage() { return "stop [ID,ID,ID..]"; } 216 | 217 | @Override 218 | public String getDescription() { return "Weist gegebene/n Server an herunterzufahren."; } 219 | 220 | @Override 221 | public String[] getAliases() { 222 | return new String[] {}; 223 | } 224 | 225 | @Override 226 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 227 | if(args[0]=="") { 228 | err.println("Syntax: " + this.getUsage()); 229 | return false; 230 | } 231 | if(args.length == 1) { 232 | try { 233 | String[] ids = args[0].split(","); 234 | for(String sid : ids) { 235 | MCServer srvr = MCServer.getByID(Integer.parseInt(sid)); 236 | if(srvr != null) { 237 | srvr.stop(); 238 | } 239 | else { 240 | err.println("404: Server #"+sid+" nicht gefunden."); 241 | } 242 | } 243 | return true; 244 | } catch (NumberFormatException e) { 245 | err.println("Ung�ltige Eingabe: \""+args[0]+"\"."); 246 | } catch (Throwable e) { 247 | err.println("[!] Fehler beim Stoppen von Server #"+args[0]); 248 | e.printStackTrace(); 249 | } 250 | return false; 251 | }else { 252 | err.println("Syntax: " + this.getUsage()); 253 | return false; 254 | } 255 | } 256 | 257 | } 258 | 259 | /** 260 | * Befehl zum Zwangsherunterfahren eines Servers. 261 | * @author Dargen_ 262 | * 263 | */ 264 | public class CommandKill implements Command { 265 | 266 | @Override 267 | public String getName() { return "kill"; } 268 | 269 | @Override 270 | public String getUsage() { return "kill [ID,ID,ID..]"; } 271 | 272 | @Override 273 | public String getDescription() { return "F�hrt Server mit gegebener/n ID/s zwanghaft herunter."; } 274 | 275 | @Override 276 | public String[] getAliases() { 277 | return new String[] {}; 278 | } 279 | 280 | @Override 281 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 282 | if(args[0]=="") { 283 | err.println("Syntax: " + this.getUsage()); 284 | return false; 285 | } 286 | if(args.length == 1) { 287 | try { 288 | String[] ids = args[0].split(","); 289 | for(String sid : ids) { 290 | MCServer srvr = MCServer.getByID(Integer.parseInt(sid)); 291 | if(srvr != null) { 292 | srvr.kill(); 293 | } 294 | else { 295 | err.println("404: Server #"+sid+" nicht gefunden."); 296 | } 297 | } 298 | return true; 299 | } catch (NumberFormatException e) { 300 | err.println("Ung�ltige Eingabe: \""+args[0]+"\"."); 301 | } catch (Throwable e) { 302 | err.println("[!] Fehler beim Killen von Server #"+args[0]); 303 | e.printStackTrace(); 304 | } 305 | return false; 306 | }else { 307 | err.println("Syntax: " + this.getUsage()); 308 | return false; 309 | } 310 | } 311 | 312 | } 313 | 314 | /** 315 | * Befehl zum Aktivieren und Deaktivieren des Webservers. 316 | * @author Dargen_ 317 | * 318 | */ 319 | public class CommandHttpd implements Command { 320 | 321 | @Override 322 | public String getName() { return "httpd"; } 323 | 324 | @Override 325 | public String getUsage() { return "httpd [start/stop]"; } 326 | 327 | @Override 328 | public String getDescription() { return "Aktiviert oder deaktiviert die integrierte Webschnittstelle."; } 329 | 330 | @Override 331 | public String[] getAliases() { 332 | return new String[] { "wi" }; 333 | } 334 | 335 | @Override 336 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 337 | if(args[0]=="") { 338 | err.println("Syntax: " + this.getUsage()); 339 | return false; 340 | } 341 | if(args.length == 1) { 342 | if(args[0].equalsIgnoreCase("start")) { 343 | try { 344 | Main.httpd = new HTTPD(Main.config); 345 | Main.httpd.Start(); 346 | return true; 347 | } catch (Throwable e) { 348 | err.println("[!] Fehler beim Starten der Webschnittstelle."); 349 | e.printStackTrace(); 350 | return false; 351 | } 352 | 353 | }else if(args[0].equalsIgnoreCase("stop")) { 354 | Main.httpd.Stop(); 355 | return true; 356 | } 357 | return false; 358 | }else { 359 | err.println("Syntax: " + this.getUsage()); 360 | return false; 361 | } 362 | } 363 | 364 | } 365 | 366 | /** 367 | * Befehl zum Senden eines Befehls an einen laufenden Server. 368 | * @author Dargen_ 369 | * 370 | */ 371 | public class CommandCommand implements Command { 372 | 373 | @Override 374 | public String getName() { return "cmd"; } 375 | 376 | @Override 377 | public String getUsage() { return "cmd "; } 378 | 379 | @Override 380 | public String getDescription() { return "Sendet gegebenen Befehl an laufenden Server mit gegebener ID."; } 381 | 382 | @Override 383 | public String[] getAliases() { 384 | return new String[] { "com", "c", "/" }; 385 | } 386 | 387 | @Override 388 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 389 | if(args[0]=="") { 390 | err.println("Syntax: " + this.getUsage()); 391 | return false; 392 | } 393 | if(args.length > 1) { 394 | try { 395 | MCServer srvr = MCServer.getByID(Integer.parseInt(args[0])); 396 | if(srvr != null) { 397 | String c = args[1]; 398 | if(args.length >= 2) 399 | for (int i = 2; i < args.length; i++) { 400 | c = c + " "+ args[i]; 401 | } 402 | srvr.sendCommand(c); 403 | } 404 | else 405 | err.println("[!] 404: Server #"+args[0]+" nicht gefunden."); 406 | } catch (NumberFormatException e) { 407 | err.println("Ung�ltige Eingabe: \""+args[0]+"\"."); 408 | } catch (Throwable e) { 409 | err.println("[!] Fehler beim senden des Befehls an Server #"+args[0]); 410 | e.printStackTrace(); 411 | } 412 | return false; 413 | }else { 414 | err.println("Syntax: " + this.getUsage()); 415 | return false; 416 | } 417 | } 418 | 419 | } 420 | 421 | /** 422 | * Command zum anzeigen der Version. 423 | * @author Dargen_ 424 | * 425 | */ 426 | public class CommandVersion implements Command { 427 | 428 | @Override 429 | public String getName() { return "version"; } 430 | 431 | @Override 432 | public String getUsage() { return "version"; } 433 | 434 | @Override 435 | public String getDescription() { return "Zeigt die Version dieses Systems an."; } 436 | 437 | @Override 438 | public String[] getAliases() { 439 | return new String[] { "ver" }; 440 | } 441 | 442 | @Override 443 | public boolean onCommand(String[] args, PrintStream out, PrintStream err) { 444 | out.println("System-Version: " + Main.version); 445 | return true; 446 | } 447 | 448 | } 449 | 450 | /** 451 | * Command zum erstellen eines Servers. 452 | * @author Dargen_ 453 | * 454 | */ 455 | public class CommandCreate implements Command { 456 | 457 | @Override 458 | public String getName() { return "create"; } 459 | 460 | @Override 461 | public String getUsage() { return "create