Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bandwidth graph colours to be set by theme #734

Merged
merged 4 commits into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions package/gargoyle/files/www/bandwidth_expand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
# itself remain covered by the GPL.
# See http://gargoyle-router.com/faq.html#qfoss for more information
eval $( gargoyle_session_validator -c "$COOKIE_hash" -e "$COOKIE_exp" -a "$HTTP_USER_AGENT" -i "$REMOTE_ADDR" -r "login.sh" -t $(uci get gargoyle.global.session_timeout) -b "$COOKIE_browser_time" )
gargoyle_header_footer -m -c "internal.css" -j gargoyle_header_footer -m -c "internal.css"
gargoyle_header_footer -m -c "internal.css"
%>
<strong><span id="plot_title" style="margin-left:10px;"></span></strong>
<strong><span id="plot_title" class="col-xs-12"></span></strong>
<label class="col-xs-4" id="plot1_title"><%~ Plot %> 1</label>
<label class="col-xs-4" id="plot2_title"><%~ Plot %> 2</label>
<label class="col-xs-4" id="plot3_title"><%~ Plot %> 3</label>
<embed id="bandwidth_plot" style="margin-left:10px; margin-right:10px; width:800px; height:600px;" src="bandwidth.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"></embed>

</body>
Expand Down
2 changes: 1 addition & 1 deletion package/gargoyle/files/www/js/bandwidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ function expand(name)
expWindow = null;
}

expWindow = openPopupWindow("bandwidth_expand.sh", name + " " + bndwS.BPlot, 730, 630);
expWindow = openPopupWindow("bandwidth_expand.sh", name + " " + bndwS.BPlot, 830, 650);
expandedWindows[name] = expWindow;

var runOnWindowLoad = function(name)
Expand Down
11 changes: 11 additions & 0 deletions package/gargoyle/files/www/js/svg_bandwidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ function init(evt)
var bodyStyle = window.getComputedStyle(window.parent.document.body);
themeColor = bodyStyle.color;
themeFontFamily = bodyStyle.fontFamily;
for(var x = 1; x < 4; x++)
{
var titleEl = window.parent.document.getElementById("plot" + x + "_title");
if(titleEl != null)
{
var titleColour = window.getComputedStyle(titleEl).color;
var plot = svgDoc.getElementById("plot" + x);
plot.style.stroke = titleColour;
plot.style.fill = titleColour;
}
}
}

var graphRightCoor=Math.floor(rightCoor*(85/100));
Expand Down
63 changes: 63 additions & 0 deletions package/plugin-gargoyle-theme-flat-blue/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=plugin_gargoyle_theme_flat_blue
PKG_VERSION:=$(GARGOYLE_VERSION)
ifeq ($(GARGOYLE_VERSION),)
PKG_VERSION:=1.0.0
endif
PKG_RELEASE:=1


PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/plugin-gargoyle-theme-flat-blue
SECTION:=admin
CATEGORY:=Administration
SUBMENU:=Gargoyle Web Interface
TITLE:=Flat Blue Theme
MAINTAINER:=Michael Gray <[email protected]>
PKGARCH:=all
endef

define Package/plugin-gargoyle-theme-flat-blue/description
Flat blue theme for Gargoyle
endef

define Build/Prepare
endef

define Build/Configure
endef

define Build/Compile
endef

define Package/plugin-gargoyle-theme-flat-blue/install
$(INSTALL_DIR) $(1)
$(CP) ./files/* $(1)/
endef

define Package/plugin-gargoyle-theme-flat-blue/postinst
if [ -z "$${IPKG_INSTROOT}" ] ; then
/etc/init.d/gargoyle_themes restart
fi
endef
define Package/plugin-gargoyle-theme-flat-blue/postrm
if [ -z "$${IPKG_INSTROOT}" ] ; then
IFS=$$(echo -en "\n\b")
for d in `find /www/themes/ -type d` ; do
if [ -d "$$d" ] ; then
contents=$$(ls "$$d")
if [ -z "$$contents" ] ; then
rmdir -p "$$d" 2>/dev/null
fi
fi
done
/etc/init.d/gargoyle_themes restart
fi
endef


$(eval $(call BuildPackage,plugin-gargoyle-theme-flat-blue))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading