diff --git a/pkg/server/root.go b/pkg/server/root.go index 7fdf26db1..1c00d62a7 100644 --- a/pkg/server/root.go +++ b/pkg/server/root.go @@ -190,10 +190,20 @@ func (rh *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/ui/", http.StatusMovedPermanently) return } - if r.URL.Path == "/favicon.ico" { + switch r.URL.Path { + case "/favicon.ico": ServeStaticFile(w, r, Files, "favicon.ico") return + case "/mobile-setup": + http.Redirect(w, r, "/ui/mobile.html", http.StatusFound) + return + case "/": + break + default: + http.NotFound(w, r) + return } + f := func(p string, a ...interface{}) { fmt.Fprintf(w, p, a...) } diff --git a/server/perkeepd/ui/header.js b/server/perkeepd/ui/header.js index 4eb6cf82c..654336d3a 100644 --- a/server/perkeepd/ui/header.js +++ b/server/perkeepd/ui/header.js @@ -52,6 +52,7 @@ cam.Header = React.createClass({ height: React.PropTypes.number.isRequired, helpURL: React.PropTypes.instanceOf(goog.Uri).isRequired, homeURL: React.PropTypes.instanceOf(goog.Uri).isRequired, + mobileSetupURL: React.PropTypes.instanceOf(goog.Uri).isRequired, importersURL: React.PropTypes.instanceOf(goog.Uri).isRequired, mainControls: React.PropTypes.arrayOf(React.PropTypes.node), onNewPermanode: React.PropTypes.func, @@ -224,6 +225,7 @@ cam.Header = React.createClass({ this.getMenuItem_('Importers', this.props.importersURL), this.getMenuItem_('Server status', this.props.statusURL), this.getMenuItem_('Favorites', this.props.favoritesURL), + this.getMenuItem_('Mobile Setup', this.props.mobileSetupURL), this.getMenuItem_('Help', this.props.helpURL), // We could use getMenuItem_, and only implement // the onClick part with Go, but we're instead also diff --git a/server/perkeepd/ui/index.js b/server/perkeepd/ui/index.js index a87277fee..479c77a9c 100644 --- a/server/perkeepd/ui/index.js +++ b/server/perkeepd/ui/index.js @@ -678,6 +678,7 @@ cam.IndexPage = React.createClass({ pendingQuery: this.state.pendingQuery, height: 38, helpURL: this.baseURL_.resolve(new goog.Uri(this.props.config.helpRoot)), + mobileSetupURL: this.baseURL_.resolve(new goog.Uri("/mobile-setup")), homeURL: this.baseURL_, importersURL: this.baseURL_.resolve(new goog.Uri(this.props.config.importerRoot)), mainControls: chooser.map(function(val, idx) { diff --git a/server/perkeepd/ui/mobile_setup.js b/server/perkeepd/ui/mobile_setup.js index 4ea7493ab..db29fe6e5 100644 --- a/server/perkeepd/ui/mobile_setup.js +++ b/server/perkeepd/ui/mobile_setup.js @@ -83,7 +83,7 @@ cam.MobileSetupView = React.createClass({ React.DOM.div({}, React.DOM.img({src:this.getQRURL_()}), React.DOM.form({ref:'form', onSubmit:this.handleChange_}, - React.DOM.label({}, 'Camlistore Server:', + React.DOM.label({}, 'Perkeep Server:', React.DOM.input({ defaultValue: this.state.server, onChange: this.handleServerChange_, @@ -113,12 +113,6 @@ cam.MobileSetupView = React.createClass({ type: 'text' }), 'MB'), - React.DOM.label({}, 'Self-signed cert fingerprint:', - React.DOM.input({ - onChange: this.handleCertFingerprintChange_, - placeholder: '', - type: 'text' - })) ))); },