Admin notes (#7259)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace Content.Shared.Administration
|
||||
namespace Content.Shared.Administration
|
||||
{
|
||||
/// <summary>
|
||||
/// Permissions that admins can have.
|
||||
@@ -80,6 +78,16 @@ namespace Content.Shared.Administration
|
||||
/// </summary>
|
||||
Adminhelp = 1 << 12,
|
||||
|
||||
/// <summary>
|
||||
/// Lets you view admin notes.
|
||||
/// </summary>
|
||||
ViewNotes = 1 << 13,
|
||||
|
||||
/// <summary>
|
||||
/// Lets you create, edit and delete admin notes.
|
||||
/// </summary>
|
||||
EditNotes = 1 << 14,
|
||||
|
||||
/// <summary>
|
||||
/// Dangerous host permissions like scsi.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Eui;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Administration;
|
||||
namespace Content.Shared.Administration.Logs;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AdminLogsEuiState : EuiStateBase
|
||||
66
Content.Shared/Administration/Notes/AdminNotesEuiState.cs
Normal file
66
Content.Shared/Administration/Notes/AdminNotesEuiState.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using Content.Shared.Eui;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Administration.Notes;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AdminNotesEuiState : EuiStateBase
|
||||
{
|
||||
public AdminNotesEuiState(string notedPlayerName, Dictionary<int, SharedAdminNote> notes, bool canCreate, bool canDelete, bool canEdit)
|
||||
{
|
||||
NotedPlayerName = notedPlayerName;
|
||||
Notes = notes;
|
||||
CanCreate = canCreate;
|
||||
CanDelete = canDelete;
|
||||
CanEdit = canEdit;
|
||||
}
|
||||
|
||||
public string NotedPlayerName { get; }
|
||||
public Dictionary<int, SharedAdminNote> Notes { get; }
|
||||
public bool CanCreate { get; }
|
||||
public bool CanDelete { get; }
|
||||
public bool CanEdit { get; }
|
||||
}
|
||||
|
||||
public static class AdminNoteEuiMsg
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class Close : EuiMessageBase
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class CreateNoteRequest : EuiMessageBase
|
||||
{
|
||||
public CreateNoteRequest(string message)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DeleteNoteRequest : EuiMessageBase
|
||||
{
|
||||
public DeleteNoteRequest(int id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EditNoteRequest : EuiMessageBase
|
||||
{
|
||||
public EditNoteRequest(int id, string message)
|
||||
{
|
||||
Id = id;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
6
Content.Shared/Administration/Notes/SharedAdminNote.cs
Normal file
6
Content.Shared/Administration/Notes/SharedAdminNote.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Administration.Notes;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed record SharedAdminNote(int Id, int? Round, string Message, string CreatedByName, string EditedByName, DateTime CreatedAt, DateTime LastEditedAt);
|
||||
Reference in New Issue
Block a user