Skip to content

Commit 5df6310

Browse files
Dumbrisclaude
andauthored
fix: improve HTTP server UI - show Login instead of Restart, use Reconnect in Actions (#184)
- Hide Restart button for HTTP servers on server cards (HTTP servers don't have a process to restart - use Login for OAuth or Reconnect instead) - Show "Reconnect" instead of "Restart" in Actions menu for HTTP servers - Fix Login button not appearing for HTTP servers with oauth: null config (HTTP servers always support OAuth via autodiscovery) - Refactor isHttpProtocol to shared computed property in both components 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 88c6ed4 commit 5df6310

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

frontend/src/components/ServerCard.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@
7777
Unquarantine
7878
</button>
7979

80+
<!-- Restart button only for stdio servers (HTTP servers use Login/Reconnect) -->
8081
<button
81-
v-if="!server.connected && server.enabled"
82+
v-if="!server.connected && server.enabled && !isHttpProtocol"
8283
@click="restart"
8384
:disabled="loading"
8485
class="btn btn-sm btn-outline"
@@ -173,22 +174,27 @@ const systemStore = useSystemStore()
173174
const loading = ref(false)
174175
const showDeleteConfirmation = ref(false)
175176
177+
const isHttpProtocol = computed(() => {
178+
return props.server.protocol === 'http' || props.server.protocol === 'streamable-http'
179+
})
180+
176181
const needsOAuth = computed(() => {
177182
// Don't show Login button if server is disabled
178183
if (!props.server.enabled) return false
179184
180185
// Don't show Login button while connecting (let the connection attempt finish)
181186
if (props.server.connecting) return false
182187
183-
const isHttpProtocol = props.server.protocol === 'http' || props.server.protocol === 'streamable-http'
184-
if (!isHttpProtocol) return false
188+
if (!isHttpProtocol.value) return false
185189
186190
// Don't show Login if already connected
187191
if (props.server.connected) return false
188192
189-
// Check if server has OAuth configuration
190-
const hasOAuthConfig = props.server.oauth !== null && props.server.oauth !== undefined
191-
if (!hasOAuthConfig) return false
193+
// HTTP servers always support OAuth via autodiscovery, even without explicit oauth config
194+
// oauth: null (new server) and oauth: {} (explicit empty config) should both allow Login
195+
// Only require explicit oauth config for non-HTTP protocols (though they don't reach here)
196+
const hasOAuthSupport = isHttpProtocol.value || (props.server.oauth !== null && props.server.oauth !== undefined)
197+
if (!hasOAuthSupport) return false
192198
193199
// Show Login if user explicitly logged out
194200
if (props.server.user_logged_out) {
@@ -227,8 +233,7 @@ const canLogout = computed(() => {
227233
// Don't show Logout if user already explicitly logged out
228234
if (props.server.user_logged_out) return false
229235
230-
const isHttpProtocol = props.server.protocol === 'http' || props.server.protocol === 'streamable-http'
231-
if (!isHttpProtocol) return false
236+
if (!isHttpProtocol.value) return false
232237
233238
const hasToken = props.server.authenticated === true
234239
if (!hasToken) return false

frontend/src/views/ServerDetail.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<li v-if="server.enabled">
7878
<button @click="restartServer" :disabled="actionLoading">
7979
<span v-if="actionLoading" class="loading loading-spinner loading-xs"></span>
80-
Restart
80+
{{ isHttpProtocol ? 'Reconnect' : 'Restart' }}
8181
</button>
8282
</li>
8383
<li v-if="needsOAuth">
@@ -460,9 +460,13 @@ const logsError = ref<string | null>(null)
460460
const logTail = ref(100)
461461
462462
// Computed
463+
const isHttpProtocol = computed(() => {
464+
return server.value?.protocol === 'http' || server.value?.protocol === 'streamable-http'
465+
})
466+
463467
const needsOAuth = computed(() => {
464468
return server.value &&
465-
(server.value.protocol === 'http' || server.value.protocol === 'streamable-http') &&
469+
isHttpProtocol.value &&
466470
!server.value.connected &&
467471
server.value.enabled &&
468472
server.value.last_error?.includes('authorization')

0 commit comments

Comments
 (0)