Skip to content

Commit 9ad4277

Browse files
authored
Merge pull request #215 from jumpserver/pr@dev@fix_telnet_pull_up
feat: add MariaDB and telnet settings page with configuration options
2 parents a3daf00 + 0471b0a commit 9ad4277

7 files changed

Lines changed: 50 additions & 5 deletions

File tree

go-client/pkg/awaken/awaken_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
5959
var appLst []config.AppItem
6060
switch r.Protocol {
6161
case "ssh", "telnet":
62-
r.Protocol = "ssh"
6362
appLst = cfg.MacOS.Terminal
6463
case "sftp":
6564
appLst = cfg.MacOS.FileTransfer
@@ -75,6 +74,7 @@ func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
7574
return nil
7675
}
7776
var cmd *exec.Cmd
77+
r.Protocol = "ssh"
7878
connectMap := map[string]string{
7979
"name": r.getName(),
8080
"protocol": r.Protocol,

go-client/pkg/awaken/awaken_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
7272
var appLst []config.AppItem
7373
switch r.Protocol {
7474
case "ssh", "telnet":
75-
r.Protocol = "ssh"
7675
appLst = cfg.Linux.Terminal
7776
case "sftp":
7877
appLst = cfg.Linux.FileTransfer
@@ -88,6 +87,7 @@ func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
8887
return nil
8988
}
9089
var cmd *exec.Cmd
90+
r.Protocol = "ssh"
9191
connectMap := map[string]string{
9292
"name": r.getName(),
9393
"protocol": r.Protocol,

go-client/pkg/awaken/awaken_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ func handleSSH(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
188188
var appLst []config.AppItem
189189
switch r.Protocol {
190190
case "ssh", "telnet":
191-
r.Protocol = "ssh"
192191
appLst = cfg.Windows.Terminal
193192
case "sftp":
194193
appLst = cfg.Windows.FileTransfer
@@ -210,7 +209,7 @@ func handleSSH(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
210209
} else {
211210
appPath = appItem.Path
212211
}
213-
212+
r.Protocol = "ssh"
214213
connectMap := map[string]string{
215214
"name": r.getName(),
216215
"protocol": r.Protocol,

ui/components/SettingItems/settingItems.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const imagesMap: Record<string, string | undefined> = {
4141
navicat17: getImageByName("navicat17"),
4242
royalts: getImageByName("royalts"),
4343
windows_rdm: getImageByName("windows_rdm"),
44-
toad: getImageByName("toadOracle")
44+
toad: getImageByName("toad")
4545
};
4646
4747

ui/layouts/setting.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ const settingMenu = computed<NavigationMenuItem[]>(() => {
8585
label: "MySQL",
8686
to: localePath({ path: "/setting/mysql" })
8787
},
88+
{
89+
label: "MariaDB",
90+
to: localePath({ path: "/setting/mariadb" })
91+
},
8892
{
8993
label: "MongoDB",
9094
to: localePath({ path: "/setting/mongodb" })

ui/pages/setting/mariadb.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<script setup lang="ts">
2+
import type { ConfigItem } from "~/types/index";
3+
4+
definePageMeta({
5+
layout: "setting"
6+
});
7+
8+
const { t } = useI18n();
9+
const { appConfig } = useSettingManager();
10+
const { selectClient } = useApplicationConfig();
11+
12+
const protocol = "mariadb";
13+
const category = "databases" as const;
14+
15+
const items = computed<ConfigItem[]>(() => {
16+
const list = appConfig!.value?.databases ?? [];
17+
return list.filter((i) => i.protocol?.includes(protocol));
18+
});
19+
20+
const isSelected = (item: ConfigItem) => item.match_first?.includes(protocol);
21+
const handleToggle = async (item: ConfigItem) => {
22+
await selectClient(category, protocol, item.name);
23+
};
24+
</script>
25+
26+
<template>
27+
<div class="flex flex-col gap-2">
28+
<template v-if="items.length">
29+
<SettingItems
30+
v-for="item in items"
31+
:key="item.name"
32+
:item="item"
33+
:protocol="protocol"
34+
:selected="isSelected(item)"
35+
@toggle="() => handleToggle(item)"
36+
/>
37+
</template>
38+
<div v-else class="text-center text-sm text-gray-500 py-10">
39+
{{ t("Common.NoData") }}
40+
</div>
41+
</div>
42+
</template>

0 commit comments

Comments
 (0)