From 5148df44913dcf6362f03a5e9add7fb79b55091e Mon Sep 17 00:00:00 2001 From: niyyzf Date: Mon, 22 Jul 2024 21:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BE=B9=E8=B7=9D=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=A4=9A=E9=87=8D=E4=BE=A7=E8=BE=B9=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ServerController.cs | 7 +- web/base.scss | 7 +- web/components/MarkdownEdit.vue | 25 +++--- web/components/ServerUserPage/UserList.vue | 47 +++++++--- web/components/UserMini.vue | 4 - web/components/shell/FloaterBar.vue | 5 ++ web/components/shell/SideBar.vue | 18 +++- web/components/shell/TitleBar.vue | 4 +- web/layouts/Login.vue | 9 +- web/layouts/Main.vue | 16 ++-- web/pages/host.vue | 8 +- web/pages/host/cpu.vue | 2 +- web/pages/host/disk/[[id]].vue | 4 +- web/pages/host/memory.vue | 4 +- web/pages/host/network/[[id]].vue | 4 +- web/pages/host/networkList.vue | 2 +- web/pages/host/process.vue | 2 +- web/pages/inspectionRecords.vue | 82 +++++++++--------- web/pages/serverUser.vue | 4 +- web/pages/signIn.vue | 21 +++++ web/public/bg2.jpg | Bin 0 -> 648724 bytes 21 files changed, 175 insertions(+), 100 deletions(-) create mode 100644 web/public/bg2.jpg diff --git a/LoongPanel-Asp/Controllers/ServerController.cs b/LoongPanel-Asp/Controllers/ServerController.cs index f8568bd..9cc6621 100755 --- a/LoongPanel-Asp/Controllers/ServerController.cs +++ b/LoongPanel-Asp/Controllers/ServerController.cs @@ -273,7 +273,7 @@ public class ServerController(IServiceProvider serviceProvider, ApplicationDbCon var serverConfigs = JobConfigHelper.GetServers().ToList(); var server = serverConfigs.Find(x =>x.Id == serverId); if (server == null) return BadRequest(); - var output = await sshClient?.ExecuteCommandAsync(serverId,"awk -F: '$1 != \"nobody\" && $1 != \"build\" && $3 >= 1000 {print $1}'","/etc/passwd")!; + var output = await sshClient?.ExecuteCommandAsync(serverId,"awk -F: '$1 != \"nobody\" &&$1 != \"build\" {print $1 \":\"$3}' /etc/passwd | sort -t: -k2nr")!; if (string.IsNullOrEmpty(output)) return BadRequest("无法获得用户树"); var data = output.Split('\n', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList(); output = await sshClient?.ExecuteCommandAsync(serverId,"w -husf","|"," awk '$2 !~ /^tty/ {print$1, $2}'"," |"," sort ","|"," uniq")!; @@ -461,6 +461,11 @@ public class ServerController(IServiceProvider serviceProvider, ApplicationDbCon public async Task GetWordList([FromQuery] string serverId) { var path = Path.Combine(AppContext.BaseDirectory, "markdowns", serverId); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + var files = Directory.GetFiles(path); var wordList = new List(); foreach (var file in files) diff --git a/web/base.scss b/web/base.scss index b68873a..07d3a48 100755 --- a/web/base.scss +++ b/web/base.scss @@ -20,10 +20,11 @@ $dark-text-color: #D3D3D3; $dark-unfocused-color: $unfocused-color; $border:1px solid rgba(51, 51, 51, 0.17); +$border-dark:1px solid rgba(255, 255, 255, 0.17); -$gap: 8px; -$padding: 16px; -$radius: 8px; +$gap: 4px; +$padding: 8px; +$radius: 4px; .dark-mode html { $dark-bg-color: red; diff --git a/web/components/MarkdownEdit.vue b/web/components/MarkdownEdit.vue index 57a8c2d..16af33a 100644 --- a/web/components/MarkdownEdit.vue +++ b/web/components/MarkdownEdit.vue @@ -82,7 +82,7 @@ const uploadFile=()=>{ $fetch('/Api/Server/UpLoadWord', { method: 'POST', params:{ - serverId: mainLayoutStore.SelectServer.id, + serverId: mainLayoutStore.SelectServer.value, userName:mainLayoutStore.UserInfo.userName, wordId: id, }, @@ -108,7 +108,7 @@ onBeforeMount(()=>{ $fetch('/Api/Server/GetWordContent', { method: 'GET', params:{ - serverId: mainLayoutStore.SelectServer.id, + serverId: mainLayoutStore.SelectServer.value, wordId: props.wordId, }, headers: { @@ -128,19 +128,18 @@ onBeforeMount(()=>{