Implemented server killing. Updated server manage ui. Added latest tailwind stuff. Added internal error handling
This commit is contained in:
@@ -26,31 +26,31 @@
|
||||
/* Colors */
|
||||
|
||||
.btn-primary {
|
||||
@apply bg-primary-600 hover:bg-primary-500 focus-visible:outline-primary-600;
|
||||
@apply bg-primary-600 hover:bg-primary-500 focus-visible:outline-primary-600 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
@apply bg-secondary-800 hover:bg-secondary-700 focus-visible:outline-secondary-800;
|
||||
@apply bg-secondary-800 hover:bg-secondary-700 focus-visible:outline-secondary-800 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-tertiary {
|
||||
@apply bg-tertiary-600 hover:bg-tertiary-500 focus-visible:outline-tertiary-600;
|
||||
@apply bg-tertiary-600 hover:bg-tertiary-500 focus-visible:outline-tertiary-600 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
@apply bg-danger-600 hover:bg-danger-500 focus-visible:outline-danger-600;
|
||||
@apply bg-danger-600 hover:bg-danger-500 focus-visible:outline-danger-600 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
@apply bg-warning-500 hover:bg-warning-400 focus-visible:outline-warning-500;
|
||||
@apply bg-warning-500 hover:bg-warning-400 focus-visible:outline-warning-500 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-info {
|
||||
@apply bg-info-600 hover:bg-info-500 focus-visible:outline-info-600;
|
||||
@apply bg-info-600 hover:bg-info-500 focus-visible:outline-info-600 text-diffcolor;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
@apply bg-success-600 hover:bg-success-500 focus-visible:outline-success-600;
|
||||
@apply bg-success-600 hover:bg-success-500 focus-visible:outline-success-600 text-diffcolor;
|
||||
}
|
||||
|
||||
/* Outline */
|
||||
@@ -77,4 +77,69 @@
|
||||
|
||||
.btn-outline-success {
|
||||
@apply bg-gray-800 hover:border-gray-600 text-success-500;
|
||||
}
|
||||
|
||||
/* Disabled Buttons */
|
||||
|
||||
.btn:disabled,
|
||||
.btn-lg:disabled,
|
||||
.btn-sm:disabled,
|
||||
.btn-xs:disabled {
|
||||
@apply opacity-50 cursor-not-allowed pointer-events-none;
|
||||
}
|
||||
|
||||
/* Colors for Disabled States */
|
||||
|
||||
.btn-primary:disabled {
|
||||
@apply bg-primary-600 text-gray-300;
|
||||
}
|
||||
|
||||
.btn-secondary:disabled {
|
||||
@apply bg-secondary-800 text-gray-400;
|
||||
}
|
||||
|
||||
.btn-tertiary:disabled {
|
||||
@apply bg-tertiary-600 text-gray-300;
|
||||
}
|
||||
|
||||
.btn-danger:disabled {
|
||||
@apply bg-danger-600 text-gray-300;
|
||||
}
|
||||
|
||||
.btn-warning:disabled {
|
||||
@apply bg-warning-500 text-gray-400;
|
||||
}
|
||||
|
||||
.btn-info:disabled {
|
||||
@apply bg-info-600 text-gray-300;
|
||||
}
|
||||
|
||||
.btn-success:disabled {
|
||||
@apply bg-success-600 text-gray-300;
|
||||
}
|
||||
|
||||
/* Outline Disabled States */
|
||||
|
||||
.btn-outline-primary:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
|
||||
.btn-outline-tertiary:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
|
||||
.btn-outline-danger:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
|
||||
.btn-outline-warning:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
|
||||
.btn-outline-info:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
|
||||
.btn-outline-success:disabled {
|
||||
@apply bg-gray-800 border-gray-700 text-gray-500;
|
||||
}
|
||||
@@ -119,6 +119,9 @@ module.exports = {
|
||||
950: '#0e121c',
|
||||
}
|
||||
},
|
||||
textColor:{
|
||||
diffcolor: 'rgb(var(--color-diffcolor, var(--color-light)))'
|
||||
},
|
||||
animation: {
|
||||
'shimmer': 'shimmer 2s linear infinite',
|
||||
}
|
||||
|
||||
@@ -74,16 +74,38 @@
|
||||
<span class="align-middle">Start</span>
|
||||
</button>
|
||||
}
|
||||
<button type="button" class="btn btn-primary">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
@if (State == ServerState.Starting || State == ServerState.Online)
|
||||
|
||||
@if (State == ServerState.Online)
|
||||
{
|
||||
<WButton CssClasses="btn btn-danger" OnClick="_ => Stop()">
|
||||
<i class="icon-squircle me-1 align-middle"></i>
|
||||
<span class="align-middle">Stop</span>
|
||||
</WButton>
|
||||
<button type="button" class="btn btn-primary">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-primary" disabled="disabled">
|
||||
<i class="icon-rotate-ccw me-1 align-middle"></i>
|
||||
<span class="align-middle">Restart</span>
|
||||
</button>
|
||||
}
|
||||
|
||||
@if (State == ServerState.Starting || State == ServerState.Online || State == ServerState.Stopping)
|
||||
{
|
||||
if (State == ServerState.Stopping)
|
||||
{
|
||||
<WButton CssClasses="btn btn-danger" OnClick="_ => Kill()">
|
||||
<i class="icon-bomb me-1 align-middle"></i>
|
||||
<span class="align-middle">Kill</span>
|
||||
</WButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<WButton CssClasses="btn btn-danger" OnClick="_ => Stop()">
|
||||
<i class="icon-squircle me-1 align-middle"></i>
|
||||
<span class="align-middle">Stop</span>
|
||||
</WButton>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -230,14 +252,13 @@
|
||||
}
|
||||
|
||||
private async Task Start()
|
||||
{
|
||||
await ApiClient.Post($"api/servers/{Server.Id}/start");
|
||||
}
|
||||
=> await ApiClient.Post($"api/servers/{Server.Id}/start");
|
||||
|
||||
private async Task Stop()
|
||||
{
|
||||
await ApiClient.Post($"api/servers/{Server.Id}/stop");
|
||||
}
|
||||
=> await ApiClient.Post($"api/servers/{Server.Id}/stop");
|
||||
|
||||
private async Task Kill()
|
||||
=> await ApiClient.Post($"api/servers/{Server.Id}/kill");
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user