mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Scripts overview enhancements
- Add missing subdirs - Add link to the scripts source
This commit is contained in:
parent
9d59aa67be
commit
a564a7a094
3 changed files with 32 additions and 16 deletions
|
|
@ -10,6 +10,8 @@ local os_utils = require("os_utils")
|
|||
local json = require("dkjson")
|
||||
local plugins_utils = require("plugins_utils")
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
|
||||
local user_scripts = {}
|
||||
|
||||
-- ##############################################
|
||||
|
|
@ -1281,4 +1283,16 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function user_scripts.getScriptEditorUrl(script)
|
||||
if(script.edition == "community") then
|
||||
local plugin_file_path = string.sub(script.source_path, string.len(dirs.scriptdir) + 1)
|
||||
local plugin_path = string.sub(script.plugin.path, string.len(dirs.scriptdir) + 1)
|
||||
return(string.format("%s/lua/code_viewer.lua?plugin_file_path=%s&plugin_path=%s", ntop.getHttpPrefix(), plugin_file_path, plugin_path))
|
||||
end
|
||||
|
||||
return(nil)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
return(user_scripts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue