From 81a0c45c89df2dc94f7d97c4367f0e549495e4d0 Mon Sep 17 00:00:00 2001
From: Jason <jason.daurus@gmail.com>
Date: Thu, 9 Jun 2016 20:34:57 +0800
Subject: [web] header.js -> Header.js

---
 web/src/js/components/Header/OptionMenu.jsx | 60 +++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 web/src/js/components/Header/OptionMenu.jsx

(limited to 'web/src/js/components/Header/OptionMenu.jsx')

diff --git a/web/src/js/components/Header/OptionMenu.jsx b/web/src/js/components/Header/OptionMenu.jsx
new file mode 100644
index 00000000..6bbf15d5
--- /dev/null
+++ b/web/src/js/components/Header/OptionMenu.jsx
@@ -0,0 +1,60 @@
+import React, { PropTypes } from 'react'
+import { ToggleInputButton, ToggleButton } from '../common.js'
+import { SettingsActions } from '../../actions.js'
+
+OptionMenu.title = "Options"
+
+OptionMenu.propTypes = {
+    settings: PropTypes.object.isRequired,
+}
+
+export default function OptionMenu({ settings }) {
+    // @todo use settings.map
+    return (
+        <div>
+            <div className="menu-row">
+                <ToggleButton text="showhost"
+                    checked={settings.showhost}
+                    onToggle={() => SettingsActions.update({ showhost: !settings.showhost })}
+                />
+                <ToggleButton text="no_upstream_cert"
+                    checked={settings.no_upstream_cert}
+                    onToggle={() => SettingsActions.update({ no_upstream_cert: !settings.no_upstream_cert })}
+                />
+                <ToggleButton text="rawtcp"
+                    checked={settings.rawtcp}
+                    onToggle={() => SettingsActions.update({ rawtcp: !settings.rawtcp })}
+                />
+                <ToggleButton text="http2"
+                    checked={settings.http2}
+                    onToggle={() => SettingsActions.update({ http2: !settings.http2 })}
+                />
+                <ToggleButton text="anticache"
+                    checked={settings.anticache}
+                    onToggle={() => SettingsActions.update({ anticache: !settings.anticache })}
+                />
+                <ToggleButton text="anticomp"
+                    checked={settings.anticomp}
+                    onToggle={() => SettingsActions.update({ anticomp: !settings.anticomp })}
+                />
+                <ToggleInputButton name="stickyauth" placeholder="Sticky auth filter"
+                    checked={!!settings.stickyauth}
+                    txt={settings.stickyauth || ''}
+                    onToggleChanged={txt => SettingsActions.update({ stickyauth: !settings.stickyauth ? txt : null })}
+                />
+                <ToggleInputButton name="stickycookie" placeholder="Sticky cookie filter"
+                    checked={!!settings.stickycookie}
+                    txt={settings.stickycookie || ''}
+                    onToggleChanged={txt => SettingsActions.update({ stickycookie: !settings.stickycookie ? txt : null })}
+                />
+                <ToggleInputButton name="stream" placeholder="stream..."
+                    checked={!!settings.stream}
+                    txt={settings.stream || ''}
+                    inputType="number"
+                    onToggleChanged={txt => SettingsActions.update({ stream: !settings.stream ? txt : null })}
+                />
+            </div>
+            <div className="clearfix"/>
+        </div>
+    )
+}
-- 
cgit v1.2.3

