mirror of
https://github.com/Adaptix-Framework/AdaptixC2
synced 2026-06-08 10:20:39 +00:00
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
#include <UI/Widgets/ConsoleWidget.h>
|
|
|
|
ConsoleWidget::ConsoleWidget( Agent* a )
|
|
{
|
|
agent = a;
|
|
this->createUI();
|
|
}
|
|
|
|
ConsoleWidget::~ConsoleWidget() {}
|
|
|
|
void ConsoleWidget::createUI()
|
|
{
|
|
QString prompt = QString("%1 >").arg(agent->data.Name);
|
|
CmdLabel = new QLabel(this );
|
|
CmdLabel->setProperty( "LabelStyle", "console" );
|
|
CmdLabel->setText( prompt );
|
|
|
|
InputLineEdit = new QLineEdit(this);
|
|
InputLineEdit->setProperty( "LineEditStyle", "console" );
|
|
|
|
QString info = QString("[%1] %2 @ %3.%4").arg( agent->data.Id ).arg( agent->data.Username ).arg( agent->data.Computer ).arg( agent->data.Domain );
|
|
InfoLabel = new QLabel(this);
|
|
InfoLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
|
InfoLabel->setProperty( "LabelStyle", "console" );
|
|
InfoLabel->setText ( info );
|
|
|
|
OutputTextEdit = new QTextEdit( this );
|
|
OutputTextEdit->setReadOnly(true);
|
|
OutputTextEdit->setLineWrapMode( QTextEdit::LineWrapMode::NoWrap );
|
|
OutputTextEdit->setProperty( "TextEditStyle", "console" );
|
|
|
|
MainGridLayout = new QGridLayout(this );
|
|
MainGridLayout->setVerticalSpacing(4 );
|
|
MainGridLayout->setContentsMargins(0, 0, 0, 4 );
|
|
MainGridLayout->addWidget( CmdLabel, 3, 0, 1, 1 );
|
|
MainGridLayout->addWidget( InputLineEdit, 3, 1, 1, 1 );
|
|
MainGridLayout->addWidget( OutputTextEdit, 0, 0, 1, 2);
|
|
MainGridLayout->addWidget( InfoLabel, 2, 0, 1, 2);
|
|
}
|