| 1186 | void BridgeApp::show_message(const QString &title, const QString &text) { QMessageBox::information(nullptr, title, text); } |
| 1187 | |
| 1188 | QJSValue BridgeApp::targets() const |
| 1189 | { |
| 1190 | QVariantMap list; |
| 1191 | auto targets = scriptEngine->manager()->GetTargets(); |
| 1192 | |
| 1193 | for (const auto& target : targets) { |
| 1194 | QVariantList sessions; |
| 1195 | for (const auto& agent : target.Agents) |
| 1196 | sessions << agent; |
| 1197 | |
| 1198 | QVariantMap map; |
| 1199 | map["id"] = target.TargetId; |
| 1200 | map["computer"] = target.Computer; |
| 1201 | map["domain"] = target.Domain; |
| 1202 | map["address"] = target.Address; |
| 1203 | map["tag"] = target.Tag; |
| 1204 | map["date"] = target.Date; |
| 1205 | map["info"] = target.Info; |
| 1206 | map["alive"] = target.Alive; |
| 1207 | map["agents"] = sessions; |
| 1208 | map["os_desc"] = target.OsDesc; |
| 1209 | map["os"] = osToString(target.Os); |
| 1210 | |
| 1211 | list[target.TargetId] = map; |
| 1212 | } |
| 1213 | |
| 1214 | return this->scriptEngine->engine()->toScriptValue(list); |
| 1215 | } |
| 1216 | |
| 1217 | void BridgeApp::targets_add(const QString &computer, const QString &domain, const QString &address, const QString &os, const QString &osDesc, const QString &tag, const QString &info, bool alive) |
| 1218 | { |
nothing calls this directly
no test coverage detected