SusiDNS: Default to the console theme

This commit is contained in:
str4d
2017-07-02 03:42:35 +00:00
parent 96c73e7fcb
commit 873b0b0f19
2 changed files with 16 additions and 16 deletions

View File

@@ -25,7 +25,6 @@ public class BaseBean
private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt"; private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt";
public static final String RC_PROP_THEME_NAME = "routerconsole.theme"; public static final String RC_PROP_THEME_NAME = "routerconsole.theme";
public static final String RC_PROP_UNIVERSAL_THEMING = "routerconsole.universal.theme";
public static final String PROP_THEME_NAME = "theme"; public static final String PROP_THEME_NAME = "theme";
public static final String DEFAULT_THEME = "light"; public static final String DEFAULT_THEME = "light";
public static final String BASE_THEME_PATH = "/themes/susidns/"; public static final String BASE_THEME_PATH = "/themes/susidns/";
@@ -90,21 +89,19 @@ public class BaseBean
public String getTheme() { public String getTheme() {
loadConfig(); loadConfig();
String url = BASE_THEME_PATH; String url = BASE_THEME_PATH;
String theme = properties.getProperty(PROP_THEME_NAME, DEFAULT_THEME); // Fetch routerconsole theme (or use our default if it doesn't exist)
boolean universalTheming = _context.getBooleanProperty(RC_PROP_UNIVERSAL_THEMING); String theme = _context.getProperty(RC_PROP_THEME_NAME, DEFAULT_THEME);
if (universalTheming) { // Apply any override
// Fetch routerconsole theme (or use our default if it doesn't exist) theme = properties.getProperty(PROP_THEME_NAME, theme);
theme = _context.getProperty(RC_PROP_THEME_NAME, DEFAULT_THEME); // Ensure that theme exists
// Ensure that theme exists String[] themes = getThemes();
String[] themes = getThemes(); boolean themeExists = false;
boolean themeExists = false; for (int i = 0; i < themes.length; i++) {
for (int i = 0; i < themes.length; i++) { if (themes[i].equals(theme))
if (themes[i].equals(theme)) themeExists = true;
themeExists = true;
}
if (!themeExists)
theme = DEFAULT_THEME;
} }
if (!themeExists)
theme = DEFAULT_THEME;
url += theme + "/"; url += theme + "/";
return url; return url;
} }

View File

@@ -1,3 +1,7 @@
2017-07-02 str4d
* Console: Show correct icon for "Firewalled" network status
* SusiDNS: Default to the console theme
2017-07-01 str4d 2017-07-01 str4d
* Console: * Console:
- /netdb: - /netdb:
@@ -15,7 +19,6 @@
- /tunnels: - /tunnels:
- Tag "Local" for translation (and convert to lowercase in CSS) - Tag "Local" for translation (and convert to lowercase in CSS)
- Arabic: ensure our tunnel tables display correctly - Arabic: ensure our tunnel tables display correctly
- Show correct icon for "Firewalled" network status
* I2PSnark: * I2PSnark:
- Fix unclosed <label> - Fix unclosed <label>
- Standalone: - Standalone: