Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eca9b6ec52 | ||
|
|
b6e048e982 | ||
|
|
b8b2ae7865 | ||
|
|
0611988019 | ||
|
|
f9fd7199b6 | ||
|
|
6ff4861fc6 | ||
|
|
2db7748703 | ||
|
|
87744e4846 | ||
|
|
ce7125b50b | ||
|
|
31d8c3f469 | ||
|
|
c80622c2fd | ||
|
|
95e659e5f7 | ||
|
|
c155909e82 | ||
|
|
0011ed29b7 | ||
|
|
52c4ca0c0a | ||
|
|
c197d0ca96 | ||
|
|
25902034e9 | ||
|
|
b10db643fe | ||
|
|
4c7ffe6714 | ||
|
|
a0c2b45a61 | ||
|
|
e49a9d3505 | ||
|
|
7ddae9c3e1 | ||
|
|
290e865ae0 | ||
|
|
00ee625e2e | ||
|
|
274e2d93f2 | ||
|
|
781171f7c5 | ||
|
|
4a8618da79 | ||
|
|
296cf0db6f | ||
|
|
48cdba5155 | ||
|
|
35c1b255b5 | ||
|
|
244b920305 | ||
|
|
3d4a2128e2 | ||
|
|
1cf8430ad8 | ||
|
|
a9b7d10fb0 | ||
|
|
47e333630e | ||
|
|
8b41a9fc13 | ||
|
|
d09957fdac | ||
|
|
f9ecb61d71 | ||
|
|
ef92dd47ad | ||
|
|
c2c533675b | ||
|
|
569dd69bdd | ||
|
|
242870b3e1 | ||
|
|
30b6e45235 | ||
|
|
cd62fdc5f6 | ||
|
|
2c54b91e6c | ||
|
|
388deacf60 | ||
|
|
aa547038de | ||
|
|
78bfd68d63 | ||
|
|
17e3345b8a | ||
|
|
f95312c1e3 | ||
|
|
2144ca3823 | ||
|
|
de45ff40d8 | ||
|
|
606085c012 | ||
|
|
00525d8099 | ||
|
|
26617d67f5 | ||
|
|
600bec3417 | ||
|
|
4e85d1755a | ||
|
|
0832936933 | ||
|
|
ecda2ec6d1 | ||
|
|
6f3765a3bf | ||
|
|
29002d3445 | ||
|
|
6d0456a008 | ||
|
|
3e698123bb | ||
|
|
f3fb86819a | ||
|
|
e2248a8444 | ||
|
|
2cf2b77090 | ||
|
|
fedc9278d4 | ||
|
|
f29206a69b | ||
|
|
0658e55a78 | ||
|
|
21bea974a9 | ||
|
|
33ef09433e | ||
|
|
173bff67df | ||
|
|
512a989609 | ||
|
|
2d7dac5089 |
@@ -17,6 +17,15 @@ public class ConfigV1
|
||||
[Description("The url moonlight is accesible with from the internet")]
|
||||
public string AppUrl { get; set; } = "http://your-moonlight-url-without-slash";
|
||||
|
||||
[JsonProperty("EnableLatencyCheck")]
|
||||
[Description(
|
||||
"This will enable a latency check for connections to moonlight. Users with an too high latency will be warned that moonlight might be buggy for them")]
|
||||
public bool EnableLatencyCheck { get; set; } = true;
|
||||
|
||||
[JsonProperty("LatencyCheckThreshold")]
|
||||
[Description("Specify the latency threshold which has to be reached in order to trigger the warning message")]
|
||||
public int LatencyCheckThreshold { get; set; } = 1000;
|
||||
|
||||
[JsonProperty("Auth")] public AuthData Auth { get; set; } = new();
|
||||
|
||||
[JsonProperty("Database")] public DatabaseData Database { get; set; } = new();
|
||||
@@ -50,6 +59,15 @@ public class ConfigV1
|
||||
[JsonProperty("Sentry")] public SentryData Sentry { get; set; } = new();
|
||||
|
||||
[JsonProperty("Stripe")] public StripeData Stripe { get; set; } = new();
|
||||
|
||||
[JsonProperty("Tickets")] public TicketsData Tickets { get; set; } = new();
|
||||
}
|
||||
|
||||
public class TicketsData
|
||||
{
|
||||
[JsonProperty("WelcomeMessage")]
|
||||
[Description("The message that will be sent when a user created a ticket")]
|
||||
public string WelcomeMessage { get; set; } = "Welcome to the support";
|
||||
}
|
||||
|
||||
public class StripeData
|
||||
@@ -272,10 +290,19 @@ public class ConfigV1
|
||||
public class SecurityData
|
||||
{
|
||||
[JsonProperty("Token")]
|
||||
[Description("This is the moonlight app token. It is used to encrypt and decrypt data and validte tokens and sessions")]
|
||||
[Description("This is the moonlight app token. It is used to encrypt and decrypt data and validate tokens and sessions")]
|
||||
[Blur]
|
||||
public string Token { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
[JsonProperty("MalwareCheckOnStart")]
|
||||
[Description(
|
||||
"This option will enable the scanning for malware on every server before it has been started and if something has been found, the power action will be canceled")]
|
||||
public bool MalwareCheckOnStart { get; set; } = true;
|
||||
|
||||
[JsonProperty("BlockIpDuration")]
|
||||
[Description("The duration in minutes a ip will be blocked by the anti ddos system")]
|
||||
public int BlockIpDuration { get; set; } = 15;
|
||||
|
||||
[JsonProperty("ReCaptcha")] public ReCaptchaData ReCaptcha { get; set; } = new();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ public class DataContext : DbContext
|
||||
public DbSet<IpBan> IpBans { get; set; }
|
||||
public DbSet<PermissionGroup> PermissionGroups { get; set; }
|
||||
public DbSet<SecurityLog> SecurityLogs { get; set; }
|
||||
public DbSet<BlocklistIp> BlocklistIps { get; set; }
|
||||
public DbSet<WhitelistIp> WhitelistIps { get; set; }
|
||||
|
||||
public DbSet<Ticket> Tickets { get; set; }
|
||||
public DbSet<TicketMessage> TicketMessages { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
||||
10
Moonlight/App/Database/Entities/BlocklistIp.cs
Normal file
10
Moonlight/App/Database/Entities/BlocklistIp.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Moonlight.App.Database.Entities;
|
||||
|
||||
public class BlocklistIp
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Ip { get; set; } = "";
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public long Packets { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
19
Moonlight/App/Database/Entities/Ticket.cs
Normal file
19
Moonlight/App/Database/Entities/Ticket.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Moonlight.App.Models.Misc;
|
||||
|
||||
namespace Moonlight.App.Database.Entities;
|
||||
|
||||
public class Ticket
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string IssueTopic { get; set; } = "";
|
||||
public string IssueDescription { get; set; } = "";
|
||||
public string IssueTries { get; set; } = "";
|
||||
public User CreatedBy { get; set; }
|
||||
public User? AssignedTo { get; set; }
|
||||
public TicketPriority Priority { get; set; }
|
||||
public TicketStatus Status { get; set; }
|
||||
public TicketSubject Subject { get; set; }
|
||||
public int SubjectId { get; set; }
|
||||
public List<TicketMessage> Messages { get; set; } = new();
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
14
Moonlight/App/Database/Entities/TicketMessage.cs
Normal file
14
Moonlight/App/Database/Entities/TicketMessage.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Moonlight.App.Database.Entities;
|
||||
|
||||
public class TicketMessage
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Content { get; set; } = "";
|
||||
public string? AttachmentUrl { get; set; }
|
||||
public User? Sender { get; set; }
|
||||
public bool IsSystemMessage { get; set; }
|
||||
public bool IsEdited { get; set; }
|
||||
public bool IsSupportMessage { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
7
Moonlight/App/Database/Entities/WhitelistIp.cs
Normal file
7
Moonlight/App/Database/Entities/WhitelistIp.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Moonlight.App.Database.Entities;
|
||||
|
||||
public class WhitelistIp
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Ip { get; set; } = "";
|
||||
}
|
||||
1107
Moonlight/App/Database/Migrations/20230721201950_AddIpRules.Designer.cs
generated
Normal file
1107
Moonlight/App/Database/Migrations/20230721201950_AddIpRules.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Moonlight.App.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIpRules : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BlocklistIps",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Ip = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ExpiresAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
Packets = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BlocklistIps", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WhitelistIps",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Ip = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WhitelistIps", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BlocklistIps");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "WhitelistIps");
|
||||
}
|
||||
}
|
||||
}
|
||||
1233
Moonlight/App/Database/Migrations/20230803012947_AddNewTicketModels.Designer.cs
generated
Normal file
1233
Moonlight/App/Database/Migrations/20230803012947_AddNewTicketModels.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Moonlight.App.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddNewTicketModels : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tickets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
IssueTopic = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IssueDescription = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IssueTries = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedById = table.Column<int>(type: "int", nullable: false),
|
||||
AssignedToId = table.Column<int>(type: "int", nullable: true),
|
||||
Priority = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Subject = table.Column<int>(type: "int", nullable: false),
|
||||
SubjectId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tickets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tickets_Users_AssignedToId",
|
||||
column: x => x.AssignedToId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Tickets_Users_CreatedById",
|
||||
column: x => x.CreatedById,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TicketMessages",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Content = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
AttachmentUrl = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
SenderId = table.Column<int>(type: "int", nullable: true),
|
||||
IsSystemMessage = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
IsEdited = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
IsSupportMessage = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
TicketId = table.Column<int>(type: "int", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TicketMessages", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TicketMessages_Tickets_TicketId",
|
||||
column: x => x.TicketId,
|
||||
principalTable: "Tickets",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_TicketMessages_Users_SenderId",
|
||||
column: x => x.SenderId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TicketMessages_SenderId",
|
||||
table: "TicketMessages",
|
||||
column: "SenderId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TicketMessages_TicketId",
|
||||
table: "TicketMessages",
|
||||
column: "TicketId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tickets_AssignedToId",
|
||||
table: "Tickets",
|
||||
column: "AssignedToId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tickets_CreatedById",
|
||||
table: "Tickets",
|
||||
column: "CreatedById");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TicketMessages");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tickets");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,30 @@ namespace Moonlight.App.Database.Migrations
|
||||
.HasAnnotation("ProductVersion", "7.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.BlocklistIp", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("ExpiresAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<long>("Packets")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BlocklistIps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.CloudPanel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -690,6 +714,97 @@ namespace Moonlight.App.Database.Migrations
|
||||
b.ToTable("SupportChatMessages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.Ticket", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("AssignedToId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("CreatedById")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("IssueDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("IssueTopic")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("IssueTries")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Subject")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SubjectId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssignedToId");
|
||||
|
||||
b.HasIndex("CreatedById");
|
||||
|
||||
b.ToTable("Tickets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.TicketMessage", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AttachmentUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("IsEdited")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("IsSupportMessage")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("IsSystemMessage")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int?>("SenderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("TicketId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SenderId");
|
||||
|
||||
b.HasIndex("TicketId");
|
||||
|
||||
b.ToTable("TicketMessages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -842,6 +957,21 @@ namespace Moonlight.App.Database.Migrations
|
||||
b.ToTable("WebSpaces");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.WhitelistIp", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("WhitelistIps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.DdosAttack", b =>
|
||||
{
|
||||
b.HasOne("Moonlight.App.Database.Entities.Node", "Node")
|
||||
@@ -1000,6 +1130,36 @@ namespace Moonlight.App.Database.Migrations
|
||||
b.Navigation("Sender");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.Ticket", b =>
|
||||
{
|
||||
b.HasOne("Moonlight.App.Database.Entities.User", "AssignedTo")
|
||||
.WithMany()
|
||||
.HasForeignKey("AssignedToId");
|
||||
|
||||
b.HasOne("Moonlight.App.Database.Entities.User", "CreatedBy")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatedById")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AssignedTo");
|
||||
|
||||
b.Navigation("CreatedBy");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.TicketMessage", b =>
|
||||
{
|
||||
b.HasOne("Moonlight.App.Database.Entities.User", "Sender")
|
||||
.WithMany()
|
||||
.HasForeignKey("SenderId");
|
||||
|
||||
b.HasOne("Moonlight.App.Database.Entities.Ticket", null)
|
||||
.WithMany("Messages")
|
||||
.HasForeignKey("TicketId");
|
||||
|
||||
b.Navigation("Sender");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.User", b =>
|
||||
{
|
||||
b.HasOne("Moonlight.App.Database.Entities.Subscription", "CurrentSubscription")
|
||||
@@ -1055,6 +1215,11 @@ namespace Moonlight.App.Database.Migrations
|
||||
b.Navigation("Variables");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.Ticket", b =>
|
||||
{
|
||||
b.Navigation("Messages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Moonlight.App.Database.Entities.WebSpace", b =>
|
||||
{
|
||||
b.Navigation("Databases");
|
||||
|
||||
119
Moonlight/App/Helpers/BackupHelper.cs
Normal file
119
Moonlight/App/Helpers/BackupHelper.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Moonlight.App.Database;
|
||||
using Moonlight.App.Services;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
namespace Moonlight.App.Helpers;
|
||||
|
||||
public class BackupHelper
|
||||
{
|
||||
public async Task CreateBackup(string path)
|
||||
{
|
||||
Logger.Info("Started moonlight backup creation");
|
||||
Logger.Info($"This backup will be saved to '{path}'");
|
||||
|
||||
var stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
|
||||
var cachePath = PathBuilder.Dir("storage", "backups", "cache");
|
||||
|
||||
Directory.CreateDirectory(cachePath);
|
||||
|
||||
//
|
||||
// Exporting database
|
||||
//
|
||||
|
||||
Logger.Info("Exporting database");
|
||||
|
||||
var configService = new ConfigService(new());
|
||||
var dataContext = new DataContext(configService);
|
||||
|
||||
await using MySqlConnection conn = new MySqlConnection(dataContext.Database.GetConnectionString());
|
||||
await using MySqlCommand cmd = new MySqlCommand();
|
||||
using MySqlBackup mb = new MySqlBackup(cmd);
|
||||
|
||||
cmd.Connection = conn;
|
||||
await conn.OpenAsync();
|
||||
mb.ExportToFile(PathBuilder.File(cachePath, "database.sql"));
|
||||
await conn.CloseAsync();
|
||||
|
||||
//
|
||||
// Saving config
|
||||
//
|
||||
|
||||
Logger.Info("Saving configuration");
|
||||
File.Copy(
|
||||
PathBuilder.File("storage", "configs", "config.json"),
|
||||
PathBuilder.File(cachePath, "config.json"));
|
||||
|
||||
//
|
||||
// Saving all storage items needed to restore the panel
|
||||
//
|
||||
|
||||
Logger.Info("Saving resources");
|
||||
CopyDirectory(
|
||||
PathBuilder.Dir("storage", "resources"),
|
||||
PathBuilder.Dir(cachePath, "resources"));
|
||||
|
||||
Logger.Info("Saving logs");
|
||||
CopyDirectory(
|
||||
PathBuilder.Dir("storage", "logs"),
|
||||
PathBuilder.Dir(cachePath, "logs"));
|
||||
|
||||
Logger.Info("Saving uploads");
|
||||
CopyDirectory(
|
||||
PathBuilder.Dir("storage", "uploads"),
|
||||
PathBuilder.Dir(cachePath, "uploads"));
|
||||
|
||||
//
|
||||
// Compressing the backup to a single file
|
||||
//
|
||||
|
||||
Logger.Info("Compressing");
|
||||
ZipFile.CreateFromDirectory(cachePath,
|
||||
path,
|
||||
CompressionLevel.Fastest,
|
||||
false);
|
||||
|
||||
Directory.Delete(cachePath, true);
|
||||
|
||||
stopWatch.Stop();
|
||||
Logger.Info($"Backup successfully created. Took {stopWatch.Elapsed.TotalSeconds} seconds");
|
||||
}
|
||||
|
||||
private void CopyDirectory(string sourceDirName, string destDirName, bool copySubDirs = true)
|
||||
{
|
||||
DirectoryInfo dir = new DirectoryInfo(sourceDirName);
|
||||
|
||||
if (!dir.Exists)
|
||||
{
|
||||
throw new DirectoryNotFoundException($"Source directory does not exist or could not be found: {sourceDirName}");
|
||||
}
|
||||
|
||||
if (!Directory.Exists(destDirName))
|
||||
{
|
||||
Directory.CreateDirectory(destDirName);
|
||||
}
|
||||
|
||||
FileInfo[] files = dir.GetFiles();
|
||||
|
||||
foreach (FileInfo file in files)
|
||||
{
|
||||
string tempPath = Path.Combine(destDirName, file.Name);
|
||||
file.CopyTo(tempPath, false);
|
||||
}
|
||||
|
||||
if (copySubDirs)
|
||||
{
|
||||
DirectoryInfo[] dirs = dir.GetDirectories();
|
||||
|
||||
foreach (DirectoryInfo subdir in dirs)
|
||||
{
|
||||
string tempPath = Path.Combine(destDirName, subdir.Name);
|
||||
CopyDirectory(subdir.FullName, tempPath, copySubDirs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
Moonlight/App/Helpers/ByteSizeValue.cs
Normal file
56
Moonlight/App/Helpers/ByteSizeValue.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
namespace Moonlight.App.Helpers;
|
||||
|
||||
public class ByteSizeValue
|
||||
{
|
||||
public long Bytes { get; set; }
|
||||
|
||||
public long KiloBytes
|
||||
{
|
||||
get => Bytes / 1024;
|
||||
set => Bytes = value * 1024;
|
||||
}
|
||||
|
||||
public long MegaBytes
|
||||
{
|
||||
get => KiloBytes / 1024;
|
||||
set => KiloBytes = value * 1024;
|
||||
}
|
||||
|
||||
public long GigaBytes
|
||||
{
|
||||
get => MegaBytes / 1024;
|
||||
set => MegaBytes = value * 1024;
|
||||
}
|
||||
|
||||
public static ByteSizeValue FromBytes(long bytes)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Bytes = bytes
|
||||
};
|
||||
}
|
||||
|
||||
public static ByteSizeValue FromKiloBytes(long kiloBytes)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
KiloBytes = kiloBytes
|
||||
};
|
||||
}
|
||||
|
||||
public static ByteSizeValue FromMegaBytes(long megaBytes)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
MegaBytes = megaBytes
|
||||
};
|
||||
}
|
||||
|
||||
public static ByteSizeValue FromGigaBytes(long gigaBytes)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
GigaBytes = gigaBytes
|
||||
};
|
||||
}
|
||||
}
|
||||
12
Moonlight/App/Helpers/ComponentHelper.cs
Normal file
12
Moonlight/App/Helpers/ComponentHelper.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Moonlight.App.Helpers;
|
||||
|
||||
public class ComponentHelper
|
||||
{
|
||||
public static RenderFragment FromType(Type type) => builder =>
|
||||
{
|
||||
builder.OpenComponent(0, type);
|
||||
builder.CloseComponent();
|
||||
};
|
||||
}
|
||||
@@ -45,7 +45,18 @@ public class DatabaseCheckupService
|
||||
{
|
||||
Logger.Info($"{migrations.Length} migrations pending. Updating now");
|
||||
|
||||
await BackupDatabase();
|
||||
try
|
||||
{
|
||||
var backupHelper = new BackupHelper();
|
||||
await backupHelper.CreateBackup(
|
||||
PathBuilder.File("storage", "backups", $"{new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds()}.zip"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Fatal("Unable to create backup");
|
||||
Logger.Fatal(e);
|
||||
Logger.Fatal("Moonlight will continue to start and apply the migrations without a backup");
|
||||
}
|
||||
|
||||
Logger.Info("Applying migrations");
|
||||
|
||||
@@ -58,53 +69,4 @@ public class DatabaseCheckupService
|
||||
Logger.Info("Database is up-to-date. No migrations have been performed");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task BackupDatabase()
|
||||
{
|
||||
Logger.Info("Creating backup from database");
|
||||
|
||||
var configService = new ConfigService(new StorageService());
|
||||
var dateTimeService = new DateTimeService();
|
||||
|
||||
var config = configService.Get().Moonlight.Database;
|
||||
|
||||
var connectionString = $"host={config.Host};" +
|
||||
$"port={config.Port};" +
|
||||
$"database={config.Database};" +
|
||||
$"uid={config.Username};" +
|
||||
$"pwd={config.Password}";
|
||||
|
||||
string file = PathBuilder.File("storage", "backups", $"{dateTimeService.GetCurrentUnix()}-mysql.sql");
|
||||
|
||||
Logger.Info($"Saving it to: {file}");
|
||||
Logger.Info("Starting backup...");
|
||||
|
||||
try
|
||||
{
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
await using MySqlConnection conn = new MySqlConnection(connectionString);
|
||||
await using MySqlCommand cmd = new MySqlCommand();
|
||||
using MySqlBackup mb = new MySqlBackup(cmd);
|
||||
|
||||
cmd.Connection = conn;
|
||||
await conn.OpenAsync();
|
||||
mb.ExportToFile(file);
|
||||
await conn.CloseAsync();
|
||||
|
||||
sw.Stop();
|
||||
Logger.Info($"Done. {sw.Elapsed.TotalSeconds}s");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Fatal("-----------------------------------------------");
|
||||
Logger.Fatal("Unable to create backup for moonlight database");
|
||||
Logger.Fatal("Moonlight will start anyways in 30 seconds");
|
||||
Logger.Fatal("-----------------------------------------------");
|
||||
Logger.Fatal(e);
|
||||
|
||||
Thread.Sleep(TimeSpan.FromSeconds(30));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,19 +43,22 @@ public class WingsFileAccess : FileAccess
|
||||
$"api/servers/{Server.Uuid}/files/list-directory?directory={CurrentPath}"
|
||||
);
|
||||
|
||||
var x = new List<FileData>();
|
||||
var result = new List<FileData>();
|
||||
|
||||
foreach (var response in res)
|
||||
foreach (var resGrouped in res.GroupBy(x => x.Directory))
|
||||
{
|
||||
x.Add(new()
|
||||
foreach (var resItem in resGrouped.OrderBy(x => x.Name))
|
||||
{
|
||||
Name = response.Name,
|
||||
Size = response.File ? response.Size : 0,
|
||||
IsFile = response.File,
|
||||
result.Add(new()
|
||||
{
|
||||
Name = resItem.Name,
|
||||
Size = resItem.File ? resItem.Size : 0,
|
||||
IsFile = resItem.File,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return x.ToArray();
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
public override Task Cd(string dir)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Moonlight.App.Services;
|
||||
|
||||
namespace Moonlight.App.Helpers;
|
||||
@@ -156,11 +157,21 @@ public static class Formatter
|
||||
}
|
||||
}
|
||||
|
||||
public static double BytesToGb(long bytes)
|
||||
public static RenderFragment FormatLineBreaks(string content)
|
||||
{
|
||||
const double gbMultiplier = 1024 * 1024 * 1024; // 1 GB = 1024 MB * 1024 KB * 1024 B
|
||||
return builder =>
|
||||
{
|
||||
int i = 0;
|
||||
var arr = content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
|
||||
double gigabytes = (double)bytes / gbMultiplier;
|
||||
return gigabytes;
|
||||
foreach (var line in arr)
|
||||
{
|
||||
builder.AddContent(i, line);
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
builder.AddMarkupContent(i, "<br/>");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -43,4 +43,15 @@ public static class StringHelper
|
||||
|
||||
return firstChar + restOfString;
|
||||
}
|
||||
|
||||
public static string CutInHalf(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
return input;
|
||||
|
||||
int length = input.Length;
|
||||
int halfLength = length / 2;
|
||||
|
||||
return input.Substring(0, halfLength);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Events;
|
||||
using Moonlight.App.Http.Requests.Daemon;
|
||||
using Moonlight.App.Repositories;
|
||||
using Moonlight.App.Services.Background;
|
||||
|
||||
namespace Moonlight.App.Http.Controllers.Api.Remote;
|
||||
|
||||
@@ -10,19 +11,17 @@ namespace Moonlight.App.Http.Controllers.Api.Remote;
|
||||
[Route("api/remote/ddos")]
|
||||
public class DdosController : Controller
|
||||
{
|
||||
private readonly NodeRepository NodeRepository;
|
||||
private readonly EventSystem Event;
|
||||
private readonly DdosAttackRepository DdosAttackRepository;
|
||||
private readonly Repository<Node> NodeRepository;
|
||||
private readonly DdosProtectionService DdosProtectionService;
|
||||
|
||||
public DdosController(NodeRepository nodeRepository, EventSystem eventSystem, DdosAttackRepository ddosAttackRepository)
|
||||
public DdosController(Repository<Node> nodeRepository, DdosProtectionService ddosProtectionService)
|
||||
{
|
||||
NodeRepository = nodeRepository;
|
||||
Event = eventSystem;
|
||||
DdosAttackRepository = ddosAttackRepository;
|
||||
DdosProtectionService = ddosProtectionService;
|
||||
}
|
||||
|
||||
[HttpPost("update")]
|
||||
public async Task<ActionResult> Update([FromBody] DdosStatus ddosStatus)
|
||||
[HttpPost("start")]
|
||||
public async Task<ActionResult> Start([FromBody] DdosStart ddosStart)
|
||||
{
|
||||
var tokenData = Request.Headers.Authorization.ToString().Replace("Bearer ", "");
|
||||
var id = tokenData.Split(".")[0];
|
||||
@@ -36,17 +35,25 @@ public class DdosController : Controller
|
||||
if (token != node.Token)
|
||||
return Unauthorized();
|
||||
|
||||
var ddosAttack = new DdosAttack()
|
||||
await DdosProtectionService.ProcessDdosSignal(ddosStart.Ip, ddosStart.Packets);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("stop")]
|
||||
public async Task<ActionResult> Stop([FromBody] DdosStop ddosStop)
|
||||
{
|
||||
Ongoing = ddosStatus.Ongoing,
|
||||
Data = ddosStatus.Data,
|
||||
Ip = ddosStatus.Ip,
|
||||
Node = node
|
||||
};
|
||||
var tokenData = Request.Headers.Authorization.ToString().Replace("Bearer ", "");
|
||||
var id = tokenData.Split(".")[0];
|
||||
var token = tokenData.Split(".")[1];
|
||||
|
||||
ddosAttack = DdosAttackRepository.Add(ddosAttack);
|
||||
var node = NodeRepository.Get().FirstOrDefault(x => x.TokenId == id);
|
||||
|
||||
await Event.Emit("node.ddos", ddosAttack);
|
||||
if (node == null)
|
||||
return NotFound();
|
||||
|
||||
if (token != node.Token)
|
||||
return Unauthorized();
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
7
Moonlight/App/Http/Requests/Daemon/DdosStart.cs
Normal file
7
Moonlight/App/Http/Requests/Daemon/DdosStart.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Moonlight.App.Http.Requests.Daemon;
|
||||
|
||||
public class DdosStart
|
||||
{
|
||||
public string Ip { get; set; } = "";
|
||||
public long Packets { get; set; }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Moonlight.App.Http.Requests.Daemon;
|
||||
|
||||
public class DdosStatus
|
||||
{
|
||||
public bool Ongoing { get; set; }
|
||||
public long Data { get; set; }
|
||||
public string Ip { get; set; } = "";
|
||||
}
|
||||
7
Moonlight/App/Http/Requests/Daemon/DdosStop.cs
Normal file
7
Moonlight/App/Http/Requests/Daemon/DdosStop.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Moonlight.App.Http.Requests.Daemon;
|
||||
|
||||
public class DdosStop
|
||||
{
|
||||
public string Ip { get; set; } = "";
|
||||
public long Traffic { get; set; }
|
||||
}
|
||||
42
Moonlight/App/MalwareScans/FakePlayerPluginScan.cs
Normal file
42
Moonlight/App/MalwareScans/FakePlayerPluginScan.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services;
|
||||
|
||||
namespace Moonlight.App.MalwareScans;
|
||||
|
||||
public class FakePlayerPluginScan : MalwareScan
|
||||
{
|
||||
public override string Name => "Fake player plugin scan";
|
||||
public override string Description => "This scan is a simple fake player plugin scan provided by moonlight";
|
||||
|
||||
public override async Task<MalwareScanResult[]> Scan(Server server, IServiceProvider serviceProvider)
|
||||
{
|
||||
var serverService = serviceProvider.GetRequiredService<ServerService>();
|
||||
var access = await serverService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => !x.IsFile && x.Name == "plugins")) // Check for plugins folder
|
||||
{
|
||||
await access.Cd("plugins");
|
||||
fileElements = await access.Ls();
|
||||
|
||||
foreach (var fileElement in fileElements)
|
||||
{
|
||||
if (fileElement.Name.ToLower().Contains("fakeplayer"))
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new MalwareScanResult
|
||||
{
|
||||
Title = "Fake player plugin",
|
||||
Description = $"Suspicious plugin file: {fileElement.Name}",
|
||||
Author = "Marcel Baumgartner"
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Array.Empty<MalwareScanResult>();
|
||||
}
|
||||
}
|
||||
40
Moonlight/App/MalwareScans/MinerJarScan.cs
Normal file
40
Moonlight/App/MalwareScans/MinerJarScan.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services;
|
||||
|
||||
namespace Moonlight.App.MalwareScans;
|
||||
|
||||
public class MinerJarScan : MalwareScan
|
||||
{
|
||||
public override string Name => "Miner jar scan";
|
||||
public override string Description => "This scan is a simple miner jar scan provided by moonlight";
|
||||
|
||||
public override async Task<MalwareScanResult[]> Scan(Server server, IServiceProvider serviceProvider)
|
||||
{
|
||||
var serverService = serviceProvider.GetRequiredService<ServerService>();
|
||||
var access = await serverService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => x.Name == "libraries" && !x.IsFile))
|
||||
{
|
||||
await access.Cd("libraries");
|
||||
|
||||
fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => x.Name == "jdk" && !x.IsFile))
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new MalwareScanResult
|
||||
{
|
||||
Title = "Found Miner",
|
||||
Description = "Detected suspicious library directory which may contain a script for miners",
|
||||
Author = "Marcel Baumgartner"
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return Array.Empty<MalwareScanResult>();
|
||||
}
|
||||
}
|
||||
38
Moonlight/App/MalwareScans/SelfBotCodeScan.cs
Normal file
38
Moonlight/App/MalwareScans/SelfBotCodeScan.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services;
|
||||
|
||||
namespace Moonlight.App.MalwareScans;
|
||||
|
||||
public class SelfBotCodeScan : MalwareScan
|
||||
{
|
||||
public override string Name => "Selfbot code scan";
|
||||
public override string Description => "This scan is a simple selfbot code scan provided by moonlight";
|
||||
|
||||
public override async Task<MalwareScanResult[]> Scan(Server server, IServiceProvider serviceProvider)
|
||||
{
|
||||
var serverService = serviceProvider.GetRequiredService<ServerService>();
|
||||
var access = await serverService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
foreach (var script in fileElements.Where(x => x.Name.EndsWith(".py") && x.IsFile))
|
||||
{
|
||||
var rawScript = await access.Read(script);
|
||||
|
||||
if (rawScript.Contains("https://discord.com/api") && !rawScript.Contains("https://discord.com/api/oauth2") && !rawScript.Contains("https://discord.com/api/webhook") || rawScript.Contains("https://rblxwild.com")) //TODO: Export to plugins, add regex for checking
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new MalwareScanResult
|
||||
{
|
||||
Title = "Potential selfbot",
|
||||
Description = $"Suspicious script file: {script.Name}",
|
||||
Author = "Marcel Baumgartner"
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return Array.Empty<MalwareScanResult>();
|
||||
}
|
||||
}
|
||||
33
Moonlight/App/MalwareScans/SelfBotScan.cs
Normal file
33
Moonlight/App/MalwareScans/SelfBotScan.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services;
|
||||
|
||||
namespace Moonlight.App.MalwareScans;
|
||||
|
||||
public class SelfBotScan : MalwareScan
|
||||
{
|
||||
public override string Name => "Selfbot Scan";
|
||||
public override string Description => "This scan is a simple selfbot scan provided by moonlight";
|
||||
|
||||
public override async Task<MalwareScanResult[]> Scan(Server server, IServiceProvider serviceProvider)
|
||||
{
|
||||
var serverService = serviceProvider.GetRequiredService<ServerService>();
|
||||
var access = await serverService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => x.Name == "tokens.txt"))
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new MalwareScanResult
|
||||
{
|
||||
Title = "Found SelfBot",
|
||||
Description = "Detected suspicious 'tokens.txt' file which may contain tokens for a selfbot",
|
||||
Author = "Marcel Baumgartner"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Array.Empty<MalwareScanResult>();
|
||||
}
|
||||
}
|
||||
21
Moonlight/App/Models/Forms/CreateTicketDataModel.cs
Normal file
21
Moonlight/App/Models/Forms/CreateTicketDataModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Moonlight.App.Models.Misc;
|
||||
|
||||
namespace Moonlight.App.Models.Forms;
|
||||
|
||||
public class CreateTicketDataModel
|
||||
{
|
||||
[Required(ErrorMessage = "You need to specify a issue topic")]
|
||||
[MinLength(5, ErrorMessage = "The issue topic needs to be longer than 5 characters")]
|
||||
public string IssueTopic { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to specify a issue description")]
|
||||
[MinLength(10, ErrorMessage = "The issue description needs to be longer than 10 characters")]
|
||||
public string IssueDescription { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to specify your tries to solve this issue")]
|
||||
public string IssueTries { get; set; }
|
||||
|
||||
public TicketSubject Subject { get; set; }
|
||||
public int SubjectId { get; set; }
|
||||
}
|
||||
10
Moonlight/App/Models/Misc/MalwareScan.cs
Normal file
10
Moonlight/App/Models/Misc/MalwareScan.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
|
||||
namespace Moonlight.App.Models.Misc;
|
||||
|
||||
public abstract class MalwareScan
|
||||
{
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract Task<MalwareScanResult[]> Scan(Server server, IServiceProvider serviceProvider);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
public class MalwareScanResult
|
||||
{
|
||||
public string Title { get; set; } = "";
|
||||
public string Title { get; set; }
|
||||
public string Description { get; set; } = "";
|
||||
public string Author { get; set; } = "";
|
||||
}
|
||||
6
Moonlight/App/Models/Misc/OfficialMoonlightPlugin.cs
Normal file
6
Moonlight/App/Models/Misc/OfficialMoonlightPlugin.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Moonlight.App.Models.Misc;
|
||||
|
||||
public class OfficialMoonlightPlugin
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
9
Moonlight/App/Models/Misc/TicketPriority.cs
Normal file
9
Moonlight/App/Models/Misc/TicketPriority.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Moonlight.App.Models.Misc;
|
||||
|
||||
public enum TicketPriority
|
||||
{
|
||||
Low = 0,
|
||||
Medium = 1,
|
||||
High = 2,
|
||||
Critical = 3
|
||||
}
|
||||
9
Moonlight/App/Models/Misc/TicketStatus.cs
Normal file
9
Moonlight/App/Models/Misc/TicketStatus.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Moonlight.App.Models.Misc;
|
||||
|
||||
public enum TicketStatus
|
||||
{
|
||||
Closed = 0,
|
||||
Open = 1,
|
||||
WaitingForUser = 2,
|
||||
Pending = 3
|
||||
}
|
||||
9
Moonlight/App/Models/Misc/TicketSubject.cs
Normal file
9
Moonlight/App/Models/Misc/TicketSubject.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Moonlight.App.Models.Misc;
|
||||
|
||||
public enum TicketSubject
|
||||
{
|
||||
Webspace = 0,
|
||||
Server = 1,
|
||||
Domain = 2,
|
||||
Other = 3
|
||||
}
|
||||
@@ -16,6 +16,13 @@ public static class Permissions
|
||||
Description = "View statistical information about the moonlight instance"
|
||||
};
|
||||
|
||||
public static Permission AdminSysPlugins = new()
|
||||
{
|
||||
Index = 2,
|
||||
Name = "Admin system plugins",
|
||||
Description = "View and install plugins"
|
||||
};
|
||||
|
||||
public static Permission AdminDomains = new()
|
||||
{
|
||||
Index = 4,
|
||||
@@ -44,13 +51,6 @@ public static class Permissions
|
||||
Description = "Create a new shared domain in the admin area"
|
||||
};
|
||||
|
||||
public static Permission AdminNodeDdos = new()
|
||||
{
|
||||
Index = 8,
|
||||
Name = "Admin Node DDoS",
|
||||
Description = "Manage DDoS protection for nodes in the admin area"
|
||||
};
|
||||
|
||||
public static Permission AdminNodeEdit = new()
|
||||
{
|
||||
Index = 9,
|
||||
@@ -401,6 +401,20 @@ public static class Permissions
|
||||
Description = "View the security logs"
|
||||
};
|
||||
|
||||
public static Permission AdminSecurityDdos = new()
|
||||
{
|
||||
Index = 59,
|
||||
Name = "Admin security ddos",
|
||||
Description = "Manage the integrated ddos protection"
|
||||
};
|
||||
|
||||
public static Permission AdminChangelog = new()
|
||||
{
|
||||
Index = 59,
|
||||
Name = "Admin changelog",
|
||||
Description = "View the changelog"
|
||||
};
|
||||
|
||||
public static Permission? FromString(string name)
|
||||
{
|
||||
var type = typeof(Permissions);
|
||||
|
||||
17
Moonlight/App/Plugin/MoonlightPlugin.cs
Normal file
17
Moonlight/App/Plugin/MoonlightPlugin.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Plugin.UI.Servers;
|
||||
using Moonlight.App.Plugin.UI.Webspaces;
|
||||
|
||||
namespace Moonlight.App.Plugin;
|
||||
|
||||
public abstract class MoonlightPlugin
|
||||
{
|
||||
public string Name { get; set; } = "N/A";
|
||||
public string Author { get; set; } = "N/A";
|
||||
public string Version { get; set; } = "N/A";
|
||||
|
||||
public Func<ServerPageContext, Task>? OnBuildServerPage { get; set; }
|
||||
public Func<WebspacePageContext, Task>? OnBuildWebspacePage { get; set; }
|
||||
public Func<IServiceCollection, Task>? OnBuildServices { get; set; }
|
||||
public Func<List<MalwareScan>, Task<List<MalwareScan>>>? OnBuildMalwareScans { get; set; }
|
||||
}
|
||||
12
Moonlight/App/Plugin/UI/Servers/ServerPageContext.cs
Normal file
12
Moonlight/App/Plugin/UI/Servers/ServerPageContext.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
|
||||
namespace Moonlight.App.Plugin.UI.Servers;
|
||||
|
||||
public class ServerPageContext
|
||||
{
|
||||
public List<ServerTab> Tabs { get; set; } = new();
|
||||
public List<ServerSetting> Settings { get; set; } = new();
|
||||
public Server Server { get; set; }
|
||||
public User User { get; set; }
|
||||
public string[] ImageTags { get; set; }
|
||||
}
|
||||
9
Moonlight/App/Plugin/UI/Servers/ServerSetting.cs
Normal file
9
Moonlight/App/Plugin/UI/Servers/ServerSetting.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Moonlight.App.Plugin.UI.Servers;
|
||||
|
||||
public class ServerSetting
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public RenderFragment Component { get; set; }
|
||||
}
|
||||
11
Moonlight/App/Plugin/UI/Servers/ServerTab.cs
Normal file
11
Moonlight/App/Plugin/UI/Servers/ServerTab.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Moonlight.App.Plugin.UI.Servers;
|
||||
|
||||
public class ServerTab
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Route { get; set; }
|
||||
public string Icon { get; set; }
|
||||
public RenderFragment Component { get; set; }
|
||||
}
|
||||
10
Moonlight/App/Plugin/UI/Webspaces/WebspacePageContext.cs
Normal file
10
Moonlight/App/Plugin/UI/Webspaces/WebspacePageContext.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
|
||||
namespace Moonlight.App.Plugin.UI.Webspaces;
|
||||
|
||||
public class WebspacePageContext
|
||||
{
|
||||
public List<WebspaceTab> Tabs { get; set; } = new();
|
||||
public User User { get; set; }
|
||||
public WebSpace WebSpace { get; set; }
|
||||
}
|
||||
10
Moonlight/App/Plugin/UI/Webspaces/WebspaceTab.cs
Normal file
10
Moonlight/App/Plugin/UI/Webspaces/WebspaceTab.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Moonlight.App.Plugin.UI.Webspaces;
|
||||
|
||||
public class WebspaceTab
|
||||
{
|
||||
public string Name { get; set; } = "N/A";
|
||||
public string Route { get; set; } = "/";
|
||||
public RenderFragment Component { get; set; }
|
||||
}
|
||||
@@ -93,14 +93,14 @@ public class CleanupService
|
||||
Logger.Debug($"Max CPU: {maxCpu}");
|
||||
executeCleanup = true;
|
||||
}
|
||||
else if (Formatter.BytesToGb(memoryMetrics.Total) - Formatter.BytesToGb(memoryMetrics.Used) <
|
||||
minMemory / 1024D)
|
||||
else if (ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes - ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes <
|
||||
minMemory)
|
||||
{
|
||||
Logger.Debug($"{node.Name}: Memory Usage is too high");
|
||||
Logger.Debug($"Memory (Total): {Formatter.BytesToGb(memoryMetrics.Total)}");
|
||||
Logger.Debug($"Memory (Used): {Formatter.BytesToGb(memoryMetrics.Used)}");
|
||||
Logger.Debug($"Memory (Total): {ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes}");
|
||||
Logger.Debug($"Memory (Used): {ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes}");
|
||||
Logger.Debug(
|
||||
$"Memory (Free): {Formatter.BytesToGb(memoryMetrics.Total) - Formatter.BytesToGb(memoryMetrics.Used)}");
|
||||
$"Memory (Free): {ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes - ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes}");
|
||||
Logger.Debug($"Min Memory: {minMemory}");
|
||||
executeCleanup = true;
|
||||
}
|
||||
|
||||
129
Moonlight/App/Services/Background/DdosProtectionService.cs
Normal file
129
Moonlight/App/Services/Background/DdosProtectionService.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using Moonlight.App.ApiClients.Daemon;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Events;
|
||||
using Moonlight.App.Helpers;
|
||||
using Moonlight.App.Repositories;
|
||||
|
||||
namespace Moonlight.App.Services.Background;
|
||||
|
||||
public class DdosProtectionService
|
||||
{
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
|
||||
public DdosProtectionService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
|
||||
Task.Run(UnBlocker);
|
||||
}
|
||||
|
||||
private async Task UnBlocker()
|
||||
{
|
||||
var periodicTimer = new PeriodicTimer(TimeSpan.FromMinutes(5));
|
||||
|
||||
while (true)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var blocklistIpRepo = scope.ServiceProvider.GetRequiredService<Repository<BlocklistIp>>();
|
||||
|
||||
var ips = blocklistIpRepo
|
||||
.Get()
|
||||
.ToArray();
|
||||
|
||||
foreach (var ip in ips)
|
||||
{
|
||||
if (DateTime.UtcNow > ip.ExpiresAt)
|
||||
{
|
||||
blocklistIpRepo.Delete(ip);
|
||||
}
|
||||
}
|
||||
|
||||
var newCount = blocklistIpRepo
|
||||
.Get()
|
||||
.Count();
|
||||
|
||||
if (newCount != ips.Length)
|
||||
{
|
||||
await RebuildNodeFirewalls();
|
||||
}
|
||||
|
||||
await periodicTimer.WaitForNextTickAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RebuildNodeFirewalls()
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var blocklistIpRepo = scope.ServiceProvider.GetRequiredService<Repository<BlocklistIp>>();
|
||||
var nodeRepo = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
|
||||
var nodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
|
||||
|
||||
var ips = blocklistIpRepo
|
||||
.Get()
|
||||
.Select(x => x.Ip)
|
||||
.ToArray();
|
||||
|
||||
foreach (var node in nodeRepo.Get().ToArray())
|
||||
{
|
||||
try
|
||||
{
|
||||
await nodeService.RebuildFirewall(node, ips);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Warn($"Error rebuilding firewall on node {node.Name}");
|
||||
Logger.Warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ProcessDdosSignal(string ip, long packets)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
var blocklistRepo = scope.ServiceProvider.GetRequiredService<Repository<BlocklistIp>>();
|
||||
var whitelistRepo = scope.ServiceProvider.GetRequiredService<Repository<WhitelistIp>>();
|
||||
|
||||
var whitelistIps = whitelistRepo.Get().ToArray();
|
||||
|
||||
if(whitelistIps.Any(x => x.Ip == ip))
|
||||
return;
|
||||
|
||||
var blocklistIps = blocklistRepo.Get().ToArray();
|
||||
|
||||
if(blocklistIps.Any(x => x.Ip == ip))
|
||||
return;
|
||||
|
||||
await BlocklistIp(ip, packets);
|
||||
}
|
||||
|
||||
public async Task BlocklistIp(string ip, long packets)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var blocklistRepo = scope.ServiceProvider.GetRequiredService<Repository<BlocklistIp>>();
|
||||
var configService = scope.ServiceProvider.GetRequiredService<ConfigService>();
|
||||
var eventSystem = scope.ServiceProvider.GetRequiredService<EventSystem>();
|
||||
|
||||
var blocklistIp = blocklistRepo.Add(new()
|
||||
{
|
||||
Ip = ip,
|
||||
Packets = packets,
|
||||
ExpiresAt = DateTime.UtcNow.AddMinutes(configService.Get().Moonlight.Security.BlockIpDuration),
|
||||
CreatedAt = DateTime.UtcNow
|
||||
});
|
||||
|
||||
await RebuildNodeFirewalls();
|
||||
await eventSystem.Emit("ddos.add", blocklistIp);
|
||||
}
|
||||
|
||||
public async Task UnBlocklistIp(string ip)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var blocklistRepo = scope.ServiceProvider.GetRequiredService<Repository<BlocklistIp>>();
|
||||
|
||||
var blocklist = blocklistRepo.Get().First(x => x.Ip == ip);
|
||||
blocklistRepo.Delete(blocklist);
|
||||
|
||||
await RebuildNodeFirewalls();
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,11 @@ public class DiscordNotificationService
|
||||
Client = new(config.WebHook);
|
||||
AppUrl = configService.Get().Moonlight.AppUrl;
|
||||
|
||||
Event.On<User>("supportChat.new", this, OnNewSupportChat);
|
||||
Event.On<SupportChatMessage>("supportChat.message", this, OnSupportChatMessage);
|
||||
Event.On<User>("supportChat.close", this, OnSupportChatClose);
|
||||
Event.On<Ticket>("tickets.new", this, OnNewTicket);
|
||||
Event.On<Ticket>("tickets.status", this, OnTicketStatusUpdated);
|
||||
Event.On<User>("user.rating", this, OnUserRated);
|
||||
Event.On<User>("billing.completed", this, OnBillingCompleted);
|
||||
Event.On<BlocklistIp>("ddos.add", this, OnIpBlockListed);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -43,6 +43,36 @@ public class DiscordNotificationService
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnTicketStatusUpdated(Ticket ticket)
|
||||
{
|
||||
await SendNotification("", builder =>
|
||||
{
|
||||
builder.Title = "Ticket status has been updated";
|
||||
builder.AddField("Issue topic", ticket.IssueTopic);
|
||||
builder.AddField("Status", ticket.Status);
|
||||
|
||||
if (ticket.AssignedTo != null)
|
||||
{
|
||||
builder.AddField("Assigned to", $"{ticket.AssignedTo.FirstName} {ticket.AssignedTo.LastName}");
|
||||
}
|
||||
|
||||
builder.Color = Color.Green;
|
||||
builder.Url = $"{AppUrl}/admin/support/view/{ticket.Id}";
|
||||
});
|
||||
}
|
||||
|
||||
private async Task OnIpBlockListed(BlocklistIp blocklistIp)
|
||||
{
|
||||
await SendNotification("", builder =>
|
||||
{
|
||||
builder.Color = Color.Red;
|
||||
builder.Title = "New ddos attack detected";
|
||||
|
||||
builder.AddField("IP", blocklistIp.Ip);
|
||||
builder.AddField("Packets", blocklistIp.Packets);
|
||||
});
|
||||
}
|
||||
|
||||
private async Task OnBillingCompleted(User user)
|
||||
{
|
||||
await SendNotification("", builder =>
|
||||
@@ -72,46 +102,14 @@ public class DiscordNotificationService
|
||||
});
|
||||
}
|
||||
|
||||
private async Task OnSupportChatClose(User user)
|
||||
private async Task OnNewTicket(Ticket ticket)
|
||||
{
|
||||
await SendNotification("", builder =>
|
||||
{
|
||||
builder.Title = "A new support chat has been marked as closed";
|
||||
builder.Color = Color.Red;
|
||||
builder.AddField("Email", user.Email);
|
||||
builder.AddField("Firstname", user.FirstName);
|
||||
builder.AddField("Lastname", user.LastName);
|
||||
builder.Url = $"{AppUrl}/admin/support/view/{user.Id}";
|
||||
});
|
||||
}
|
||||
|
||||
private async Task OnSupportChatMessage(SupportChatMessage message)
|
||||
{
|
||||
if(message.Sender == null)
|
||||
return;
|
||||
|
||||
await SendNotification("", builder =>
|
||||
{
|
||||
builder.Title = "New message in support chat";
|
||||
builder.Color = Color.Blue;
|
||||
builder.AddField("Message", message.Content);
|
||||
builder.Author = new EmbedAuthorBuilder()
|
||||
.WithName($"{message.Sender.FirstName} {message.Sender.LastName}")
|
||||
.WithIconUrl(ResourceService.Avatar(message.Sender));
|
||||
builder.Url = $"{AppUrl}/admin/support/view/{message.Recipient.Id}";
|
||||
});
|
||||
}
|
||||
|
||||
private async Task OnNewSupportChat(User user)
|
||||
{
|
||||
await SendNotification("", builder =>
|
||||
{
|
||||
builder.Title = "A new support chat has been marked as active";
|
||||
builder.Title = "A new ticket has been created";
|
||||
builder.AddField("Issue topic", ticket.IssueTopic);
|
||||
builder.Color = Color.Green;
|
||||
builder.AddField("Email", user.Email);
|
||||
builder.AddField("Firstname", user.FirstName);
|
||||
builder.AddField("Lastname", user.LastName);
|
||||
builder.Url = $"{AppUrl}/admin/support/view/{user.Id}";
|
||||
builder.Url = $"{AppUrl}/admin/support/view/{ticket.Id}";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
using Moonlight.App.ApiClients.Daemon.Resources;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Events;
|
||||
using Moonlight.App.Exceptions;
|
||||
using Moonlight.App.Helpers;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Repositories;
|
||||
|
||||
namespace Moonlight.App.Services.Background;
|
||||
|
||||
public class MalwareBackgroundScanService
|
||||
{
|
||||
private readonly EventSystem Event;
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
|
||||
public bool IsRunning => !ScanTask?.IsCompleted ?? false;
|
||||
public bool ScanAllServers { get; set; }
|
||||
public readonly Dictionary<Server, MalwareScanResult[]> ScanResults;
|
||||
public string Status { get; private set; } = "N/A";
|
||||
|
||||
private Task? ScanTask;
|
||||
|
||||
public MalwareBackgroundScanService(IServiceScopeFactory serviceScopeFactory, EventSystem eventSystem)
|
||||
{
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
Event = eventSystem;
|
||||
ScanResults = new();
|
||||
}
|
||||
|
||||
public Task Start()
|
||||
{
|
||||
if (IsRunning)
|
||||
throw new DisplayException("Malware scan is already running");
|
||||
|
||||
ScanTask = Task.Run(Run);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task Run()
|
||||
{
|
||||
// Clean results
|
||||
Status = "Clearing last results";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
lock (ScanResults)
|
||||
ScanResults.Clear();
|
||||
|
||||
await Event.Emit("malwareScan.result");
|
||||
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var serverRepo = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
|
||||
var malwareScanService = scope.ServiceProvider.GetRequiredService<MalwareScanService>();
|
||||
|
||||
Status = "Fetching servers to scan";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
Server[] servers;
|
||||
|
||||
if (ScanAllServers)
|
||||
servers = serverRepo.Get().ToArray();
|
||||
else
|
||||
servers = await GetOnlineServers();
|
||||
|
||||
// Perform scan
|
||||
|
||||
int i = 1;
|
||||
foreach (var server in servers)
|
||||
{
|
||||
Status = $"[{i} / {servers.Length}] Scanning server {server.Name}";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
var results = await malwareScanService.Perform(server);
|
||||
|
||||
if (results.Any())
|
||||
{
|
||||
lock (ScanResults)
|
||||
{
|
||||
ScanResults.Add(server, results);
|
||||
}
|
||||
|
||||
await Event.Emit("malwareScan.result");
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
Task.Run(async () => // Because we use the task as the status indicator we need to notify the event system in a new task
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
});
|
||||
}
|
||||
|
||||
private async Task<Server[]> GetOnlineServers()
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
// Load services from di scope
|
||||
var nodeRepo = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
|
||||
var serverRepo = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
|
||||
var nodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
|
||||
|
||||
var nodes = nodeRepo.Get().ToArray();
|
||||
var containers = new List<Container>();
|
||||
|
||||
// Fetch and summarize all running containers from all nodes
|
||||
Logger.Verbose("Fetching and summarizing all running containers from all nodes");
|
||||
|
||||
Status = "Fetching and summarizing all running containers from all nodes";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
var metrics = await nodeService.GetDockerMetrics(node);
|
||||
|
||||
foreach (var container in metrics.Containers)
|
||||
{
|
||||
containers.Add(container);
|
||||
}
|
||||
}
|
||||
|
||||
var containerServerMapped = new Dictionary<Server, Container>();
|
||||
|
||||
// Map all the containers to their corresponding server if existing
|
||||
Logger.Verbose("Mapping all the containers to their corresponding server if existing");
|
||||
|
||||
Status = "Mapping all the containers to their corresponding server if existing";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
foreach (var container in containers)
|
||||
{
|
||||
if (Guid.TryParse(container.Name, out Guid uuid))
|
||||
{
|
||||
var server = serverRepo
|
||||
.Get()
|
||||
.FirstOrDefault(x => x.Uuid == uuid);
|
||||
|
||||
if(server == null)
|
||||
continue;
|
||||
|
||||
containerServerMapped.Add(server, container);
|
||||
}
|
||||
}
|
||||
|
||||
return containerServerMapped.Keys.ToArray();
|
||||
}
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
using Moonlight.App.ApiClients.Daemon.Resources;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Events;
|
||||
using Moonlight.App.Exceptions;
|
||||
using Moonlight.App.Helpers;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Repositories;
|
||||
|
||||
namespace Moonlight.App.Services.Background;
|
||||
|
||||
public class MalwareScanService
|
||||
{
|
||||
private Repository<Server> ServerRepository;
|
||||
private Repository<Node> NodeRepository;
|
||||
private NodeService NodeService;
|
||||
private ServerService ServerService;
|
||||
|
||||
private readonly EventSystem Event;
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
|
||||
public bool IsRunning { get; private set; }
|
||||
public readonly Dictionary<Server, MalwareScanResult[]> ScanResults;
|
||||
public string Status { get; private set; } = "N/A";
|
||||
|
||||
public MalwareScanService(IServiceScopeFactory serviceScopeFactory, EventSystem eventSystem)
|
||||
{
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
Event = eventSystem;
|
||||
|
||||
ScanResults = new();
|
||||
}
|
||||
|
||||
public Task Start()
|
||||
{
|
||||
if (IsRunning)
|
||||
throw new DisplayException("Malware scan is already running");
|
||||
|
||||
Task.Run(Run);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task Run()
|
||||
{
|
||||
IsRunning = true;
|
||||
Status = "Clearing last results";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
lock (ScanResults)
|
||||
{
|
||||
ScanResults.Clear();
|
||||
}
|
||||
|
||||
await Event.Emit("malwareScan.result");
|
||||
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
// Load services from di scope
|
||||
NodeRepository = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
|
||||
ServerRepository = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
|
||||
NodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
|
||||
ServerService = scope.ServiceProvider.GetRequiredService<ServerService>();
|
||||
|
||||
var nodes = NodeRepository.Get().ToArray();
|
||||
var containers = new List<Container>();
|
||||
|
||||
// Fetch and summarize all running containers from all nodes
|
||||
Logger.Verbose("Fetching and summarizing all running containers from all nodes");
|
||||
|
||||
Status = "Fetching and summarizing all running containers from all nodes";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
var metrics = await NodeService.GetDockerMetrics(node);
|
||||
|
||||
foreach (var container in metrics.Containers)
|
||||
{
|
||||
containers.Add(container);
|
||||
}
|
||||
}
|
||||
|
||||
var containerServerMapped = new Dictionary<Server, Container>();
|
||||
|
||||
// Map all the containers to their corresponding server if existing
|
||||
Logger.Verbose("Mapping all the containers to their corresponding server if existing");
|
||||
|
||||
Status = "Mapping all the containers to their corresponding server if existing";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
foreach (var container in containers)
|
||||
{
|
||||
if (Guid.TryParse(container.Name, out Guid uuid))
|
||||
{
|
||||
var server = ServerRepository
|
||||
.Get()
|
||||
.FirstOrDefault(x => x.Uuid == uuid);
|
||||
|
||||
if(server == null)
|
||||
continue;
|
||||
|
||||
containerServerMapped.Add(server, container);
|
||||
}
|
||||
}
|
||||
|
||||
// Perform scan
|
||||
var resultsMapped = new Dictionary<Server, MalwareScanResult[]>();
|
||||
foreach (var mapping in containerServerMapped)
|
||||
{
|
||||
Logger.Verbose($"Scanning server {mapping.Key.Name} for malware");
|
||||
|
||||
Status = $"Scanning server {mapping.Key.Name} for malware";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
var results = await PerformScanOnServer(mapping.Key, mapping.Value);
|
||||
|
||||
if (results.Any())
|
||||
{
|
||||
resultsMapped.Add(mapping.Key, results);
|
||||
Logger.Verbose($"{results.Length} findings on server {mapping.Key.Name}");
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Verbose($"Scan complete. Detected {resultsMapped.Count} servers with findings");
|
||||
|
||||
IsRunning = false;
|
||||
Status = $"Scan complete. Detected {resultsMapped.Count} servers with findings";
|
||||
await Event.Emit("malwareScan.status", IsRunning);
|
||||
|
||||
lock (ScanResults)
|
||||
{
|
||||
foreach (var mapping in resultsMapped)
|
||||
{
|
||||
ScanResults.Add(mapping.Key, mapping.Value);
|
||||
}
|
||||
}
|
||||
|
||||
await Event.Emit("malwareScan.result");
|
||||
}
|
||||
|
||||
private async Task<MalwareScanResult[]> PerformScanOnServer(Server server, Container container)
|
||||
{
|
||||
var results = new List<MalwareScanResult>();
|
||||
|
||||
// TODO: Move scans to an universal format / api
|
||||
|
||||
// Define scans here
|
||||
|
||||
async Task ScanSelfBot()
|
||||
{
|
||||
var access = await ServerService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => x.Name == "tokens.txt"))
|
||||
{
|
||||
results.Add(new ()
|
||||
{
|
||||
Title = "Found SelfBot",
|
||||
Description = "Detected suspicious 'tokens.txt' file which may contain tokens for a selfbot",
|
||||
Author = "Marcel Baumgartner"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async Task ScanFakePlayerPlugins()
|
||||
{
|
||||
var access = await ServerService.CreateFileAccess(server, null!);
|
||||
var fileElements = await access.Ls();
|
||||
|
||||
if (fileElements.Any(x => !x.IsFile && x.Name == "plugins")) // Check for plugins folder
|
||||
{
|
||||
await access.Cd("plugins");
|
||||
fileElements = await access.Ls();
|
||||
|
||||
foreach (var fileElement in fileElements)
|
||||
{
|
||||
if (fileElement.Name.ToLower().Contains("fake"))
|
||||
{
|
||||
results.Add(new()
|
||||
{
|
||||
Title = "Fake player plugin",
|
||||
Description = $"Suspicious plugin file: {fileElement.Name}",
|
||||
Author = "Marcel Baumgartner"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Execute scans
|
||||
await ScanSelfBot();
|
||||
await ScanFakePlayerPlugins();
|
||||
|
||||
return results.ToArray();
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public class StorageService
|
||||
Directory.CreateDirectory(PathBuilder.Dir("storage", "resources"));
|
||||
Directory.CreateDirectory(PathBuilder.Dir("storage", "backups"));
|
||||
Directory.CreateDirectory(PathBuilder.Dir("storage", "logs"));
|
||||
Directory.CreateDirectory(PathBuilder.Dir("storage", "plugins"));
|
||||
|
||||
if(IsEmpty(PathBuilder.Dir("storage", "resources")))
|
||||
{
|
||||
|
||||
49
Moonlight/App/Services/MalwareScanService.cs
Normal file
49
Moonlight/App/Services/MalwareScanService.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.MalwareScans;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services.Plugins;
|
||||
|
||||
namespace Moonlight.App.Services;
|
||||
|
||||
public class MalwareScanService //TODO: Make this moddable using plugins
|
||||
{
|
||||
private readonly PluginService PluginService;
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
|
||||
public MalwareScanService(PluginService pluginService, IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
PluginService = pluginService;
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
}
|
||||
|
||||
public async Task<MalwareScanResult[]> Perform(Server server)
|
||||
{
|
||||
var defaultScans = new List<MalwareScan>
|
||||
{
|
||||
new SelfBotScan(),
|
||||
new MinerJarScan(),
|
||||
new SelfBotCodeScan(),
|
||||
new FakePlayerPluginScan()
|
||||
};
|
||||
|
||||
var scans = await PluginService.BuildMalwareScans(defaultScans.ToArray());
|
||||
|
||||
var results = new List<MalwareScanResult>();
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
foreach (var scan in scans)
|
||||
{
|
||||
var result = await scan.Scan(server, scope.ServiceProvider);
|
||||
|
||||
if (result.Any())
|
||||
{
|
||||
foreach (var scanResult in result)
|
||||
{
|
||||
results.Add(scanResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results.ToArray();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class MoonlightService
|
||||
|
||||
try
|
||||
{
|
||||
var client = new GitHubClient(new ProductHeaderValue("Moonlight"));
|
||||
var client = new GitHubClient(new ProductHeaderValue("Moonlight-Panel"));
|
||||
|
||||
var pullRequests = await client.PullRequest.GetAllForRepository("Moonlight-Panel", "Moonlight", new PullRequestRequest
|
||||
{
|
||||
|
||||
@@ -50,6 +50,11 @@ public class NodeService
|
||||
return await DaemonApiHelper.Get<DockerMetrics>(node, "metrics/docker");
|
||||
}
|
||||
|
||||
public async Task RebuildFirewall(Node node, string[] ips)
|
||||
{
|
||||
await DaemonApiHelper.Post(node, "firewall/rebuild", ips);
|
||||
}
|
||||
|
||||
public async Task Mount(Node node, string server, string serverPath, string path)
|
||||
{
|
||||
await DaemonApiHelper.Post(node, "mount", new Mount()
|
||||
|
||||
114
Moonlight/App/Services/Plugins/PluginService.cs
Normal file
114
Moonlight/App/Services/Plugins/PluginService.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
using Moonlight.App.Helpers;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Plugin;
|
||||
using Moonlight.App.Plugin.UI.Servers;
|
||||
using Moonlight.App.Plugin.UI.Webspaces;
|
||||
|
||||
namespace Moonlight.App.Services.Plugins;
|
||||
|
||||
public class PluginService
|
||||
{
|
||||
public readonly List<MoonlightPlugin> Plugins = new();
|
||||
public readonly Dictionary<MoonlightPlugin, string> PluginFiles = new();
|
||||
|
||||
public PluginService()
|
||||
{
|
||||
ReloadPlugins().Wait();
|
||||
}
|
||||
|
||||
public Task ReloadPlugins()
|
||||
{
|
||||
PluginFiles.Clear();
|
||||
Plugins.Clear();
|
||||
|
||||
// Try to update all plugins ending with .dll.cache
|
||||
foreach (var pluginFile in Directory.EnumerateFiles(
|
||||
PathBuilder.Dir(Directory.GetCurrentDirectory(), "storage", "plugins"))
|
||||
.Where(x => x.EndsWith(".dll.cache")))
|
||||
{
|
||||
try
|
||||
{
|
||||
var realPath = pluginFile.Replace(".cache", "");
|
||||
File.Copy(pluginFile, realPath, true);
|
||||
File.Delete(pluginFile);
|
||||
Logger.Info($"Updated plugin {realPath} on startup");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
var pluginType = typeof(MoonlightPlugin);
|
||||
|
||||
foreach (var pluginFile in Directory.EnumerateFiles(
|
||||
PathBuilder.Dir(Directory.GetCurrentDirectory(), "storage", "plugins"))
|
||||
.Where(x => x.EndsWith(".dll")))
|
||||
{
|
||||
var assembly = Assembly.LoadFile(pluginFile);
|
||||
|
||||
foreach (var type in assembly.GetTypes())
|
||||
{
|
||||
if (type.IsSubclassOf(pluginType))
|
||||
{
|
||||
var plugin = (Activator.CreateInstance(type) as MoonlightPlugin)!;
|
||||
|
||||
Logger.Info($"Loaded plugin '{plugin.Name}' ({plugin.Version}) by {plugin.Author}");
|
||||
|
||||
Plugins.Add(plugin);
|
||||
PluginFiles.Add(plugin, pluginFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Info($"Loaded {Plugins.Count} plugins");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task<ServerPageContext> BuildServerPage(ServerPageContext context)
|
||||
{
|
||||
foreach (var plugin in Plugins)
|
||||
{
|
||||
if (plugin.OnBuildServerPage != null)
|
||||
await plugin.OnBuildServerPage.Invoke(context);
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
public async Task<WebspacePageContext> BuildWebspacePage(WebspacePageContext context)
|
||||
{
|
||||
foreach (var plugin in Plugins)
|
||||
{
|
||||
if (plugin.OnBuildWebspacePage != null)
|
||||
await plugin.OnBuildWebspacePage.Invoke(context);
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
public async Task BuildServices(IServiceCollection serviceCollection)
|
||||
{
|
||||
foreach (var plugin in Plugins)
|
||||
{
|
||||
if (plugin.OnBuildServices != null)
|
||||
await plugin.OnBuildServices.Invoke(serviceCollection);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<MalwareScan[]> BuildMalwareScans(MalwareScan[] defaultScans)
|
||||
{
|
||||
var scanList = defaultScans.ToList();
|
||||
|
||||
foreach (var plugin in Plugins)
|
||||
{
|
||||
if (plugin.OnBuildMalwareScans != null)
|
||||
scanList = await plugin.OnBuildMalwareScans.Invoke(scanList);
|
||||
}
|
||||
|
||||
return scanList.ToArray();
|
||||
}
|
||||
}
|
||||
63
Moonlight/App/Services/Plugins/PluginStoreService.cs
Normal file
63
Moonlight/App/Services/Plugins/PluginStoreService.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.Text;
|
||||
using Moonlight.App.Helpers;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Octokit;
|
||||
|
||||
namespace Moonlight.App.Services.Plugins;
|
||||
|
||||
public class PluginStoreService
|
||||
{
|
||||
private readonly GitHubClient Client;
|
||||
private readonly PluginService PluginService;
|
||||
|
||||
public PluginStoreService(PluginService pluginService)
|
||||
{
|
||||
PluginService = pluginService;
|
||||
Client = new(new ProductHeaderValue("Moonlight-Panel"));
|
||||
}
|
||||
|
||||
public async Task<OfficialMoonlightPlugin[]> GetPlugins()
|
||||
{
|
||||
var items = await Client.Repository.Content.GetAllContents("Moonlight-Panel", "OfficialPlugins");
|
||||
|
||||
if (items == null)
|
||||
{
|
||||
Logger.Fatal("Unable to read plugin repo contents");
|
||||
return Array.Empty<OfficialMoonlightPlugin>();
|
||||
}
|
||||
|
||||
return items
|
||||
.Where(x => x.Type == ContentType.Dir)
|
||||
.Select(x => new OfficialMoonlightPlugin()
|
||||
{
|
||||
Name = x.Name
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public async Task<string> GetPluginReadme(OfficialMoonlightPlugin plugin)
|
||||
{
|
||||
var rawReadme = await Client.Repository.Content
|
||||
.GetRawContent("Moonlight-Panel", "OfficialPlugins", $"{plugin.Name}/README.md");
|
||||
|
||||
if (rawReadme == null)
|
||||
return "Error";
|
||||
|
||||
return Encoding.UTF8.GetString(rawReadme);
|
||||
}
|
||||
|
||||
public async Task InstallPlugin(OfficialMoonlightPlugin plugin, bool updating = false)
|
||||
{
|
||||
var rawPlugin = await Client.Repository.Content
|
||||
.GetRawContent("Moonlight-Panel", "OfficialPlugins", $"{plugin.Name}/{plugin.Name}.dll");
|
||||
|
||||
if (updating)
|
||||
{
|
||||
await File.WriteAllBytesAsync(PathBuilder.File("storage", "plugins", $"{plugin.Name}.dll.cache"), rawPlugin);
|
||||
return;
|
||||
}
|
||||
|
||||
await File.WriteAllBytesAsync(PathBuilder.File("storage", "plugins", $"{plugin.Name}.dll"), rawPlugin);
|
||||
await PluginService.ReloadPlugins();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ using Moonlight.App.Helpers.Wings;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Repositories;
|
||||
using Moonlight.App.Repositories.Servers;
|
||||
using Moonlight.App.Services.Background;
|
||||
using Moonlight.App.Services.Plugins;
|
||||
using FileAccess = Moonlight.App.Helpers.Files.FileAccess;
|
||||
|
||||
namespace Moonlight.App.Services;
|
||||
@@ -32,6 +34,11 @@ public class ServerService
|
||||
private readonly DateTimeService DateTimeService;
|
||||
private readonly EventSystem Event;
|
||||
|
||||
// We inject the dependencies for the malware scan service here because otherwise it may result in
|
||||
// a circular dependency injection which will crash the app
|
||||
private readonly PluginService PluginService;
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
|
||||
public ServerService(
|
||||
ServerRepository serverRepository,
|
||||
WingsApiHelper wingsApiHelper,
|
||||
@@ -45,7 +52,9 @@ public class ServerService
|
||||
NodeAllocationRepository nodeAllocationRepository,
|
||||
DateTimeService dateTimeService,
|
||||
EventSystem eventSystem,
|
||||
Repository<ServerVariable> serverVariablesRepository)
|
||||
Repository<ServerVariable> serverVariablesRepository,
|
||||
PluginService pluginService,
|
||||
IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
ServerRepository = serverRepository;
|
||||
WingsApiHelper = wingsApiHelper;
|
||||
@@ -60,6 +69,8 @@ public class ServerService
|
||||
DateTimeService = dateTimeService;
|
||||
Event = eventSystem;
|
||||
ServerVariablesRepository = serverVariablesRepository;
|
||||
PluginService = pluginService;
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
}
|
||||
|
||||
private Server EnsureNodeData(Server s)
|
||||
@@ -99,6 +110,26 @@ public class ServerService
|
||||
{
|
||||
Server server = EnsureNodeData(s);
|
||||
|
||||
if (ConfigService.Get().Moonlight.Security.MalwareCheckOnStart && signal == PowerSignal.Start ||
|
||||
signal == PowerSignal.Restart)
|
||||
{
|
||||
var results = await new MalwareScanService(
|
||||
PluginService,
|
||||
ServiceScopeFactory
|
||||
).Perform(server);
|
||||
|
||||
if (results.Any())
|
||||
{
|
||||
var resultText = string.Join(" ", results.Select(x => x.Title));
|
||||
|
||||
Logger.Warn($"Found malware on server {server.Uuid}. Results: " + resultText);
|
||||
|
||||
throw new DisplayException(
|
||||
$"Unable to start server. Found following malware on this server: {resultText}. Please contact the support if you think this detection is a false positive",
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
var rawSignal = signal.ToString().ToLower();
|
||||
|
||||
await WingsApiHelper.Post(server.Node, $"api/servers/{server.Uuid}/power", new ServerPower()
|
||||
@@ -420,10 +451,7 @@ public class ServerService
|
||||
await new Retry()
|
||||
.Times(3)
|
||||
.At(x => x.Message.Contains("A task was canceled"))
|
||||
.Call(async () =>
|
||||
{
|
||||
await WingsApiHelper.Delete(server.Node, $"api/servers/{server.Uuid}", null);
|
||||
});
|
||||
.Call(async () => { await WingsApiHelper.Delete(server.Node, $"api/servers/{server.Uuid}", null); });
|
||||
}
|
||||
catch (WingsException e)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ public class IdentityService
|
||||
if (user == null)
|
||||
{
|
||||
Logger.Warn(
|
||||
$"Cannot find user with the id '{userid}' in the database. Maybe the user has been deleted or a token has been successfully faked by a hacker");
|
||||
$"Cannot find user with the id '{userid}' in the database. Maybe the user has been deleted or a token has been successfully faked by a hacker", "security");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
67
Moonlight/App/Services/Tickets/TicketAdminService.cs
Normal file
67
Moonlight/App/Services/Tickets/TicketAdminService.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services.Files;
|
||||
using Moonlight.App.Services.Sessions;
|
||||
|
||||
namespace Moonlight.App.Services.Tickets;
|
||||
|
||||
public class TicketAdminService
|
||||
{
|
||||
private readonly TicketServerService TicketServerService;
|
||||
private readonly IdentityService IdentityService;
|
||||
private readonly BucketService BucketService;
|
||||
|
||||
public Ticket? Ticket { get; set; }
|
||||
|
||||
public TicketAdminService(
|
||||
TicketServerService ticketServerService,
|
||||
IdentityService identityService,
|
||||
BucketService bucketService)
|
||||
{
|
||||
TicketServerService = ticketServerService;
|
||||
IdentityService = identityService;
|
||||
BucketService = bucketService;
|
||||
}
|
||||
|
||||
public async Task<TicketMessage> Send(string content, IBrowserFile? file = null)
|
||||
{
|
||||
string? attachment = null;
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
attachment = await BucketService.StoreFile(
|
||||
"tickets",
|
||||
file.OpenReadStream(1024 * 1024 * 5),
|
||||
file.Name);
|
||||
}
|
||||
|
||||
return await TicketServerService.SendMessage(
|
||||
Ticket!,
|
||||
IdentityService.User,
|
||||
content,
|
||||
attachment,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public async Task UpdateStatus(TicketStatus status)
|
||||
{
|
||||
await TicketServerService.UpdateStatus(Ticket!, status);
|
||||
}
|
||||
|
||||
public async Task UpdatePriority(TicketPriority priority)
|
||||
{
|
||||
await TicketServerService.UpdatePriority(Ticket!, priority);
|
||||
}
|
||||
|
||||
public async Task<TicketMessage[]> GetMessages()
|
||||
{
|
||||
return await TicketServerService.GetMessages(Ticket!);
|
||||
}
|
||||
|
||||
public async Task SetClaim(User? user)
|
||||
{
|
||||
await TicketServerService.SetClaim(Ticket!, user);
|
||||
}
|
||||
}
|
||||
63
Moonlight/App/Services/Tickets/TicketClientService.cs
Normal file
63
Moonlight/App/Services/Tickets/TicketClientService.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services.Files;
|
||||
using Moonlight.App.Services.Sessions;
|
||||
|
||||
namespace Moonlight.App.Services.Tickets;
|
||||
|
||||
public class TicketClientService
|
||||
{
|
||||
private readonly TicketServerService TicketServerService;
|
||||
private readonly IdentityService IdentityService;
|
||||
private readonly BucketService BucketService;
|
||||
|
||||
public Ticket? Ticket { get; set; }
|
||||
|
||||
public TicketClientService(
|
||||
TicketServerService ticketServerService,
|
||||
IdentityService identityService,
|
||||
BucketService bucketService)
|
||||
{
|
||||
TicketServerService = ticketServerService;
|
||||
IdentityService = identityService;
|
||||
BucketService = bucketService;
|
||||
}
|
||||
|
||||
public async Task<Ticket> Create(string issueTopic, string issueDescription, string issueTries, TicketSubject subject, int subjectId)
|
||||
{
|
||||
return await TicketServerService.Create(
|
||||
IdentityService.User,
|
||||
issueTopic,
|
||||
issueDescription,
|
||||
issueTries,
|
||||
subject,
|
||||
subjectId
|
||||
);
|
||||
}
|
||||
|
||||
public async Task<TicketMessage> Send(string content, IBrowserFile? file = null)
|
||||
{
|
||||
string? attachment = null;
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
attachment = await BucketService.StoreFile(
|
||||
"tickets",
|
||||
file.OpenReadStream(1024 * 1024 * 5),
|
||||
file.Name);
|
||||
}
|
||||
|
||||
return await TicketServerService.SendMessage(
|
||||
Ticket!,
|
||||
IdentityService.User,
|
||||
content,
|
||||
attachment
|
||||
);
|
||||
}
|
||||
|
||||
public async Task<TicketMessage[]> GetMessages()
|
||||
{
|
||||
return await TicketServerService.GetMessages(Ticket!);
|
||||
}
|
||||
}
|
||||
181
Moonlight/App/Services/Tickets/TicketServerService.cs
Normal file
181
Moonlight/App/Services/Tickets/TicketServerService.cs
Normal file
@@ -0,0 +1,181 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Moonlight.App.Database.Entities;
|
||||
using Moonlight.App.Events;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Repositories;
|
||||
|
||||
namespace Moonlight.App.Services.Tickets;
|
||||
|
||||
public class TicketServerService
|
||||
{
|
||||
private readonly IServiceScopeFactory ServiceScopeFactory;
|
||||
private readonly EventSystem Event;
|
||||
private readonly ConfigService ConfigService;
|
||||
|
||||
public TicketServerService(
|
||||
IServiceScopeFactory serviceScopeFactory,
|
||||
EventSystem eventSystem,
|
||||
ConfigService configService)
|
||||
{
|
||||
ServiceScopeFactory = serviceScopeFactory;
|
||||
Event = eventSystem;
|
||||
ConfigService = configService;
|
||||
}
|
||||
|
||||
public async Task<Ticket> Create(User creator, string issueTopic, string issueDescription, string issueTries, TicketSubject subject, int subjectId)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
var userRepo = scope.ServiceProvider.GetRequiredService<Repository<User>>();
|
||||
|
||||
var creatorUser = userRepo
|
||||
.Get()
|
||||
.First(x => x.Id == creator.Id);
|
||||
|
||||
var ticket = ticketRepo.Add(new()
|
||||
{
|
||||
Priority = TicketPriority.Low,
|
||||
Status = TicketStatus.Open,
|
||||
AssignedTo = null,
|
||||
IssueTopic = issueTopic,
|
||||
IssueDescription = issueDescription,
|
||||
IssueTries = issueTries,
|
||||
Subject = subject,
|
||||
SubjectId = subjectId,
|
||||
CreatedBy = creatorUser
|
||||
});
|
||||
|
||||
await Event.Emit("tickets.new", ticket);
|
||||
|
||||
// Do automatic stuff here
|
||||
await SendSystemMessage(ticket, ConfigService.Get().Moonlight.Tickets.WelcomeMessage);
|
||||
|
||||
if (ticket.Subject != TicketSubject.Other)
|
||||
{
|
||||
await SendMessage(ticket, creatorUser, $"Subject :\n\n{ticket.Subject}: {ticket.SubjectId}");
|
||||
}
|
||||
|
||||
//TODO: Check for opening times
|
||||
|
||||
return ticket;
|
||||
}
|
||||
public async Task SendSystemMessage(Ticket t, string content, string? attachmentUrl = null)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
|
||||
var ticket = ticketRepo.Get().First(x => x.Id == t.Id);
|
||||
|
||||
var message = new TicketMessage()
|
||||
{
|
||||
Content = content,
|
||||
Sender = null,
|
||||
AttachmentUrl = attachmentUrl,
|
||||
IsSystemMessage = true
|
||||
};
|
||||
|
||||
ticket.Messages.Add(message);
|
||||
ticketRepo.Update(ticket);
|
||||
|
||||
await Event.Emit("tickets.message", message);
|
||||
await Event.Emit($"tickets.{ticket.Id}.message", message);
|
||||
}
|
||||
public async Task UpdatePriority(Ticket t, TicketPriority priority)
|
||||
{
|
||||
if(t.Priority == priority)
|
||||
return;
|
||||
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
|
||||
var ticket = ticketRepo.Get().First(x => x.Id == t.Id);
|
||||
|
||||
ticket.Priority = priority;
|
||||
|
||||
ticketRepo.Update(ticket);
|
||||
|
||||
await Event.Emit("tickets.status", ticket);
|
||||
await Event.Emit($"tickets.{ticket.Id}.status", ticket);
|
||||
|
||||
await SendSystemMessage(ticket, $"The ticket priority has been changed to: {priority}");
|
||||
}
|
||||
public async Task UpdateStatus(Ticket t, TicketStatus status)
|
||||
{
|
||||
if(t.Status == status)
|
||||
return;
|
||||
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
|
||||
var ticket = ticketRepo.Get().First(x => x.Id == t.Id);
|
||||
|
||||
ticket.Status = status;
|
||||
|
||||
ticketRepo.Update(ticket);
|
||||
|
||||
await Event.Emit("tickets.status", ticket);
|
||||
await Event.Emit($"tickets.{ticket.Id}.status", ticket);
|
||||
|
||||
await SendSystemMessage(ticket, $"The ticket status has been changed to: {status}");
|
||||
}
|
||||
public async Task<TicketMessage> SendMessage(Ticket t, User sender, string content, string? attachmentUrl = null, bool isSupportMessage = false)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
var userRepo = scope.ServiceProvider.GetRequiredService<Repository<User>>();
|
||||
|
||||
var ticket = ticketRepo.Get().First(x => x.Id == t.Id);
|
||||
var user = userRepo.Get().First(x => x.Id == sender.Id);
|
||||
|
||||
var message = new TicketMessage()
|
||||
{
|
||||
Content = content,
|
||||
Sender = user,
|
||||
AttachmentUrl = attachmentUrl,
|
||||
IsSupportMessage = isSupportMessage
|
||||
};
|
||||
|
||||
ticket.Messages.Add(message);
|
||||
ticketRepo.Update(ticket);
|
||||
|
||||
await Event.Emit("tickets.message", message);
|
||||
await Event.Emit($"tickets.{ticket.Id}.message", message);
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
public Task<TicketMessage[]> GetMessages(Ticket ticket)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
|
||||
var tickets = ticketRepo
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.Messages)
|
||||
.ThenInclude(x => x.Sender)
|
||||
.First(x => x.Id == ticket.Id);
|
||||
|
||||
return Task.FromResult(tickets.Messages.ToArray());
|
||||
}
|
||||
|
||||
public async Task SetClaim(Ticket t, User? u = null)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
|
||||
var userRepo = scope.ServiceProvider.GetRequiredService<Repository<User>>();
|
||||
|
||||
var ticket = ticketRepo.Get().Include(x => x.AssignedTo).First(x => x.Id == t.Id);
|
||||
var user = u == null ? u : userRepo.Get().First(x => x.Id == u.Id);
|
||||
|
||||
ticket.AssignedTo = user;
|
||||
|
||||
ticketRepo.Update(ticket);
|
||||
|
||||
await Event.Emit("tickets.status", ticket);
|
||||
await Event.Emit($"tickets.{ticket.Id}.status", ticket);
|
||||
|
||||
var claimName = user == null ? "None" : user.FirstName + " " + user.LastName;
|
||||
await SendSystemMessage(ticket, $"Ticked claim has been set to {claimName}");
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ public class UserService
|
||||
private readonly DateTimeService DateTimeService;
|
||||
private readonly ConfigService ConfigService;
|
||||
private readonly TempMailService TempMailService;
|
||||
private readonly MoonlightService MoonlightService;
|
||||
|
||||
private readonly string JwtSecret;
|
||||
|
||||
@@ -32,7 +33,8 @@ public class UserService
|
||||
IdentityService identityService,
|
||||
IpLocateService ipLocateService,
|
||||
DateTimeService dateTimeService,
|
||||
TempMailService tempMailService)
|
||||
TempMailService tempMailService,
|
||||
MoonlightService moonlightService)
|
||||
{
|
||||
UserRepository = userRepository;
|
||||
TotpService = totpService;
|
||||
@@ -42,6 +44,7 @@ public class UserService
|
||||
IpLocateService = ipLocateService;
|
||||
DateTimeService = dateTimeService;
|
||||
TempMailService = tempMailService;
|
||||
MoonlightService = moonlightService;
|
||||
|
||||
JwtSecret = configService
|
||||
.Get()
|
||||
@@ -67,16 +70,24 @@ public class UserService
|
||||
throw new DisplayException("The email is already in use");
|
||||
}
|
||||
|
||||
//TODO: Validation
|
||||
bool admin = false;
|
||||
|
||||
if (!UserRepository.Get().Any())
|
||||
{
|
||||
if ((DateTime.UtcNow - MoonlightService.StartTimestamp).TotalMinutes < 15)
|
||||
admin = true;
|
||||
else
|
||||
throw new DisplayException("You have to register within 15 minutes after the start of moonlight to get admin permissions. Please restart moonlight in order to register as admin. Please note that this will only works once and will be deactivated after a admin has registered");
|
||||
}
|
||||
|
||||
// Add user
|
||||
var user = UserRepository.Add(new()
|
||||
{
|
||||
Address = "",
|
||||
Admin = false,
|
||||
Admin = admin,
|
||||
City = "",
|
||||
Country = "",
|
||||
Email = email,
|
||||
Email = email.ToLower(),
|
||||
Password = BCrypt.Net.BCrypt.HashPassword(password),
|
||||
FirstName = firstname,
|
||||
LastName = lastname,
|
||||
@@ -108,7 +119,7 @@ public class UserService
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security");
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
|
||||
throw new DisplayException("Email and password combination not found");
|
||||
}
|
||||
|
||||
@@ -117,7 +128,7 @@ public class UserService
|
||||
return user.TotpEnabled;
|
||||
}
|
||||
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security");
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
|
||||
throw new DisplayException("Email and password combination not found");;
|
||||
}
|
||||
|
||||
@@ -150,7 +161,7 @@ public class UserService
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security");
|
||||
Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
|
||||
throw new DisplayException("2FA code invalid");
|
||||
}
|
||||
}
|
||||
@@ -192,7 +203,7 @@ public class UserService
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {password}", "security");
|
||||
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {StringHelper.CutInHalf(password)}", "security");
|
||||
|
||||
throw new Exception("Invalid username");
|
||||
}
|
||||
@@ -203,7 +214,7 @@ public class UserService
|
||||
return user;
|
||||
}
|
||||
|
||||
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {password}", "security");
|
||||
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {StringHelper.CutInHalf(password)}", "security");
|
||||
throw new Exception("Invalid userid or password");
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="MineStat" Version="3.1.1" />
|
||||
<PackageReference Include="MySqlBackup.NET" Version="2.3.8" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3-beta1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Octokit" Version="6.0.0" />
|
||||
<PackageReference Include="Otp.NET" Version="1.3.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
|
||||
<PackageReference Include="QRCoder" Version="1.4.3" />
|
||||
<PackageReference Include="RestSharp" Version="109.0.0-preview.1" />
|
||||
<PackageReference Include="RestSharp" Version="110.2.1-alpha.0.10" />
|
||||
<PackageReference Include="Sentry.AspNetCore" Version="3.33.1" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="3.33.1" />
|
||||
<PackageReference Include="Serilog" Version="3.0.0" />
|
||||
@@ -111,12 +111,4 @@
|
||||
<AdditionalFiles Include="Shared\Views\Server\Settings\ServerResetSetting.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="storage\configs\config.json.bak">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -25,9 +25,11 @@ using Moonlight.App.Services.Interop;
|
||||
using Moonlight.App.Services.Mail;
|
||||
using Moonlight.App.Services.Minecraft;
|
||||
using Moonlight.App.Services.Notifications;
|
||||
using Moonlight.App.Services.Plugins;
|
||||
using Moonlight.App.Services.Sessions;
|
||||
using Moonlight.App.Services.Statistics;
|
||||
using Moonlight.App.Services.SupportChat;
|
||||
using Moonlight.App.Services.Tickets;
|
||||
using Sentry;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
@@ -110,6 +112,9 @@ namespace Moonlight
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var pluginService = new PluginService();
|
||||
await pluginService.BuildServices(builder.Services);
|
||||
|
||||
// Switch to logging.net injection
|
||||
// TODO: Enable in production
|
||||
builder.Logging.ClearProviders();
|
||||
@@ -208,6 +213,11 @@ namespace Moonlight
|
||||
builder.Services.AddScoped<PopupService>();
|
||||
builder.Services.AddScoped<SubscriptionService>();
|
||||
builder.Services.AddScoped<BillingService>();
|
||||
builder.Services.AddSingleton<PluginStoreService>();
|
||||
builder.Services.AddSingleton<TicketServerService>();
|
||||
builder.Services.AddScoped<TicketClientService>();
|
||||
builder.Services.AddScoped<TicketAdminService>();
|
||||
builder.Services.AddScoped<MalwareScanService>();
|
||||
|
||||
builder.Services.AddScoped<SessionClientService>();
|
||||
builder.Services.AddSingleton<SessionServerService>();
|
||||
@@ -236,9 +246,11 @@ namespace Moonlight
|
||||
builder.Services.AddSingleton<StatisticsCaptureService>();
|
||||
builder.Services.AddSingleton<DiscordNotificationService>();
|
||||
builder.Services.AddSingleton<CleanupService>();
|
||||
builder.Services.AddSingleton<MalwareScanService>();
|
||||
builder.Services.AddSingleton<MalwareBackgroundScanService>();
|
||||
builder.Services.AddSingleton<TelemetryService>();
|
||||
builder.Services.AddSingleton<TempMailService>();
|
||||
builder.Services.AddSingleton<DdosProtectionService>();
|
||||
builder.Services.AddSingleton(pluginService);
|
||||
|
||||
// Other
|
||||
builder.Services.AddSingleton<MoonlightService>();
|
||||
@@ -286,10 +298,10 @@ namespace Moonlight
|
||||
_ = app.Services.GetRequiredService<DiscordBotService>();
|
||||
_ = app.Services.GetRequiredService<StatisticsCaptureService>();
|
||||
_ = app.Services.GetRequiredService<DiscordNotificationService>();
|
||||
_ = app.Services.GetRequiredService<MalwareScanService>();
|
||||
_ = app.Services.GetRequiredService<MalwareBackgroundScanService>();
|
||||
_ = app.Services.GetRequiredService<TelemetryService>();
|
||||
_ = app.Services.GetRequiredService<TempMailService>();
|
||||
|
||||
_ = app.Services.GetRequiredService<DdosProtectionService>();
|
||||
_ = app.Services.GetRequiredService<MoonlightService>();
|
||||
|
||||
// Discord bot service
|
||||
|
||||
@@ -35,6 +35,18 @@
|
||||
},
|
||||
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118",
|
||||
"dotnetRunMessages": true
|
||||
},
|
||||
"Dev DB 2":
|
||||
{
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ML_DEBUG": "true",
|
||||
"ML_CONFIG_PATH": "storage\\configs\\dev_2_config.json"
|
||||
},
|
||||
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118",
|
||||
"dotnetRunMessages": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
### Some explanations
|
||||
|
||||
# Some explanations
|
||||
defaultstorage:
|
||||
|
||||
This directory is for the default assets of a moonlight instance, e.g. lang files, images etc
|
||||
This directory is for the default assets of a Moonlight instance, e.g., Lang files, images, etc.
|
||||
|
||||
storage:
|
||||
Storage:
|
||||
|
||||
This directory is empty in fresh moonlight instances and will be populated with example config upon first run.
|
||||
Before using moonlight this config file has to be modified.
|
||||
Also resources are going to be copied from the default storage to this storage.
|
||||
To access files in this storage we recommend to use the PathBuilder functions to ensure cross platform compatibility.
|
||||
The storage directory should be mounted to a specific path when using docker container so when the container is replaced/rebuild your storage will not be modified
|
||||
This directory is empty in fresh Moonlight instances and will be populated with an example configuration upon first run. Before using Moonlight, this config file has to be modified. Also, resources are going to be copied from the default storage to this storage. To access files in this storage, we recommend using the Path Builder functions to ensure cross-platform compatibility. The storage directory should be mounted to a specific path when using a Docker container, so when the container is replaced or rebuilt, your storage will not be modified.
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
@inject AlertService AlertService
|
||||
@inject ConfigService ConfigService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@if (Crashed)
|
||||
@if (HardCrashed)
|
||||
{
|
||||
<div class="card card-flush h-md-100">
|
||||
<div class="card-body d-flex flex-column justify-content-between mt-9 bgi-no-repeat bgi-size-cover bgi-position-x-center pb-0">
|
||||
@@ -30,6 +31,16 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (SoftCrashed)
|
||||
{
|
||||
<div class="card card-body bg-danger mb-5">
|
||||
<span class="text-center">
|
||||
@(ErrorMessage)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ChildContent
|
||||
}
|
||||
else
|
||||
{
|
||||
@ChildContent
|
||||
@@ -37,7 +48,22 @@ else
|
||||
|
||||
@code
|
||||
{
|
||||
private bool Crashed = false;
|
||||
private bool HardCrashed = false;
|
||||
private bool SoftCrashed = false;
|
||||
private string ErrorMessage = "";
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
NavigationManager.LocationChanged += OnPathChanged;
|
||||
}
|
||||
|
||||
private void OnPathChanged(object? sender, LocationChangedEventArgs e)
|
||||
{
|
||||
if (SoftCrashed)
|
||||
SoftCrashed = false;
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected override async Task OnErrorAsync(Exception exception)
|
||||
{
|
||||
@@ -50,74 +76,57 @@ else
|
||||
{
|
||||
if (displayException.DoNotTranslate)
|
||||
{
|
||||
await AlertService.Error(
|
||||
displayException.Message
|
||||
);
|
||||
await SoftCrash(displayException.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate(displayException.Message)
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate(displayException.Message));
|
||||
}
|
||||
}
|
||||
else if (exception is CloudflareException cloudflareException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from cloudflare api"),
|
||||
cloudflareException.Message
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from cloudflare: ") + cloudflareException.Message);
|
||||
}
|
||||
else if (exception is WingsException wingsException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from wings"),
|
||||
wingsException.Message
|
||||
);
|
||||
|
||||
//TODO: Error log service
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from wings: ") + wingsException.Message);
|
||||
|
||||
Logger.Warn($"Wings exception status code: {wingsException.StatusCode}");
|
||||
}
|
||||
else if (exception is DaemonException daemonException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from daemon"),
|
||||
daemonException.Message
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from daemon: ") + daemonException.Message);
|
||||
|
||||
Logger.Warn($"Wings exception status code: {daemonException.StatusCode}");
|
||||
}
|
||||
else if (exception is ModrinthException modrinthException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from modrinth"),
|
||||
modrinthException.Message
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from modrinth: ") + modrinthException.Message);
|
||||
}
|
||||
else if (exception is CloudPanelException cloudPanelException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Error from cloud panel"),
|
||||
cloudPanelException.Message
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from cloudpanel: ") + cloudPanelException.Message);
|
||||
}
|
||||
else if (exception is NotImplementedException)
|
||||
{
|
||||
await AlertService.Error(SmartTranslateService.Translate("This function is not implemented"));
|
||||
await SoftCrash(SmartTranslateService.Translate("This function is not implemented"));
|
||||
}
|
||||
else if (exception is StripeException stripeException)
|
||||
{
|
||||
await AlertService.Error(
|
||||
SmartTranslateService.Translate("Unknown error from stripe"),
|
||||
stripeException.Message
|
||||
);
|
||||
await SoftCrash(SmartTranslateService.Translate("Error from stripe: ") + stripeException.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Warn(exception);
|
||||
Crashed = true;
|
||||
HardCrashed = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
private Task SoftCrash(string message)
|
||||
{
|
||||
SoftCrashed = true;
|
||||
ErrorMessage = message;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,13 @@
|
||||
@implements IDisposable
|
||||
|
||||
<div class="card bg-black rounded">
|
||||
@if (ShowHeader)
|
||||
{
|
||||
<div class="card-header">
|
||||
<span class="card-title">@(Header)</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-body">
|
||||
<MonacoEditor CssClass="h-100" @ref="Editor" Id="vseditor" ConstructionOptions="(x) => EditorOptions"/>
|
||||
</div>
|
||||
@@ -44,6 +51,12 @@
|
||||
[Parameter]
|
||||
public bool HideControls { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public bool ShowHeader { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public string Header { get; set; } = "Header.changeme.txt";
|
||||
|
||||
// Events
|
||||
[Parameter]
|
||||
public Action<string> OnSubmit { get; set; }
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
Language="@EditorLanguage"
|
||||
OnCancel="() => Cancel()"
|
||||
OnSubmit="(_) => Save()"
|
||||
HideControls="false">
|
||||
HideControls="false"
|
||||
ShowHeader="true"
|
||||
Header="@(EditingFile.Name)">
|
||||
</FileEditor>
|
||||
}
|
||||
else
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
<tbody class="fw-semibold text-gray-600">
|
||||
<LazyLoader Load="Load">
|
||||
<ContentBlock @ref="ContentBlock" AllowContentOverride="true">
|
||||
@if (Access.CurrentPath != "/")
|
||||
{
|
||||
<tr class="even">
|
||||
<td class="w-10px">
|
||||
</td>
|
||||
@@ -57,6 +59,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var file in Data)
|
||||
{
|
||||
<tr class="even">
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
<TL>Logs</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 5 ? "active" : "")" href="/admin/security/ddos">
|
||||
<TL>Ddos protection</TL>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
<TL>Mail</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 10 ? "active" : "")" href="/admin/system/plugins">
|
||||
<TL>Plugins</TL>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
<span class="menu-icon">
|
||||
<i class="bx bxs-log-in"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Login</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Login</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -22,7 +24,9 @@
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-user-plus"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Register</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Register</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
@@ -33,7 +37,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-layer"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Dashboard</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Dashboard</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -41,7 +47,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-server"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Servers</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Servers</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -49,7 +57,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-globe"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Webspaces</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Webspaces</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -57,15 +67,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-purchase-tag"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Domains</TL></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="/changelog">
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-notepad"></i>
|
||||
<span class="menu-title">
|
||||
<TL>Domains</TL>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Changelog</TL></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +77,9 @@ else
|
||||
{
|
||||
<div class="menu-item pt-5">
|
||||
<div class="menu-content">
|
||||
<span class="menu-heading fw-bold text-uppercase fs-7"><TL>Admin</TL></span>
|
||||
<span class="menu-heading fw-bold text-uppercase fs-7">
|
||||
<TL>Admin</TL>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -81,7 +87,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-layer"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Dashboard</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Dashboard</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -89,7 +97,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-chip"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>System</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>System</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -97,7 +107,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-shield"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Security</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Security</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -105,7 +117,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-server"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Servers</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Servers</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -113,7 +127,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-globe"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Webspaces</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Webspaces</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -121,7 +137,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-user"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Users</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Users</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div data-kt-menu-trigger="click" class="menu-item menu-accordion">
|
||||
@@ -129,7 +147,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-purchase-tag"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Domains</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Domains</TL>
|
||||
</span>
|
||||
<span class="menu-arrow"></span>
|
||||
</span>
|
||||
<div class="menu-sub menu-sub-accordion">
|
||||
@@ -138,7 +158,9 @@ else
|
||||
<span class="menu-bullet">
|
||||
<span class="bullet bullet-dot"></span>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Domains</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Domains</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -146,7 +168,9 @@ else
|
||||
<span class="menu-bullet">
|
||||
<span class="bullet bullet-dot"></span>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Shared domains</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Shared domains</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +180,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-support"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Support</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Support</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -164,7 +190,9 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-credit-card"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Subscriptions</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Subscriptions</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item">
|
||||
@@ -172,7 +200,20 @@ else
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-objects-vertical-bottom"></i>
|
||||
</span>
|
||||
<span class="menu-title"><TL>Statistics</TL></span>
|
||||
<span class="menu-title">
|
||||
<TL>Statistics</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="/admin/changelog">
|
||||
<span class="menu-icon">
|
||||
<i class="bx bx-notepad"></i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
<TL>Changelog</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
236
Moonlight/Shared/Components/Tickets/TicketMessageView.razor
Normal file
236
Moonlight/Shared/Components/Tickets/TicketMessageView.razor
Normal file
@@ -0,0 +1,236 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Files
|
||||
@using System.Text.RegularExpressions
|
||||
|
||||
@inject ResourceService ResourceService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
<div class="scroll-y me-n5 pe-5" style="max-height: 50vh; display: flex; flex-direction: column-reverse;">
|
||||
@foreach (var message in Messages.OrderByDescending(x => x.Id)) // Reverse messages to use auto scrolling
|
||||
{
|
||||
if (message.IsSupportMessage)
|
||||
{
|
||||
if (ViewAsSupport)
|
||||
{
|
||||
<div class="d-flex justify-content-end mb-10 ">
|
||||
<div class="d-flex flex-column align-items-end">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="me-3">
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<span class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
|
||||
}
|
||||
</div>
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
|
||||
@{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
@foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(message.AttachmentUrl))
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.AttachmentUrl, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.AttachmentUrl)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-start mb-10 ">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
}
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<span class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start">
|
||||
@{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
@foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(message.AttachmentUrl))
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.AttachmentUrl, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.AttachmentUrl)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else if (message.IsSystemMessage)
|
||||
{
|
||||
<div class="separator separator-content border-primary my-15">
|
||||
<span class="w-250px fw-bold">
|
||||
@(message.Content)
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ViewAsSupport)
|
||||
{
|
||||
<div class="d-flex justify-content-start mb-10 ">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
}
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<span class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start">
|
||||
@{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
@foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(message.AttachmentUrl))
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.AttachmentUrl, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.AttachmentUrl)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-end mb-10 ">
|
||||
<div class="d-flex flex-column align-items-end">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="me-3">
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
<span class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
|
||||
</div>
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
|
||||
@{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
@foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(message.AttachmentUrl))
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.AttachmentUrl, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("tickets", message.AttachmentUrl))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.AttachmentUrl)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public IEnumerable<TicketMessage> Messages { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool ViewAsSupport { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Plugin.UI.Webspaces
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
|
||||
@@ -34,26 +35,14 @@
|
||||
<div class="card mb-xl-10 mb-5">
|
||||
<div class="card-body pt-0 pb-0">
|
||||
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold">
|
||||
@foreach (var tab in Context.Tabs)
|
||||
{
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/webspace/@(WebSpace.Id)">
|
||||
<TL>Dashboard</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/webspace/@(WebSpace.Id)/files">
|
||||
<TL>Files</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 2 ? "active" : "")" href="/webspace/@(WebSpace.Id)/sftp">
|
||||
<TL>Sftp</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 3 ? "active" : "")" href="/webspace/@(WebSpace.Id)/databases">
|
||||
<TL>Databases</TL>
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Route == tab.Route ? "active" : "")" href="/webspace/@(WebSpace.Id + tab.Route)">
|
||||
<TL>@(tab.Name)</TL>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,11 +50,14 @@
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public int Index { get; set; }
|
||||
public string Route { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public WebSpace WebSpace { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
public WebspacePageContext Context { get; set; }
|
||||
|
||||
private async Task Delete()
|
||||
{
|
||||
if (await AlertService.ConfirmMath())
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
@inject IpBanService IpBanService
|
||||
@inject DynamicBackgroundService DynamicBackgroundService
|
||||
@inject KeyListenerService KeyListenerService
|
||||
@inject ConfigService ConfigService
|
||||
|
||||
@{
|
||||
var uri = new Uri(NavigationManager.Uri);
|
||||
@@ -57,7 +58,7 @@
|
||||
<Sidebar></Sidebar>
|
||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||
<div class="d-flex flex-column flex-column-fluid">
|
||||
<div id="kt_app_content" class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: url('@(DynamicBackgroundService.BackgroundImageUrl)')">
|
||||
<div id="kt_app_content" class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: linear-gradient(rgba(0, 0, 0, 0.55),rgba(0, 0, 0, 0.55)) ,url('@(DynamicBackgroundService.BackgroundImageUrl)');">
|
||||
<div id="kt_app_content_container" class="app-container container-fluid">
|
||||
<div class="mt-10">
|
||||
<SoftErrorBoundary>
|
||||
@@ -245,6 +246,13 @@
|
||||
RunDelayedMenu(1);
|
||||
RunDelayedMenu(3);
|
||||
RunDelayedMenu(5);
|
||||
|
||||
if (ConfigService.Get().Moonlight.EnableLatencyCheck)
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("moonlight.loading.checkConnection",
|
||||
ConfigService.Get().Moonlight.AppUrl,
|
||||
ConfigService.Get().Moonlight.LatencyCheckThreshold);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
@page "/changelog"
|
||||
@page "/admin/changelog"
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject MoonlightService MoonlightService
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminChangelog))]
|
||||
|
||||
@{
|
||||
int i = 0;
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
@page "/admin/nodes/ddos"
|
||||
|
||||
@using Moonlight.Shared.Components.Navigations
|
||||
@using Moonlight.App.Repositories
|
||||
@using BlazorTable
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@inject DdosAttackRepository DdosAttackRepository
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject EventSystem Event
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminNodeDdos))]
|
||||
|
||||
<AdminNodesNavigation Index="1"/>
|
||||
|
||||
<LazyLoader @ref="LazyLoader" Load="Load">
|
||||
<div class="card">
|
||||
<div class="card-body pt-0">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="DdosAttack" Items="DdosAttacks" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="DdosAttack" Title="@(SmartTranslateService.Translate("Id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
|
||||
<Column TableItem="DdosAttack" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Ongoing)" Sortable="true" Filterable="true">
|
||||
<Template>
|
||||
@if (context.Ongoing)
|
||||
{
|
||||
<TL>DDos attack started</TL>
|
||||
}
|
||||
else
|
||||
{
|
||||
<TL>DDos attack stopped</TL>
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="DdosAttack" Title="@(SmartTranslateService.Translate("Node"))" Field="@(x => x.Node)" Sortable="false" Filterable="false">
|
||||
<Template>
|
||||
<a href="/admin/nodes/view/@(context.Id)">
|
||||
@(context.Node.Name)
|
||||
</a>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="DdosAttack" Title="Ip" Field="@(x => x.Ip)" Sortable="true" Filterable="true"/>
|
||||
<Column TableItem="DdosAttack" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Ongoing)" Sortable="true" Filterable="true">
|
||||
<Template>
|
||||
@if (context.Ongoing)
|
||||
{
|
||||
@(context.Data)
|
||||
<TL> packets</TL>
|
||||
}
|
||||
else
|
||||
{
|
||||
@(context.Data)
|
||||
<span> MB</span>
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="DdosAttack" Title="@(SmartTranslateService.Translate("Date"))" Field="@(x => x.Ongoing)" Sortable="true" Filterable="true">
|
||||
<Template>
|
||||
@(Formatter.FormatDate(context.CreatedAt))
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
|
||||
@code
|
||||
{
|
||||
private DdosAttack[] DdosAttacks;
|
||||
private LazyLoader LazyLoader;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await Event.On<DdosAttack>("node.ddos", this, async attack => await LazyLoader.Reload());
|
||||
}
|
||||
}
|
||||
|
||||
private Task Load(LazyLoader arg)
|
||||
{
|
||||
DdosAttacks = DdosAttackRepository
|
||||
.Get()
|
||||
.Include(x => x.Node)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.ToArray();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async void Dispose()
|
||||
{
|
||||
await Event.Off("node.ddos", this);
|
||||
}
|
||||
|
||||
//TODO: Move to security
|
||||
}
|
||||
@@ -88,7 +88,7 @@ else
|
||||
else
|
||||
{
|
||||
<span>
|
||||
@(Formatter.FormatSize(MemoryMetrics.Used)) <TL>of</TL> @(Formatter.FormatSize(MemoryMetrics.Total)) <TL>memory used</TL>
|
||||
@(Formatter.FormatSize(ByteSizeValue.FromKiloBytes(MemoryMetrics.Used).Bytes)) <TL>of</TL> @(Formatter.FormatSize(ByteSizeValue.FromKiloBytes(MemoryMetrics.Total).Bytes)) <TL>memory used</TL>
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
|
||||
148
Moonlight/Shared/Views/Admin/Security/Ddos.razor
Normal file
148
Moonlight/Shared/Views/Admin/Security/Ddos.razor
Normal file
@@ -0,0 +1,148 @@
|
||||
@page "/admin/security/ddos"
|
||||
|
||||
@using Moonlight.Shared.Components.Navigations
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Services
|
||||
@using BlazorTable
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services.Background
|
||||
|
||||
@inject Repository<BlocklistIp> BlocklistIpRepository
|
||||
@inject Repository<WhitelistIp> WhitelistIpRepository
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject DdosProtectionService DdosProtectionService
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminSecurityDdos))]
|
||||
|
||||
<AdminSecurityNavigation Index="5"/>
|
||||
|
||||
<div class="card card-body mb-5">
|
||||
<div class="d-flex justify-content-center fs-4">
|
||||
<span class="me-3">
|
||||
@(BlocklistIps.Length) <TL>blocked IPs</TL>
|
||||
</span>
|
||||
<span>
|
||||
@(WhitelistIps.Length) <TL>whitelisted IPs</TL>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-body mb-5">
|
||||
<div class="input-group input-group-lg">
|
||||
<input @bind="Ip" type="text" class="form-control">
|
||||
<WButton CssClasses="btn-secondary" OnClick="BlockIp" Text="@(SmartTranslateService.Translate("Block"))"/>
|
||||
<WButton CssClasses="btn-secondary" OnClick="WhitelistIp" Text="@(SmartTranslateService.Translate("Whitelist"))"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-body mb-5">
|
||||
<LazyLoader @ref="BlocklistLazyLoader" Load="LoadBlocklist">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="BlocklistIp" Items="BlocklistIps" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="BlocklistIp" Width="30%" Title="@(SmartTranslateService.Translate("Ip"))" Field="@(x => x.Ip)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="BlocklistIp" Width="30%" Title="@(SmartTranslateService.Translate("Packets"))" Field="@(x => x.Packets)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@(context.Packets) <TL>packets</TL>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="BlocklistIp" Width="30%" Title="" Field="@(x => x.ExpiresAt)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@Formatter.FormatUptime(context.ExpiresAt - DateTime.UtcNow) <TL>remaining</TL>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="BlocklistIp" Width="15%" Title="" Field="@(x => x.Id)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
<div class="text-end">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Details"))" />
|
||||
<DeleteButton Confirm="true" OnClick="() => RevokeBlocklistIp(context)" />
|
||||
</div>
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
|
||||
<div class="card card-body">
|
||||
<LazyLoader @ref="WhitelistLazyLoader" Load="LoadWhitelist">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="WhitelistIp" Items="WhitelistIps" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="WhitelistIp" Width="85%" Title="@(SmartTranslateService.Translate("Ip"))" Field="@(x => x.Ip)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="WhitelistIp" Width="15%" Title="" Field="@(x => x.Id)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
<div class="text-end">
|
||||
<DeleteButton Confirm="true" OnClick="() => RevokeWhitelistIp(context)" />
|
||||
</div>
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private BlocklistIp[] BlocklistIps = Array.Empty<BlocklistIp>();
|
||||
private WhitelistIp[] WhitelistIps = Array.Empty<WhitelistIp>();
|
||||
|
||||
private LazyLoader BlocklistLazyLoader;
|
||||
private LazyLoader WhitelistLazyLoader;
|
||||
|
||||
private string Ip = "";
|
||||
|
||||
private async Task LoadBlocklist(LazyLoader _)
|
||||
{
|
||||
BlocklistIps = BlocklistIpRepository
|
||||
.Get()
|
||||
.ToArray();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task LoadWhitelist(LazyLoader _)
|
||||
{
|
||||
WhitelistIps = WhitelistIpRepository
|
||||
.Get()
|
||||
.ToArray();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task BlockIp()
|
||||
{
|
||||
await DdosProtectionService.BlocklistIp(Ip, -1);
|
||||
|
||||
Ip = "";
|
||||
|
||||
await BlocklistLazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task RevokeBlocklistIp(BlocklistIp blocklistIp)
|
||||
{
|
||||
await DdosProtectionService.UnBlocklistIp(blocklistIp.Ip);
|
||||
|
||||
await BlocklistLazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task WhitelistIp()
|
||||
{
|
||||
WhitelistIpRepository.Add(new()
|
||||
{
|
||||
Ip = Ip
|
||||
});
|
||||
|
||||
Ip = "";
|
||||
|
||||
await WhitelistLazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task RevokeWhitelistIp(WhitelistIp whitelistIp)
|
||||
{
|
||||
WhitelistIpRepository.Delete(whitelistIp);
|
||||
|
||||
await WhitelistLazyLoader.Reload();
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@
|
||||
{
|
||||
SecurityLogs = SecurityLogRepository
|
||||
.Get()
|
||||
.ToArray()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.ToArray();
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Models.Misc
|
||||
|
||||
@inject MalwareScanService MalwareScanService
|
||||
@inject MalwareBackgroundScanService MalwareBackgroundScanService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject EventSystem Event
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<div class="col-12 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@if (MalwareScanService.IsRunning)
|
||||
@if (MalwareBackgroundScanService.IsRunning)
|
||||
{
|
||||
<span class="fs-3 spinner-border align-middle me-3"></span>
|
||||
}
|
||||
|
||||
<span class="fs-3">@(MalwareScanService.Status)</span>
|
||||
<span class="fs-3">@(MalwareBackgroundScanService.Status)</span>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
@if (MalwareScanService.IsRunning)
|
||||
@if (MalwareBackgroundScanService.IsRunning)
|
||||
{
|
||||
<button class="btn btn-success disabled">
|
||||
<TL>Scan in progress</TL>
|
||||
@@ -38,9 +38,18 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="scanAllServers" @bind="MalwareBackgroundScanService.ScanAllServers">
|
||||
<label class="form-check-label" for="scanAllServers">
|
||||
<TL>Scan all servers</TL>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<WButton Text="@(SmartTranslateService.Translate("Start scan"))"
|
||||
CssClasses="btn-success"
|
||||
OnClick="MalwareScanService.Start">
|
||||
OnClick="MalwareBackgroundScanService.Start">
|
||||
</WButton>
|
||||
}
|
||||
</div>
|
||||
@@ -115,9 +124,9 @@
|
||||
{
|
||||
ScanResults.Clear();
|
||||
|
||||
lock (MalwareScanService.ScanResults)
|
||||
lock (MalwareBackgroundScanService.ScanResults)
|
||||
{
|
||||
foreach (var result in MalwareScanService.ScanResults)
|
||||
foreach (var result in MalwareBackgroundScanService.ScanResults)
|
||||
{
|
||||
ScanResults.Add(result.Key, result.Value);
|
||||
}
|
||||
|
||||
@@ -1,101 +1,278 @@
|
||||
@page "/admin/support"
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Services.SupportChat
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using BlazorTable
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject SupportChatServerService ServerService
|
||||
@inject EventSystem Event
|
||||
|
||||
@implements IDisposable
|
||||
@inject Repository<Ticket> TicketRepository
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminSupport))]
|
||||
|
||||
<LazyLoader @ref="LazyLoader" Load="Load">
|
||||
<div class="card">
|
||||
<div class="row mb-5">
|
||||
<LazyLoader Load="LoadStatistics">
|
||||
<div class="col-12 col-lg-6 col-xl">
|
||||
<div class="mt-4 card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-column flex-xl-row p-5 pb-0">
|
||||
<div class="flex-lg-row-fluid me-xl-15 mb-20 mb-xl-0">
|
||||
<div class="mb-0">
|
||||
<h1 class="text-dark mb-6">
|
||||
<TL>Open chats</TL>
|
||||
</h1>
|
||||
<div class="separator"></div>
|
||||
<div class="mb-5">
|
||||
@if (OpenChats.Any())
|
||||
{
|
||||
foreach (var chat in OpenChats)
|
||||
{
|
||||
<div class="d-flex mt-3 mb-3 ms-2 me-2">
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<span class="svg-icon svg-icon-2x me-5 ms-n1 svg-icon-success">
|
||||
<i class="text-primary bx bx-md bx-message-dots"></i>
|
||||
<div class="row align-items-center gx-0">
|
||||
<div class="col">
|
||||
<h6 class="text-uppercase text-muted mb-2">
|
||||
<TL>Total Tickets</TL>
|
||||
</h6>
|
||||
<span class="h2 mb-0">
|
||||
@(TotalTicketCount)
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/admin/support/view/@(chat.Key.Id)" class="text-dark text-hover-primary fs-4 me-3 fw-semibold">
|
||||
@(chat.Key.FirstName) @(chat.Key.LastName)
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-muted fw-semibold fs-6">
|
||||
@if (chat.Value == null)
|
||||
{
|
||||
<TL>No message sent yet</TL>
|
||||
}
|
||||
else
|
||||
{
|
||||
@(chat.Value.Content)
|
||||
}
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="h2 text-muted mb-0">
|
||||
<i class="text-primary bx bx-purchase-tag bx-lg"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert alert-info">
|
||||
<TL>No support chat is currently open</TL>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 col-xl">
|
||||
<div class="mt-4 card">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center gx-0">
|
||||
<div class="col">
|
||||
<h6 class="text-uppercase text-muted mb-2">
|
||||
<TL>Unassigned tickets</TL>
|
||||
</h6>
|
||||
<span class="h2 mb-0">
|
||||
@(UnAssignedTicketCount)
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="h2 text-muted mb-0">
|
||||
<i class="text-primary bx bxs-bell-ring bx-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 col-xl">
|
||||
<div class="mt-4 card">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center gx-0">
|
||||
<div class="col">
|
||||
<h6 class="text-uppercase text-muted mb-2">
|
||||
<TL>Pending tickets</TL>
|
||||
</h6>
|
||||
<span class="h2 mb-0">
|
||||
@(PendingTicketCount)
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="h2 text-muted mb-">
|
||||
<i class="text-primary bx bx-hourglass bx-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 col-xl">
|
||||
<div class="mt-4 card">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center gx-0">
|
||||
<div class="col">
|
||||
<h6 class="text-uppercase text-muted mb-2">
|
||||
<TL>Closed tickets</TL>
|
||||
</h6>
|
||||
<span class="h2 mb-0">
|
||||
@(ClosedTicketCount)
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="h2 text-muted mb-">
|
||||
<i class="text-primary bx bx-lock bx-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Ticket overview</TL>
|
||||
</span>
|
||||
<div class="card-toolbar">
|
||||
<div class="btn-group">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Overview"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(0)" />
|
||||
<WButton Text="@(SmartTranslateService.Translate("Unassigned tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(1)" />
|
||||
<WButton Text="@(SmartTranslateService.Translate("My tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(2)" />
|
||||
<WButton Text="@(SmartTranslateService.Translate("All tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(3)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<LazyLoader @ref="TicketLazyLoader" Load="LoadTickets">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="Ticket" Items="AllTickets" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Id"))" Field="@(x => x.Id)" Filterable="true" Sortable="true"/>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Assigned to"))" Field="@(x => x.AssignedTo)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
<span>@(context.AssignedTo == null ? "None" : context.AssignedTo.FirstName + " " + context.AssignedTo.LastName)</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Ticket title"))" Field="@(x => x.IssueTopic)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("User"))" Field="@(x => x.CreatedBy)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
<span>@(context.CreatedBy.FirstName) @(context.CreatedBy.LastName)</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Created at"))" Field="@(x => x.CreatedAt)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
<span>@(Formatter.FormatDate(context.CreatedAt))</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Priority"))" Field="@(x => x.Priority)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@switch (context.Priority)
|
||||
{
|
||||
case TicketPriority.Low:
|
||||
<span class="badge bg-success">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.Medium:
|
||||
<span class="badge bg-primary">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.High:
|
||||
<span class="badge bg-warning">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.Critical:
|
||||
<span class="badge bg-danger">@(context.Priority)</span>
|
||||
break;
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Status)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@switch (context.Status)
|
||||
{
|
||||
case TicketStatus.Closed:
|
||||
<span class="badge bg-danger">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.Open:
|
||||
<span class="badge bg-success">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.Pending:
|
||||
<span class="badge bg-warning">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.WaitingForUser:
|
||||
<span class="badge bg-primary">@(context.Status)</span>
|
||||
break;
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="" Field="@(x => x.Id)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
<a class="btn btn-sm btn-primary" href="/admin/support/view/@(context.Id)">
|
||||
<TL>Open</TL>
|
||||
</a>
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private LazyLoader? LazyLoader;
|
||||
private Dictionary<User, SupportChatMessage?> OpenChats = new();
|
||||
private int TotalTicketCount;
|
||||
private int UnAssignedTicketCount;
|
||||
private int PendingTicketCount;
|
||||
private int ClosedTicketCount;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
private Ticket[] AllTickets;
|
||||
private int Filter = 0;
|
||||
|
||||
private LazyLoader TicketLazyLoader;
|
||||
|
||||
private Task LoadStatistics(LazyLoader _)
|
||||
{
|
||||
await Event.On<User>("supportChat.new", this, async user =>
|
||||
{
|
||||
//TODO: Play sound or smth. Add a config option
|
||||
TotalTicketCount = TicketRepository
|
||||
.Get()
|
||||
.Count();
|
||||
|
||||
OpenChats = await ServerService.GetOpenChats();
|
||||
UnAssignedTicketCount = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.Status != TicketStatus.Closed)
|
||||
.Count(x => x.AssignedTo == null);
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
PendingTicketCount = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.AssignedTo != null)
|
||||
.Count(x => x.Status != TicketStatus.Closed);
|
||||
|
||||
ClosedTicketCount = TicketRepository
|
||||
.Get()
|
||||
.Count(x => x.Status == TicketStatus.Closed);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task Load(LazyLoader arg) // Only for initial load
|
||||
private Task LoadTickets(LazyLoader _)
|
||||
{
|
||||
OpenChats = await ServerService.GetOpenChats();
|
||||
switch (Filter)
|
||||
{
|
||||
default:
|
||||
AllTickets = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.Status != TicketStatus.Closed)
|
||||
.ToArray();
|
||||
break;
|
||||
case 1:
|
||||
AllTickets = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.AssignedTo == null)
|
||||
.Where(x => x.Status != TicketStatus.Closed)
|
||||
.ToArray();
|
||||
break;
|
||||
case 2:
|
||||
AllTickets = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.AssignedTo != null)
|
||||
.Where(x => x.AssignedTo!.Id == IdentityService.User.Id)
|
||||
.Where(x => x.Status != TicketStatus.Closed)
|
||||
.ToArray();
|
||||
break;
|
||||
case 3:
|
||||
AllTickets = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.AssignedTo)
|
||||
.ToArray();
|
||||
break;
|
||||
}
|
||||
|
||||
public async void Dispose()
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task UpdateFilter(int filterId)
|
||||
{
|
||||
await Event.Off("supportChat.new", this);
|
||||
Filter = filterId;
|
||||
await TicketLazyLoader.Reload();
|
||||
}
|
||||
}
|
||||
379
Moonlight/Shared/Views/Admin/Support/Old_Index.razor
Normal file
379
Moonlight/Shared/Views/Admin/Support/Old_Index.razor
Normal file
@@ -0,0 +1,379 @@
|
||||
@page "/old_admin/support"
|
||||
@page "/old_admin/support/{Id:int}"
|
||||
|
||||
@using Moonlight.App.Services.Tickets
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.Shared.Components.Tickets
|
||||
|
||||
@inject TicketAdminService AdminService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject EventSystem EventSystem
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminSupport))]
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<div class="d-flex flex-column flex-lg-row">
|
||||
<div class="flex-column flex-lg-row-auto w-100 w-lg-300px w-xl-400px mb-10 mb-lg-0">
|
||||
<div class="card card-flush">
|
||||
<div class="card-body pt-5">
|
||||
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_header, #kt_app_header, #kt_toolbar, #kt_app_toolbar, #kt_footer, #kt_app_footer, #kt_chat_contacts_header" data-kt-scroll-wrappers="#kt_content, #kt_app_content, #kt_chat_contacts_body" data-kt-scroll-offset="5px" style="max-height: 601px;">
|
||||
<div class="separator separator-content border-primary mb-10 mt-5">
|
||||
<span class="w-250px fw-bold fs-5">
|
||||
<TL>Unassigned tickets</TL>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@foreach (var ticket in UnAssignedTickets)
|
||||
{
|
||||
<div class="d-flex flex-stack py-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="ms-5">
|
||||
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
|
||||
@if (ticket.Value != null)
|
||||
{
|
||||
<div class="fw-semibold text-muted">
|
||||
@(ticket.Value.Content)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column align-items-end ms-2">
|
||||
@if (ticket.Value != null)
|
||||
{
|
||||
<span class="text-muted fs-7 mb-1">
|
||||
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
if (ticket.Key != UnAssignedTickets.Last().Key)
|
||||
{
|
||||
<div class="separator"></div>
|
||||
}
|
||||
}
|
||||
|
||||
@if (AssignedTickets.Any())
|
||||
{
|
||||
<div class="separator separator-content border-primary mb-5 mt-8">
|
||||
<span class="w-250px fw-bold fs-5">
|
||||
<TL>Assigned tickets</TL>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@foreach (var ticket in AssignedTickets)
|
||||
{
|
||||
<div class="d-flex flex-stack py-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="ms-5">
|
||||
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
|
||||
@if (ticket.Value != null)
|
||||
{
|
||||
<div class="fw-semibold text-muted">
|
||||
@(ticket.Value.Content)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column align-items-end ms-2">
|
||||
@if (ticket.Value != null)
|
||||
{
|
||||
<span class="text-muted fs-7 mb-1">
|
||||
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
if (ticket.Key != AssignedTickets.Last().Key)
|
||||
{
|
||||
<div class="separator"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-lg-row-fluid ms-lg-7 ms-xl-10">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@if (AdminService.Ticket != null)
|
||||
{
|
||||
<div class="card-title">
|
||||
<div class="d-flex justify-content-center flex-column me-3">
|
||||
<span class="fs-3 fw-bold text-gray-900 me-1 mb-2 lh-1">@(AdminService.Ticket.IssueTopic)</span>
|
||||
<div class="mb-0 lh-1">
|
||||
<span class="fs-6 fw-bold text-muted me-2">
|
||||
<TL>Status</TL>
|
||||
</span>
|
||||
@switch (AdminService.Ticket.Status)
|
||||
{
|
||||
case TicketStatus.Closed:
|
||||
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketStatus.Open:
|
||||
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketStatus.Pending:
|
||||
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketStatus.WaitingForUser:
|
||||
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
}
|
||||
<span class="fs-6 fw-semibold text-muted me-5">@(AdminService.Ticket.Status)</span>
|
||||
|
||||
<span class="fs-6 fw-bold text-muted me-2">
|
||||
<TL>Priority</TL>
|
||||
</span>
|
||||
@switch (AdminService.Ticket.Priority)
|
||||
{
|
||||
case TicketPriority.Low:
|
||||
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketPriority.Medium:
|
||||
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketPriority.High:
|
||||
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
case TicketPriority.Critical:
|
||||
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
|
||||
break;
|
||||
}
|
||||
<span class="fs-6 fw-semibold text-muted">@(AdminService.Ticket.Priority)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<div class="input-group">
|
||||
<div class="me-3">
|
||||
@if (AdminService.Ticket!.AssignedTo == null)
|
||||
{
|
||||
<WButton Text="@(SmartTranslateService.Translate("Claim"))"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<WButton Text="@(SmartTranslateService.Translate("Unclaim"))"/>
|
||||
}
|
||||
</div>
|
||||
<select @bind="Priority" class="form-select rounded-start">
|
||||
@foreach (var priority in (TicketPriority[])Enum.GetValues(typeof(TicketPriority)))
|
||||
{
|
||||
if (Priority == priority)
|
||||
{
|
||||
<option value="@(priority)" selected="">@(priority)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(priority)">@(priority)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Update priority"))"
|
||||
CssClasses="btn-primary"
|
||||
OnClick="UpdatePriority">
|
||||
</WButton>
|
||||
<select @bind="Status" class="form-select">
|
||||
@foreach (var status in (TicketStatus[])Enum.GetValues(typeof(TicketStatus)))
|
||||
{
|
||||
if (Status == status)
|
||||
{
|
||||
<option value="@(status)" selected="">@(status)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(status)">@(status)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Update status"))"
|
||||
CssClasses="btn-primary"
|
||||
OnClick="UpdateStatus">
|
||||
</WButton>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card-title">
|
||||
<div class="d-flex justify-content-center flex-column me-3">
|
||||
<span class="fs-4 fw-bold text-gray-900 me-1 mb-2 lh-1">
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;">
|
||||
@if (AdminService.Ticket == null)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
<TicketMessageView Messages="Messages" ViewAsSupport="true"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (AdminService.Ticket != null)
|
||||
{
|
||||
<div class="card-footer pt-4" id="kt_chat_messenger_footer">
|
||||
<div class="d-flex flex-stack">
|
||||
<table class="w-100">
|
||||
<tr>
|
||||
<td class="align-top">
|
||||
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
<textarea @bind="MessageText" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Send"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Sending"))"
|
||||
CssClasses="btn-primary ms-2"
|
||||
OnClick="SendMessage">
|
||||
</WButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
private Dictionary<Ticket, TicketMessage?> AssignedTickets;
|
||||
private Dictionary<Ticket, TicketMessage?> UnAssignedTickets;
|
||||
private List<TicketMessage> Messages = new();
|
||||
private string MessageText;
|
||||
private SmartFileSelect FileSelect;
|
||||
|
||||
private TicketPriority Priority;
|
||||
private TicketStatus Status;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Unsubscribe();
|
||||
await ReloadTickets();
|
||||
await Subscribe();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task UpdatePriority()
|
||||
{
|
||||
await AdminService.UpdatePriority(Priority);
|
||||
}
|
||||
|
||||
private async Task UpdateStatus()
|
||||
{
|
||||
await AdminService.UpdateStatus(Status);
|
||||
}
|
||||
|
||||
private async Task SendMessage()
|
||||
{
|
||||
if (string.IsNullOrEmpty(MessageText) && FileSelect.SelectedFile != null)
|
||||
MessageText = "File upload";
|
||||
|
||||
if (string.IsNullOrEmpty(MessageText))
|
||||
return;
|
||||
|
||||
var msg = await AdminService.Send(MessageText, FileSelect.SelectedFile);
|
||||
Messages.Add(msg);
|
||||
MessageText = "";
|
||||
FileSelect.SelectedFile = null;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task Subscribe()
|
||||
{
|
||||
await EventSystem.On<Ticket>("tickets.new", this, async _ =>
|
||||
{
|
||||
await ReloadTickets(false);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
|
||||
if (AdminService.Ticket != null)
|
||||
{
|
||||
await EventSystem.On<TicketMessage>($"tickets.{AdminService.Ticket.Id}.message", this, async message =>
|
||||
{
|
||||
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && message.IsSupportMessage)
|
||||
return;
|
||||
|
||||
Messages.Add(message);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
|
||||
await EventSystem.On<Ticket>($"tickets.{AdminService.Ticket.Id}.status", this, async _ =>
|
||||
{
|
||||
await ReloadTickets(false);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Unsubscribe()
|
||||
{
|
||||
await EventSystem.Off("tickets.new", this);
|
||||
|
||||
if (AdminService.Ticket != null)
|
||||
{
|
||||
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.message", this);
|
||||
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.status", this);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ReloadTickets(bool reloadMessages = true)
|
||||
{
|
||||
AdminService.Ticket = null;
|
||||
//AssignedTickets = await AdminService.GetAssigned();
|
||||
//UnAssignedTickets = await AdminService.GetUnAssigned();
|
||||
|
||||
if (Id != 0)
|
||||
{
|
||||
AdminService.Ticket = AssignedTickets
|
||||
.FirstOrDefault(x => x.Key.Id == Id)
|
||||
.Key ?? null;
|
||||
|
||||
if (AdminService.Ticket == null)
|
||||
{
|
||||
AdminService.Ticket = UnAssignedTickets
|
||||
.FirstOrDefault(x => x.Key.Id == Id)
|
||||
.Key ?? null;
|
||||
}
|
||||
|
||||
if (AdminService.Ticket == null)
|
||||
return;
|
||||
|
||||
Status = AdminService.Ticket.Status;
|
||||
Priority = AdminService.Ticket.Priority;
|
||||
|
||||
if (reloadMessages)
|
||||
{
|
||||
var msgs = await AdminService.GetMessages();
|
||||
Messages = msgs.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async void Dispose()
|
||||
{
|
||||
await Unsubscribe();
|
||||
}
|
||||
}
|
||||
@@ -1,219 +1,194 @@
|
||||
@page "/admin/support/view/{Id:int}"
|
||||
|
||||
@using Moonlight.App.Services.Tickets
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.SupportChat
|
||||
@using System.Text.RegularExpressions
|
||||
@using Moonlight.App.Services.Files
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.Shared.Components.Tickets
|
||||
|
||||
@inject SupportChatAdminService AdminService
|
||||
@inject UserRepository UserRepository
|
||||
@inject TicketAdminService TicketAdminService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject ResourceService ResourceService
|
||||
@inject Repository<Ticket> TicketRepository
|
||||
@inject EventSystem Event
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminSupportView))]
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@if (User == null)
|
||||
<LazyLoader @ref="LazyLoader" Load="Load">
|
||||
@if (Ticket == null)
|
||||
{
|
||||
<div class="alert alert-danger">
|
||||
<TL>User not found</TL>
|
||||
</div>
|
||||
<NotFoundAlert/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="d-flex flex-column flex-xl-row p-7">
|
||||
<div class="flex-lg-row-fluid me-6 mb-20 mb-xl-0">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<LazyLoader Load="LoadMessages">
|
||||
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;">
|
||||
@foreach (var message in Messages)
|
||||
{
|
||||
if (message.Sender == null || message.Sender.Id != User.Id)
|
||||
{
|
||||
<div class="d-flex justify-content-end mb-10 ">
|
||||
<div class="d-flex flex-column align-items-end">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="me-3">
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
<a class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<span>@(message.Sender.FirstName) @(message.Sender.LastName)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>
|
||||
<TL>System</TL>
|
||||
<div class="row g-0">
|
||||
<div class="col-xl-9 col-lg-8">
|
||||
<div class="card-body border-end">
|
||||
<div class="row mb-4 pb-2 g-3">
|
||||
<span class="fs-2 fw-bold">@(Ticket.IssueTopic)</span>
|
||||
</div>
|
||||
<span class="fs-4">
|
||||
<TL>Issue description</TL>:
|
||||
</span>
|
||||
}
|
||||
</a>
|
||||
</div>
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
|
||||
@if (message.Sender == null)
|
||||
{
|
||||
<TL>@(message.Content)</TL>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var line in message.Content.Split("\n"))
|
||||
{
|
||||
@(line)<br/>
|
||||
}
|
||||
|
||||
if (message.Attachment != "")
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.Attachment, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("supportChat", message.Attachment))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("supportChat", message.Attachment))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.Attachment)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-start mb-10 ">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<a class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">
|
||||
<span>@(message.Sender.FirstName) @(message.Sender.LastName)</span>
|
||||
</a>
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start">
|
||||
@{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);}
|
||||
@foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br />
|
||||
}
|
||||
}
|
||||
|
||||
@if (message.Attachment != "")
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.Attachment, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("supportChat", message.Attachment))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("supportChat", message.Attachment))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.Attachment)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
@if (Typing.Any())
|
||||
{
|
||||
<span class="mb-5 fs-5 d-flex flex-row">
|
||||
<div class="wave me-1">
|
||||
<div class="dot h-5px w-5px" style="margin-right: 1px;"></div>
|
||||
<div class="dot h-5px w-5px" style="margin-right: 1px;"></div>
|
||||
<div class="dot h-5px w-5px"></div>
|
||||
</div>
|
||||
@if (Typing.Length > 1)
|
||||
{
|
||||
<span>
|
||||
@(Typing.Aggregate((current, next) => current + ", " + next)) <TL>are typing</TL>
|
||||
<p class="fs-5 text-muted">
|
||||
@(Formatter.FormatLineBreaks(Ticket.IssueDescription))
|
||||
</p>
|
||||
<span class="fs-4">
|
||||
<TL>Issue resolve tries</TL>:
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>
|
||||
@(Typing.First()) <TL>is typing</TL>
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
||||
<p class="fs-5 text-muted">
|
||||
@(Formatter.FormatLineBreaks(Ticket.IssueTries))
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-body border-end border-top bg-black">
|
||||
<TicketMessageView Messages="Messages" ViewAsSupport="true"/>
|
||||
</div>
|
||||
<div class="card-footer pt-4">
|
||||
<div class="d-flex flex-stack">
|
||||
<table class="w-100">
|
||||
<tr>
|
||||
<td class="align-top">
|
||||
<SmartFileSelect @ref="SmartFileSelect"></SmartFileSelect>
|
||||
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
<textarea @bind="Content" @oninput="OnTyping" class="form-control mb-3 form-control-flush" rows="1" placeholder="Type a message">
|
||||
</textarea>
|
||||
<textarea @bind="MessageContent" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Send"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Sending"))"
|
||||
CssClasses="btn-primary ms-2"
|
||||
OnClick="Send">
|
||||
</WButton>
|
||||
OnClick="SendMessage"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4">
|
||||
<div class="card-header">
|
||||
<h6 class="card-title mb-0">
|
||||
<TL>Ticket details</TL>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="flex-column flex-lg-row-auto w-100 mw-lg-300px mw-xxl-350px">
|
||||
<div class="card p-10 mb-15 pb-8">
|
||||
<h2 class="text-dark fw-bold mb-2">
|
||||
<TL>User information</TL>
|
||||
</h2>
|
||||
|
||||
<div class="d-flex align-items-center mb-1">
|
||||
<span class="fw-semibold text-gray-800 fs-5 m-0">
|
||||
<TL>Name</TL>: @(User.FirstName) @User.LastName
|
||||
</span>
|
||||
</div>
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<span class="fw-semibold text-gray-800 fs-5 m-0">
|
||||
<TL>Email</TL>: <a href="/admin/users/view/@User.Id">@(User.Email)</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="align-items-center mt-3">
|
||||
<span class="fw-semibold text-gray-800 fs-5 m-0">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Close ticket"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Closing"))"
|
||||
CssClasses="btn-danger float-end"
|
||||
OnClick="CloseTicket">
|
||||
</WButton>
|
||||
</span>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless align-middle mb-0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Ticket ID</TL>
|
||||
</th>
|
||||
<td>@(Ticket.Id)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>User</TL>
|
||||
</th>
|
||||
<td>
|
||||
<a href="/admin/users/view/@(Ticket.CreatedBy.Id)">
|
||||
@(Ticket.CreatedBy.FirstName) @(Ticket.CreatedBy.LastName)
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Subject</TL>
|
||||
</th>
|
||||
<td>
|
||||
<TL>@(Ticket.Subject)</TL>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Subject ID</TL>
|
||||
</th>
|
||||
<td>@(Ticket.SubjectId)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Assigned to</TL>
|
||||
</th>
|
||||
@if (Ticket.AssignedTo == null)
|
||||
{
|
||||
<td>
|
||||
<TL>None</TL>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>@(Ticket.AssignedTo.FirstName) @(Ticket.AssignedTo.LastName)</td>
|
||||
}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Status</TL>
|
||||
</th>
|
||||
<td>
|
||||
<select @bind="StatusModified" class="form-select">
|
||||
@foreach (var status in (TicketStatus[])Enum.GetValues(typeof(TicketStatus)))
|
||||
{
|
||||
if (StatusModified == status)
|
||||
{
|
||||
<option value="@(status)" selected="">@(status)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(status)">@(status)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Priority</TL>
|
||||
</th>
|
||||
<td>
|
||||
<select @bind="PriorityModified" class="form-select">
|
||||
@foreach (var priority in (TicketPriority[])Enum.GetValues(typeof(TicketPriority)))
|
||||
{
|
||||
if (PriorityModified == priority)
|
||||
{
|
||||
<option value="@(priority)" selected="">@(priority)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(priority)">@(priority)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<TL>Created at</TL>
|
||||
</th>
|
||||
<td>@(Formatter.FormatDate(Ticket.CreatedAt))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Save"))" OnClick="Save"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Claim"))" OnClick="() => SetClaim(IdentityService.User)"/>
|
||||
</th>
|
||||
<td>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Unclaim"))" OnClick="() => SetClaim(null)"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -227,87 +202,92 @@
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
private User? User;
|
||||
private Ticket? Ticket { get; set; }
|
||||
private TicketPriority PriorityModified;
|
||||
private TicketStatus StatusModified;
|
||||
|
||||
private List<SupportChatMessage> Messages = new();
|
||||
private string[] Typing = Array.Empty<string>();
|
||||
private List<TicketMessage> Messages = new();
|
||||
private SmartFileSelect FileSelect;
|
||||
private string MessageContent = "";
|
||||
|
||||
private string Content = "";
|
||||
private DateTime LastTypingTimestamp = DateTime.UtcNow.AddMinutes(-10);
|
||||
private LazyLoader LazyLoader;
|
||||
|
||||
private SmartFileSelect SmartFileSelect;
|
||||
|
||||
private async Task Load(LazyLoader arg)
|
||||
private async Task Load(LazyLoader _)
|
||||
{
|
||||
User = UserRepository
|
||||
Ticket = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.AssignedTo)
|
||||
.Include(x => x.CreatedBy)
|
||||
.FirstOrDefault(x => x.Id == Id);
|
||||
|
||||
if (User != null)
|
||||
if (Ticket != null)
|
||||
{
|
||||
AdminService.OnMessage += OnMessage;
|
||||
AdminService.OnTypingChanged += OnTypingChanged;
|
||||
TicketAdminService.Ticket = Ticket;
|
||||
PriorityModified = Ticket.Priority;
|
||||
StatusModified = Ticket.Status;
|
||||
|
||||
await AdminService.Start(User);
|
||||
}
|
||||
}
|
||||
Messages = (await TicketAdminService.GetMessages()).ToList();
|
||||
|
||||
private async Task LoadMessages(LazyLoader arg)
|
||||
// Register events
|
||||
|
||||
await Event.On<TicketMessage>($"tickets.{Ticket.Id}.message", this, async message =>
|
||||
{
|
||||
Messages = (await AdminService.GetMessages()).ToList();
|
||||
}
|
||||
|
||||
private async Task OnTypingChanged(string[] typing)
|
||||
{
|
||||
Typing = typing;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task OnMessage(SupportChatMessage arg)
|
||||
{
|
||||
Messages.Insert(0, arg);
|
||||
|
||||
//TODO: Sound when message from system or admin
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task Send()
|
||||
{
|
||||
if (SmartFileSelect.SelectedFile != null && string.IsNullOrEmpty(Content))
|
||||
Content = "File upload";
|
||||
|
||||
if (string.IsNullOrEmpty(Content))
|
||||
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && message.IsSupportMessage)
|
||||
return;
|
||||
|
||||
var message = await AdminService.SendMessage(Content, SmartFileSelect.SelectedFile);
|
||||
Content = "";
|
||||
Messages.Add(message);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
|
||||
await SmartFileSelect.RemoveSelection();
|
||||
await Event.On<Ticket>($"tickets.{Ticket.Id}.status", this, async _ =>
|
||||
{
|
||||
//TODO: Does not work because of data caching. So we dont reload because it will look the same anyways
|
||||
//await LazyLoader.Reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Messages.Insert(0, message);
|
||||
private async Task Save()
|
||||
{
|
||||
if (PriorityModified != Ticket!.Priority)
|
||||
await TicketAdminService.UpdatePriority(PriorityModified);
|
||||
|
||||
if (StatusModified != Ticket!.Status)
|
||||
await TicketAdminService.UpdateStatus(StatusModified);
|
||||
}
|
||||
|
||||
private async Task SetClaim(User? user)
|
||||
{
|
||||
await TicketAdminService.SetClaim(user);
|
||||
}
|
||||
|
||||
private async Task SendMessage()
|
||||
{
|
||||
if (string.IsNullOrEmpty(MessageContent) && FileSelect.SelectedFile != null)
|
||||
MessageContent = "File upload";
|
||||
|
||||
if (string.IsNullOrEmpty(MessageContent))
|
||||
return;
|
||||
|
||||
var msg = await TicketAdminService.Send(
|
||||
MessageContent,
|
||||
FileSelect.SelectedFile
|
||||
);
|
||||
|
||||
Messages.Add(msg);
|
||||
|
||||
MessageContent = "";
|
||||
FileSelect.SelectedFile = null;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task CloseTicket()
|
||||
public async void Dispose()
|
||||
{
|
||||
await AdminService.Close();
|
||||
}
|
||||
|
||||
private async Task OnTyping()
|
||||
if (Ticket != null)
|
||||
{
|
||||
if ((DateTime.UtcNow - LastTypingTimestamp).TotalSeconds > 5)
|
||||
{
|
||||
LastTypingTimestamp = DateTime.UtcNow;
|
||||
|
||||
await AdminService.SendTyping();
|
||||
await Event.Off($"tickets.{Ticket.Id}.message", this);
|
||||
await Event.Off($"tickets.{Ticket.Id}.status", this);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
AdminService?.Dispose();
|
||||
}
|
||||
}
|
||||
138
Moonlight/Shared/Views/Admin/Sys/Plugins.razor
Normal file
138
Moonlight/Shared/Views/Admin/Sys/Plugins.razor
Normal file
@@ -0,0 +1,138 @@
|
||||
@page "/admin/system/plugins"
|
||||
|
||||
@using Moonlight.Shared.Components.Navigations
|
||||
@using Moonlight.App.Services.Plugins
|
||||
@using BlazorTable
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Moonlight.App.Plugin
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
|
||||
@inject PluginStoreService PluginStoreService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject PluginService PluginService
|
||||
@inject ToastService ToastService
|
||||
@inject ModalService ModalService
|
||||
|
||||
@attribute [PermissionRequired(nameof(Permissions.AdminSysPlugins))]
|
||||
|
||||
<AdminSystemNavigation Index="10"/>
|
||||
|
||||
<div class="card mb-5">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Installed plugins</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="MoonlightPlugin" Items="PluginService.Plugins" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="MoonlightPlugin" Title="@(SmartTranslateService.Translate("Name"))" Field="@(x => x.Name)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="MoonlightPlugin" Title="@(SmartTranslateService.Translate("Author"))" Field="@(x => x.Author)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="MoonlightPlugin" Title="@(SmartTranslateService.Translate("Version"))" Field="@(x => x.Version)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="MoonlightPlugin" Title="@(SmartTranslateService.Translate("Path"))" Field="@(x => x.Name)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
@{
|
||||
var path = PluginService.PluginFiles[context];
|
||||
}
|
||||
|
||||
<span>@(path)</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Official plugins</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<LazyLoader @ref="PluginsLazyLoader" Load="LoadOfficialPlugins">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="OfficialMoonlightPlugin" Items="PluginList" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="OfficialMoonlightPlugin" Width="80%" Title="@(SmartTranslateService.Translate("Name"))" Field="@(x => x.Name)" Filterable="true" Sortable="false"/>
|
||||
<Column TableItem="OfficialMoonlightPlugin" Width="10%" Title="" Field="@(x => x.Name)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
<WButton Text="@(SmartTranslateService.Translate("Show readme"))"
|
||||
CssClasses="btn-secondary"
|
||||
OnClick="() => ShowOfficialPluginReadme(context)"/>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="OfficialMoonlightPlugin" Width="10%" Title="" Field="@(x => x.Name)" Filterable="false" Sortable="false">
|
||||
<Template>
|
||||
@if (PluginService.PluginFiles.Values.Any(x =>
|
||||
Path.GetFileName(x).Replace(".dll", "") == context.Name))
|
||||
{
|
||||
<WButton Text="@(SmartTranslateService.Translate("Update"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Updating"))"
|
||||
CssClasses="btn-primary"
|
||||
OnClick="() => UpdateOfficialPlugin(context)"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<WButton Text="@(SmartTranslateService.Translate("Install"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Installing"))"
|
||||
CssClasses="btn-primary"
|
||||
OnClick="() => InstallOfficialPlugin(context)"/>
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="pluginReadme" class="modal" style="display: none">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
<TL>Plugin readme</TL>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@((MarkupString)Markdig.Markdown.ToHtml(PluginReadme))
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private LazyLoader PluginsLazyLoader;
|
||||
private OfficialMoonlightPlugin[] PluginList;
|
||||
private string PluginReadme = "";
|
||||
|
||||
private async Task LoadOfficialPlugins(LazyLoader lazyLoader)
|
||||
{
|
||||
PluginList = await PluginStoreService.GetPlugins();
|
||||
}
|
||||
|
||||
private async Task ShowOfficialPluginReadme(OfficialMoonlightPlugin plugin)
|
||||
{
|
||||
PluginReadme = await PluginStoreService.GetPluginReadme(plugin);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await ModalService.Show("pluginReadme");
|
||||
}
|
||||
|
||||
private async Task InstallOfficialPlugin(OfficialMoonlightPlugin plugin)
|
||||
{
|
||||
await PluginStoreService.InstallPlugin(plugin);
|
||||
await ToastService.Success(SmartTranslateService.Translate("Successfully installed plugin"));
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task UpdateOfficialPlugin(OfficialMoonlightPlugin plugin)
|
||||
{
|
||||
await PluginStoreService.InstallPlugin(plugin, true);
|
||||
await ToastService.Success(SmartTranslateService.Translate("Successfully installed plugin. You need to reboot to apply changes"));
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using BlazorTable
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject UserRepository UserRepository
|
||||
@@ -39,7 +40,11 @@
|
||||
</Column>
|
||||
<Column TableItem="User" Title="@(SmartTranslateService.Translate("First name"))" Field="@(x => x.FirstName)" Sortable="true" Filterable="true"/>
|
||||
<Column TableItem="User" Title="@(SmartTranslateService.Translate("Last name"))" Field="@(x => x.LastName)" Sortable="true" Filterable="true"/>
|
||||
<Column TableItem="User" Title="@(SmartTranslateService.Translate("Created at"))" Field="@(x => x.CreatedAt)" Sortable="true" Filterable="true"/>
|
||||
<Column TableItem="User" Title="@(SmartTranslateService.Translate("Created at"))" Field="@(x => x.CreatedAt)" Sortable="true" Filterable="true">
|
||||
<Template>
|
||||
<span>@(Formatter.FormatDate(context.CreatedAt))</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="User" Title="@(SmartTranslateService.Translate("Manage"))" Field="@(x => x.Id)" Sortable="false" Filterable="false">
|
||||
<Template>
|
||||
<a href="/admin/users/edit/@(context.Id)/">
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
@using Moonlight.App.Services
|
||||
@using CloudFlare.Client.Enumerators
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject DomainRepository DomainRepository
|
||||
@inject DomainService DomainService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject AlertService AlertService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@if (Domain == null)
|
||||
@@ -181,9 +183,6 @@
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
public User? User { get; set; }
|
||||
|
||||
private Domain? Domain;
|
||||
private DnsRecord[] DnsRecords;
|
||||
private DnsRecord NewRecord = new()
|
||||
@@ -205,13 +204,13 @@
|
||||
if (Domain == null)
|
||||
return;
|
||||
|
||||
if (User == null)
|
||||
if (IdentityService.User == null)
|
||||
{
|
||||
Domain = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Domain.Owner.Id != User.Id && !User.Admin)
|
||||
if (Domain.Owner.Id != IdentityService.User.Id && !IdentityService.User.Admin)
|
||||
{
|
||||
Domain = null;
|
||||
return;
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
@using Moonlight.App.Repositories.Domains
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject DomainRepository DomainRepository
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@if (Domains.Any())
|
||||
@@ -49,11 +51,8 @@
|
||||
}
|
||||
</LazyLoader>
|
||||
|
||||
@code {
|
||||
|
||||
[CascadingParameter]
|
||||
public User? User { get; set; }
|
||||
|
||||
@code
|
||||
{
|
||||
private Domain[] Domains { get; set; }
|
||||
|
||||
private Task Load(LazyLoader loader)
|
||||
@@ -62,7 +61,7 @@
|
||||
.Get()
|
||||
.Include(x => x.SharedDomain)
|
||||
.Include(x => x.Owner)
|
||||
.Where(x => x.Owner == User)
|
||||
.Where(x => x.Owner == IdentityService.User)
|
||||
.ToArray();
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Helpers.Wings
|
||||
@using Moonlight.App.Helpers.Wings.Enums
|
||||
@using Moonlight.App.Plugin.UI
|
||||
@using Moonlight.App.Plugin.UI.Servers
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Plugins
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.Shared.Components.Xterm
|
||||
@using Moonlight.Shared.Views.Server.Settings
|
||||
@using Newtonsoft.Json
|
||||
|
||||
@inject ImageRepository ImageRepository
|
||||
@@ -21,10 +26,11 @@
|
||||
@inject DynamicBackgroundService DynamicBackgroundService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject IdentityService IdentityService
|
||||
@inject PluginService PluginService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<LazyLoader Load="LoadData">
|
||||
<LazyLoader Load="Load">
|
||||
@if (CurrentServer == null)
|
||||
{
|
||||
<NotFoundAlert/>
|
||||
@@ -33,7 +39,7 @@
|
||||
{
|
||||
if (NodeOnline)
|
||||
{
|
||||
if (Console.ConsoleState == ConsoleState.Connected)
|
||||
if (Console != null && Console.ConsoleState == ConsoleState.Connected)
|
||||
{
|
||||
if (Console.ServerState == ServerState.Installing || CurrentServer.Installing)
|
||||
{
|
||||
@@ -75,47 +81,36 @@
|
||||
<CascadingValue Value="Console">
|
||||
<CascadingValue Value="CurrentServer">
|
||||
<CascadingValue Value="Tags">
|
||||
<CascadingValue Value="Context">
|
||||
<SmartRouter Route="@Route">
|
||||
<Route Path="/">
|
||||
<ServerNavigation Index="0">
|
||||
<ServerConsole/>
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
<Route Path="/files">
|
||||
<ServerNavigation Index="1">
|
||||
<ServerFiles/>
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
<Route Path="/backups">
|
||||
<ServerNavigation Index="2">
|
||||
<ServerBackups/>
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
<Route Path="/network">
|
||||
<ServerNavigation Index="3">
|
||||
<ServerNetwork/>
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
<Route Path="/addons">
|
||||
<ServerNavigation Index="4">
|
||||
<ServerAddons/>
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
<Route Path="/settings">
|
||||
<ServerNavigation Index="5">
|
||||
<ServerSettings/>
|
||||
@foreach (var tab in Context.Tabs)
|
||||
{
|
||||
<Route Path="@(tab.Route)">
|
||||
<ServerNavigation Route="@(tab.Route)">
|
||||
@(tab.Component)
|
||||
</ServerNavigation>
|
||||
</Route>
|
||||
}
|
||||
</SmartRouter>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert alert-info">
|
||||
<div class="d-flex justify-content-center flex-center">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<h1 class="card-title">
|
||||
<TL>Connecting</TL>
|
||||
</h1>
|
||||
<p class="card-text fs-4">
|
||||
<TL>Connecting to the servers console to stream logs and the current resource usage</TL>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -144,21 +139,19 @@
|
||||
[Parameter]
|
||||
public string ServerUuid { get; set; }
|
||||
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string? Route { get; set; }
|
||||
|
||||
private WingsConsole? Console;
|
||||
private Server? CurrentServer;
|
||||
private Node Node;
|
||||
private bool NodeOnline = false;
|
||||
private Image Image;
|
||||
private NodeAllocation NodeAllocation;
|
||||
private string[] Tags;
|
||||
|
||||
private Terminal? InstallConsole;
|
||||
|
||||
private ServerPageContext Context;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Console = new();
|
||||
@@ -171,68 +164,61 @@
|
||||
|
||||
Console.OnMessage += async (_, s) =>
|
||||
{
|
||||
if (Console.ServerState == ServerState.Installing)
|
||||
{
|
||||
if (InstallConsole != null)
|
||||
if (Console.ServerState == ServerState.Installing && InstallConsole != null)
|
||||
{
|
||||
if (s.IsInternal)
|
||||
await InstallConsole.WriteLine("\x1b[38;5;16;48;5;135m\x1b[39m\x1b[1m Moonlight \x1b[0m " + s.Content + "\x1b[0m");
|
||||
else
|
||||
await InstallConsole.WriteLine(s.Content);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async Task LoadData(LazyLoader lazyLoader)
|
||||
private async Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
await lazyLoader.SetText("Requesting server data");
|
||||
|
||||
try
|
||||
{
|
||||
var uuid = Guid.Parse(ServerUuid);
|
||||
if (!Guid.TryParse(ServerUuid, out var uuid))
|
||||
return;
|
||||
|
||||
CurrentServer = ServerRepository
|
||||
.Get()
|
||||
.Include(x => x.Allocations)
|
||||
.Include(x => x.Image)
|
||||
.ThenInclude(x => x.Variables)
|
||||
.Include(x => x.Node)
|
||||
.Include(x => x.Variables)
|
||||
.Include(x => x.MainAllocation)
|
||||
.Include(x => x.Owner)
|
||||
.First(x => x.Uuid == uuid);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
if (CurrentServer != null)
|
||||
{
|
||||
if (CurrentServer.Owner.Id != IdentityService.User.Id && !IdentityService.User.Admin)
|
||||
{
|
||||
CurrentServer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentServer != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CurrentServer.Image.BackgroundImageUrl))
|
||||
await DynamicBackgroundService.Reset();
|
||||
else
|
||||
await DynamicBackgroundService.Change(CurrentServer.Image.BackgroundImageUrl);
|
||||
|
||||
await lazyLoader.SetText("Checking node online status");
|
||||
|
||||
NodeOnline = await ServerService.IsHostUp(CurrentServer);
|
||||
|
||||
if (NodeOnline)
|
||||
{
|
||||
await lazyLoader.SetText("Checking server variables");
|
||||
if (!NodeOnline)
|
||||
return;
|
||||
|
||||
var image = ImageRepository
|
||||
.Get()
|
||||
.Include(x => x.Variables)
|
||||
.First(x => x.Id == CurrentServer.Image.Id);
|
||||
await lazyLoader.SetText("Checking server variables");
|
||||
|
||||
// Live variable migration
|
||||
|
||||
foreach (var variable in image.Variables)
|
||||
foreach (var variable in CurrentServer.Image.Variables)
|
||||
{
|
||||
if (!CurrentServer.Variables.Any(x => x.Key == variable.Key))
|
||||
if (CurrentServer.Variables.All(x => x.Key != variable.Key))
|
||||
{
|
||||
CurrentServer.Variables.Add(new ServerVariable()
|
||||
{
|
||||
@@ -246,15 +232,86 @@
|
||||
|
||||
// Tags
|
||||
|
||||
await lazyLoader.SetText("Requesting tags");
|
||||
await lazyLoader.SetText("Reading tags");
|
||||
|
||||
Tags = JsonConvert.DeserializeObject<string[]>(image.TagsJson) ?? Array.Empty<string>();
|
||||
Image = image;
|
||||
Tags = JsonConvert.DeserializeObject<string[]>(CurrentServer.Image.TagsJson) ?? Array.Empty<string>();
|
||||
|
||||
// Build server pages and settings
|
||||
|
||||
Context = new ServerPageContext()
|
||||
{
|
||||
Server = CurrentServer,
|
||||
User = IdentityService.User,
|
||||
ImageTags = Tags
|
||||
};
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Name = "Console",
|
||||
Route = "/",
|
||||
Icon = "bx-terminal",
|
||||
Component = ComponentHelper.FromType(typeof(ServerConsole))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Name = "Files",
|
||||
Route = "/files",
|
||||
Icon = "bx-folder",
|
||||
Component = ComponentHelper.FromType(typeof(ServerFiles))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Name = "Backups",
|
||||
Route = "/backups",
|
||||
Icon = "bx-box",
|
||||
Component = ComponentHelper.FromType(typeof(ServerBackups))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Name = "Network",
|
||||
Route = "/network",
|
||||
Icon = "bx-wifi",
|
||||
Component = ComponentHelper.FromType(typeof(ServerNetwork))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Name = "Settings",
|
||||
Route = "/settings",
|
||||
Icon = "bx-cog",
|
||||
Component = ComponentHelper.FromType(typeof(ServerSettings))
|
||||
});
|
||||
|
||||
// Add default settings
|
||||
|
||||
Context.Settings.Add(new()
|
||||
{
|
||||
Name = "Rename",
|
||||
Component = ComponentHelper.FromType(typeof(ServerRenameSetting))
|
||||
});
|
||||
|
||||
Context.Settings.Add(new()
|
||||
{
|
||||
Name = "Reset",
|
||||
Component = ComponentHelper.FromType(typeof(ServerResetSetting))
|
||||
});
|
||||
|
||||
Context.Settings.Add(new()
|
||||
{
|
||||
Name = "Delete",
|
||||
Component = ComponentHelper.FromType(typeof(ServerDeleteSetting))
|
||||
});
|
||||
|
||||
Context = await PluginService.BuildServerPage(Context);
|
||||
|
||||
await lazyLoader.SetText("Connecting to console");
|
||||
|
||||
await ReconnectConsole();
|
||||
|
||||
// Register event system
|
||||
|
||||
await Event.On<Server>($"server.{CurrentServer.Uuid}.installComplete", this, server =>
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigationManager.Uri, true);
|
||||
@@ -268,12 +325,6 @@
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
if (string.IsNullOrEmpty(Image.BackgroundImageUrl))
|
||||
await DynamicBackgroundService.Reset();
|
||||
else
|
||||
await DynamicBackgroundService.Change(Image.BackgroundImageUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Helpers.Wings
|
||||
@using Moonlight.App.Helpers.Wings.Enums
|
||||
@using Moonlight.App.Plugin.UI
|
||||
@using Moonlight.App.Plugin.UI.Servers
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.App.ApiClients.Wings
|
||||
|
||||
@inject SmartTranslateService TranslationService
|
||||
@inject ServerService ServerService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
<div class="align-items-center">
|
||||
<div class="row">
|
||||
<div class="card card-body me-6">
|
||||
<div class="card card-body me-6 pb-0">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="d-flex align-items-center">
|
||||
@@ -26,22 +30,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex flex-column flex-end mb-1">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="w-100 nav-link btn btn-sm btn-success fw-bold px-4 me-1 @(Console.ServerState == ServerState.Offline ? "" : "disabled")" aria-selected="true" role="tab" @onclick="Start">
|
||||
<div class="btn-group btn-group-md">
|
||||
<button class="nav-link btn btn-md btn-success fw-bold px-4 me-1 @(Console.ServerState == ServerState.Offline ? "" : "disabled")" aria-selected="true" role="tab" @onclick="Start">
|
||||
<TL>Start</TL>
|
||||
</button>
|
||||
<button class="w-100 nav-link btn btn-sm btn-primary fw-bold px-4 me-1 @(Console.ServerState == ServerState.Running ? "" : "disabled")" aria-selected="true" role="tab" @onclick="Restart">
|
||||
<button class="nav-link btn btn-md btn-primary fw-bold px-4 me-1 @(Console.ServerState == ServerState.Running ? "" : "disabled")" aria-selected="true" role="tab" @onclick="Restart">
|
||||
<TL>Restart</TL>
|
||||
</button>
|
||||
@if (Console.ServerState == ServerState.Stopping)
|
||||
{
|
||||
<button class="w-100 nav-link btn btn-sm btn-danger fw-bold px-4 me-1" aria-selected="true" role="tab" @onclick="Kill">
|
||||
<button class="nav-link btn btn-md btn-danger fw-bold px-4 me-1" aria-selected="true" role="tab" @onclick="Kill">
|
||||
<TL>Kill</TL>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="w-100 nav-link btn btn-sm btn-danger fw-bold px-4 me-1 @(Console.ServerState == ServerState.Running || Console.ServerState == ServerState.Starting ? "" : "disabled")"
|
||||
<button class="nav-link btn btn-md btn-danger fw-bold px-4 me-1 @(Console.ServerState == ServerState.Running || Console.ServerState == ServerState.Starting ? "" : "disabled")"
|
||||
aria-selected="true" role="tab" @onclick="Stop">
|
||||
<TL>Stop</TL>
|
||||
</button>
|
||||
@@ -49,15 +53,27 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold text-nowrap flex-nowrap hide-scrollbar" style="overflow-x: auto; overflow-y: hidden;">
|
||||
@foreach (var tab in Context.Tabs)
|
||||
{
|
||||
<li class="nav-item mt-2 @(tab == Context.Tabs.First() ? "ms-5" : "")">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Route == tab.Route ? "active" : "")" href="/server/@(CurrentServer.Uuid + tab.Route)">
|
||||
<i class="bx bx-@(tab.Icon) bx-sm me-2"></i><TL>@(tab.Name)</TL>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="card card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 text-nowrap py-2">
|
||||
<span class="fw-bold"><TL>Shared IP</TL>:</span>
|
||||
<span class="ms-1 text-muted @(IdentityService.User.StreamerMode ? "blur" : "")">@($"{CurrentServer.Node.Fqdn}:{CurrentServer.MainAllocation?.Port ?? 0}")</span>
|
||||
</div>
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 py-2">
|
||||
<span class="fw-bold"><TL>Server ID</TL>:</span>
|
||||
<span class="ms-1 text-muted">
|
||||
@if (IdentityService.User.Admin)
|
||||
@@ -70,7 +86,7 @@
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 py-2">
|
||||
<span class="fw-bold"><TL>Status</TL>:</span>
|
||||
<span class="ms-1 text-muted">
|
||||
@switch (Console.ServerState)
|
||||
@@ -104,15 +120,15 @@
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 py-2">
|
||||
<span class="fw-bold"><TL>Cpu</TL>:</span>
|
||||
<span class="ms-1 text-muted">@(Math.Round(Console.Resource.CpuAbsolute / (CurrentServer.Cpu / 100f), 2))%</span>
|
||||
</div>
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 py-2">
|
||||
<span class="fw-bold"><TL>Memory</TL>:</span>
|
||||
<span class="ms-1 text-muted">@(Formatter.FormatSize(Console.Resource.MemoryBytes)) / @(Formatter.FormatSize(Console.Resource.MemoryLimitBytes))</span>
|
||||
<span class="ms-1 text-muted">@(Formatter.FormatSize(Console.Resource.MemoryBytes)) / @Math.Round(CurrentServer.Memory / 1024f, 2) GB</span>
|
||||
</div>
|
||||
<div class="col fs-5">
|
||||
<div class="col fs-5 py-2">
|
||||
<span class="fw-bold"><TL>Disk</TL>:</span>
|
||||
<span class="ms-1 text-muted">@(Formatter.FormatSize(Console.Resource.DiskBytes)) / @(Math.Round(CurrentServer.Disk / 1024f, 2)) GB</span>
|
||||
</div>
|
||||
@@ -121,68 +137,23 @@
|
||||
</div>
|
||||
<div class="mt-5 row">
|
||||
<div class="d-flex flex-column flex-md-row card card-body p-5">
|
||||
@*
|
||||
<ul class="nav nav-tabs nav-pills flex-row border-0 flex-md-column fs-6 pe-5 mb-5">
|
||||
@foreach (var tab in Context.Tabs)
|
||||
{
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/" class="nav-link w-100 btn btn-flex @(Index == 0 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-terminal bx-sm me-2"></i>
|
||||
<a href="/server/@(CurrentServer.Uuid + tab.Route)" class="nav-link w-100 btn btn-flex @(Route == tab.Route ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx @(tab.Icon) bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Console</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/files" class="nav-link w-100 btn btn-flex @(Index == 1 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-folder bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Files</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/backups" class="nav-link w-100 btn btn-flex @(Index == 2 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-box bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Backups</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/network" class="nav-link w-100 btn btn-flex @(Index == 3 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-wifi bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Network</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/addons" class="nav-link w-100 btn btn-flex @(Index == 4 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-plug bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Addons</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item w-100 me-0 mb-md-2">
|
||||
<a href="/server/@(CurrentServer.Uuid)/settings" class="nav-link w-100 btn btn-flex @(Index == 5 ? "active" : "") btn-active-light-primary">
|
||||
<i class="bx bx-cog bx-sm me-2"></i>
|
||||
<span class="d-flex flex-column align-items-start">
|
||||
<span class="fs-5">
|
||||
<TL>Settings</TL>
|
||||
<TL>@(tab.Name)</TL>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
*@
|
||||
<div class="tab-content w-100">
|
||||
<div class="tab-pane fade show active">
|
||||
@ChildContent
|
||||
@@ -198,16 +169,17 @@
|
||||
[CascadingParameter]
|
||||
public Server CurrentServer { get; set; }
|
||||
|
||||
|
||||
|
||||
[CascadingParameter]
|
||||
public WingsConsole Console { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
public ServerPageContext Context { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment ChildContent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int Index { get; set; } = 0;
|
||||
public string Route { get; set; } = "/";
|
||||
|
||||
//TODO: NodeIpService which loads and caches raw ips for nodes (maybe)
|
||||
|
||||
@@ -221,22 +193,22 @@
|
||||
|
||||
private async Task Start()
|
||||
{
|
||||
await Console.SetPowerState("start");
|
||||
await ServerService.SetPowerState(CurrentServer, PowerSignal.Start);
|
||||
}
|
||||
|
||||
private async Task Stop()
|
||||
{
|
||||
await Console.SetPowerState("stop");
|
||||
await ServerService.SetPowerState(CurrentServer, PowerSignal.Stop);
|
||||
}
|
||||
|
||||
private async Task Kill()
|
||||
{
|
||||
await Console.SetPowerState("kill");
|
||||
await ServerService.SetPowerState(CurrentServer, PowerSignal.Kill);
|
||||
}
|
||||
|
||||
private async Task Restart()
|
||||
{
|
||||
await Console.SetPowerState("restart");
|
||||
await ServerService.SetPowerState(CurrentServer, PowerSignal.Restart);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
@foreach (var allocation in CurrentServer.Allocations)
|
||||
{
|
||||
<div class="row align-items-center">
|
||||
<div class="row align-items-center mb-3">
|
||||
<div class="col-1 me-4">
|
||||
<i class="text-primary bx bx-wifi bx-md"></i>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.Shared.Views.Server.Settings
|
||||
@using Microsoft.AspNetCore.Components.Rendering
|
||||
@using Moonlight.App.Plugin.UI.Servers
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
<div class="row">
|
||||
@foreach (var setting in Settings)
|
||||
@foreach (var setting in Context.Settings)
|
||||
{
|
||||
<div class="col-12 col-md-6 p-3">
|
||||
<div class="accordion" id="serverSetting@(setting.GetHashCode())">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="serverSetting-header@(setting.GetHashCode())">
|
||||
<button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#serverSetting-body@(setting.GetHashCode())" aria-expanded="false" aria-controls="serverSetting-body@(setting.GetHashCode())">
|
||||
<TL>@(setting.Key)</TL>
|
||||
<TL>@(setting.Name)</TL>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="serverSetting-body@(setting.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="serverSetting-header@(setting.GetHashCode())" data-bs-parent="#serverSetting">
|
||||
<div class="accordion-body">
|
||||
@(GetComponent(setting.Value))
|
||||
@(setting.Component)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,68 +21,9 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</LazyLoader>
|
||||
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public Server CurrentServer { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
private Dictionary<string, Type> Settings = new();
|
||||
|
||||
private Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
if (Tags.Contains("paperversion"))
|
||||
Settings.Add("Paper version", typeof(PaperVersionSetting));
|
||||
|
||||
if (Tags.Contains("forgeversion"))
|
||||
Settings.Add("Forge version", typeof(ForgeVersionSetting));
|
||||
|
||||
if (Tags.Contains("fabricversion"))
|
||||
Settings.Add("Fabric version", typeof(FabricVersionSetting));
|
||||
|
||||
if (Tags.Contains("join2start"))
|
||||
Settings.Add("Join2Start", typeof(Join2StartSetting));
|
||||
|
||||
if (Tags.Contains("javascriptversion"))
|
||||
Settings.Add("Javascript version", typeof(JavascriptVersionSetting));
|
||||
|
||||
if (Tags.Contains("javascriptfile"))
|
||||
Settings.Add("Javascript file", typeof(JavascriptFileSetting));
|
||||
|
||||
if (Tags.Contains("pythonversion"))
|
||||
Settings.Add("Python version", typeof(PythonVersionSetting));
|
||||
|
||||
if (Tags.Contains("javaversion"))
|
||||
Settings.Add("Java version", typeof(JavaRuntimeVersionSetting));
|
||||
|
||||
if (Tags.Contains("dotnetversion"))
|
||||
Settings.Add("Dotnet version", typeof(DotnetVersionSetting));
|
||||
|
||||
if (Tags.Contains("pythonfile"))
|
||||
Settings.Add("Python file", typeof(PythonFileSetting));
|
||||
|
||||
if (Tags.Contains("javafile"))
|
||||
Settings.Add("Jar file", typeof(JavaFileSetting));
|
||||
|
||||
if (Tags.Contains("dotnetfile"))
|
||||
Settings.Add("Dll file", typeof(DotnetFileSetting));
|
||||
|
||||
Settings.Add("Rename", typeof(ServerRenameSetting));
|
||||
|
||||
Settings.Add("Reset", typeof(ServerResetSetting));
|
||||
|
||||
Settings.Add("Delete", typeof(ServerDeleteSetting));
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private RenderFragment GetComponent(Type type) => builder =>
|
||||
{
|
||||
builder.OpenComponent(0, type);
|
||||
builder.CloseComponent();
|
||||
};
|
||||
public ServerPageContext Context { get; set; }
|
||||
}
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="serverListGroup-header@(group.GetHashCode())">
|
||||
<button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#serverListGroup-body@(group.GetHashCode())" aria-expanded="false" aria-controls="serverListGroup-body@(group.GetHashCode())">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex gap-2 justify-content-between">
|
||||
<div>
|
||||
@if (EditMode)
|
||||
{
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="serverListGroup-body@(group.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="serverListGroup-header@(group.GetHashCode())" data-bs-parent="#serverListGroup">
|
||||
<div id="serverListGroup-body@(group.GetHashCode())" class="accordion-collapse collapse @(string.IsNullOrEmpty(group.Name) ? "show" : "")" aria-labelledby="serverListGroup-header@(group.GetHashCode())" data-bs-parent="#serverListGroup">
|
||||
<div class="accordion-body">
|
||||
<div class="row min-h-200px draggable-zone" ml-server-group="@(group.Name)">
|
||||
@foreach (var id in group.Servers)
|
||||
|
||||
@@ -1,275 +0,0 @@
|
||||
@page "/support"
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services.SupportChat
|
||||
@using System.Text.RegularExpressions
|
||||
@using Moonlight.App.Services.Files
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject ResourceService ResourceService
|
||||
@inject SupportChatClientService ClientService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<LazyLoader Load="LoadMessages">
|
||||
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;">
|
||||
@foreach (var message in Messages.ToArray())
|
||||
{
|
||||
if (message.Sender == null || message.Sender.Id != IdentityService.User.Id)
|
||||
{
|
||||
<div class="d-flex justify-content-start mb-10 ">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))">
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<a class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">
|
||||
@if (message.Sender != null)
|
||||
{
|
||||
<span>@(message.Sender.FirstName) @(message.Sender.LastName)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>
|
||||
<TL>System</TL>
|
||||
</span>
|
||||
}
|
||||
</a>
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start">
|
||||
@if (message.Sender == null)
|
||||
{
|
||||
<TL>@(message.Content)</TL>
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = 0;
|
||||
var arr = message.Content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
foreach (var line in arr)
|
||||
{
|
||||
@line
|
||||
if (i++ != arr.Length - 1)
|
||||
{
|
||||
<br />
|
||||
}
|
||||
}
|
||||
|
||||
if (message.Attachment != "")
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.Attachment, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("supportChat", message.Attachment))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("supportChat", message.Attachment))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.Attachment)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-end mb-10 ">
|
||||
<div class="d-flex flex-column align-items-end">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="me-3">
|
||||
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
|
||||
<a class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">
|
||||
<span>@(message.Sender.FirstName) @(message.Sender.LastName)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
|
||||
@foreach (var line in message.Content.Split("\n"))
|
||||
{
|
||||
@(line)<br/>
|
||||
}
|
||||
|
||||
@if (message.Attachment != "")
|
||||
{
|
||||
<div class="mt-3">
|
||||
@if (Regex.IsMatch(message.Attachment, @"\.(jpg|jpeg|png|gif|bmp)$"))
|
||||
{
|
||||
<img src="@(ResourceService.BucketItem("supportChat", message.Attachment))" class="img-fluid" alt="Attachment"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="btn btn-secondary" href="@(ResourceService.BucketItem("supportChat", message.Attachment))">
|
||||
<i class="me-2 bx bx-download"></i> @(message.Attachment)
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="d-flex justify-content-start mb-10 ">
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="symbol symbol-35px symbol-circle ">
|
||||
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))">
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<a class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">
|
||||
<span>
|
||||
<TL>System</TL>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start">
|
||||
<TL>Welcome to the support chat. Ask your question here and we will help you</TL>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
@if (Typing.Any())
|
||||
{
|
||||
<span class="mb-5 fs-5 d-flex flex-row">
|
||||
<div class="wave me-1">
|
||||
<div class="dot h-5px w-5px" style="margin-right: 1px;"></div>
|
||||
<div class="dot h-5px w-5px" style="margin-right: 1px;"></div>
|
||||
<div class="dot h-5px w-5px"></div>
|
||||
</div>
|
||||
@if (Typing.Length > 1)
|
||||
{
|
||||
<span>
|
||||
@(Typing.Aggregate((current, next) => current + ", " + next)) <TL>are typing</TL>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>
|
||||
@(Typing.First()) <TL>is typing</TL>
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
||||
<div class="d-flex flex-stack">
|
||||
<table class="w-100">
|
||||
<tr>
|
||||
<td class="align-top">
|
||||
<SmartFileSelect @ref="SmartFileSelect"></SmartFileSelect>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
<textarea @bind="Content" @oninput="OnTyping" class="form-control mb-3 form-control-flush" rows="1" placeholder="Type a message">
|
||||
</textarea>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Send"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Sending"))"
|
||||
CssClasses="btn-primary ms-2"
|
||||
OnClick="Send">
|
||||
</WButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
|
||||
@code
|
||||
{
|
||||
private List<SupportChatMessage> Messages = new();
|
||||
private string[] Typing = Array.Empty<string>();
|
||||
|
||||
private string Content = "";
|
||||
private DateTime LastTypingTimestamp = DateTime.UtcNow.AddMinutes(-10);
|
||||
|
||||
private SmartFileSelect SmartFileSelect;
|
||||
|
||||
private async Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
await lazyLoader.SetText("Starting chat client");
|
||||
|
||||
ClientService.OnMessage += OnMessage;
|
||||
ClientService.OnTypingChanged += OnTypingChanged;
|
||||
|
||||
await ClientService.Start();
|
||||
}
|
||||
|
||||
private async Task LoadMessages(LazyLoader arg)
|
||||
{
|
||||
Messages = (await ClientService.GetMessages()).ToList();
|
||||
}
|
||||
|
||||
private async Task OnTypingChanged(string[] typing)
|
||||
{
|
||||
Typing = typing;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task OnMessage(SupportChatMessage message)
|
||||
{
|
||||
Messages.Insert(0, message);
|
||||
|
||||
//TODO: Sound when message from system or admin
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task Send()
|
||||
{
|
||||
if (SmartFileSelect.SelectedFile != null && string.IsNullOrEmpty(Content))
|
||||
Content = "File upload";
|
||||
|
||||
var message = await ClientService.SendMessage(Content, SmartFileSelect.SelectedFile);
|
||||
Content = "";
|
||||
|
||||
await SmartFileSelect.RemoveSelection();
|
||||
|
||||
Messages.Insert(0, message);
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async void OnTyping()
|
||||
{
|
||||
if ((DateTime.UtcNow - LastTypingTimestamp).TotalSeconds > 5)
|
||||
{
|
||||
LastTypingTimestamp = DateTime.UtcNow;
|
||||
await ClientService.SendTyping();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ClientService?.Dispose();
|
||||
}
|
||||
|
||||
private void OnFileChange(InputFileChangeEventArgs obj)
|
||||
{
|
||||
}
|
||||
}
|
||||
253
Moonlight/Shared/Views/Support/Index.razor
Normal file
253
Moonlight/Shared/Views/Support/Index.razor
Normal file
@@ -0,0 +1,253 @@
|
||||
@page "/support"
|
||||
@using Moonlight.App.Services.Tickets
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Repositories
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using BlazorTable
|
||||
@using Moonlight.App.Models.Forms
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject TicketClientService TicketClientService
|
||||
@inject Repository<Ticket> TicketRepository
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject IdentityService IdentityService
|
||||
@inject Repository<WebSpace> WebSpaceRepository
|
||||
@inject Repository<Domain> DomainRepository
|
||||
@inject Repository<Server> ServerRepository
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Create a new ticket</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<LazyLoader Load="LoadTicketCreate">
|
||||
<SmartForm Model="Model" OnValidSubmit="OnValidSubmit">
|
||||
<div class="mb-3">
|
||||
<InputText @bind-Value="Model.IssueTopic"
|
||||
placeholder="@(SmartTranslateService.Translate("Enter a title for your ticket"))"
|
||||
class="form-control">
|
||||
</InputText>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<InputTextArea @bind-Value="Model.IssueDescription"
|
||||
placeholder="@(SmartTranslateService.Translate("Describe the issue you are experiencing"))"
|
||||
class="form-control">
|
||||
</InputTextArea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<InputTextArea @bind-Value="Model.IssueTries"
|
||||
placeholder="@(SmartTranslateService.Translate("Describe what you have tried to solve this issue"))"
|
||||
class="form-control">
|
||||
</InputTextArea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<select @bind="Model.Subject" class="form-select">
|
||||
@foreach (var subject in (TicketSubject[])Enum.GetValues(typeof(TicketSubject)))
|
||||
{
|
||||
if (Model.Subject == subject)
|
||||
{
|
||||
<option value="@(subject)" selected="">@(subject)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(subject)">@(subject)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
@if (Model.Subject == TicketSubject.Domain)
|
||||
{
|
||||
<select @bind="Model.SubjectId" class="form-select">
|
||||
@foreach (var domain in Domains)
|
||||
{
|
||||
if (Model.SubjectId == domain.Id)
|
||||
{
|
||||
<option value="@(domain.Id)" selected="">@(domain.Name).@(domain.SharedDomain.Name)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(domain.Id)">@(domain.Name).@(domain.SharedDomain.Name)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
}
|
||||
else if (Model.Subject == TicketSubject.Server)
|
||||
{
|
||||
<select @bind="Model.SubjectId" class="form-select">
|
||||
@foreach (var server in Servers)
|
||||
{
|
||||
if (Model.SubjectId == server.Id)
|
||||
{
|
||||
<option value="@(server.Id)" selected="">@(server.Name)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(server.Id)">@(server.Name)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
}
|
||||
else if (Model.Subject == TicketSubject.Webspace)
|
||||
{
|
||||
<select @bind="Model.SubjectId" class="form-select">
|
||||
@foreach (var webSpace in WebSpaces)
|
||||
{
|
||||
if (Model.SubjectId == webSpace.Id)
|
||||
{
|
||||
<option value="@(webSpace.Id)" selected="">@(webSpace.Domain)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(webSpace.Id)">@(webSpace.Domain)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<TL>Create ticket</TL>
|
||||
</button>
|
||||
</div>
|
||||
</SmartForm>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<TL>Your tickets</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<LazyLoader Load="LoadTickets">
|
||||
<div class="table-responsive">
|
||||
<Table TableItem="Ticket" Items="Tickets" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Ticket title"))" Field="@(x => x.IssueTopic)" Filterable="true" Sortable="false">
|
||||
<Template>
|
||||
<a href="/support/view/@(context.Id)">@(context.IssueTopic)</a>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Assigned to"))" Field="@(x => x.AssignedTo)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
<span>@(context.AssignedTo == null ? "None" : context.AssignedTo.FirstName + " " + context.AssignedTo.LastName)</span>
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Priority"))" Field="@(x => x.Priority)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@switch (context.Priority)
|
||||
{
|
||||
case TicketPriority.Low:
|
||||
<span class="badge bg-success">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.Medium:
|
||||
<span class="badge bg-primary">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.High:
|
||||
<span class="badge bg-warning">@(context.Priority)</span>
|
||||
break;
|
||||
case TicketPriority.Critical:
|
||||
<span class="badge bg-danger">@(context.Priority)</span>
|
||||
break;
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Status)" Filterable="true" Sortable="true">
|
||||
<Template>
|
||||
@switch (context.Status)
|
||||
{
|
||||
case TicketStatus.Closed:
|
||||
<span class="badge bg-danger">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.Open:
|
||||
<span class="badge bg-success">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.Pending:
|
||||
<span class="badge bg-warning">@(context.Status)</span>
|
||||
break;
|
||||
case TicketStatus.WaitingForUser:
|
||||
<span class="badge bg-primary">@(context.Status)</span>
|
||||
break;
|
||||
}
|
||||
</Template>
|
||||
</Column>
|
||||
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
|
||||
</Table>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private Ticket[] Tickets;
|
||||
private CreateTicketDataModel Model = new();
|
||||
|
||||
private Server[] Servers;
|
||||
private WebSpace[] WebSpaces;
|
||||
private Domain[] Domains;
|
||||
|
||||
private Task LoadTickets(LazyLoader _)
|
||||
{
|
||||
Tickets = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Include(x => x.AssignedTo)
|
||||
.Where(x => x.Status != TicketStatus.Closed)
|
||||
.Where(x => x.CreatedBy.Id == IdentityService.User.Id)
|
||||
.ToArray();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task LoadTicketCreate(LazyLoader _)
|
||||
{
|
||||
Servers = ServerRepository
|
||||
.Get()
|
||||
.Include(x => x.Owner)
|
||||
.Where(x => x.Owner.Id == IdentityService.User.Id)
|
||||
.ToArray();
|
||||
|
||||
WebSpaces = WebSpaceRepository
|
||||
.Get()
|
||||
.Include(x => x.Owner)
|
||||
.Where(x => x.Owner.Id == IdentityService.User.Id)
|
||||
.ToArray();
|
||||
|
||||
Domains = DomainRepository
|
||||
.Get()
|
||||
.Include(x => x.SharedDomain)
|
||||
.Include(x => x.Owner)
|
||||
.Where(x => x.Owner.Id == IdentityService.User.Id)
|
||||
.ToArray();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task OnValidSubmit()
|
||||
{
|
||||
var ticket = await TicketClientService.Create(
|
||||
Model.IssueTopic,
|
||||
Model.IssueDescription,
|
||||
Model.IssueTries,
|
||||
Model.Subject,
|
||||
Model.SubjectId
|
||||
);
|
||||
|
||||
Model = new();
|
||||
|
||||
NavigationManager.NavigateTo("/support/view/" + ticket.Id);
|
||||
}
|
||||
}
|
||||
131
Moonlight/Shared/Views/Support/View.razor
Normal file
131
Moonlight/Shared/Views/Support/View.razor
Normal file
@@ -0,0 +1,131 @@
|
||||
@page "/support/view/{Id:int}"
|
||||
|
||||
@using Moonlight.App.Services.Tickets
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Repositories
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.Shared.Components.Tickets
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Events
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject TicketClientService TicketClientService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject Repository<Ticket> TicketRepository
|
||||
@inject IdentityService IdentityService
|
||||
@inject EventSystem Event
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@if (Ticket == null)
|
||||
{
|
||||
<NotFoundAlert />
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">@(Ticket.IssueTopic)</span>
|
||||
</div>
|
||||
<div class="card-body border-end border-top bg-black">
|
||||
<TicketMessageView Messages="Messages"/>
|
||||
</div>
|
||||
<div class="card-footer pt-4">
|
||||
<div class="d-flex flex-stack">
|
||||
<table class="w-100">
|
||||
<tr>
|
||||
<td class="align-top">
|
||||
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
<textarea @bind="MessageContent" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<WButton Text="@(SmartTranslateService.Translate("Send"))"
|
||||
WorkingText="@(SmartTranslateService.Translate("Sending"))"
|
||||
CssClasses="btn-primary ms-2"
|
||||
OnClick="SendMessage"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</LazyLoader>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
private Ticket? Ticket;
|
||||
private List<TicketMessage> Messages = new();
|
||||
|
||||
private SmartFileSelect FileSelect;
|
||||
private string MessageContent = "";
|
||||
|
||||
private async Task Load(LazyLoader _)
|
||||
{
|
||||
Ticket = TicketRepository
|
||||
.Get()
|
||||
.Include(x => x.CreatedBy)
|
||||
.Where(x => x.CreatedBy.Id == IdentityService.User.Id)
|
||||
.FirstOrDefault(x => x.Id == Id);
|
||||
|
||||
if (Ticket != null)
|
||||
{
|
||||
TicketClientService.Ticket = Ticket;
|
||||
|
||||
Messages = (await TicketClientService.GetMessages()).ToList();
|
||||
|
||||
// Register events
|
||||
|
||||
await Event.On<TicketMessage>($"tickets.{Ticket.Id}.message", this, async message =>
|
||||
{
|
||||
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && !message.IsSupportMessage)
|
||||
return;
|
||||
|
||||
Messages.Add(message);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
|
||||
await Event.On<Ticket>($"tickets.{Ticket.Id}.status", this, async _ =>
|
||||
{
|
||||
//TODO: Does not work because of data caching. So we dont reload because it will look the same anyways
|
||||
//await LazyLoader.Reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SendMessage()
|
||||
{
|
||||
if (string.IsNullOrEmpty(MessageContent) && FileSelect.SelectedFile != null)
|
||||
MessageContent = "File upload";
|
||||
|
||||
if (string.IsNullOrEmpty(MessageContent))
|
||||
return;
|
||||
|
||||
var msg = await TicketClientService.Send(
|
||||
MessageContent,
|
||||
FileSelect.SelectedFile
|
||||
);
|
||||
|
||||
Messages.Add(msg);
|
||||
|
||||
MessageContent = "";
|
||||
FileSelect.SelectedFile = null;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
public async void Dispose()
|
||||
{
|
||||
if (Ticket != null)
|
||||
{
|
||||
await Event.Off($"tickets.{Ticket.Id}.message", this);
|
||||
await Event.Off($"tickets.{Ticket.Id}.status", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,14 @@
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.Shared.Components.WebsiteControl
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Plugin.UI.Webspaces
|
||||
@using Moonlight.App.Services.Plugins
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inject Repository<WebSpace> WebSpaceRepository
|
||||
@inject WebSpaceService WebSpaceService
|
||||
@inject PluginService PluginService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
@@ -32,43 +36,17 @@
|
||||
if (HostOnline)
|
||||
{
|
||||
<CascadingValue Value="CurrentWebspace">
|
||||
@{
|
||||
var index = 0;
|
||||
|
||||
switch (Route)
|
||||
<CascadingValue Value="Context">
|
||||
<SmartRouter Route="@(Route)">
|
||||
@foreach (var tab in Context.Tabs)
|
||||
{
|
||||
case "files":
|
||||
index = 1;
|
||||
break;
|
||||
case "sftp":
|
||||
index = 2;
|
||||
break;
|
||||
case "databases":
|
||||
index = 3;
|
||||
break;
|
||||
default:
|
||||
index = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
<WebSpaceNavigation Index="index" WebSpace="CurrentWebspace" />
|
||||
|
||||
@switch (Route)
|
||||
{
|
||||
case "files":
|
||||
<WebSpaceFiles />
|
||||
break;
|
||||
case "sftp":
|
||||
<WebSpaceSftp />
|
||||
break;
|
||||
case "databases":
|
||||
<WebSpaceDatabases />
|
||||
break;
|
||||
default:
|
||||
<WebSpaceDashboard />
|
||||
break;
|
||||
}
|
||||
<Route Path="@(tab.Route)">
|
||||
<WebSpaceNavigation Route="@(tab.Route)" WebSpace="CurrentWebspace"/>
|
||||
@(tab.Component)
|
||||
</Route>
|
||||
}
|
||||
</SmartRouter>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
}
|
||||
else
|
||||
@@ -101,6 +79,8 @@
|
||||
private WebSpace? CurrentWebspace;
|
||||
private bool HostOnline = false;
|
||||
|
||||
private WebspacePageContext Context;
|
||||
|
||||
private async Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
CurrentWebspace = WebSpaceRepository
|
||||
@@ -112,14 +92,53 @@
|
||||
if (CurrentWebspace != null)
|
||||
{
|
||||
if (CurrentWebspace.Owner.Id != IdentityService.User.Id && !IdentityService.User.Admin)
|
||||
{
|
||||
CurrentWebspace = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentWebspace != null)
|
||||
{
|
||||
await lazyLoader.SetText("Checking host system online status");
|
||||
|
||||
HostOnline = await WebSpaceService.IsHostUp(CurrentWebspace);
|
||||
|
||||
if (!HostOnline)
|
||||
return;
|
||||
|
||||
Context = new WebspacePageContext()
|
||||
{
|
||||
WebSpace = CurrentWebspace,
|
||||
User = IdentityService.User
|
||||
};
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Route = "/",
|
||||
Name = "Dashboard",
|
||||
Component = ComponentHelper.FromType(typeof(WebSpaceDashboard))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Route = "/files",
|
||||
Name = "Files",
|
||||
Component = ComponentHelper.FromType(typeof(WebSpaceFiles))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Route = "/sftp",
|
||||
Name = "SFTP",
|
||||
Component = ComponentHelper.FromType(typeof(WebSpaceSftp))
|
||||
});
|
||||
|
||||
Context.Tabs.Add(new()
|
||||
{
|
||||
Route = "/databases",
|
||||
Name = "Databases",
|
||||
Component = ComponentHelper.FromType(typeof(WebSpaceDatabases))
|
||||
});
|
||||
|
||||
Context = await PluginService.BuildWebspacePage(Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ Add admin accounts;Admin Konto hinzufügen
|
||||
First name;Vorname
|
||||
Last name;Nachname
|
||||
Email address;E-Mail-Adresse
|
||||
Enter password;Passwort eingeben
|
||||
Enter password;Password eingeben
|
||||
Next;Weiter
|
||||
Back;Zurück
|
||||
Configure features;Features konfigurieren
|
||||
@@ -53,17 +53,17 @@ Account settings;Benutzer-Einstellungen
|
||||
Logout;Abmelden
|
||||
Dashboard;Dashboard
|
||||
Order;Bestellen
|
||||
Website;Website
|
||||
Website;Webseite
|
||||
Database;Datenbank
|
||||
Domain;Domain
|
||||
Servers;Server
|
||||
Websites;Websiten
|
||||
Websites;Webseiten
|
||||
Databases;Datenbanken
|
||||
Domains;Domains
|
||||
Changelog;Änderungen
|
||||
Firstname;Vorname
|
||||
Lastname;Nachname
|
||||
Repeat password;Passwort wiederholen
|
||||
Repeat password;Password wiederholen
|
||||
Sign Up;Anmelden
|
||||
Sign up to start with moonlight;Registrieren um mit Moonlight zu starten
|
||||
Sign up with Discord;Mit Discord Registrieren
|
||||
@@ -71,22 +71,22 @@ Sign up with Google;Mit Google Registrieren
|
||||
Sign-up;Registrieren
|
||||
Already registered?;Schon Registriert?
|
||||
Sign in;Registrieren
|
||||
Create something new;Etwas Neues erstellen
|
||||
Create something new;Etwas neues erstellen
|
||||
Create a gameserver;Einen Gameserver erstellen
|
||||
A new gameserver in just a few minutes;Ein neuer Gameserver in wenigen Minuten
|
||||
Create a database;Eine Datenbank erstellen
|
||||
A quick way to store your data and manage it from all around the world;Eine schnelle Möglichkeit, deine Daten von überall auf der Welt zu verwalten
|
||||
A quick way to store your data and manage it from all around the world;Eine schnelle Möglichkeit, um deine Daten von überall auf der Welt zu verwalten
|
||||
Manage your services;Deine Dienste verwalten
|
||||
Manage your gameservers;Gameserver verwalten
|
||||
Adjust your gameservers;Deine Gameserver anpassen
|
||||
Manage your databases;Datenbanken verwalten
|
||||
Insert, delete and update the data in your databases;Daten in die Datenbank einfügen, entfernen und ändern
|
||||
Create a website;Eine Website erstellen
|
||||
Make your own websites with a webspace;Mit einem Webspace eine Website erstellen
|
||||
Create a website;Eine Webseite erstellen
|
||||
Make your own websites with a webspace;Mit einem Webspace eine Webseite erstellen
|
||||
Create a domain;Eine Domain erstellen
|
||||
Make your servvices accessible throught your own domain;Mache deine Dienste mit einer Domain erreichbar
|
||||
Manage your websites;Deine Websiten verwalten
|
||||
Modify the content of your websites;Den Inhalt deiner Websiten verwalten
|
||||
Manage your websites;Deine Webseiten verwalten
|
||||
Modify the content of your websites;Den Inhalt deiner Webseiten verwalten
|
||||
Manage your domains;Deine Domains verwalten
|
||||
Add, edit and delete dns records;DNS-Records hinzufügen, entfernen oder bearbeiten
|
||||
Admin;Admin
|
||||
@@ -100,7 +100,7 @@ aaPanel;aaPanel
|
||||
Users;Benutzer
|
||||
Support;Hilfe
|
||||
Statistics;Statistiken
|
||||
No nodes found. Start with adding a new node;Keine Nodes gefunden. Eine neue Node hinzufügen
|
||||
No nodes found. Start with adding a new node;Keine Nodes gefunden. Ein neues Node hinzufügen
|
||||
Nodename;Nodename
|
||||
FQDN;FQDN
|
||||
Create;Erstellen
|
||||
@@ -115,25 +115,25 @@ Memory;Arbeitsspeicher
|
||||
Used / Available memory;Benutzter / Verfügbarer Arbeitsspeicher
|
||||
Storage;Speicherplatz
|
||||
Available storage;Verfügbarer Speicherplatz
|
||||
Add a new node;Eine neue Node hinzufügen
|
||||
Add a new node;Ein neues Node hinzufügen
|
||||
Delete;Löschen
|
||||
Deleting;Wird gelöscht...
|
||||
Edit;Bearbeiten
|
||||
Token Id;Token ID
|
||||
Token Id;Token Id
|
||||
Token;Token
|
||||
Save;Speichern
|
||||
Setup;Aufsetzen
|
||||
Open a ssh connection to your node and enter;Eine SSH verbindung zu der Node hinzufügen und öffnen
|
||||
and paste the config below. Then press STRG+O and STRG+X to save;und die Config darunter einfügen. Dann STRG+O und STRG+X drücken um zu Speichern
|
||||
Open a ssh connection to your node and enter;Eine SSH verbindung zum Node hinzufügen und öffnen
|
||||
and paste the config below. Then press STRG+O and STRG+X to save;und die Config darunter einfügern. Dann STRG+O und STRG+X um zu Speichern
|
||||
Before configuring this node, install the daemon;Installiere den Daemon bevor du dieses Node konfigurierst
|
||||
Delete this node?;Diese Node löschen?
|
||||
Do you really want to delete this node;Möchtest du diese Node wirklich löschen?
|
||||
Delete this node?;Dieses Node löschen?
|
||||
Do you really want to delete this node;Möchtest du dieses Node wirklich löschen?
|
||||
Yes;Ja
|
||||
No;Nein
|
||||
Status;Status
|
||||
Adding;Hinzufügen
|
||||
Port;Port
|
||||
Id;ID
|
||||
Id;Id
|
||||
Manage;Verwalten
|
||||
Create new server;Neuen Server erstellen
|
||||
No servers found;Keine Server gefunden
|
||||
@@ -150,20 +150,20 @@ Cores;Kerne
|
||||
Owner;Besitzer
|
||||
Value;Wert
|
||||
An unknown error occured;Ein unbekannter Fehler ist aufgetreten
|
||||
No allocation found;Keine Allocation gefunden
|
||||
No allocation found;Keine Zuweisung gefunden
|
||||
Identifier;Identifier
|
||||
UuidIdentifier;UUIDIdentifier
|
||||
UuidIdentifier;UuidIdentifier
|
||||
Override startup command;Startup Befehl überschreiben
|
||||
Loading;Wird geladen...
|
||||
Offline;Offline
|
||||
Connecting;Verbiden...
|
||||
Start;Start
|
||||
Restart;Neustarten
|
||||
Restart;Neu Starten
|
||||
Stop;Stoppen
|
||||
Shared IP;Geteilte IP
|
||||
Server ID;Server ID
|
||||
Cpu;CPU
|
||||
Console;Konsole
|
||||
Console;Console
|
||||
Files;Dateien
|
||||
Backups;Backups
|
||||
Network;Netzwerk
|
||||
@@ -184,11 +184,11 @@ Search files and folders;Ordner und Dateien durchsuchen
|
||||
Launch WinSCP;WinSCP starten
|
||||
New folder;Neuer Ordner
|
||||
Upload;Hochladen
|
||||
File name;Dateiname
|
||||
File size;Dateigröße
|
||||
Last modified;Zuletzt geändert
|
||||
File name;Datei-Name
|
||||
File size;Datei-Größe
|
||||
Last modified;Zuletz geändert
|
||||
Cancel;Abbrechen
|
||||
Canceling;Wird Abgebrochen
|
||||
Canceling;Wird Abbgebrochen
|
||||
Running;Läuft
|
||||
Loading backups;Backups werden geladen
|
||||
Started backup creation;Backup wird erstellt
|
||||
@@ -198,35 +198,35 @@ Move;Bewegen
|
||||
Archive;Archivieren
|
||||
Unarchive;Archivieren rückgängig machen
|
||||
Download;Herunterladen
|
||||
Starting download;Download wird gestartet
|
||||
Starting download;Herunterladen wird gestartet
|
||||
Backup successfully created;Backup wurde erfolgreich erstellt
|
||||
Restore;Wiederherstellen
|
||||
Copy url;URL Kopieren
|
||||
Backup deletion started;Backup Löschung wird gestartet
|
||||
Backup deletion started;Backup löschung wird gestartet
|
||||
Backup successfully deleted;Backup wurde erfolgreich gelöscht
|
||||
Primary;Primärer
|
||||
This feature is currently not available;Diese Funktion ist zurzeit leider nicht verfügbar
|
||||
This feature is currently not available;Diese Funktion ist zur Zeit nicht verfügbar
|
||||
Send;Senden
|
||||
Sending;Wird gesendet
|
||||
Welcome to the support chat. Ask your question here and we will help you;Willkommen im Support Chat. Stelle hier deine Frage und wir helfen dir.
|
||||
minutes ago; Minuten her
|
||||
Welcome to the support chat. Ask your question here and we will help you;Willkommen in der Chat Hilfe. Stelle hier deine Frage und wir helfen dir.
|
||||
minutes ago; Minuten
|
||||
just now;gerade eben
|
||||
less than a minute ago;vor weniger als einer Minute
|
||||
less than a minute ago;weniger als eine Minute
|
||||
1 hour ago;vor einer Stunde
|
||||
1 minute ago;vor einer Minute
|
||||
Failed;Fehlgeschlagen
|
||||
hours ago; Stunden her
|
||||
hours ago; Stunden
|
||||
Open tickets;Tickets öffnen
|
||||
Actions;Aktionen
|
||||
No support ticket is currently open;Kein Support Ticket ist zurzeit offen.
|
||||
User information;Benutzer-Information
|
||||
Close ticket;Ticket schließen
|
||||
Closing;Wird geschlossen...
|
||||
The support team has been notified. Please be patient;Das Support-Team wurde benachrichtigt. Habe etwas Geduld
|
||||
The support team has been notified. Please be patient;Das Support-Team wurde benachrichtigt. Habe etwas gedult
|
||||
The ticket is now closed. Type a message to open it again;Das Ticket wurde geschlossen. Schreibe etwas, um es wieder zu öffnen
|
||||
1 day ago;vor einem Tag
|
||||
is typing;schreibt...
|
||||
are typing;schreiben...
|
||||
are typing;schreiben
|
||||
No domains available;Keine Domains verfügbar
|
||||
Shared domains;Geteilte Domains
|
||||
Shared domain;Geteilte Domain
|
||||
@@ -238,16 +238,16 @@ Fetching dns records;Es wird nach DNS-Records gesucht
|
||||
No dns records found;Keine DNS-Records gefunden
|
||||
Content;Inhalt
|
||||
Priority;Priorität
|
||||
Ttl;TTL
|
||||
Ttl;Ttl
|
||||
Enable cloudflare proxy;Cloudflare-Proxy benutzen
|
||||
CF Proxy;CF Proxy
|
||||
days ago; Tage her
|
||||
days ago; Tage
|
||||
Cancle;Abbrechen
|
||||
An unexpected error occured;Ein unbekannter Fehler ist aufgetreten
|
||||
Testy;Testy
|
||||
Error from cloudflare api;Fehler von der Cloudflare-API
|
||||
Profile;Profil
|
||||
No subscription available;Kein Abonnement verfügbar
|
||||
No subscription available;Kein Abo verfügbar
|
||||
Buy;Kaufen
|
||||
Redirecting;Weiterleiten
|
||||
Apply;Anwenden
|
||||
@@ -255,7 +255,7 @@ Applying code;Code Anwenden
|
||||
Invalid subscription code;Unbekannter Abo-Code
|
||||
Cancel Subscription;Abo beenden
|
||||
Active until;Aktiv bis
|
||||
We will send you a notification upon subscription expiration;Wenn dein Abonnement endet, senden wir dir eine E-Mail
|
||||
We will send you a notification upon subscription expiration;Wenn dein Abo endet, senden wir dir eine E-Mail
|
||||
This token has been already used;Dieser Token wurde schon benutzt
|
||||
New login for;Neue Anmeldung für
|
||||
No records found for this day;Für diesen Tag wurden keine Records gefunden
|
||||
@@ -265,7 +265,7 @@ Minecraft version;Minecraft Version
|
||||
Build version;Build Version
|
||||
Server installation is currently running;Der Server wird installiert.
|
||||
Selected;Ausgewählt
|
||||
Move deleted;Gelöschtes Bewegen
|
||||
Move deleted;Gelöschtest Bewegen
|
||||
Delete selected;Ausgewähltes löschen
|
||||
Log level;Log Level
|
||||
Log message;Log Message
|
||||
@@ -274,11 +274,11 @@ Version;Version
|
||||
You are running moonlight version;Du benutzt die Moonlight-Version
|
||||
Operating system;Betriebssystem
|
||||
Moonlight is running on;Moonlight läuft auf
|
||||
Memory usage;Arbeitsspeicher Auslastung
|
||||
Memory usage;Arbeitsspeicher-Auslastung
|
||||
Moonlight is using;Moonlight benutzt
|
||||
of memory;des Arbeitsspeichers
|
||||
Cpu usage;CPU Auslastung
|
||||
Refresh;Neuladen
|
||||
Refresh;Neu Laden
|
||||
Send a message to all users;Eine Nachricht an alle Benutzer senden
|
||||
IP;IP
|
||||
URL;URL
|
||||
@@ -286,9 +286,9 @@ Device;Gerät
|
||||
Change url;URL Ändern
|
||||
Message;Nachricht
|
||||
Enter message;Nachricht eingeben
|
||||
Enter the message to send;Eine Nachricht zum Senden eingeben
|
||||
Enter the message to send;Eine Nachricht zum senden eingeben
|
||||
Confirm;Bestätigen
|
||||
Are you sure?;Bist du dir sicher?
|
||||
Are you sure?;Bist du dir sicher
|
||||
Enter url;URL eingeben
|
||||
An unknown error occured while starting backup deletion;Ein unbekannter Fehler ist während der Backuplöschung aufgetreten
|
||||
Success;erfolgreich
|
||||
@@ -311,24 +311,24 @@ Sessions;Sitzungen
|
||||
New user;Neuer Benutzer
|
||||
Created at;Erstellt am
|
||||
Mail template not found;E-Mail template wurde nicht gefunden
|
||||
Missing admin permissions. This attempt has been logged ;Fehlende Admin-Rechte. Dieser Versuch wurde aufgezeichnet und ist für das ganze Admin Team sichtbar
|
||||
Missing admin permissions. This attempt has been logged ;Fehlende Admin-Rechte. Dieser Versuch wurde aufgezeichnet
|
||||
Address;Addresse
|
||||
City;Stadt
|
||||
State;Land
|
||||
Country;Staat
|
||||
Totp;TOTP
|
||||
Totp;Totp
|
||||
Discord;Discord
|
||||
Subscription;Abonnement
|
||||
None;None
|
||||
No user with this id found;Kein Benutzer mit dieser ID gefunden
|
||||
Back to list;Zurück zur Liste
|
||||
New domain;Neue Domain
|
||||
Back to list;Zurück zur liste
|
||||
New domain;Neue domain
|
||||
Reset password;Password wiederherstellen
|
||||
Password reset;Password wiederherstellung
|
||||
Reset the password of your account;Password deines Accounts zurücksetzen
|
||||
Wrong here?;Falsch hier?
|
||||
A user with this email can not be found;Ein Benutzer mit dieser E-Mail konnte nicht gefunden werden
|
||||
Passwort reset successfull. Check your mail;Password wiederherstellung erfolgreich. Überprüfe dein Email Postfach
|
||||
Password reset successfull. Check your mail;Password wiederherstellung erfolgreich. Überprüfe deine Email
|
||||
Discord bot;Discord Bot
|
||||
New image;Neues Image
|
||||
Description;Beschreibung
|
||||
@@ -348,15 +348,15 @@ Startup detection;Startuperkennung
|
||||
Stop command;Stopp-Befehl
|
||||
Successfully saved image;Das Image wurde erfolgreich gespeichert
|
||||
No docker images found;Keine Docker Images gefunden
|
||||
Key;Key
|
||||
Key;Schlüssel
|
||||
Default value;Standardwert
|
||||
Allocations;Zuweisung
|
||||
No variables found;Keine Variablen gefunden
|
||||
Successfully added image;Das Image wurde erfolgreich hinzugefügt
|
||||
Password change for;Password ändern für
|
||||
of;von
|
||||
New node;Neue Node
|
||||
Fqdn;FQDN
|
||||
New node;Neues Node
|
||||
Fqdn;Fqdn
|
||||
Cores used;Kerne genutzt
|
||||
used;benutzt
|
||||
5.15.90.1-microsoft-standard-WSL2 - amd64;5.15.90.1-microsoft-standard-WSL2 - amd64
|
||||
@@ -367,7 +367,7 @@ details;Details
|
||||
1;1
|
||||
2;2
|
||||
DDos;DDos
|
||||
No ddos attacks found;Keine DDos Attacken gefunden
|
||||
No ddos attacks found;Keine DDoS gefunden
|
||||
Node;Node
|
||||
Date;Datum
|
||||
DDos attack started;DDos Attacke gestartet
|
||||
@@ -383,25 +383,25 @@ Do you really want to kill all running servers?;Möchtest du wirklich alle laufe
|
||||
Change power state for;Power-State ändern für
|
||||
to;zu
|
||||
Stop all servers;Alle Server stoppen
|
||||
Do you really want to stop all running servers?;Möchtest du wirklich alle laufenden Server stoppen?
|
||||
Do you really want to stop all running servers?;Möchtest du wirklich alle laufenden Server Killen?
|
||||
Manage ;Verwalten
|
||||
Manage user ;Benutzer verwalten
|
||||
Reloading;Lade neu...
|
||||
Reloading;Neu Laden...
|
||||
Update;Aktualisieren
|
||||
Updating;Wird Aktualisiert...
|
||||
Successfully updated user;Benutzer erfolgreich aktualisiert
|
||||
Discord id;Discord User ID
|
||||
Discord id;Discord ID
|
||||
Discord username;Discord Benutzername
|
||||
Discord discriminator;Discord Tag
|
||||
The Name field is required.;Der Name dieses Feldes ist erforderlich
|
||||
An error occured while logging you in;Ein Fehler ist aufgetreten, während du dich angemeldet hast
|
||||
An error occured while logging you in;Ein Fehler ist aufgetreten, als du dich angemeldet hast
|
||||
You need to enter an email address;Du musst eine E-Mail-Adresse angeben
|
||||
You need to enter a password;Du musst ein Password eingeben
|
||||
You need to enter a password with minimum 8 characters in lenght;Du musst ein Password eingeben, das mindestens 8 Buchstaben lang ist
|
||||
Proccessing;Weid verarbeitet...
|
||||
Proccessing;Wird verarbeitet...
|
||||
The FirstName field is required.;Das Vorname-Feld ist erforderlich
|
||||
The LastName field is required.;Das Nachname-Feld ist erforderlich
|
||||
The Address field is required.;Das Addresse-Feld ist erforderlich
|
||||
The Address field is required.;Das Address-Feld ist erforderlich
|
||||
The City field is required.;Das Stadt-Feld ist erforderlich
|
||||
The State field is required.;Das Staat-Feld ist erforderlich
|
||||
The Country field is required.;Das Land-Feld ist erforderlich
|
||||
@@ -417,7 +417,7 @@ Disable;Deaktivieren
|
||||
Addons;Add-ons
|
||||
Javascript version;Javascript Version
|
||||
Javascript file;Javascript Datei
|
||||
Select javascript file to execute on start;Javascript Datei zum Starten auswählen
|
||||
Select javascript file to execute on start;Javascript Datei zum starten auswählen
|
||||
Submit;Einreichen
|
||||
Processing;Wird verarbeitet...
|
||||
Go up;Nach oben gehen
|
||||
@@ -433,7 +433,7 @@ Are you sure you want to reset this server?;Möchtest du diesen Server wirklich
|
||||
Are you sure? This cannot be undone;Bist du dir sicher? Dies kann nicht rückgängig gemacht werden
|
||||
Resetting server;Server wird zurückgesetzt...
|
||||
Deleted file;Datei gelöscht
|
||||
Reinstalling server;Server wird neuinstalliert
|
||||
Reinstalling server;Server wird reinstalliert
|
||||
Uploading files;Dateien wurden hochgeladen
|
||||
complete;vollständig
|
||||
Upload complete;Upload komplett
|
||||
@@ -441,7 +441,7 @@ Security;Sicherheit
|
||||
Subscriptions;Abonnements
|
||||
2fa Code;2FA Code
|
||||
Your account is secured with 2fa;Dein Account wird mit 2-FA gesichert
|
||||
anyone write a fancy text here?;hier einen schönen Text schreiben? -Nö.
|
||||
anyone write a fancy text here?;hier einen schönen Text schreiben?
|
||||
Activate 2fa;2-FA Aktivieren
|
||||
2fa apps;2-FA Apps
|
||||
Use an app like ;Benutze eine App wie
|
||||
@@ -462,13 +462,13 @@ Options;Optionen
|
||||
Amount;Betrag
|
||||
Do you really want to delete it?;Möchtes du es wirklich löschen?
|
||||
Loading your subscription;Dein Abonnement wird geladen
|
||||
Searching for deploy node;Suche nach einer verfügbaren Node
|
||||
Searching for deploy node;Suche Node zum Aufsetzen
|
||||
Searching for available images;Nach verfügbaren Images wird gesucht
|
||||
Server details;Server Details
|
||||
Configure your server;Deinen Server konfigurieren
|
||||
Default;Standart
|
||||
Default;Standard
|
||||
You reached the maximum amount of servers for every image of your subscription;Du hast die maximale Anzahl an Images von deinem Abonnement erreicht.
|
||||
Personal information;Persönliche Informationen
|
||||
Personal information;Prsönliche Informationen
|
||||
Enter code;Code eingeben
|
||||
Server rename;Server Umbenennen
|
||||
Create code;Code erstellen
|
||||
@@ -476,17 +476,17 @@ Save subscription;Abonnement speichern
|
||||
Enter your information;Informationen eingeben
|
||||
You need to enter your full name in order to use moonlight;Du musst deinen ganzen Namen eingeben, um Moonlight zu nutzen
|
||||
No node found;Kein Node gefunden
|
||||
No node found to deploy to found;Keine Node für die Bereitstellung gefunden
|
||||
No node found to deploy to found;Keine Node zum Aufsetzen gefunden
|
||||
Node offline;Node offline
|
||||
The node the server is running on is currently offline;Das Node, auf dem der Server grade läuft, ist offline
|
||||
The node the server is running on is currently offline;Die Node, auf dem der Server grat läuft, ist offline
|
||||
Server not found;Server konnte nicht gefunden werden
|
||||
A server with that id cannot be found or you have no access for this server;Ein Server mit dieser ID konnte nicht gefunden werden oder du hast keinen Zugriff auf ihn
|
||||
A server with that id cannot be found or you have no access for this server;Ein Server mit dieser ID konnte nicht gefunden werden
|
||||
Compress;Komprimieren
|
||||
Decompress;De-Komprimieren
|
||||
Moving;Bewegen...
|
||||
Compressing;Komprimieren...
|
||||
selected;Ausgewählt
|
||||
New website;Neue Website
|
||||
New website;Neue Webseite
|
||||
Plesk servers;Plesk Servers
|
||||
Base domain;Base Domain
|
||||
Plesk server;Plesk Server
|
||||
@@ -495,17 +495,17 @@ No SSL certificate found;Keine SSL-Zertifikate gefunden
|
||||
Ftp Host;FTP Host
|
||||
Ftp Port;FTP Port
|
||||
Ftp Username;FTP Username
|
||||
Ftp Password;FTP Passwort
|
||||
Ftp Password;FTP Password
|
||||
Use;Benutzen
|
||||
SSL Certificates;SSL Zertifikate
|
||||
SSL certificates;SSL Zertifikate
|
||||
Issue certificate;SSL-Zertifikat erstellen lassen
|
||||
Issue certificate;SSL-Zertifikat Ausgeben
|
||||
New plesk server;Neuer Plesk Server
|
||||
Api url;API URL
|
||||
Host system offline;Host System Offline
|
||||
The host system the website is running on is currently offline;Das Host System, auf dem diese Website läuft, ist offline
|
||||
The host system the website is running on is currently offline;Das Host System, auf dem diese Webseite läuft, ist offline
|
||||
No SSL certificates found;Keine SSL-Zertifikate gefunden
|
||||
No databases found for this website;Dieser Website konnten keine Datenbanken zugeordnet werden
|
||||
No databases found for this website;Dieser Webseite konnten keine Datenbanken zugeordnet werden
|
||||
The name should be at least 8 characters long;Der Name sollte mindestens 8 Zeichen lang sein
|
||||
The name should only contain of lower case characters and numbers;Der Name sollte nur Kleinbuchstaben und Zahlen enthalten
|
||||
Error from plesk;Error von Plesk
|
||||
@@ -514,7 +514,7 @@ Username;Benutzername
|
||||
SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one;SRV Records können aufgrund von Cloudflare nicht geupdatet werden. Bitte lösche den Record und erstelle einen neuen.
|
||||
The User field is required.;Das Benutzer-Feld ist erforderlich
|
||||
You need to specify a owner;Du musst einen Server-Besitzer angeben
|
||||
You need to specify a image;Du musst ein Image angeben
|
||||
You need to specify a image;You need to specify a image
|
||||
Api Url;API URL
|
||||
Api Key;Api Key
|
||||
Duration;Dauer
|
||||
@@ -539,14 +539,14 @@ The Email field is required.;Das E-Mail-Feld ist erforderlich
|
||||
The Password field is required.;Das Password-Feld ist erforderlich
|
||||
The ConfirmPassword field is required.;Das Password-Bestätigen-Feld ist erforderlich
|
||||
Passwords need to match;Die Passwörter müssen übereinstimmen
|
||||
Cleanup exception;Cleanup Ausnahme
|
||||
Cleanup exception;Cleanup ausnahme
|
||||
No shared domain found;Keine Shared-Domain gefunden
|
||||
Searching for deploy plesk server;Suchen um den Plesk Server aufzusetzen
|
||||
No plesk server found;Kein Plesk Server gefunden
|
||||
No plesk server found to deploy to;Keinen Plesk Server zum Aufsetzen gefunden
|
||||
No node found to deploy to;Kein Node zum Aufsetzen
|
||||
Website details;Website Details
|
||||
Configure your website;Konfiguriere deine Website
|
||||
Website details;Details der Webseite
|
||||
Configure your website;Konfiguriere deine Webseite
|
||||
The name cannot be longer that 32 characters;Der Name kann nicht länger als 32 Zeichen sein
|
||||
The name should only consist of lower case characters;Der Name sollte nur aus Kleinbuchstaben bestehen
|
||||
News;Neuigkeiten
|
||||
@@ -558,10 +558,10 @@ Delete post;Post löschen
|
||||
Do you really want to delete the post ";Post löschen? "
|
||||
You have no domains;Du hast keine Domains
|
||||
We were not able to find any domains associated with your account;Wir haben keine Domains, die mit deinem Account verbunden sind, gefunden
|
||||
You have no websites;Du hast keine Websites
|
||||
We were not able to find any websites associated with your account;Wir haben keine Websiten, die mit deinem Account verbunden sind, gefunden
|
||||
You have no websites;Du hast keine Webseites
|
||||
We were not able to find any websites associated with your account;Wir haben keine Webseiten, die mit deinem Account verbunden sind, gefunden
|
||||
Guest;Gast
|
||||
You need a domain;Du brauchst eine Domain
|
||||
You need a domain;Du brauchts eine Domain
|
||||
New post;Neuer Post
|
||||
New entry;Neuer Eintrag
|
||||
You have no servers;Du hast keine Server
|
||||
@@ -572,22 +572,22 @@ Error from daemon;Fehler vom Daemon
|
||||
End;Ende
|
||||
Cloud panel;Cloud Panel
|
||||
Cloud panels;Cloud Panels
|
||||
New cloud panel;Neues Cloud Panel
|
||||
New cloud panel;Neues cloud Panel
|
||||
You need to enter an api key;Du musst einen API-Key eigeben
|
||||
Webspaces;Webspaces
|
||||
New webspace;Neuer Webspace
|
||||
The uploaded file should not be bigger than 100MB;Die Datei sollte nicht größer als 100MB sein
|
||||
An unknown error occured while uploading a file;Ein unbekannter Fehler ist während dem Datei Upload aufgetreten
|
||||
The uploaded file should not be bigger than 100MB;DIe Datei sollte nicht größer als 100MB sein
|
||||
An unknown error occured while uploading a file;Ein unbekannter Fehler ist während dem Datei-Hochladen aufgetreten
|
||||
No databases found for this webspace;Keine Datenbanken für diesen Webspace gefunden
|
||||
Sftp;SFTP
|
||||
Sftp Host;SFTP Host
|
||||
Sftp Port;SFTP Port
|
||||
Sftp Username;SFTP Benutzername
|
||||
Sftp Password;SFTP Password
|
||||
Sftp Host;Sftp Host
|
||||
Sftp Port;Sftp Port
|
||||
Sftp Username;Sftp Benutzername
|
||||
Sftp Password;Sftp Password
|
||||
Lets Encrypt certificate successfully issued;Lets Encrypt Zertifikat erfolgreich erstellt
|
||||
Add shared domain;Shared Domain Hinzufügen
|
||||
Webspace;Webspace
|
||||
You reached the maximum amount of websites in your subscription;Du hast das Maximum an Websiten in deinem Abonnement erreicht
|
||||
You reached the maximum amount of websites in your subscription;Du hast das Maximum an Webseiten in deinem Abonnement erreicht
|
||||
Searching for deploy web host;Suchen um den Webhost aufzusetzen
|
||||
Webspace details;Webspace Details
|
||||
Web host;Web host
|
||||
@@ -607,8 +607,8 @@ We paused your connection because of inactivity. The resume just focus the tab a
|
||||
Failed to reconnect to the moonlight servers;Die Wiederverbindung zu den Moonlight-Servern ist gescheitert
|
||||
We were unable to reconnect to moonlight. Please refresh the page;Verbindung zu Moonlight fehlgeschlagen. Bitte aktualisiere die Seite
|
||||
Failed to reconnect to the moonlight servers. The connection has been rejected;Die Wiederverbindung zu den Moonlight-Servern ist fehlgeschlagen. Die Verbindung wurde abgelehnt
|
||||
We were unable to reconnect to moonlight. Most of the time this is caused by an update of moonlight. Please refresh the page;Verbindung zu Moonlight fehlgeschlagen. Meistens wird dies durch eine Aktualisierung von Moonlight verursacht. Bitte aktualisiere die Seite
|
||||
Verifying token, loading user data;Token verifizieren, lade Benutzerdaten
|
||||
We were unable to reconnect to moonlight. Most of the time this is caused by an update of moonlight. Please refresh the page;Verbindung zu Moonlight fehlgeschlagen. Meistens wird dies durch eine Aktualisierung von Moonlight verursacht. Bitte aktualisieren Sie die Seite
|
||||
Verifying token, loading user data;Token verifizieren, Benutzer-Daten laden
|
||||
Reload config;Konfiguration neu laden
|
||||
Successfully reloading configuration;Konfiguration wird neu geladen...
|
||||
Successfully reloaded configuration;Die Konfiguration wurde erfolgreich neu geladen
|
||||
@@ -627,10 +627,152 @@ Fabric loader version;Fabric Loader Version
|
||||
Rate;Rate
|
||||
Hey, can i borrow you for a second?;Hey, kann ich dich mal kurz ausleihen?
|
||||
We want to improve our services and get a little bit of feedback how we are currently doing. Please leave us a rating;Da wir unsere Dienste ständig verbessern, möchten wir dich um Feedback bitten. Bitte Bewerte uns:
|
||||
Thanks for your rating;Danke für deine Bewertung
|
||||
Thanks for your rating;Danke für deine Bewertun
|
||||
It would be really kind of you rating us on a external platform as it will help our project very much;Es wäre wirklich nett, wenn du uns auf einer externen Plattform bewerten würdest, denn das würde unserem Projekt sehr helfen
|
||||
Close;Schließen
|
||||
Rating saved;Bewertung gespeichert
|
||||
Rating saved;Bewretung gespeichert
|
||||
Group;Gruppe
|
||||
Beta;Beta
|
||||
Create a new group;Eine neue Gruppe erstellen
|
||||
Download WinSCP;WinSCP herunterladen
|
||||
Show connection details;Verbindungsdetails anzeigen
|
||||
New;Neu
|
||||
New file;Neue Datei
|
||||
Connection details;Verbindungsdetails
|
||||
Malware;Malware
|
||||
Create a new file;Eine neue Datei erstellen
|
||||
Edit layout;Layout anpassen
|
||||
Uptime;Laufzeit
|
||||
Moonlight is online since;Moonlight ist online seit
|
||||
User;Benutzer
|
||||
Databases;Datenbanken
|
||||
Sitzungen;Sitzungen
|
||||
Active users;Aktive Nutzer
|
||||
Search for plugins;Nach Plugins suchen
|
||||
Search;Suchen
|
||||
Searching;Wird gesucht...
|
||||
Successfully installed gunshell;Gunshell wurde erfolgreich installiert
|
||||
Successfully installed fastasyncworldedit;Fastasyncworldedit wurde erfolgreich installiert
|
||||
Successfully installed minimotd;Minimotd wurde erfolgreich installiert
|
||||
Moonlight health;Moonlight Status
|
||||
Healthy;Healthy
|
||||
Successfully saved file;Die Datei wurde erfolgreich gespeichert
|
||||
Unsorted servers;Unsortierte Server
|
||||
Enter a new name;Einen neuen Namen eingeben
|
||||
Sign in with;Anmelden mit
|
||||
Make your services accessible through your own domain;Mache deine Dienste mit einer Domain verfügbar
|
||||
New group;Neue Gruppe
|
||||
Finish editing layout;Layout Fertigstellen
|
||||
Remove group;Gruppe löschen
|
||||
Hidden in edit mode;Im Edit-Mode ausgeblendet
|
||||
Enter your 2fa code here;Deinen 2FA Code hier eingeben
|
||||
Two factor authentication;Zwei Faktor Authentifikation
|
||||
Preferences;Preferenzen
|
||||
Streamer mode;Streamer Modus
|
||||
Scan the QR code and enter the code generated by the app you have scanned it in;Scanne den QR-Code mit der App
|
||||
Start scan;Scan Starten
|
||||
Results;Ergebnisse
|
||||
Scan in progress;Wird gescannt
|
||||
Debug;Debug
|
||||
Save changes;Änderungen speichern
|
||||
Delete domain;Domain löschen
|
||||
Python version;Python Version
|
||||
Python file;Python Datei
|
||||
Select python file to execute on start;Wähle die Python Datei aus, die beim Start ausgeführt wird
|
||||
You have no webspaces;Du hast keine Webspaces
|
||||
We were not able to find any webspaces associated with your account;Wir haben keine Webspaces gefunden, die mit deinem Account verbunden sind
|
||||
Backup download successfully started;Der Backup-Download wurde erfolgreich gestartet
|
||||
Error from cloud panel;Fehler vom Cloud Panel
|
||||
Error from wings;Fehler von Wings
|
||||
Remove link;Link entfernen
|
||||
Your account is linked to a discord account;Dein Account ist mit einem Discord Account verbunden
|
||||
You are able to use features like the discord bot of moonlight;Du kannst Features wie den Discord Bot von Moonlight benutzen
|
||||
The password should be at least 8 characters long;Dein Password sollte mindestens 8 Zeichen lang sein
|
||||
The name should only consist of lower case characters or numbers;Der Name sollte nur aus Kleinbuchstaben und Nummern bestehen
|
||||
The requested resource was not found;Die gewünschte Ressource wurde nicht gefunden
|
||||
We were not able to find the requested resource. This can have following reasons;Wir haben die gewünschte Ressource nicht gefunden. Das kann folgenden Grund haben
|
||||
The resource was deleted;Die Ressource wurde gelöscht
|
||||
You have to permission to access this resource;Du hast keine Rechte um auf diese Ressource zuzugreifen
|
||||
You may have entered invalid data;Du hast ungültige Daten angegeben
|
||||
A unknown bug occured;Ein unbekannter Bug ist aufgetreten
|
||||
An api was down and not proper handled;Eine API war offline und wurde nicht richtig behandelt
|
||||
A database with this name does already exist;Es gibt bereits eine Datenbank mit diesem Namen
|
||||
Successfully installed quickshop-hikari;Quickshop-Hikari wurde erfolgreich installiert
|
||||
You need to enter a valid domain;Du musst eine gültige Domain angeben
|
||||
2fa code;2FA Code
|
||||
This feature is not available for;Dieses Feature ist nicht verfügbar für
|
||||
Your account is currently not linked to discord;Dein Account ist nicht mit Discord verbunden
|
||||
To use features like the discord bot, link your moonlight account with your discord account;Um Features wie Moonlights Discord Bot nutzen zu können, verbinde deinen Account mit Discord
|
||||
Link account;Account verbinden
|
||||
Continue;Weiter
|
||||
Preparing;Wird vorbereitet
|
||||
Make sure you have installed one of the following apps on your smartphone and press continue;Stelle sicher dass du eine der folgenden Apps auf deinem Smartphone installiert hast und drücke auf Weiter
|
||||
The max lenght for the name is 32 characters;Die maximale Länge für den Namen beträgt 32 Zeichen
|
||||
Successfully installed chunky;Chunky wurde erfolgreich installiert
|
||||
Successfully installed huskhomes;Huskhomes wurde erfolgreich installiert
|
||||
Successfully installed simply-farming;Simple-Farming wurde erfolgreich installiert
|
||||
You need to specify a first name;Du musst einen Vornamen eingeben
|
||||
You need to specify a last name;Du musst einen Nachnamen angeben
|
||||
You need to specify a password;Du musst ein Password angeben
|
||||
Please solve the captcha;Bitte löse das Captcha
|
||||
The email is already in use;Diese Email wird bereits verwendet
|
||||
The dns records of your webspace do not point to the host system;Die DNS Records deines Webspaces zeigen nicht zum Hostsystem
|
||||
Scan complete;Scan komplett
|
||||
Currently scanning:;Zurzeit wird gescannt:
|
||||
Successfully installed dynmap;Dynmap wurde erfolgreich installiert
|
||||
Successfully installed squaremap;Squaremap wurde erfolgreich installiert
|
||||
No web host found;Kein Webhost gefunden
|
||||
No web host found to deploy to;Es wurde kein Webhost zum Aufsetzen gefunden
|
||||
Successfully installed sleeper;Sleeper wurde erfolgreich installiert
|
||||
You need to enter a domain;Du musst eine Domain angeben
|
||||
Enter a ip;Eine IP angeben
|
||||
Ip Bans;Ip Bans
|
||||
Ip;Ip
|
||||
Successfully installed simple-voice-chat;Simple-Voice-Chat wurde erfolgreich installiert
|
||||
Successfully installed smithing-table-fix;Smithing-Table-Fix wurde erfolgreich installiert
|
||||
Successfully installed justplayer-tpa;Justplayer-TPA wurde erfolgreich installiert
|
||||
Successfully installed ishop;iShop wurde erfolgreich installiert
|
||||
Successfully installed lifestealre;Lifestealre wurde erfolgreich installiert
|
||||
Successfully installed lifeswap;Lifeswap wurde erfolgreich installiert
|
||||
Java version;Java Version
|
||||
Jar file;JAR Datei
|
||||
Select jar to execute on start;Eine JAR Datei auswählen, die beim Start ausgeführt wird
|
||||
A website with this domain does already exist;Eine Webseite mit dieser Domain existiert bereits
|
||||
Successfully installed discordsrv;DiscordSrv wurde erfolgreich installiert
|
||||
Reinstall;Reinstallieren
|
||||
Reinstalling;Wird Reinstalliert
|
||||
Successfully installed freedomchat;Freedomchat wurde erfolgreich installiert
|
||||
Leave empty for the default background image;Für das Standard Hintergrundbild freilassen
|
||||
Background image url;URL zum Hintergrundbild
|
||||
of CPU used;von der CPU wird benutzt
|
||||
memory used;Speicher benutzt
|
||||
163;163
|
||||
172;172
|
||||
Sentry;Sentry
|
||||
Sentry is enabled;Sentry ist eingeschaltet
|
||||
Successfully installed mobis-homes;Mobis-Homes wurde erfolgreich installiert
|
||||
Your moonlight account is disabled;Dein Moonlight Account ist deaktiviert
|
||||
Your moonlight account is currently disabled. But dont worry your data is still saved;Dein Moonlight Account ist deaktiviert, aber keine Sorge, deine Daten sind noch gespeichert
|
||||
You need to specify a email address;Du musst eine Email Adresse angeben
|
||||
A user with that email does already exist;Ein Nutzer mit dieser Email Adresse existiert bereits
|
||||
Successfully installed buildmode;Buildmode wurde erfolgreich installiert
|
||||
Successfully installed plasmo-voice;Plasmo-Voice wurde erfolgreich installiert
|
||||
157;157
|
||||
174;174
|
||||
158;158
|
||||
Webspace not found;Webspace nicht gefunden
|
||||
A webspace with that id cannot be found or you have no access for this webspace;Ein Webspace mit dieser ID wurde nicht gefunden, oder du hast keinen Zugriff auf diesen Webspace
|
||||
No plugin download for your minecraft version found;Kein Plugin für deine Minecraft-Version gefunden
|
||||
Successfully installed gamemode-alias;Gamemode-Alias wurde erfolgreich installiert
|
||||
228;228
|
||||
User;Nutzer
|
||||
Send notification;Benachrichtigung senden
|
||||
Successfully saved changes;Änderungen erfolgreich gespeichert
|
||||
Archiving;Wird Archiviert
|
||||
Server is currently not archived;Dieser Server ist zurzeit nicht Archiviert
|
||||
Add allocation;Zuweisung hinzufügen
|
||||
231;231
|
||||
175;175
|
||||
Dotnet version;Dotnet Version
|
||||
Dll file;DLL Datei
|
||||
Select dll to execute on start;Wähle die DLL Datei aus, die beim Start ausgeführt wird
|
||||
|
||||
778
Moonlight/defaultstorage/resources/lang/ro_ro.lang
Normal file
778
Moonlight/defaultstorage/resources/lang/ro_ro.lang
Normal file
@@ -0,0 +1,778 @@
|
||||
Open support;Suport deschis
|
||||
About us;Despre noi
|
||||
Imprint;Impresum
|
||||
Privacy;Confidențialitate
|
||||
Login;Autentificare
|
||||
Register;Înregistrare
|
||||
Insert brand name...;Introduceți numele mărcii...
|
||||
Save and continue;Salvați și continuați
|
||||
Saving;Se salvează
|
||||
Configure basics;Configurare elemente de bază
|
||||
Brand name;Numele mărcii
|
||||
test;test
|
||||
Insert first name...;Introduceți prenumele...
|
||||
Insert last name...;Introduceți numele de familie...
|
||||
Insert email address...;Introduceți adresa de email...
|
||||
Add;Adăugați
|
||||
Adding...;Se adaugă...
|
||||
Add admin accounts;Adăugați conturi de administrator
|
||||
First name;Prenume
|
||||
Last name;Nume de familie
|
||||
Email address;Adresă de email
|
||||
Enter password;Introduceți parola
|
||||
Next;Următorul
|
||||
Back;Înapoi
|
||||
Configure features;Configurați funcționalitățile
|
||||
Support chat;Asistență prin chat
|
||||
Finish;Finalizare
|
||||
Finalize installation;Finalizați instalarea
|
||||
Moonlight basic settings successfully configured;Setările de bază Moonlight au fost configurate cu succes
|
||||
Ooops. This page is crashed;Hopa. Această pagină s-a blocat.
|
||||
This page is crashed. The error has been reported to the moonlight team. Meanwhile you can try reloading the page;Această pagină s-a blocat. Eroarea a fost raportată echipei Moonlight. Între timp, puteți încerca să reîncărcați pagina
|
||||
Setup complete;Configurare completă
|
||||
It looks like this moonlight instance is ready to go;Se pare că această instanță Moonlight este gata de utilizare
|
||||
User successfully created;Utilizator creat cu succes
|
||||
Ooops. Your moonlight client is crashed;Hopa. Clientul tău Moonlight s-a blocat.
|
||||
This error has been reported to the moonlight team;Această eroare a fost raportată echipei Moonlight
|
||||
Sign In;Autentificare
|
||||
Sign in to start with moonlight;Autentificați-vă pentru a începe cu Moonlight
|
||||
Sign in with Discord;Autentificare cu Discord
|
||||
Or with email;Sau cu email
|
||||
Forgot password?;Ați uitat parola?
|
||||
Sign-in;Autentificare
|
||||
Not registered yet?;Încă nu sunteți înregistrat?
|
||||
Sign up;Înregistrare
|
||||
Authenticating;Se autentifică...
|
||||
Sign in with Google;Autentificare cu Google
|
||||
Working;Se lucrează...
|
||||
Error;Eroare
|
||||
Email and password combination not found;Combinarea de email și parolă nu a fost găsită
|
||||
Email;Email
|
||||
Password;Parolă
|
||||
Account settings;Setări cont
|
||||
Logout;Deconectare
|
||||
Dashboard;Panou de control
|
||||
Order;Comandă
|
||||
Website;Website
|
||||
Database;Bază de date
|
||||
Domain;Domeniu
|
||||
Servers;Servere
|
||||
Websites;Site-uri web
|
||||
Databases;Baze de date
|
||||
Domains;Domenii
|
||||
Changelog;Jurnal de modificări
|
||||
Firstname;Prenume
|
||||
Lastname;Nume de familie
|
||||
Repeat password;Repetă parola
|
||||
Sign Up;Înregistrare
|
||||
Sign up to start with moonlight;Înregistrați-vă pentru a începe cu Moonlight
|
||||
Sign up with Discord;Înregistrare cu Discord
|
||||
Sign up with Google;Înregistrare cu Google
|
||||
Sign-up;Înregistrare
|
||||
Already registered?;Deja înregistrat?
|
||||
Sign in;Autentificare
|
||||
Create something new;Creați ceva nou
|
||||
Create a gameserver;Creați un server de jocuri
|
||||
A new gameserver in just a few minutes;Un server de jocuri nou în doar câteva minute
|
||||
Create a database;Creați o bază de date
|
||||
A quick way to store your data and manage it from all around the world;O modalitate rapidă de a stoca datele și de a le gestiona din întreaga lume
|
||||
Manage your services;Gestionați serviciile dumneavoastră
|
||||
Manage your gameservers;Gestionați serverele dumneavoastră de jocuri
|
||||
Adjust your gameservers;Reglați serverele dumneavoastră de jocuri
|
||||
Manage your databases;Gestionați bazele de date
|
||||
Insert, delete and update the data in your databases;Introduceți, ștergeți și actualizați datele din bazele de date
|
||||
Create a website;Creați un site web
|
||||
Make your own websites with a webspace;Creați propriile site-uri web cu un spațiu web
|
||||
Create a domain;Creați un domeniu
|
||||
Make your services accessible through your own domain;Faceți serviciile dumneavoastră accesibile prin propriul domeniu
|
||||
Manage your websites;Gestionați site-urile web
|
||||
Modify the content of your websites;Modificați conținutul site-urilor dumneavoastră
|
||||
Manage your domains;Gestionați domeniile dumneavoastră
|
||||
Add, edit, and delete DNS records;Adăugați, editați și ștergeți înregistrări DNS
|
||||
Admin;Administrator
|
||||
System;Sistem
|
||||
Overview;Prezentare generală
|
||||
Manager;Manager
|
||||
Cleanup;Curățare
|
||||
Nodes;Noduri
|
||||
Images;Imagini
|
||||
aaPanel;aaPanel
|
||||
Users;Utilizatori
|
||||
Support;Asistență
|
||||
Statistics;Statistici
|
||||
No nodes found. Start with adding a new node;Nu s-au găsit noduri. Începeți prin adăugarea unui nod nou
|
||||
Nodename;Nume nod
|
||||
FQDN;Nume complet de domeniu (FQDN)
|
||||
Create;Creare
|
||||
Creating;Se creează...
|
||||
Http port;Port HTTP
|
||||
Sftp port;Port SFTP
|
||||
Moonlight daemon port;Port daemon Moonlight
|
||||
SSL;SSL
|
||||
CPU Usage;Utilizare CPU
|
||||
In %;În %
|
||||
Memory;Memorie
|
||||
Used / Available memory;Memorie utilizată / Memorie disponibilă
|
||||
Storage;Stocare
|
||||
Available storage;Stocare disponibilă
|
||||
Add a new node;Adăugați un nod nou
|
||||
Delete;Ștergere
|
||||
Deleting;Se șterge...
|
||||
Edit;Editare
|
||||
Token Id;ID token
|
||||
Token;Token
|
||||
Save;Salvare
|
||||
Setup;Configurare
|
||||
Open a ssh connection to your node and enter;Deschideți o conexiune SSH la nodul dvs. și introduceți
|
||||
and paste the config below. Then press STRG+O and STRG+X to save;și lipiți configurația de mai jos. Apoi apăsați STRG+O și STRG+X pentru a salva
|
||||
Before configuring this node, install the daemon;Înainte de a configura acest nod, instalați daemonul
|
||||
Delete this node?;Doriți să ștergeți acest nod?
|
||||
Do you really want to delete this node;Doriți cu adevărat să ștergeți acest nod?
|
||||
Yes;Da
|
||||
No;Nu
|
||||
Status;Stare
|
||||
Adding;Se adaugă
|
||||
Port;Port
|
||||
Id;ID
|
||||
Manage;Administrare
|
||||
Create new server;Creați un server nou
|
||||
No servers found;Niciun server găsit
|
||||
Server name;Nume server
|
||||
Cpu cores;Nuclee CPU
|
||||
Disk;Disc
|
||||
Image;Imagine
|
||||
Override startup;Suprascrie pornirea
|
||||
Docker image;Imagine Docker
|
||||
CPU Cores (100% = 1 Core);Nuclee CPU (100% = 1 nucleu)
|
||||
Server successfully created;Server creat cu succes
|
||||
Name;Nume
|
||||
Cores;Nuclee
|
||||
Owner;Proprietar
|
||||
Value;Valoare
|
||||
An unknown error occurred;A apărut o eroare necunoscută
|
||||
No allocation found;Nicio alocare găsită
|
||||
Identifier;Identificator
|
||||
UuidIdentifier;UuidIdentifier
|
||||
Override startup command;Suprascrieți comanda de pornire
|
||||
Loading;Se încarcă...
|
||||
Offline;Deconectat
|
||||
Connecting;Conectare...
|
||||
Start;Pornire
|
||||
Restart;Repornire
|
||||
Stop;Oprire
|
||||
Shared IP;IP partajată
|
||||
Server ID;ID server
|
||||
Cpu;CPU
|
||||
Console;Consolă
|
||||
Files;Fișiere
|
||||
Backups;Copii de siguranță
|
||||
Network;Rețea
|
||||
Plugins;Plugin-uri
|
||||
Settings;Setări
|
||||
Enter command;Introduceți comanda
|
||||
Execute;Executare
|
||||
Checking disk space;Verificare spațiu pe disc
|
||||
Updating config files;Actualizare fișiere de configurație
|
||||
Checking file permissions;Verificare permisiuni de fișiere
|
||||
Downloading server image;Se descarcă imaginea serverului
|
||||
Downloaded server image;Imaginea serverului a fost descărcată
|
||||
Starting;Începere
|
||||
Online;Conectat
|
||||
Kill;Oprit forțat
|
||||
Stopping;Se oprește
|
||||
Search files and folders;Căutare fișiere și foldere
|
||||
Launch WinSCP;Lansați WinSCP
|
||||
New folder;Folder nou
|
||||
Upload;Încărcare
|
||||
File name;Nume fișier
|
||||
File size;Mărime fișier
|
||||
Last modified;Ultima modificare
|
||||
Cancel;Anulare
|
||||
Canceling;Se anulează
|
||||
Running;În execuție
|
||||
Loading backups;Se încarcă copiile de siguranță
|
||||
Started backup creation;Crearea copiei de siguranță a început
|
||||
Backup is going to be created;Se va crea o copie de siguranță
|
||||
Rename;Redenumire
|
||||
Move;Mutare
|
||||
Archive;Arhivare
|
||||
Unarchive;Dezarhivare
|
||||
Download;Descărcare
|
||||
Starting download;Începerea descărcării
|
||||
Backup successfully created;Copie de siguranță creată cu succes
|
||||
Restore;Restaurare
|
||||
Copy url;Copiere URL
|
||||
Backup deletion started;Se începe ștergerea copiei de siguranță
|
||||
Backup successfully deleted;Copie de siguranță ștearsă cu succes
|
||||
Primary;Primar
|
||||
This feature is currently not available;Această funcționalitate nu este disponibilă în prezent
|
||||
Send;Trimite
|
||||
Sending;Se trimite
|
||||
Welcome to the support chat. Ask your question here and we will help you;Bine ați venit la chatul de asistență. Puneți-vă întrebarea aici și vă vom ajuta
|
||||
minutes ago;minute în urmă
|
||||
just now;chiar acum
|
||||
less than a minute ago;mai puțin de o minută în urmă
|
||||
1 hour ago;acum 1 oră
|
||||
1 minute ago;acum 1 minut
|
||||
Failed;Eșuat
|
||||
hours ago;ore în urmă
|
||||
Open tickets;Deschideți tichete
|
||||
Actions;Acțiuni
|
||||
No support ticket is currently open;Nu există momentan niciun tichet de asistență deschis
|
||||
User information;Informații utilizator
|
||||
Close ticket;Închideți tichetul
|
||||
Closing;Se închide
|
||||
The support team has been notified. Please be patient;Echipa de suport a fost notificată. Vă rugăm să aveți răbdare
|
||||
The ticket is now closed. Type a message to open it again;Tichetul este acum închis. Tastați un mesaj pentru a-l deschide din nou
|
||||
1 day ago;acum 1 zi
|
||||
is typing;scrie...
|
||||
are typing;scriu...
|
||||
No domains available;Niciun domeniu disponibil
|
||||
Shared domains;Domenii partajate
|
||||
Shared domain;Domeniu partajat
|
||||
Shared domain successfully deleted;Domeniu partajat șters cu succes
|
||||
Shared domain successfully added;Domeniu partajat adăugat cu succes
|
||||
Domain name;Nume de domeniu
|
||||
DNS records for;Înregistrări DNS pentru
|
||||
Fetching dns records;Se preiau înregistrările DNS
|
||||
No dns records found;Nicio înregistrare DNS găsită
|
||||
Content;Conținut
|
||||
Priority;Prioritate
|
||||
Ttl;TTL (Timp de Viață)
|
||||
Enable cloudflare proxy;Activați proxy Cloudflare
|
||||
CF Proxy;Proxy CF
|
||||
days ago;zile în urmă
|
||||
Cancel;Anulare
|
||||
An unexpected error occurred;A apărut o eroare neașteptată
|
||||
Testy;Testy
|
||||
Error from cloudflare api;Eroare de la API Cloudflare
|
||||
Profile;Profil
|
||||
No subscription available;Nicio abonare disponibilă
|
||||
Buy;Cumpără
|
||||
Redirecting;Redirecționare
|
||||
Apply;Aplică
|
||||
Applying code;Se aplică codul
|
||||
Invalid subscription code;Cod de abonament invalid
|
||||
Cancel Subscription;Anulează abonamentul
|
||||
Active until;Activ până la
|
||||
We will send you a notification upon subscription expiration;Vă vom trimite o notificare la expirarea abonamentului
|
||||
This token has been already used;Acest token a fost deja utilizat
|
||||
New login for;Autentificare nouă pentru
|
||||
No records found for this day;Nu s-au găsit înregistrări pentru această zi
|
||||
Change;Schimbă
|
||||
Changing;Se schimbă
|
||||
Minecraft version;Versiune Minecraft
|
||||
Build version;Versiune build
|
||||
Server installation is currently running;Instalarea serverului este în desfășurare în prezent
|
||||
Selected;Selectat
|
||||
Move deleted;Mutarea ștergerii
|
||||
Delete selected;Ștergeți selecția
|
||||
Log level;Nivelul de jurnal
|
||||
Log message;Mesaj de jurnal
|
||||
Time;Timp
|
||||
Version;Versiune
|
||||
You are running moonlight version;Rulați versiunea Moonlight
|
||||
Operating system;Sistem de operare
|
||||
Moonlight is running on;Moonlight rulează pe
|
||||
Memory usage;Utilizare memorie
|
||||
Moonlight is using;Moonlight folosește
|
||||
of memory;din memorie
|
||||
Cpu usage;Utilizare CPU
|
||||
Refresh;Reîmprospătează
|
||||
Send a message to all users;Trimiteți un mesaj tuturor utilizatorilor
|
||||
IP;IP
|
||||
URL;URL
|
||||
Device;Dispozitiv
|
||||
Change url;Schimbați URL-ul
|
||||
Message;Mesaj
|
||||
Enter message;Introduceți mesajul
|
||||
Enter the message to send;Introduceți mesajul de trimis
|
||||
Confirm;Confirmă
|
||||
Are you sure?;Sunteți sigur?
|
||||
Enter url;Introduceți URL-ul
|
||||
An unknown error occured while starting backup deletion;A apărut o eroare necunoscută în timpul începerii ștergerii backup-ului
|
||||
Success;Succes
|
||||
Backup URL successfully copied to your clipboard;URL-ul de backup a fost copiat cu succes în clipboard
|
||||
Backup restore started;Restaurarea backup-ului a început
|
||||
Backup successfully restored;Backup-ul a fost restaurat cu succes
|
||||
Register for;Înregistrare pentru
|
||||
Core;Nucleu
|
||||
Logs;Jurnale
|
||||
AuditLog;Jurnal de audit
|
||||
SecurityLog;Jurnal de securitate
|
||||
ErrorLog;Jurnal de eroare
|
||||
Resources;Resurse
|
||||
WinSCP cannot be launched here;WinSCP nu poate fi lansat aici
|
||||
Create a new folder;Creați un folder nou
|
||||
Enter a name;Introduceți un nume
|
||||
File upload complete;Încărcarea fișierului a fost finalizată
|
||||
New server;Server nou
|
||||
Sessions;Sesiuni
|
||||
New user;Utilizator nou
|
||||
Created at;Creat la
|
||||
Mail template not found;Șablonul de e-mail nu a fost găsit
|
||||
Missing admin permissions. This attempt has been logged ;Lipsesc permisiunile de administrator. Acest încercare a fost înregistrată
|
||||
Address;Adresă
|
||||
City;Oraș
|
||||
State;Stat
|
||||
Country;Țară
|
||||
Totp;Totp
|
||||
Discord;Discord
|
||||
Subscription;Abonament
|
||||
None;Niciunul
|
||||
No user with this id found;Niciun utilizator cu această ID găsit
|
||||
Back to list;Înapoi la listă
|
||||
New domain;Domeniu nou
|
||||
Reset password;Resetare parolă
|
||||
Password reset;Resetare parolă
|
||||
Reset the password of your account;Resetați parola contului dvs.
|
||||
Wrong here?;Greșit aici?
|
||||
A user with this email can not be found;Un utilizator cu această adresă de e-mail nu poate fi găsit
|
||||
Password reset successfull. Check your mail;Resetarea parolei a fost efectuată cu succes. Verificați-vă poșta
|
||||
Discord bot;Bot Discord
|
||||
New image;Imagine nouă
|
||||
Description;Descriere
|
||||
Uuid;UUID
|
||||
Enter tag name;Introduceți numele etichetei
|
||||
Remove;Eliminați
|
||||
No tags found;Nu s-au găsit etichete
|
||||
Enter docker image name;Introduceți numele imaginii Docker
|
||||
Tags;Etichete
|
||||
Docker images;Imagini Docker
|
||||
Default image;Imagine implicită
|
||||
Startup command;Comandă de pornire
|
||||
Install container;Instalați containerul
|
||||
Install entry;Intrare de instalare
|
||||
Configuration files;Fișiere de configurare
|
||||
Startup detection;Detectare de pornire
|
||||
Stop command;Comandă de oprire
|
||||
Successfully saved image;Imaginea a fost salvată cu succes
|
||||
No docker images found;Nu s-au găsit imagini Docker
|
||||
Key;Cheie
|
||||
Default value;Valoare implicită
|
||||
Allocations;Alocări
|
||||
No variables found;Nu s-au găsit variabile
|
||||
Successfully added image;Imaginea a fost adăugată cu succes
|
||||
Password change for;Schimbarea parolei pentru
|
||||
of;al
|
||||
New node;Nod nou
|
||||
Fqdn;Nume de domeniu complet
|
||||
Cores used;Nuclee utilizate
|
||||
used;folosite
|
||||
5.15.90.1-microsoft-standard-WSL2 - amd64;5.15.90.1-microsoft-standard-WSL2 - amd64
|
||||
Host system information;Informații despre sistemul gazdă
|
||||
0;0
|
||||
Docker containers running;Containere Docker în execuție
|
||||
details;Detalii
|
||||
1;1
|
||||
2;2
|
||||
DDos;DDoS
|
||||
No ddos attacks found;Nu s-au găsit atacuri DDoS
|
||||
Node;Nod
|
||||
Date;Dată
|
||||
DDos attack started;Atac DDoS început
|
||||
packets;pachete
|
||||
DDos attack stopped;Atac DDoS oprit
|
||||
packets; pachete
|
||||
Stop all;Oprește totul
|
||||
Kill all;Omoară totul
|
||||
Network in;Rețea intrare
|
||||
Network out;Rețea ieșire
|
||||
Kill all servers;Omoară toate serverele
|
||||
Do you really want to kill all running servers?;Doriți cu adevărat să opriți toate serverele care rulează?
|
||||
Change power state for;Schimbați starea de alimentare pentru
|
||||
to;la
|
||||
Stop all servers;Oprește toate serverele
|
||||
Do you really want to stop all running servers?;Doriți cu adevărat să opriți toate serverele care rulează?
|
||||
Manage ;Gestionează
|
||||
Manage user ;Gestionează utilizatorul
|
||||
Reloading;Se reîncarcă...
|
||||
Update;Actualizare
|
||||
Updating;Se actualizează
|
||||
Successfully updated user;Utilizator actualizat cu succes
|
||||
Discord id;ID Discord
|
||||
Discord username;Nume de utilizator Discord
|
||||
Discord discriminator;Discord Discriminator
|
||||
The Name field is required.;Câmpul Nume este obligatoriu.
|
||||
An error occured while logging you in;A apărut o eroare în timpul autentificării
|
||||
You need to enter an email address;Trebuie să introduceți o adresă de email
|
||||
You need to enter a password;Trebuie să introduceți o parolă
|
||||
You need to enter a password with minimum 8 characters in lenght;Trebuie să introduceți o parolă cu minim 8 caractere în lungime
|
||||
Proccessing;Se procesează...
|
||||
The FirstName field is required.;Câmpul Prenume este obligatoriu.
|
||||
The LastName field is required.;Câmpul Nume este obligatoriu.
|
||||
The Address field is required.;Câmpul Adresă este obligatoriu.
|
||||
The City field is required.;Câmpul Oraș este obligatoriu.
|
||||
The State field is required.;Câmpul Stat este obligatoriu.
|
||||
The Country field is required.;Câmpul Țară este obligatoriu.
|
||||
Street and house number requered;Strada și numărul casei sunt necesare.
|
||||
Max lenght reached;A fost atinsă lungimea maximă
|
||||
Server;Server
|
||||
stopped;oprit
|
||||
Cleanups;Curățări
|
||||
executed;executat
|
||||
Used clanup;Curățare folosită
|
||||
Enable;Activare
|
||||
Disable;Dezactivare
|
||||
Addons;Add-on-uri
|
||||
Javascript version;Versiune JavaScript
|
||||
Javascript file;Fișier JavaScript
|
||||
Select javascript file to execute on start;Selectați fișierul JavaScript pentru a fi executat la pornire
|
||||
Submit;Trimite
|
||||
Processing;Se procesează...
|
||||
Go up;Urcați în sus
|
||||
Running cleanup;Curățarea în curs de rulare
|
||||
servers;servere
|
||||
Select folder to move the file(s) to;Selectați folderul în care să mutați fișierele
|
||||
Paper version;Versiune tipărită
|
||||
Join2Start;Join2Start
|
||||
Server reset;Resetare server
|
||||
Reset;Resetare
|
||||
Resetting;Se resetează...
|
||||
Are you sure you want to reset this server?;Sigur doriți să resetați acest server?
|
||||
Are you sure? This cannot be undone;Sunteți sigur? Aceasta nu poate fi anulată
|
||||
Resetting server;Se resetează serverul...
|
||||
Deleted file;Fișier șters
|
||||
Reinstalling server;Se reinstalează serverul
|
||||
Uploading files;Încărcare fișiere
|
||||
complete;complet
|
||||
Upload complete;Încărcare completă
|
||||
Security;Securitate
|
||||
Subscriptions;Abonamente
|
||||
2fa Code;Cod 2FA
|
||||
Your account is secured with 2fa;Contul dvs. este securizat cu 2FA
|
||||
anyone write a fancy text here?;cineva să scrie un text frumos aici?
|
||||
Activate 2fa;Activare 2FA
|
||||
2fa apps;Aplicații 2FA
|
||||
Use an app like ;Utilizați o aplicație precum
|
||||
or;sau
|
||||
and scan the following QR Code;și scanați codul QR următor
|
||||
If you have trouble using the QR Code, select manual input in the app and enter your email and the following code:;Dacă întâmpinați probleme la utilizarea codului QR, selectați introducerea manuală în aplicație și introduceți adresa dvs. de email și următorul cod:
|
||||
Finish activation;Finalizare activare
|
||||
2fa Code requiered;Cod 2FA necesar
|
||||
New password;Parolă nouă
|
||||
Secure your account;Securizați contul dvs.
|
||||
2fa adds another layer of security to your account. You have to enter a 6 digit code in order to login.;2FA adaugă un alt nivel de securitate contului dvs. Trebuie să introduceți un cod cu 6 cifre pentru a vă autentifica.
|
||||
New subscription;Abonament nou
|
||||
You need to enter a name;Trebuie să introduceți un nume
|
||||
You need to enter a description;Trebuie să introduceți o descriere
|
||||
Add new limit;Adăugați o limită nouă
|
||||
Create subscription;Creați abonament
|
||||
Options;Opțiuni
|
||||
Amount;Suma
|
||||
Do you really want to delete it?;Sigur doriți să ștergeți acesta?
|
||||
Loading your subscription;Se încarcă abonamentul dvs.
|
||||
Searching for deploy node;Căutare nod de implementare
|
||||
Searching for available images;Căutare imagini disponibile
|
||||
Server details;Detalii server
|
||||
Configure your server;Configurați serverul dvs.
|
||||
Default;Implicit
|
||||
You reached the maximum amount of servers for every image of your subscription;Ați atins cantitatea maximă de servere pentru fiecare imagine din abonamentul dvs.
|
||||
Personal information;Informații personale
|
||||
Enter code;Introduceți codul
|
||||
Server rename;Redenumire server
|
||||
Create code;Creați codul
|
||||
Save subscription;Salvați abonamentul
|
||||
Enter your information;Introduceți informațiile dvs.
|
||||
You need to enter your full name in order to use moonlight;Trebuie să introduceți numele complet pentru a utiliza Moonlight
|
||||
No node found;Niciun nod găsit
|
||||
No node found to deploy to found;Nu s-a găsit niciun nod pentru a fi implementat
|
||||
Node offline;Nodul este deconectat
|
||||
The node the server is running on is currently offline;Nodul pe care rulează serverul este momentan deconectat
|
||||
Server not found;Serverul nu a fost găsit
|
||||
A server with that id cannot be found or you have no access for this server;Un server cu această ID nu poate fi găsit sau nu aveți acces la acest server
|
||||
Compress;Comprimare
|
||||
Decompress;Dezcompresare
|
||||
Moving;Mutare...
|
||||
Compressing;Se comprimă...
|
||||
selected;selectat
|
||||
New website;Site web nou
|
||||
Plesk servers;Servere Plesk
|
||||
Base domain;Domeniu de bază
|
||||
Plesk server;Server Plesk
|
||||
Ftp;FTP
|
||||
No SSL certificate found;Nu s-a găsit niciun certificat SSL
|
||||
Ftp Host;Gazdă FTP
|
||||
Ftp Port;Port FTP
|
||||
Ftp Username;Nume utilizator FTP
|
||||
Ftp Password;Parolă FTP
|
||||
Use;Utilizați
|
||||
SSL Certificates;Certificate SSL
|
||||
SSL certificates;Certificate SSL
|
||||
Issue certificate;Emitere certificat
|
||||
New plesk server;Un nou server Plesk
|
||||
Api url;URL API
|
||||
Host system offline;Sistemul gazdă este offline
|
||||
The host system the website is running on is currently offline;Sistemul gazdă pe care rulează site-ul este în prezent offline
|
||||
No SSL certificates found;Nu s-au găsit certificate SSL
|
||||
No databases found for this website;Nu s-au găsit baze de date pentru acest site web
|
||||
The name should be at least 8 characters long;Numele trebuie să aibă cel puțin 8 caractere
|
||||
The name should only contain of lower case characters and numbers;Numele ar trebui să conțină doar litere mici și cifre
|
||||
Error from plesk;Eroare de la Plesk
|
||||
Host;Gazdă
|
||||
Username;Nume de utilizator
|
||||
SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one;Înregistrările SRV nu pot fi actualizate datorită clientului API Cloudflare. Vă rugăm să ștergeți înregistrarea și să creați una nouă
|
||||
The User field is required.;Câmpul Utilizator este obligatoriu
|
||||
You need to specify an owner;Trebuie să specificați un proprietar
|
||||
You need to specify an image;Trebuie să specificați o imagine
|
||||
Api Url;URL API
|
||||
Api Key;Cheie API
|
||||
Duration;Durată
|
||||
Enter duration of subscription;Introduceți durata abonamentului
|
||||
Copied code to clipboard;Codul a fost copiat în clipboard
|
||||
Invalid or expired subscription code;Cod de abonament invalid sau expirat
|
||||
Current subscription;Abonament curent
|
||||
You need to specify a server image;Trebuie să specificați o imagine de server
|
||||
CPU;CPU
|
||||
Hour;Oră
|
||||
Day;Zi
|
||||
Month;Lună
|
||||
Year;An
|
||||
All time;Tot timpul
|
||||
This function is not implemented;Această funcție nu este implementată
|
||||
Domain details;Detalii domeniu
|
||||
Configure your domain;Configurați domeniul dvs.
|
||||
You reached the maximum amount of domains in your subscription;Ați atins numărul maxim de domenii în abonamentul dvs.
|
||||
You need to specify a shared domain;Trebuie să specificați un domeniu partajat
|
||||
A domain with this name already exists for this shared domain;Un domeniu cu acest nume există deja pentru acest domeniu partajat
|
||||
The Email field is required.;Câmpul Email este obligatoriu
|
||||
The Password field is required.;Câmpul Parolă este obligatoriu
|
||||
The ConfirmPassword field is required.;Câmpul Confirmare Parolă este obligatoriu
|
||||
Passwords need to match;Parolele trebuie să se potrivească
|
||||
Cleanup exception;Excepție la curățare
|
||||
No shared domain found;Nu s-a găsit niciun domeniu partajat
|
||||
Searching for deploy plesk server;Se caută pentru a implementa serverul Plesk
|
||||
No plesk server found;Nu s-a găsit niciun server Plesk
|
||||
No plesk server found to deploy to;Nu s-a găsit niciun server Plesk pentru a implementa
|
||||
No node found to deploy to;Nu s-a găsit niciun nod pentru a implementa
|
||||
Website details;Detalii site web
|
||||
Configure your website;Configurați site-ul dvs. web
|
||||
The name cannot be longer that 32 characters;Numele nu poate avea mai mult de 32 de caractere
|
||||
The name should only consist of lower case characters;Numele ar trebui să conțină doar litere mici
|
||||
News;Știri
|
||||
Title...;Titlu...
|
||||
Enter text...;Introduceți text...
|
||||
Saving...;Se salvează...
|
||||
Deleting...;Se șterge...
|
||||
Delete post;Ștergeți postarea
|
||||
Do you really want to delete the post ";Doriți cu adevărat să ștergeți postarea "
|
||||
You have no domains;Nu aveți domenii
|
||||
We were not able to find any domains associated with your account;Nu am putut găsi niciun domeniu asociat cu contul dvs.
|
||||
You have no websites;Nu aveți site-uri web
|
||||
We were not able to find any websites associated with your account;Nu am putut găsi niciun site web asociat cu contul dvs.
|
||||
Guest;Vizitator
|
||||
You need a domain;Aveți nevoie de un domeniu
|
||||
New post;Postare nouă
|
||||
New entry;Intrare nouă
|
||||
You have no servers;Nu aveți servere
|
||||
We were not able to find any servers associated with your account;Nu am putut găsi niciun server asociat cu contul dvs.
|
||||
Error creating server on wings;Eroare la crearea serverului pe Wings
|
||||
An unknown error occurred while restoring a backup;A apărut o eroare necunoscută în timpul restaurării unei copii de rezervă
|
||||
Error from daemon;Eroare de la daemon
|
||||
End;Sfârșit
|
||||
Cloud panel;Panou de control pentru cloud
|
||||
Cloud panels;Panouri de control pentru cloud
|
||||
New cloud panel;Panou de control pentru cloud nou
|
||||
You need to enter an api key;Trebuie să introduceți o cheie API
|
||||
Webspaces;Spații web
|
||||
New webspace;Spațiu web nou
|
||||
The uploaded file should not be bigger than 100MB;Fișierul încărcat nu trebuie să depășească 100MB
|
||||
An unknown error occurred while uploading a file;A apărut o eroare necunoscută în timpul încărcării unui fișier
|
||||
No databases found for this webspace;Nu s-au găsit baze de date pentru acest spațiu web
|
||||
Sftp;SFTP
|
||||
Sftp Host;Gazdă SFTP
|
||||
Sftp Port;Port SFTP
|
||||
Sftp Username;Nume de utilizator SFTP
|
||||
Sftp Password;Parolă SFTP
|
||||
Lets Encrypt certificate successfully issued;Certificatul Lets Encrypt a fost emis cu succes
|
||||
Add shared domain;Adăugați domeniu partajat
|
||||
Webspace;Spațiu web
|
||||
You reached the maximum amount of websites in your subscription;Ați atins numărul maxim de site-uri web în abonamentul dvs.
|
||||
Searching for deploy web host;Se caută pentru a implementa gazda web
|
||||
Webspace details;Detalii spațiu web
|
||||
Web host;Gazdă web
|
||||
Configure your webspaces;Configurați spațiile dvs. web
|
||||
You reached the maximum amount of webspaces in your subscription;Ați atins numărul maxim de spații web în abonamentul dvs.
|
||||
Create a webspace;Creați un spațiu web
|
||||
Manage your webspaces;Gestionați spațiile dvs. web
|
||||
Modify the content of your webspaces;Modificați conținutul spațiilor dvs. web
|
||||
Successfully updated password;Parola a fost actualizată cu succes
|
||||
An unknown error occurred while sending your message;A apărut o eroare necunoscută în timpul trimiterii mesajului dvs.
|
||||
Open chats;Deschideți conversații
|
||||
No message sent yet;Nu ați trimis încă niciun mesaj
|
||||
Support ticket open;Bilet de suport deschis
|
||||
Support ticket closed;Bilet de suport închis
|
||||
Your connection has been paused;Conexiunea dvs. a fost pusă în pauză
|
||||
We paused your connection because of inactivity. To resume, simply focus the tab and wait a few seconds;Am pus în pauză conexiunea dvs. din cauza inactivității. Pentru a relua, focalizați pur și simplu fila și așteptați câteva secunde
|
||||
Failed to reconnect to the moonlight servers;Nu s-a reușit reconectarea la serverele Moonlight
|
||||
We were unable to reconnect to moonlight. Please refresh the page;Nu am reușit să ne reconectăm la Moonlight. Vă rugăm să reîmprospătați pagina
|
||||
Failed to reconnect to the moonlight servers. The connection has been rejected;Nu s-a reușit reconectarea la serverele Moonlight. Conexiunea a fost respinsă
|
||||
We were unable to reconnect to moonlight. Most of the time this is caused by an update of moonlight. Please refresh the page;Nu am reușit să ne reconectăm la Moonlight. De cele mai multe ori, aceasta este cauzată de o actualizare a Moonlight. Vă rugăm să reîmprospătați pagina
|
||||
Verifying token, loading user data;Se verifică token-ul, se încarcă datele utilizatorului
|
||||
Reload config;Reîncarcă configurația
|
||||
Successfully reloading configuration;Configurația a fost reîncărcată cu succes
|
||||
Successfully reloaded configuration;Configurația a fost reîncărcată cu succes
|
||||
Flows;Fluxuri
|
||||
Add node;Adăugați nod
|
||||
Web system;Sistem web
|
||||
Servers with this image;Servere cu această imagine
|
||||
You need to specify a user;Trebuie să specificați un utilizator
|
||||
Import;Importați
|
||||
Export;Exportați
|
||||
Exporting;Se exportă
|
||||
Successfully imported image;Imaginea a fost importată cu succes
|
||||
Forge version;Versiune Forge
|
||||
Fabric version;Versiune Fabric
|
||||
Fabric loader version;Versiune Fabric Loader
|
||||
Rate;Evaluare
|
||||
Hey, can i borrow you for a second?;Hey, pot să te împrumut pentru o secundă?
|
||||
We want to improve our services and get a little bit of feedback how we are currently doing. Please leave us a rating;Vrem să îmbunătățim serviciile noastre și să obținem un pic de feedback despre modul în care facem în prezent. Vă rugăm să ne lăsați o evaluare
|
||||
Thanks for your rating;Mulțumim pentru evaluarea dvs.
|
||||
It would be really kind of you rating us on a external platform as it will help our project very much;Ar fi foarte amabil din partea dvs. să ne evaluați pe o platformă externă, deoarece va ajuta foarte mult proiectul nostru
|
||||
Close;Închide
|
||||
Rating saved;Evaluare salvată
|
||||
Group;Grup
|
||||
Beta;Beta
|
||||
Create a new group;Creați un grup nou
|
||||
Download WinSCP;Descărcați WinSCP
|
||||
Show connection details;Afișați detaliile de conexiune
|
||||
New;Nou
|
||||
New file;Fișier nou
|
||||
Connection details;Detalii de conexiune
|
||||
Malware;Program malware
|
||||
Create a new file;Creați un fișier nou
|
||||
Edit layout;Editați aspectul
|
||||
Uptime;Timp de funcționare
|
||||
Moonlight is online since;Moonlight este online de la
|
||||
User;Utilizator
|
||||
Databases;Baze de date
|
||||
Sesiuni;Sesiuni
|
||||
Active users;Utilizatori activi
|
||||
Search for plugins;Căutați plugin-uri
|
||||
Search;Căutare
|
||||
Searching;Se caută...
|
||||
Successfully installed gunshell;Gunshell a fost instalat cu succes
|
||||
Successfully installed fastasyncworldedit;FastAsyncWorldEdit a fost instalat cu succes
|
||||
Successfully installed minimotd;MiniMotd a fost instalat cu succes
|
||||
Moonlight health;Stare Moonlight
|
||||
Healthy;Sănătos
|
||||
Successfully saved file;Fișier salvat cu succes
|
||||
Unsorted servers;Servere nesortate
|
||||
Enter a new name;Introduceți un nume nou
|
||||
Sign in with;Conectare cu
|
||||
Make your services accessible through your own domain;Faceți serviciile dvs. accesibile prin propriul domeniu
|
||||
New group;Grup nou
|
||||
Finish editing layout;Finalizați editarea aspectului
|
||||
Remove group;Eliminați grupul
|
||||
Hidden in edit mode;Ascuns în modul de editare
|
||||
Enter your 2fa code here;Introduceți codul dvs. 2FA aici
|
||||
Two factor authentication;Autentificare în două factori
|
||||
Preferences;Preferințe
|
||||
Streamer mode;Mod streamer
|
||||
Scan the QR code and enter the code generated by the app you have scanned it in;Scanați codul QR și introduceți codul generat de aplicație
|
||||
Start scan;Începeți scanarea
|
||||
Results;Rezultate
|
||||
Scan in progress;Scanare în curs
|
||||
Debug;Depanare
|
||||
Save changes;Salvați modificările
|
||||
Delete domain;Ștergeți domeniul
|
||||
Python version;Versiune Python
|
||||
Python file;Fișier Python
|
||||
Select python file to execute on start;Selectați fișierul Python pentru a fi executat la pornire
|
||||
You have no webspaces;Nu aveți spații web
|
||||
We were not able to find any webspaces associated with your account;Nu am reușit să găsim spații web asociate contului dvs.
|
||||
Backup download successfully started;Descărcarea backup-ului a început cu succes
|
||||
Error from cloud panel;Eroare din panoul de control al norului
|
||||
Error from wings;Eroare din Wings
|
||||
Remove link;Elimină linkul
|
||||
Your account is linked to a discord account;Contul dvs. este legat de un cont Discord
|
||||
You are able to use features like the discord bot of moonlight;Puteți utiliza funcții precum botul Discord al Moonlight
|
||||
The password should be at least 8 characters long;Parola trebuie să aibă cel puțin 8 caractere
|
||||
The name should only consist of lower case characters or numbers;Numele ar trebui să conțină doar litere mici sau cifre
|
||||
The requested resource was not found;Resursa cerută nu a fost găsită
|
||||
We were not able to find the requested resource. This can have following reasons;Nu am putut găsi resursa solicitată. Acest lucru poate avea următoarele motive
|
||||
The resource was deleted;Resursa a fost ștearsă
|
||||
You have to permission to access this resource;Nu aveți permisiunea de a accesa această resursă
|
||||
You may have entered invalid data;Ați putut introduce date invalide
|
||||
A unknown bug occured;A apărut o eroare necunoscută
|
||||
An api was down and not proper handled;O interfață API a fost indisponibilă și nu a fost gestionată corespunzător
|
||||
A database with this name does already exist;O bază de date cu acest nume există deja
|
||||
Successfully installed quickshop-hikari;Quickshop-Hikari a fost instalat cu succes
|
||||
You need to enter a valid domain;Trebuie să introduceți un domeniu valid
|
||||
2fa code;Cod 2FA
|
||||
This feature is not available for;Această funcționalitate nu este disponibilă pentru
|
||||
Your account is currently not linked to discord;Contul dvs. nu este în prezent legat de Discord
|
||||
To use features like the discord bot, link your moonlight account with your discord account;Pentru a utiliza funcții precum botul Discord, legați-vă contul Moonlight de contul Discord
|
||||
Link account;Conectează contul
|
||||
Continue;Continuați
|
||||
Preparing;Pregătire
|
||||
Make sure you have installed one of the following apps on your smartphone and press continue;Asigurați-vă că ați instalat una dintre următoarele aplicații pe smartphone-ul dvs. și apăsați Continuare
|
||||
The max length for the name is 32 characters;Lungimea maximă a numelui este de 32 de caractere
|
||||
Successfully installed chunky;Chunky a fost instalat cu succes
|
||||
Successfully installed huskhomes;Huskhomes a fost instalat cu succes
|
||||
Successfully installed simply-farming;Simply-Farming a fost instalat cu succes
|
||||
You need to specify a first name;Trebuie să specificați un prenume
|
||||
You need to specify a last name;Trebuie să specificați un nume de familie
|
||||
You need to specify a password;Trebuie să specificați o parolă
|
||||
Please solve the captcha;Vă rugăm să rezolvați captcha
|
||||
The email is already in use;Adresa de email este deja folosită
|
||||
The dns records of your webspace do not point to the host system;Înregistrările DNS ale spațiului dvs. web nu se îndreaptă către sistemul gazdă
|
||||
Scan complete;Scanare completă
|
||||
Currently scanning:;În prezent se scanează:
|
||||
Successfully installed dynmap;Dynmap a fost instalat cu succes
|
||||
Successfully installed squaremap;Squaremap a fost instalat cu succes
|
||||
No web host found;Niciun gazdă web găsită
|
||||
No web host found to deploy to;Niciun gazdă web găsită pentru a implementa
|
||||
Successfully installed sleeper;Sleeper a fost instalat cu succes
|
||||
You need to enter a domain;Trebuie să introduceți un domeniu
|
||||
Enter a ip;Introduceți o adresă IP
|
||||
Ip Bans;Interdicții IP
|
||||
Ip;Adresă IP
|
||||
Successfully installed simple-voice-chat;Simple-Voice-Chat a fost instalat cu succes
|
||||
Successfully installed smithing-table-fix;Smithing-Table-Fix a fost instalat cu succes
|
||||
Successfully installed justplayer-tpa;Justplayer-TPA a fost instalat cu succes
|
||||
Successfully installed ishop;iShop a fost instalat cu succes
|
||||
Successfully installed lifestealre;Lifestealre a fost instalat cu succes
|
||||
Successfully installed lifeswap;Lifeswap a fost instalat cu succes
|
||||
Java version;Versiune Java
|
||||
Jar file;Fișier JAR
|
||||
Select jar to execute on start;Selectați fișierul JAR pentru a fi executat la pornire
|
||||
A website with this domain does already exist;Un website cu acest domeniu există deja
|
||||
Successfully installed discordsrv;DiscordSrv a fost instalat cu succes
|
||||
Reinstall;Reinstalați
|
||||
Reinstalling;Se reinstalează
|
||||
Successfully installed freedomchat;Freedomchat a fost instalat cu succes
|
||||
Leave empty for the default background image;Lăsați gol pentru imaginea de fundal implicită
|
||||
Background image url;URL-ul imaginii de fundal
|
||||
of CPU used;de CPU folosit
|
||||
memory used;memorie folosită
|
||||
163;163
|
||||
172;172
|
||||
Sentry;Sentry
|
||||
Sentry is enabled;Sentry este activat
|
||||
Successfully installed mobis-homes;Mobis-Homes a fost instalat cu succes
|
||||
Your moonlight account is disabled;Contul Moonlight este dezactivat
|
||||
Your moonlight account is currently disabled. But dont worry your data is still saved;Contul Moonlight este în prezent dezactivat. Dar nu vă faceți griji, datele dvs. sunt încă salvate
|
||||
You need to specify a email address;Trebuie să specificați o adresă de email
|
||||
A user with that email does already exist;Un utilizator cu această adresă de email există deja
|
||||
Successfully installed buildmode;Buildmode a fost instalat cu succes
|
||||
Successfully installed plasmo-voice;Plasmo-Voice a fost instalat cu succes
|
||||
157;157
|
||||
174;174
|
||||
158;158
|
||||
Webspace not found;Spațiu web nu găsit
|
||||
A webspace with that id cannot be found or you have no access for this webspace;Un spațiu web cu această ID nu poate fi găsit sau nu aveți acces la acest spațiu web
|
||||
No plugin download for your minecraft version found;Nu s-a găsit nicio descărcare de plugin pentru versiunea dvs. Minecraft
|
||||
Successfully installed gamemode-alias;Gamemode-Alias a fost instalat cu succes
|
||||
228;228
|
||||
User;Utilizator
|
||||
Send notification;Trimite notificare
|
||||
Successfully saved changes;Modificări salvate cu succes
|
||||
Archiving;Se arhivează
|
||||
Server is currently not archived;Serverul nu este arhivat în prezent
|
||||
Add allocation;Adaugă alocare
|
||||
231;231
|
||||
175;175
|
||||
Dotnet version;Versiune Dotnet
|
||||
Dll file;Fișier DLL
|
||||
Select dll to execute on start;Selectați fișierul DLL pentru a fi executat la pornire
|
||||
22
Moonlight/wwwroot/assets/css/utils.css
vendored
22
Moonlight/wwwroot/assets/css/utils.css
vendored
@@ -39,10 +39,30 @@ div.wave .dot:nth-child(3) {
|
||||
}
|
||||
|
||||
@keyframes wave {
|
||||
0%, 60%, 100% {
|
||||
0%,
|
||||
60%,
|
||||
100% {
|
||||
transform: initial;
|
||||
}
|
||||
30% {
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
}
|
||||
|
||||
div.card-body
|
||||
div.table-responsive
|
||||
div.d-flex.justify-content-end
|
||||
ul.pagination {
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
/* Hide scrollbar for Chrome, Safari and Opera */
|
||||
.hide-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide scrollbar for IE, Edge and Firefox */
|
||||
.hide-scrollbar {
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
15
Moonlight/wwwroot/assets/js/moonlight.js
vendored
15
Moonlight/wwwroot/assets/js/moonlight.js
vendored
@@ -313,6 +313,21 @@
|
||||
'editor.background': '#000000'
|
||||
}
|
||||
});
|
||||
},
|
||||
checkConnection: async function(url, threshold) {
|
||||
const start = performance.now();
|
||||
|
||||
try
|
||||
{
|
||||
const response = await fetch(url, { mode: 'no-cors' });
|
||||
const latency = performance.now() - start;
|
||||
|
||||
if (latency > threshold)
|
||||
{
|
||||
moonlight.toasts.warning(`High latency detected: ${latency}ms. Moonlight might feel laggy. Please check your internet connection`);
|
||||
}
|
||||
}
|
||||
catch (error) {}
|
||||
}
|
||||
},
|
||||
flashbang: {
|
||||
|
||||
1
Moonlight/wwwroot/assets/media/svg/create.svg
vendored
Normal file
1
Moonlight/wwwroot/assets/media/svg/create.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="922.43055" height="543.51482" viewBox="0 0 922.43055 543.51482" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M429.40405,719.95523c-.05566-.24511-5.43994-24.79785,5.55615-45.19043,10.9961-20.39166,34.46827-29.38476,34.70411-29.47363l1.07275-.40234.25342,1.11816c.05566.24512,5.43994,24.79785-5.55615,45.19043-10.99561,20.39166-34.46827,29.38477-34.70411,29.47363l-1.07324.40235Zm39.86182-72.33782c-4.70166,2.02246-23.25781,10.874-32.54492,28.09667-9.28809,17.22461-6.48584,37.59375-5.59229,42.63086,4.69971-2.01757,23.24854-10.85546,32.54492-28.09668C472.96118,673.02457,470.15991,652.65738,469.26587,647.61741Z" transform="translate(-138.78472 -178.24259)" fill="#f1f1f1"/><path d="M457.03116,684.04435c-19.76056,11.88861-27.371,35.50268-27.371,35.50268s24.42779,4.33881,44.18835-7.5498,27.371-35.50269,27.371-35.50269S476.79172,672.15574,457.03116,684.04435Z" transform="translate(-138.78472 -178.24259)" fill="#f1f1f1"/><path d="M403.38208,533.755h55.82731V505.49264H403.38208Z" transform="translate(-138.78472 -178.24259)" fill="#6c63ff"/><path d="M415.04913,508.29308a7.93668,7.93668,0,0,0-8.31091-8.89017L398.88446,483.055l-11.09864,2.34969,11.41528,22.93065a7.97965,7.97965,0,0,0,15.848-.04225Z" transform="translate(-138.78472 -178.24259)" fill="#ffb7b7"/><polygon points="105.767 519.858 115.004 524.585 137.634 491.205 124 484.228 105.767 519.858" fill="#ffb7b7"/><path d="M243.73878,693.879l18.19172,9.3096.00074.00038a13.02378,13.02378,0,0,1,5.65977,17.526l-.19281.37672-29.785-15.24261Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><polygon points="212.454 532.791 222.83 532.79 227.767 492.766 212.452 492.766 212.454 532.791" fill="#ffb7b7"/><path d="M348.59142,707.64523l20.43546-.00083h.00082a13.02377,13.02377,0,0,1,13.02307,13.02286v.4232l-33.45873.00124Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><path d="M302.70032,384.56392s-6.94873-5.32368-6.94873,7.68016l-1.09716,42.97236,12.25169,40.59517,7.13159-13.166-2.92578-28.52633Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><path d="M377.03136,502.10087s8.05774,39.24119-2.14873,71.4453L369.24221,697.3668l-20.68154-1.61155-7.252-91.85825-6.98338-45.66053L319.8214,599.86813l-47.80927,88.098-22.02449-17.18985s24.40667-66.59522,42.43744-80.57741l9.043-102.99572Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><circle cx="213.7317" cy="130.27454" r="23.5814" fill="#ffb8b8"/><path d="M350.84761,313.51884c2.82683.3678,4.95918-2.52447,5.94818-5.19806s1.74257-5.7862,4.2003-7.23041c3.35778-1.9731,7.65389.4,11.49368-.251,4.33631-.73516,7.15572-5.3308,7.37669-9.72343s-1.5271-8.61741-3.24227-12.66737l-.5988,5.03318a9.98113,9.98113,0,0,0-4.36168-8.72436l.77179,7.38543a7.83853,7.83853,0,0,0-9.01785-6.48609l.12154,4.40051c-5.00844-.59556-10.06064-1.19195-15.08391-.73823s-10.08162,2.043-13.88883,5.35126c-5.695,4.94857-7.77493,13.097-7.07665,20.6092s3.79932,14.56944,7.0313,21.38674c.81317,1.71525,1.9379,3.65079,3.82353,3.86929a3.85158,3.85158,0,0,0,3.7712-2.84219,10.30188,10.30188,0,0,0-.04573-5.06077c-.4765-2.5321-1.07717-5.12024-.62916-7.65754s2.27332-5.04462,4.831-5.35557,5.1749,2.61264,3.94519,4.8768Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><polygon points="239.706 334.352 160.991 329.274 166.915 304.729 238.859 320.81 239.706 334.352" fill="#cbcbcb"/><path d="M329.94662,340.67725l4.93725-6.85464s5.51849,1.8754,20.29759,9.23183l1.04414,6.42222,25.65358,157.78706-46.62958-2.01147-12.69811-.27017-4.15546-9.315-5.12418,9.11755-12.40014-.26383-12.61742-7.31445,12.43455-38.03511,4.02295-34.74361-6.21728-32.73214s-7.82347-30.05728,22.30906-46.26386Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><polygon points="255.787 321.656 257.48 327.581 269.329 319.864 264.858 314.745 255.787 321.656" fill="#cbcbcb"/><path d="M338.76693,359.748s18.36836-23.45,29.47029,2.68606l3.50019,27.38928s13.44915,34.04483,13.85365,47.81926c0,0,9.11826,17.97712,9.0345,27.41942l13.48858,30.53718-13.8346,8.58887L355.991,445.481Z" transform="translate(-138.78472 -178.24259)" fill="#2f2e41"/><path d="M520.78472,721.75741h-381a1,1,0,0,1,0-2h381a1,1,0,0,1,0,2Z" transform="translate(-138.78472 -178.24259)" fill="#cbcbcb"/><path d="M597.358,414.94225h460.06211V182.03786H597.358Z" transform="translate(-138.78472 -178.24259)" fill="#fff"/><path d="M1061.21528,418.73745H593.5628V178.24259h467.65248ZM601.153,411.14723h452.472V185.83281H601.153Z" transform="translate(-138.78472 -178.24259)" fill="#e5e5e5"/><rect x="739.86245" y="46.21081" width="86.67858" height="148.0759" fill="#e5e5e5"/><rect x="550.66766" y="46.20822" width="174.83378" height="40.75957" fill="#6c63ff"/><rect x="550.66766" y="98.31856" width="174.83378" height="43.85523" fill="#e5e5e5"/><rect x="550.66766" y="153.52456" width="174.83378" height="40.75957" fill="#e5e5e5"/></svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
50
Moonlight/wwwroot/assets/media/svg/opentabs.svg
vendored
Normal file
50
Moonlight/wwwroot/assets/media/svg/opentabs.svg
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="653.146" height="396.47" viewBox="0 0 653.146 396.47" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="Group_22" data-name="Group 22" transform="translate(-288 -252.29)">
|
||||
<g id="Group_20" data-name="Group 20" transform="matrix(0.839, -0.545, 0.545, 0.839, -851.767, -5983.48)">
|
||||
<path id="Path_561-393" data-name="Path 561" d="M434.056,197.674H233.67a2.881,2.881,0,0,0-2.879,2.879V336.34a2.881,2.881,0,0,0,2.879,2.879H434.056a2.876,2.876,0,0,0,2.189-1.01.669.669,0,0,0,.063-.079,2.7,2.7,0,0,0,.413-.7,2.808,2.808,0,0,0,.218-1.093V200.553A2.882,2.882,0,0,0,434.056,197.674Zm2.06,138.666a2.039,2.039,0,0,1-.34,1.129,2.129,2.129,0,0,1-.779.7,2.042,2.042,0,0,1-.941.228H233.67a2.059,2.059,0,0,1-2.057-2.057V200.553a2.059,2.059,0,0,1,2.057-2.057H434.056a2.06,2.06,0,0,1,2.06,2.057Z" transform="translate(-2405.791 5984.326)" fill="#3f3d56"/>
|
||||
<rect id="Rectangle_99" data-name="Rectangle 99" width="205.323" height="0.823" transform="translate(-2174.59 6193.538)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_88" data-name="Ellipse 88" cx="2.469" cy="2.469" r="2.469" transform="translate(-2170.064 6185.703)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_89" data-name="Ellipse 89" cx="2.469" cy="2.469" r="2.469" transform="translate(-2162.966 6185.703)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_90" data-name="Ellipse 90" cx="2.469" cy="2.469" r="2.469" transform="translate(-2155.868 6185.703)" fill="#3f3d56"/>
|
||||
<path id="Path_583-394" data-name="Path 583" d="M344.945,347.5H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5887.343)" fill="#6c63ff"/>
|
||||
<path id="Path_584-395" data-name="Path 584" d="M370.968,362.93H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,0,1,0,.66Z" transform="translate(-2439.762 5874.067)" fill="#3f3d56"/>
|
||||
<path id="Path_585-396" data-name="Path 585" d="M344.945,411.551H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5844.438)" fill="#6c63ff"/>
|
||||
<path id="Path_586-397" data-name="Path 586" d="M370.968,426.98H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,1,1,0,.66Z" transform="translate(-2439.762 5831.162)" fill="#3f3d56"/>
|
||||
<path id="Path_587-398" data-name="Path 587" d="M344.945,475.6H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5801.532)" fill="#f2f2f2"/>
|
||||
<path id="Path_588-399" data-name="Path 588" d="M370.968,491.029H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,0,1,0,.66Z" transform="translate(-2439.762 5788.257)" fill="#3f3d56"/>
|
||||
</g>
|
||||
<path id="Path_552-400" data-name="Path 552" d="M792.253,565.923a10.091,10.091,0,0,1,1.411.787l44.852-19.143,1.6-11.815,17.922-.11-1.059,27.1L797.78,578.4a10.6,10.6,0,0,1-.448,1.208,10.235,10.235,0,1,1-5.079-13.682Z" transform="translate(-246.576 -174.461)" fill="#a0616a"/>
|
||||
<path id="Path_553-401" data-name="Path 553" d="M636.98,735.021H624.72l-5.832-47.288h18.094Z" transform="translate(-19 -98)" fill="#a0616a"/>
|
||||
<path id="Path_554-402" data-name="Path 554" d="M615.963,731.518h23.644V746.4H601.076a14.887,14.887,0,0,1,14.887-14.887Z" transform="translate(-19 -98)" fill="#2f2e41"/>
|
||||
<path id="Path_555-403" data-name="Path 555" d="M684.66,731.557l-12.2,1.2-10.441-46.488,18.007-1.774Z" transform="translate(-19 -98)" fill="#a0616a"/>
|
||||
<path id="Path_556-404" data-name="Path 556" d="M891.686,806.128H915.33v14.887H876.8a14.887,14.887,0,0,1,14.887-14.887Z" transform="translate(-322.009 -82.709) rotate(-5.625)" fill="#2f2e41"/>
|
||||
<circle id="Ellipse_84" data-name="Ellipse 84" cx="24.561" cy="24.561" r="24.561" transform="translate(596.832 262.013)" fill="#a0616a"/>
|
||||
<path id="Path_557-405" data-name="Path 557" d="M849.556,801.919a4.471,4.471,0,0,1-4.415-3.7C838.8,763,818.053,647.817,817.557,644.626a1.432,1.432,0,0,1-.016-.222v-8.588a1.489,1.489,0,0,1,.279-.872l2.74-3.838a1.479,1.479,0,0,1,1.144-.625c15.622-.732,66.784-2.879,69.256.209h0c2.482,3.1,1.605,12.507,1.4,14.36l.01.193,22.985,147a4.512,4.512,0,0,1-3.715,5.135l-14.356,2.365a4.521,4.521,0,0,1-5.025-3.093c-4.44-14.188-19.329-61.918-24.489-80.387a.5.5,0,0,0-.981.139c.258,17.606.881,62.523,1.1,78.037l.023,1.671a4.518,4.518,0,0,1-4.093,4.536L849.976,801.9C849.836,801.914,849.7,801.919,849.556,801.919Z" transform="translate(-246.576 -174.461)" fill="#2f2e41"/>
|
||||
<path id="Path_99-406" data-name="Path 99" d="M852.381,495.254c-4.286,2.548-6.851,7.23-8.323,12a113.683,113.683,0,0,0-4.884,27.159l-1.556,27.6-19.255,73.17c16.689,14.121,26.315,10.911,48.781-.639s25.032,3.851,25.032,3.851l4.492-62.258,6.418-68.032a30.169,30.169,0,0,0-4.862-4.674,49.659,49.659,0,0,0-42.442-9Z" transform="translate(-246.576 -174.461)" fill="#6c63ff"/>
|
||||
<path id="Path_558-407" data-name="Path 558" d="M846.127,580.7a10.527,10.527,0,0,1,1.5.7l44.348-22.2.736-12.026,18.294-1.261.98,27.413-59.266,19.6a10.5,10.5,0,1,1-6.593-12.232Z" transform="translate(-246.576 -174.461)" fill="#a0616a"/>
|
||||
<path id="Path_101-408" data-name="Path 101" d="M902.766,508.411c10.911,3.851,12.834,45.574,12.834,45.574-12.837-7.06-28.241,4.493-28.241,4.493s-3.209-10.912-7.06-25.032a24.53,24.53,0,0,1,5.134-23.106S891.854,504.558,902.766,508.411Z" transform="translate(-246.576 -174.461)" fill="#6c63ff"/>
|
||||
<path id="Path_102-409" data-name="Path 102" d="M889.991,467.531c-3.06-2.448-7.235,2-7.235,2L880.308,447.5s-15.3,1.833-25.094-.612-11.323,8.875-11.323,8.875a78.583,78.583,0,0,1-.306-13.771c.612-5.508,8.568-11.017,22.645-14.689s21.421,12.241,21.421,12.241C897.445,444.439,893.051,469.979,889.991,467.531Z" transform="translate(-246.576 -174.461)" fill="#2f2e41"/>
|
||||
<g id="Group_19" data-name="Group 19" transform="translate(2910 -5674.784)">
|
||||
<path id="Path_561-2-410" data-name="Path 561" d="M434.056,197.674H233.67a2.881,2.881,0,0,0-2.879,2.879V336.34a2.881,2.881,0,0,0,2.879,2.879H434.056a2.876,2.876,0,0,0,2.189-1.01.669.669,0,0,0,.063-.079,2.7,2.7,0,0,0,.413-.7,2.808,2.808,0,0,0,.218-1.093V200.553A2.882,2.882,0,0,0,434.056,197.674Zm2.06,138.666a2.039,2.039,0,0,1-.34,1.129,2.129,2.129,0,0,1-.779.7,2.042,2.042,0,0,1-.941.228H233.67a2.059,2.059,0,0,1-2.057-2.057V200.553a2.059,2.059,0,0,1,2.057-2.057H434.056a2.06,2.06,0,0,1,2.06,2.057Z" transform="translate(-2405.791 5984.326)" fill="#3f3d56"/>
|
||||
<rect id="Rectangle_99-2" data-name="Rectangle 99" width="205.323" height="0.823" transform="translate(-2174.59 6193.538)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_88-2" data-name="Ellipse 88" cx="2.469" cy="2.469" r="2.469" transform="translate(-2170.064 6185.703)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_89-2" data-name="Ellipse 89" cx="2.469" cy="2.469" r="2.469" transform="translate(-2162.966 6185.703)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_90-2" data-name="Ellipse 90" cx="2.469" cy="2.469" r="2.469" transform="translate(-2155.868 6185.703)" fill="#3f3d56"/>
|
||||
<path id="Path_583-2-411" data-name="Path 583" d="M344.945,347.5H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5887.343)" fill="#6c63ff"/>
|
||||
<path id="Path_584-2-412" data-name="Path 584" d="M370.968,362.93H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,0,1,0,.66Z" transform="translate(-2439.762 5874.067)" fill="#3f3d56"/>
|
||||
<path id="Path_585-2-413" data-name="Path 585" d="M344.945,411.551H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5844.438)" fill="#6c63ff"/>
|
||||
<path id="Path_586-2-414" data-name="Path 586" d="M370.968,426.98H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,1,1,0,.66Z" transform="translate(-2439.762 5831.162)" fill="#3f3d56"/>
|
||||
<path id="Path_587-2-415" data-name="Path 587" d="M344.945,475.6H293.029a2.525,2.525,0,0,1,0-5.049h51.916a2.525,2.525,0,0,1,0,5.049Z" transform="translate(-2445.791 5801.532)" fill="#f2f2f2"/>
|
||||
<path id="Path_588-2-416" data-name="Path 588" d="M370.968,491.029H281.834a.33.33,0,1,1,0-.66h89.134a.33.33,0,0,1,0,.66Z" transform="translate(-2439.762 5788.257)" fill="#3f3d56"/>
|
||||
</g>
|
||||
<path id="Path_561-3-417" data-name="Path 561" d="M474.659,197.674H234.245a3.457,3.457,0,0,0-3.454,3.454V364.039a3.457,3.457,0,0,0,3.454,3.454H474.659a3.451,3.451,0,0,0,2.626-1.212.8.8,0,0,0,.075-.095,3.236,3.236,0,0,0,.5-.836,3.37,3.37,0,0,0,.261-1.311V201.128A3.457,3.457,0,0,0,474.659,197.674Zm2.472,166.365a2.445,2.445,0,0,1-.408,1.355,2.554,2.554,0,0,1-.935.84,2.45,2.45,0,0,1-1.129.273H234.245a2.47,2.47,0,0,1-2.467-2.467V201.128a2.47,2.47,0,0,1,2.467-2.467H474.659a2.471,2.471,0,0,1,2.472,2.468Z" transform="translate(57.209 173.542)" fill="#3f3d56"/>
|
||||
<rect id="Rectangle_99-3" data-name="Rectangle 99" width="246.338" height="0.987" transform="translate(288.492 385.058)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_88-3" data-name="Ellipse 88" cx="2.962" cy="2.962" r="2.962" transform="translate(293.922 375.659)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_89-3" data-name="Ellipse 89" cx="2.962" cy="2.962" r="2.962" transform="translate(302.438 375.659)" fill="#3f3d56"/>
|
||||
<circle id="Ellipse_90-3" data-name="Ellipse 90" cx="2.962" cy="2.962" r="2.962" transform="translate(310.954 375.659)" fill="#3f3d56"/>
|
||||
<path id="Path_589-418" data-name="Path 589" d="M923.117,453.186h-82.26a3.739,3.739,0,1,1,0-7.478h82.26a3.739,3.739,0,0,1,0,7.478Z" transform="translate(-445.702 17.923)" fill="#f2f2f2"/>
|
||||
<path id="Path_590-419" data-name="Path 590" d="M869.368,419.186h-28.51a3.739,3.739,0,1,1,0-7.478h28.51a3.739,3.739,0,0,1,0,7.478Z" transform="translate(-445.702 36.032)" fill="#f2f2f2"/>
|
||||
<ellipse id="Ellipse_91" data-name="Ellipse 91" cx="15.891" cy="15.891" rx="15.891" ry="15.891" transform="translate(342.006 443.883)" fill="#6c63ff"/>
|
||||
<path id="Path_591-420" data-name="Path 591" d="M860.866,385.456H712.706a7.957,7.957,0,0,0-7.946,7.946v32.717a7.957,7.957,0,0,0,7.945,7.945H860.866a7.957,7.957,0,0,0,7.945-7.946V393.4a7.957,7.957,0,0,0-7.945-7.946Zm7.011,40.662a7.019,7.019,0,0,1-7.011,7.011H712.706a7.019,7.019,0,0,1-7.011-7.011V393.4a7.019,7.019,0,0,1,7.011-7.011H860.866a7.019,7.019,0,0,1,7.011,7.011Z" transform="translate(-375.206 50.014)" fill="#3f3d56"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.9 KiB |
59
README.md
59
README.md
@@ -1,36 +1,37 @@
|
||||
<br/>
|
||||
<center>
|
||||
<p align="center">
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight">
|
||||
<img src="https://my.endelon-hosting.de/api/moonlight/resources/images/logo.svg" alt="Logo" width="80" height="80">
|
||||
</a>
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight">
|
||||
<img src="https://my.endelon-hosting.de/api/moonlight/resources/images/logo.svg" alt="Logo" width="80" height="80">
|
||||
</a>
|
||||
|
||||
<h3 align="center">Moonlight</h3>
|
||||
<h3 align="center">Moonlight</h3>
|
||||
|
||||
<p align="center">
|
||||
The next generation hosting panel
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight/issues">Report Bug</a>
|
||||
.
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight/issues">Request Feature</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
The next generation hosting panel
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight/issues">Report Bug</a>
|
||||
.
|
||||
<a href="https://github.com/Moonlight-Panel/Moonlight/issues">Request Feature</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
   
|
||||
  
|
||||
|
||||
## About The Project
|
||||
|
||||

|
||||
|
||||
Moonlight is a new free and open source alternative to pterodactyl allowing users to create their own hosting platform and host all sorts of gameservers in docker containers. With a simple migration from pterodactyl to moonlight ([see guide](https://docs.moonlightpanel.xyz/migrating-from-pterodactyl)) you can easily switch to moonlight and use its features like a server manager, cleanup system and automatic version switcher, just to name a few.
|
||||
</center>
|
||||
Moonlight is a new free and open-source alternative to Pterodactyl, allowing users to create their own hosting platform and host all sorts of game servers in Docker containers. With a simple migration from pterodactyl to moonlight ([see guide](https://docs.moonlightpanel.xyz/migrating-from-pterodactyl)) you can easily switch to moonlight and use its features like a server manager, cleanup system, and automatic version switcher, just to name a few.
|
||||
|
||||
Moonlight's core features are
|
||||
|
||||
* Hosting game servers using wings + docker
|
||||
* Creating and managing webspaces using the cloudpanel based web hosting solution
|
||||
* Adding your domains as shared domains and provide subdomains for users with them
|
||||
* Hosting game servers using Wings and Docker
|
||||
* Creating and managing webspaces using the CloudPanel based web hosting solution
|
||||
* Adding your domains as shared domains and providing subdomains for users with them
|
||||
* Live support chat
|
||||
* Subscription system (sellpass integration wip)
|
||||
* Subscription system (sell pass integration WIP)
|
||||
* Statistics
|
||||
* and many more
|
||||
|
||||
@@ -51,34 +52,30 @@ This project is currently in beta
|
||||
|
||||
* Linux based operating system
|
||||
* Docker
|
||||
* MySQL Database
|
||||
* MySQL/MariaDB Database
|
||||
* A domain (optional)
|
||||
|
||||
### Installation
|
||||
|
||||
A full guide how to install moonlight can be found here:
|
||||
A full guide on how to install moonlight can be found here:
|
||||
[https://docs.moonlightpanel.xyz/installing-moonlight](https://docs.moonlightpanel.xyz/installing-moonlight)
|
||||
|
||||
Quick installers/updaters:
|
||||
|
||||
Moonlight:
|
||||
`curl https://install.moonlightpanel.xyz/moonlight | bash`
|
||||
|
||||
Daemon (not wings):
|
||||
`curl https://install.moonlightpanel.xyz/daemon| bash`
|
||||
Quick installer/updater:
|
||||
`curl https://install.moonlightpanel.xyz/install > install.sh; bash install.sh`
|
||||
You'd need to select what to install: The Panel, Wings or the daemon
|
||||
|
||||
Having any issues?
|
||||
We are happy to help on our discord server:
|
||||
We are happy to help on our Discord server:
|
||||
[https://discord.gg/TJaspT7A8p](https://discord.gg/TJaspT7A8p)
|
||||
|
||||
## Roadmap
|
||||
|
||||
The roudmap can be found here:
|
||||
The roadmap can be found here:
|
||||
[https://github.com/orgs/Moonlight-Panel/projects/1](https://github.com/orgs/Moonlight-Panel/projects/1)
|
||||
|
||||
## Contributing
|
||||
|
||||
* If you have suggestions for adding or removing projects, feel free to open an issue to discuss it.
|
||||
* If you have suggestions for adding or removing projects, feel free to open an issue to discuss them.
|
||||
* Please make sure you check your spelling and grammar.
|
||||
* Create individual PR for each suggestion.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user