Skip to content

Commit

Permalink
Merge branch 'ntop:dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaferret authored Jul 16, 2024
2 parents 79b0141 + ee8f775 commit f9758fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/NetworkInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ class NetworkInterface : public NetworkInterfaceAlertableEntity {
inline AddressTree *getInterfaceNetworks() { return (&interface_networks); };
virtual void startPacketPolling();
virtual void startFlowDumping();
virtual bool isLoading() { return false; };
virtual void shutdown();
virtual void cleanup();
virtual char *getEndpoint(u_int8_t id) { return NULL; };
Expand Down
4 changes: 4 additions & 0 deletions scripts/lua/inc/footer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ print[[
msg += "<a href=\"https://cloud.ntop.org\">";
msg += "<span class=\"badge bg-danger\">ntop <i class=\"fas fa-cloud\"></i></span></a>";
}
if(rsp.is_loading == true) {
msg += "<blink><span class=\"badge bg-primary\"><i class=\"fas fa-spinner\"></i> ]] print (i18n("loading")) print [[</span></blink>";
}
]]

if ntop.isOffline() then
Expand Down
2 changes: 2 additions & 0 deletions scripts/lua/rest/v2/get/interface/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ function dumpBriefInterfaceStats(ifid)
-- Adding a preference if active discovery is enabled
res["active_discovery_active"] = ntop.getPref("ntopng.prefs.is_periodic_network_discovery_running.ifid_" ..
interface.getId()) == "1"

res["is_loading"] = ifstats.isLoading
end

return res
Expand Down
1 change: 1 addition & 0 deletions src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7394,6 +7394,7 @@ void NetworkInterface::lua(lua_State *vm, bool fullStats) {
lua_push_bool_table_entry(vm, "isViewed", isViewed()); /* Viewed interface */
lua_push_bool_table_entry(vm, "isSampledTraffic",
isSampledTraffic()); /* Whether this interface has sampled traffic */
lua_push_bool_table_entry(vm, "isLoading", isLoading());
if (isSubInterface()) luaSubInterface(vm);
#ifdef NTOPNG_PRO
#ifndef HAVE_NEDGE
Expand Down

0 comments on commit f9758fe

Please sign in to comment.