File size: 6,786 Bytes
b25c766
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Server Console - CraftyHost</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
</head>
<body class="bg-gray-900 text-white">
    <custom-navbar></custom-navbar>
    
    <main class="container mx-auto px-4 py-8">
        <div class="flex items-center justify-between mb-8">
            <div>
                <h1 class="text-2xl md:text-3xl font-bold">Server Console</h1>
                <p class="text-gray-400">My Minecraft Server</p>
            </div>
            <div class="flex gap-2">
                <button class="bg-gray-700 hover:bg-gray-600 px-3 py-2 rounded-lg transition">
                    <i data-feather="refresh-cw" class="w-4 h-4"></i>
                </button>
                <button class="bg-gray-700 hover:bg-gray-600 px-3 py-2 rounded-lg transition">
                    <i data-feather="maximize" class="w-4 h-4"></i>
                </button>
                <button class="bg-gray-700 hover:bg-gray-600 px-3 py-2 rounded-lg transition">
                    <i data-feather="trash-2" class="w-4 h-4"></i>
                </button>
            </div>
        </div>
        
        <!-- Console -->
        <div class="bg-gray-800 rounded-xl p-6 mb-8">
            <div id="server-console" class="console">
                [00:00:01] [Server thread/INFO]: Starting minecraft server version 1.20.2
                [00:00:01] [Server thread/INFO]: Loading properties
                [00:00:01] [Server thread/INFO]: Default game type: SURVIVAL
                [00:00:02] [Server thread/INFO]: Generating keypair
                [00:00:02] [Server thread/INFO]: Starting Minecraft server on *:25565
                [00:00:02] [Server thread/INFO]: Using epoll channel type
                [00:00:02] [Server thread/INFO]: Preparing level "world"
                [00:00:03] [Server thread/INFO]: Done (1.234s)! For help, type "help"
                [00:01:23] [User Authenticator #1/INFO]: UUID of player Notch is 069a79f4-44e9-4726-a5be-fca90e38aaf5
                [00:01:23] [Server thread/INFO]: Notch joined the game
                [00:02:45] [Server thread/INFO]: <Notch> Hello world!
                [00:03:12] [Server thread/INFO]: Steve[/192.168.1.1:1234] logged in with entity id 123 at ([world] 12.3, 64.0, -45.6)
                [00:03:45] [Server thread/INFO]: Steve: Can someone help me?
                [00:04:12] [Server thread/INFO]: Alex[/192.168.1.2:5678] logged in with entity id 124 at ([world] -32.1, 64.0, 12.8)
                [00:04:32] [Server thread/INFO]: Notch gave Steve a diamond
            </div>
            <input type="text" id="console-input" class="console-input mt-4" placeholder="Enter command...">
        </div>
        
        <!-- Quick Commands -->
        <div class="bg-gray-800 rounded-xl p-6">
            <h2 class="text-xl font-semibold mb-4">Quick Commands</h2>
            <div class="grid grid-cols-2 md:grid-cols-4 gap-3">
                <button onclick="sendCommand('say Hello from CraftyHost!')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="message-square" class="w-4 h-4 mr-2"></i>
                        <span>Broadcast</span>
                    </div>
                </button>
                <button onclick="sendCommand('op ${player}')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="shield" class="w-4 h-4 mr-2"></i>
                        <span>OP Player</span>
                    </div>
                </button>
                <button onclick="sendCommand('ban ${player}')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="user-x" class="w-4 h-4 mr-2"></i>
                        <span>Ban Player</span>
                    </div>
                </button>
                <button onclick="sendCommand('whitelist add ${player}')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="user-plus" class="w-4 h-4 mr-2"></i>
                        <span>Whitelist</span>
                    </div>
                </button>
                <button onclick="sendCommand('time set day')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="sun" class="w-4 h-4 mr-2"></i>
                        <span>Set Day</span>
                    </div>
                </button>
                <button onclick="sendCommand('weather clear')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="cloud" class="w-4 h-4 mr-2"></i>
                        <span>Clear Weather</span>
                    </div>
                </button>
                <button onclick="sendCommand('gamemode creative ${player}')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="star" class="w-4 h-4 mr-2"></i>
                        <span>Creative Mode</span>
                    </div>
                </button>
                <button onclick="sendCommand('save-all')" class="bg-gray-700 hover:bg-gray-600 p-3 rounded-lg transition">
                    <div class="flex items-center justify-center">
                        <i data-feather="save" class="w-4 h-4 mr-2"></i>
                        <span>Save World</span>
                    </div>
                </button>
            </div>
        </div>
    </main>

    <custom-footer></custom-footer>

    <script src="components/navbar.js"></script>
    <script src="components/footer.js"></script>
    <script src="script.js"></script>
    <script>
        feather.replace();
        setupConsole('server-console');
        
        function sendCommand(command) {
            const input = document.getElementById('console-input');
            input.value = command;
            input.focus();
        }
    </script>
</body>
</html>