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(()=>{