diff --git a/gui/main.qml b/gui/main.qml index 99184da..2ee34c3 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -351,6 +351,9 @@ ApplicationWindow { spacing: 16 Layout.margins: 16 + // --- Session --- + Label { text: "Session"; font.bold: true; font.pointSize: theme.fontSize > 0 ? theme.fontSize + 1 : Qt.application.font.pointSize + 1 } + // Directory RowLayout { Layout.fillWidth: true @@ -415,10 +418,24 @@ ApplicationWindow { } } - // Agent + // Remote RowLayout { Layout.fillWidth: true - Label { text: "Agent:"; Layout.preferredWidth: 80 } + Label { text: "Remote:"; Layout.preferredWidth: 80 } + TextField { + id: remoteField + Layout.fillWidth: true + placeholderText: "user@host:port" + } + } + + // --- Agent --- + Label { text: "Agent"; font.bold: true; font.pointSize: theme.fontSize > 0 ? theme.fontSize + 1 : Qt.application.font.pointSize + 1 } + + // Agent profile + RowLayout { + Layout.fillWidth: true + Label { text: "Profile:"; Layout.preferredWidth: 80 } ComboBox { id: agentCombo Layout.fillWidth: true @@ -428,14 +445,14 @@ ApplicationWindow { } } - // Remote + // Agent Name RowLayout { Layout.fillWidth: true - Label { text: "Remote:"; Layout.preferredWidth: 80 } + Label { text: "Alias:"; Layout.preferredWidth: 80 } TextField { - id: remoteField + id: agentAliasField Layout.fillWidth: true - placeholderText: "user@host:port" + placeholderText: "(auto-generated)" } } @@ -477,8 +494,9 @@ ApplicationWindow { var model = modelCombo.currentIndex >= 0 ? modelCombo.currentText.trim() : "" var agent = agentCombo.currentText var remote = remoteField.text.trim() + var agentAlias = agentAliasField.text.trim() - var ok = ollie.createSession(cwd, name, backend, model, agent, remote) + var ok = ollie.createSession(cwd, name, backend, model, agent, remote, agentAlias) if (ok) { ollie.refreshSessions() } else { diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index 7b1c565..cb5f02e 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -264,7 +264,7 @@ QStringList Ollie9pClient::getAvailableModels(const QString &backend) const return it.value().toStringList(); } -bool Ollie9pClient::createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote) +bool Ollie9pClient::createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote, const QString &agentAlias) { if (cwd.isEmpty()) return false; @@ -275,6 +275,7 @@ bool Ollie9pClient::createSession(const QString &cwd, const QString &name, const if (!model.isEmpty()) args << "model=" + model; if (!agent.isEmpty()) args << "agent=" + agent; if (!remote.isEmpty()) args << "remote=" + remote; + if (!agentAlias.isEmpty()) args << "agent_alias=" + agentAlias; QProcess proc; QStringList fullArgs = {"-a", serverAddr(), "write", "session/new"}; diff --git a/gui/ollie9pclient.h b/gui/ollie9pclient.h index 5145aaa..c850adf 100644 --- a/gui/ollie9pclient.h +++ b/gui/ollie9pclient.h @@ -65,7 +65,7 @@ public: Q_INVOKABLE void loadRootBackends(); Q_INVOKABLE void loadRootAgents(); Q_INVOKABLE QStringList getAvailableModels(const QString &backend) const; - Q_INVOKABLE bool createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote); + Q_INVOKABLE bool createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote, const QString &agentAlias); Q_INVOKABLE bool renameSession(const QString &sessionId, const QString &newName); Q_INVOKABLE bool renameAgent(const QString &sessionId, const QString &agentId, const QString &newName);