bugfix: fixed qml warnings when loading user list on PageShare (#1119)
This commit is contained in:
parent
d4fff4af3c
commit
399a8c6d28
1 changed files with 3 additions and 1 deletions
|
@ -77,6 +77,7 @@ ErrorCode ClientManagementModel::updateModel(const DockerContainer container, co
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_clientsTable = QJsonArray();
|
m_clientsTable = QJsonArray();
|
||||||
|
endResetModel();
|
||||||
|
|
||||||
ErrorCode error = ErrorCode::NoError;
|
ErrorCode error = ErrorCode::NoError;
|
||||||
|
|
||||||
|
@ -90,10 +91,10 @@ ErrorCode ClientManagementModel::updateModel(const DockerContainer container, co
|
||||||
const QByteArray clientsTableString = serverController->getTextFileFromContainer(container, credentials, clientsTableFile, error);
|
const QByteArray clientsTableString = serverController->getTextFileFromContainer(container, credentials, clientsTableFile, error);
|
||||||
if (error != ErrorCode::NoError) {
|
if (error != ErrorCode::NoError) {
|
||||||
logger.error() << "Failed to get the clientsTable file from the server";
|
logger.error() << "Failed to get the clientsTable file from the server";
|
||||||
endResetModel();
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beginResetModel();
|
||||||
m_clientsTable = QJsonDocument::fromJson(clientsTableString).array();
|
m_clientsTable = QJsonDocument::fromJson(clientsTableString).array();
|
||||||
|
|
||||||
if (m_clientsTable.isEmpty()) {
|
if (m_clientsTable.isEmpty()) {
|
||||||
|
@ -601,5 +602,6 @@ QHash<int, QByteArray> ClientManagementModel::roleNames() const
|
||||||
roles[LatestHandshakeRole] = "latestHandshake";
|
roles[LatestHandshakeRole] = "latestHandshake";
|
||||||
roles[DataReceivedRole] = "dataReceived";
|
roles[DataReceivedRole] = "dataReceived";
|
||||||
roles[DataSentRole] = "dataSent";
|
roles[DataSentRole] = "dataSent";
|
||||||
|
roles[AllowedIpsRole] = "allowedIps";
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue