Skip to content

Instantly share code, notes, and snippets.

@stephenquan
Created May 3, 2018 05:34
Show Gist options
  • Save stephenquan/72ea637776a082aabc43c914e0413df6 to your computer and use it in GitHub Desktop.
Save stephenquan/72ea637776a082aabc43c914e0413df6 to your computer and use it in GitHub Desktop.
appstudio-active-networks.qml
import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Networking 1.0
Item {
Flickable {
anchors.fill: parent
contentWidth: textArea.width
contentHeight: textArea.height
TextArea {
id: textArea
text: JSON.stringify(toArray(Networking.configurations).filter(isConfigActive).map(summary), undefined, 2)
}
}
function toArray(o) {
return Object.keys(o).map(function (e) { return o[e]; } );
}
function isConfigActive(c) {
return (c.state & NetworkConfiguration.StateActive) === NetworkConfiguration.StateActive;
}
function summary(c) {
return {
name: c.name,
bearerType: c.bearerType
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment