Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { basepath } from 'devui-data';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/button';
import { RouterController } from 'router-controller';
import {notifier} from 'notifier';

/**
* This component show settings for the Dev MCP Server
Expand Down Expand Up @@ -135,7 +136,12 @@ export class QwcDevMCPSetting extends QwcHotReloadElement {
<div class="serverDetailsText">
<span>Connect to the Quarkus Dev MCP Server with:</span>
<span><b>Protocol:</b> Remote Streamable HTTP</span>
<span><b>URL:</b> ${this._mcpPath}</span>
<span><b>URL:</b> ${this._mcpPath}
<vaadin-button theme="tertiary small" title="Copy to clipboard" @click=${() => this._copyToClipboard(this._mcpPath, 'MCP URL')}>
<vaadin-icon icon="font-awesome-solid:clipboard" slot="prefix" class="btn-icon">
</vaadin-icon>
</vaadin-button>
</span>
<div/>
</div>
${this._renderDisableButton()}`;
Expand Down Expand Up @@ -184,7 +190,18 @@ export class QwcDevMCPSetting extends QwcHotReloadElement {
});
}
}



_copyToClipboard(txt, what) {
navigator.clipboard.writeText(txt).then(
() => {
notifier.showInfoMessage(`Copied "${what}" to clipboard.`, 'top-end');
},
() => {
notifier.showErrorMessage(`Failed to copy "${what}" to clipboard.`, 'top-end');
}
);
}


}
customElements.define('qwc-dev-mcp-setting', QwcDevMCPSetting);
Loading