{"version":3,"sources":["config.ts","layout/Header.tsx","common/DefaultPage.tsx","common/LoadingSpinner.tsx","inject.tsx","snack/browserNotification.ts","layout/Navigation.tsx","common/ScrollUpButton.tsx","common/SettingsDialog.tsx","snack/SnackBarHandler.tsx","common/ConfirmDialog.tsx","message/extras.ts","common/ToggleVisibility.tsx","application/AddApplicationDialog.tsx","application/UpdateApplicationDialog.tsx","application/Applications.tsx","client/AddClientDialog.tsx","client/UpdateClientDialog.tsx","client/Clients.tsx","plugin/Plugins.tsx","common/Container.tsx","plugin/PluginDetailView.tsx","user/Login.tsx","message/Message.tsx","message/Messages.tsx","user/AddEditUserDialog.tsx","user/Users.tsx","common/ConnectionErrorBanner.tsx","layout/Layout.tsx","registerServiceWorker.ts","CurrentUser.ts","common/BaseStore.ts","application/AppStore.ts","message/WebSocketStore.ts","snack/SnackManager.ts","user/UserStore.ts","message/MessagesStore.ts","client/ClientStore.ts","plugin/PluginStore.ts","reactions.ts","index.tsx","apiAuth.ts"],"names":["config","get","val","Header","observer","this","props","classes","version","name","loggedIn","admin","toggleTheme","logout","style","setNavOpen","width","position","AppBar","className","appBar","Toolbar","toolbar","title","to","link","Typography","variant","titleName","color","href","renderButtons","IconButton","onClick","target","rel","showSettings","menuButtons","Hidden","smUp","implementation","icon","label","id","Component","ResponsiveButton","children","rest","Button","startIcon","withWidth","withStyles","theme","createStyles","zIndex","drawer","breakpoints","down","paddingBottom","justifyContent","flexWrap","display","flex","flexBasis","marginTop","order","up","paddingRight","textDecoration","withTheme","DefaultPage","rightControl","maxWidth","margin","Grid","container","spacing","item","xs","LoadingSpinner","textAlign","CircularProgress","size","inject","stores","node","mobxInject","InjectProvider","mayAllowPermission","Notify","needsPermission","isSupported","Notification","permission","closeAndFocus","event","window","parent","focus","location","close","closeAfterTimeout","setTimeout","Navigation","state","showRequestNotification","appStore","navOpen","apps","getItems","userApps","length","map","app","key","ListItem","button","ListItemText","primary","placeholderItems","disabled","paper","drawerPaper","Divider","align","requestPermission","console","log","setState","ResponsiveDrawer","Drawer","open","xsDown","minHeight","height","mixins","ScrollUpButton","scrollUp","scrollTo","Fab","bottom","right","SettingsDialog","pass","fClose","currentUser","Dialog","onClose","aria-labelledby","DialogTitle","DialogContent","TextField","autoFocus","type","value","onChange","e","fullWidth","DialogActions","Tooltip","changePassword","observable","SnackBarHandler","dispose","componentDidMount","reaction","snackManager","counter","onNewSnack","componentWillUnmount","openWhen","snackOpenSince","Date","now","MIN_VISIBLE_SNACK_TIME_IN_MS","closeCurrentSnack","openNextSnack","hasNext","next","current","message","duration","MAX_VISIBLE_SNACK_TIME_IN_MS","Snackbar","anchorOrigin","vertical","horizontal","autoHideDuration","onExited","action","aria-label","ConfirmDialog","text","fOnSubmit","DialogContentText","RenderMode","ToggleVisibility","visible","toggleVisibility","fontFamily","fontSize","AddDialog","description","submitEnabled","handleChange","bind","multiline","propertyName","UpdateDialog","initialName","initialDescription","Applications","uploadId","upload","refresh","uploadImage","click","onUploadImage","file","files","indexOf","alert","createDialog","deleteId","updateId","Paper","elevation","Table","TableHead","TableRow","TableCell","padding","TableBody","image","token","fUpload","fDelete","fEdit","noDelete","internal","ref","create","update","getByID","remove","Row","Avatar","src","alignItems","placement","Clients","clientStore","showDialog","clients","client","Plugins","pluginStore","plugins","plugin","enabled","fToggleStatus","changeEnabledState","Switch","checked","data-enabled","PluginDetailView","pluginID","parseInt","match","params","pluginInfo","displayText","currentConfig","refreshFeatures","nextProps","Promise","all","refreshConfigurer","refreshDisplayer","capabilities","requestConfig","response","requestDisplay","Info","Build","initialConfig","save","newConfig","a","changeConfig","Subject","PanelWrapper","Icon","float","toLowerCase","trim","replace","ConfigurerPanel","unsavedChanges","options","mode","lineNumbers","instance","data","newConf","then","DisplayerPanel","source","PluginInfo","url","author","modulePath","website","license","join","Login","login","preventDefault","username","password","onSubmit","connectionErrorMessage","marginBottom","contentType","extras","extract","Object","keys","k","some","Plain","path","Message","getBoundingClientRect","renderContent","content","Markdown","escapeHtml","date","wrapperPadding","imageWrapper","alt","messageContentWrapper","header","headerTitle","trash","component","React","PureComponent","marginRight","opacity","whiteSpace","wordBreak","overflow","Messages","appId","isLoadingMore","updateAllWithProps","messagesStore","exists","loadMore","updateAll","deleteMessage","removeSingle","renderMessage","heights","gutterBottom","onscroll","innerHeight","pageYOffset","document","body","offsetHeight","checkIfLoadMore","messages","hasMore","canLoadMore","getName","hasMessages","refreshByApp","removeByApp","useWindowAsScrollContainer","preloadBatchSize","elementHeight","m","undefined","AddEditDialog","isEdit","namePresent","passPresent","FormControlLabel","control","handleChecked","UserRow","Users","userStore","editId","users","user","wrapper","ConnectionErrorBanner","retry","backgroundColor","lineHeight","themeMap","light","createMuiTheme","palette","dark","Layout","defaultVersion","axios","resp","localStorageTheme","localStorage","getItem","currentTheme","setItem","authenticating","tryReconnect","flexDirection","CssBaseline","top","exact","render","isLocalhost","Boolean","hostname","register","navigator","URL","process","toString","origin","addEventListener","swUrl","fetch","status","headers","serviceWorker","ready","registration","unregister","reload","registerValidSW","catch","checkValidServiceWorker","onupdatefound","installingWorker","installing","onstatechange","controller","error","tokenKey","CurrentUser","snack","tokenCache","reconnectTimeoutId","reconnectTime","localStorageToken","setToken","browser","detect","request","method","Authorization","Base64","encode","tryAuthenticate","reject","passThrough","connectionError","statusText","filter","forEach","delete","resolve","removeItem","post","quiet","clearTimeout","Math","min","BaseStore","getByIDOrUndefined","Error","items","find","hasId","requestDelete","requestItems","AppStore","onDelete","formData","FormData","append","put","WebSocketStore","wsActive","ws","listen","callback","wsUrl","WebSocket","onerror","onmessage","JSON","parse","onclose","SnackManager","shift","push","UserStore","MessagesStore","loading","stateOf","emptyState","loaded","clear","fetchMessages","since","getUnCached","appToImage","reduce","appid","createTransformer","clearCache","createEmptyStatesForApps","array","nextSince","messageToDelete","index","findIndex","splice","pagedResult","paging","unshift","clearAll","removeFromList","ClientStore","createNoNotifcation","PluginStore","registerReactions","wsStore","loadAll","msg","publishSingleMessage","removeMarkdown","silent","notifyClick","notifyShow","show","priority","Audio","play","port","protocol","pathname","slashes","concat","endsWith","substring","lastIndexOf","defaultProdConfig","c","initStores","interceptors","use","errorDescription","onbeforeunload","ReactDOM","getElementById","registerServiceWorker"],"mappings":"+JAIIA,E,kDAMG,SAASC,EAAIC,GAChB,OAAOF,EAAOE,G,sXCqEZC,EADLC,Y,yKAEoB,IAAD,EAYRC,KAAKC,MAVLC,EAFQ,EAERA,QACAC,EAHQ,EAGRA,QACAC,EAJQ,EAIRA,KACAC,EALQ,EAKRA,SACAC,EANQ,EAMRA,MACAC,EAPQ,EAORA,YACAC,EARQ,EAQRA,OACAC,EATQ,EASRA,MACAC,EAVQ,EAURA,WACAC,EAXQ,EAWRA,MAGEC,EAAqB,OAAVD,EAAiB,SAAW,QAE7C,OACI,kBAACE,EAAA,EAAD,CAAQD,SAAUA,EAAUH,MAAOA,EAAOK,UAAWZ,EAAQa,QACzD,kBAACC,EAAA,EAAD,CAASF,UAAWZ,EAAQe,SACxB,yBAAKH,UAAWZ,EAAQgB,OACpB,kBAAC,IAAD,CAAMC,GAAG,IAAIL,UAAWZ,EAAQkB,MAC5B,kBAACC,EAAA,EAAD,CAAYC,QAAQ,KAAKR,UAAWZ,EAAQqB,UAAWC,MAAM,WAA7D,WAIJ,uBACIC,KAAM,kDAAoDtB,EAC1DW,UAAWZ,EAAQkB,MACnB,kBAACC,EAAA,EAAD,CAAYC,QAAQ,SAASE,MAAM,WAAnC,IACMrB,KAIbE,GAAYL,KAAK0B,cAActB,EAAME,EAAOE,EAAQG,EAAOD,GAC5D,6BACI,kBAACiB,EAAA,EAAD,CAAYC,QAASrB,EAAaiB,MAAM,WACpC,kBAAC,IAAD,OAGJ,uBACIC,KAAK,mCACLX,UAAWZ,EAAQkB,KACnBS,OAAO,SACPC,IAAI,uBACJ,kBAACH,EAAA,EAAD,CAAYH,MAAM,WACd,kBAAC,IAAD,a,oCAUxBpB,EACAE,EACAE,EACAG,EACAD,GACD,IAAD,EACkCV,KAAKC,MAA9BC,EADT,EACSA,QAA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EAAO2c,QAAQ3b,SAGnBsd,SACI,gBAAC,GAAD,CAAgBte,OAAQA,GACpB,gBAAC,GAAD,OAEJ8R,SAASyM,eAAe,SAE5BC,KAvBJ,K","file":"static/js/main.8515d752.chunk.js","sourcesContent":["export interface IConfig {\n url: string;\n}\n\nlet config: IConfig;\n\nexport function set(c: IConfig) {\n config = c;\n}\n\nexport function get(val: 'url'): string {\n return config[val];\n}\n","import AppBar from '@material-ui/core/AppBar';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport {createStyles, Theme, WithStyles, withStyles} from '@material-ui/core/styles';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport AccountCircle from '@material-ui/icons/AccountCircle';\nimport Chat from '@material-ui/icons/Chat';\nimport DevicesOther from '@material-ui/icons/DevicesOther';\nimport ExitToApp from '@material-ui/icons/ExitToApp';\nimport Highlight from '@material-ui/icons/Highlight';\nimport GitHubIcon from '@material-ui/icons/GitHub';\nimport MenuIcon from '@material-ui/icons/Menu';\nimport Apps from '@material-ui/icons/Apps';\nimport SupervisorAccount from '@material-ui/icons/SupervisorAccount';\nimport React, {Component, CSSProperties} from 'react';\nimport {Link} from 'react-router-dom';\nimport {observer} from 'mobx-react';\nimport {Hidden, PropTypes, withWidth} from '@material-ui/core';\nimport {Breakpoint} from '@material-ui/core/styles/createBreakpoints';\n\nconst styles = (theme: Theme) =>\n createStyles({\n appBar: {\n zIndex: theme.zIndex.drawer + 1,\n [theme.breakpoints.down('xs')]: {\n paddingBottom: 10,\n },\n },\n toolbar: {\n justifyContent: 'space-between',\n [theme.breakpoints.down('xs')]: {\n flexWrap: 'wrap',\n },\n },\n menuButtons: {\n display: 'flex',\n [theme.breakpoints.down('sm')]: {\n flex: 1,\n },\n justifyContent: 'center',\n [theme.breakpoints.down('xs')]: {\n flexBasis: '100%',\n marginTop: 5,\n order: 1,\n justifyContent: 'space-between',\n },\n },\n title: {\n [theme.breakpoints.up('md')]: {\n flex: 1,\n },\n display: 'flex',\n alignItems: 'center',\n },\n titleName: {\n paddingRight: 10,\n },\n link: {\n color: 'inherit',\n textDecoration: 'none',\n },\n });\n\ntype Styles = WithStyles<'link' | 'menuButtons' | 'toolbar' | 'titleName' | 'title' | 'appBar'>;\n\ninterface IProps extends Styles {\n loggedIn: boolean;\n name: string;\n admin: boolean;\n version: string;\n toggleTheme: VoidFunction;\n showSettings: VoidFunction;\n logout: VoidFunction;\n style: CSSProperties;\n width: Breakpoint;\n setNavOpen: (open: boolean) => void;\n}\n\n@observer\nclass Header extends Component {\n public render() {\n const {\n classes,\n version,\n name,\n loggedIn,\n admin,\n toggleTheme,\n logout,\n style,\n setNavOpen,\n width,\n } = this.props;\n\n const position = width === 'xs' ? 'sticky' : 'fixed';\n\n return (\n \n \n
\n \n \n Gotify\n \n \n \n \n @{version}\n \n \n
\n {loggedIn && this.renderButtons(name, admin, logout, width, setNavOpen)}\n
\n \n \n \n\n \n \n \n \n \n
\n
\n
\n );\n }\n\n private renderButtons(\n name: string,\n admin: boolean,\n logout: VoidFunction,\n width: Breakpoint,\n setNavOpen: (open: boolean) => void\n ) {\n const {classes, showSettings} = this.props;\n return (\n
\n \n }\n onClick={() => setNavOpen(true)}\n label=\"menu\"\n width={width}\n color=\"inherit\"\n />\n \n {admin && (\n \n }\n label=\"users\"\n width={width}\n color=\"inherit\"\n />\n \n )}\n \n } label=\"apps\" width={width} color=\"inherit\" />\n \n \n }\n label=\"clients\"\n width={width}\n color=\"inherit\"\n />\n \n \n }\n label=\"plugins\"\n width={width}\n color=\"inherit\"\n />\n \n }\n label={name}\n onClick={showSettings}\n id=\"changepw\"\n width={width}\n color=\"inherit\"\n />\n }\n label=\"Logout\"\n onClick={logout}\n id=\"logout\"\n width={width}\n color=\"inherit\"\n />\n
\n );\n }\n}\n\nconst ResponsiveButton: React.FC<{\n width: Breakpoint;\n color: PropTypes.Color;\n label: string;\n id?: string;\n onClick?: () => void;\n icon: React.ReactNode;\n}> = ({width, icon, children, label, ...rest}) => {\n if (width === 'xs' || width === 'sm') {\n return {icon};\n }\n return (\n \n );\n};\n\nexport default withWidth()(withStyles(styles, {withTheme: true})(Header));\n","import Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, {FC} from 'react';\n\ninterface IProps {\n title: string;\n rightControl?: React.ReactNode;\n maxWidth?: number;\n}\n\nconst DefaultPage: FC = ({title, rightControl, maxWidth = 700, children}) => (\n
\n \n \n \n {title}\n \n {rightControl}\n \n {children}\n \n
\n);\nexport default DefaultPage;\n","import CircularProgress from '@material-ui/core/CircularProgress';\nimport Grid from '@material-ui/core/Grid';\nimport React from 'react';\nimport DefaultPage from './DefaultPage';\n\nexport default function LoadingSpinner() {\n return (\n \n \n \n \n \n );\n}\n","import * as React from 'react';\nimport {UserStore} from './user/UserStore';\nimport {SnackManager} from './snack/SnackManager';\nimport {MessagesStore} from './message/MessagesStore';\nimport {CurrentUser} from './CurrentUser';\nimport {ClientStore} from './client/ClientStore';\nimport {AppStore} from './application/AppStore';\nimport {inject as mobxInject, Provider} from 'mobx-react';\nimport {WebSocketStore} from './message/WebSocketStore';\nimport {PluginStore} from './plugin/PluginStore';\n\nexport interface StoreMapping {\n userStore: UserStore;\n snackManager: SnackManager;\n messagesStore: MessagesStore;\n currentUser: CurrentUser;\n clientStore: ClientStore;\n appStore: AppStore;\n pluginStore: PluginStore;\n wsStore: WebSocketStore;\n}\n\nexport type AllStores = Extract;\nexport type Stores = Pick;\n\nexport const inject = (...stores: I[]) => {\n return

(\n node: React.ComponentType

\n ): React.ComponentType>> => {\n // tslint:disable-next-line:no-any\n return mobxInject(...stores)(node) as any;\n };\n};\n\nexport const InjectProvider: React.SFC<{stores: StoreMapping}> = ({children, stores}) => {\n return {children};\n};\n","import Notify from 'notifyjs';\nimport removeMarkdown from 'remove-markdown';\nimport {IMessage} from '../types';\n\nexport function mayAllowPermission(): boolean {\n return Notify.needsPermission && Notify.isSupported() && Notification.permission !== 'denied';\n}\n\nexport function requestPermission() {\n if (Notify.needsPermission && Notify.isSupported()) {\n Notify.requestPermission(\n () => console.log('granted notification permissions'),\n () => console.log('notification permission denied')\n );\n }\n}\n\nexport function notifyNewMessage(msg: IMessage) {\n const notify = new Notify(msg.title, {\n body: removeMarkdown(msg.message),\n icon: msg.image,\n silent: true,\n notifyClick: closeAndFocus,\n notifyShow: closeAfterTimeout,\n });\n notify.show();\n}\n\nfunction closeAndFocus(event: Event) {\n if (window.parent) {\n window.parent.focus();\n }\n window.focus();\n window.location.href = '/';\n const target = event.target as Notification;\n target.close();\n}\n\nfunction closeAfterTimeout(event: Event) {\n setTimeout(() => {\n const target = event.target as Notification;\n target.close();\n }, 5000);\n}\n","import Divider from '@material-ui/core/Divider';\nimport Drawer from '@material-ui/core/Drawer';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport {StyleRules, Theme, WithStyles, withStyles} from '@material-ui/core/styles';\nimport React, {Component} from 'react';\nimport {Link} from 'react-router-dom';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {mayAllowPermission, requestPermission} from '../snack/browserNotification';\nimport {Button, Hidden, IconButton, Typography} from '@material-ui/core';\nimport {DrawerProps} from '@material-ui/core/Drawer/Drawer';\nimport CloseIcon from '@material-ui/icons/Close';\n\nconst styles = (theme: Theme): StyleRules<'drawerPaper' | 'toolbar' | 'link'> => ({\n drawerPaper: {\n position: 'relative',\n width: 250,\n minHeight: '100%',\n height: '100vh',\n },\n toolbar: theme.mixins.toolbar,\n link: {\n color: 'inherit',\n textDecoration: 'none',\n },\n});\n\ntype Styles = WithStyles<'drawerPaper' | 'toolbar' | 'link'>;\n\ninterface IProps {\n loggedIn: boolean;\n navOpen: boolean;\n setNavOpen: (open: boolean) => void;\n}\n\n@observer\nclass Navigation extends Component<\n IProps & Styles & Stores<'appStore'>,\n {showRequestNotification: boolean}\n> {\n public state = {showRequestNotification: mayAllowPermission()};\n\n public render() {\n const {classes, loggedIn, appStore, navOpen, setNavOpen} = this.props;\n const {showRequestNotification} = this.state;\n const apps = appStore.getItems();\n\n const userApps =\n apps.length === 0\n ? null\n : apps.map((app) => {\n return (\n setNavOpen(false)}\n className={`${classes.link} item`}\n to={'/messages/' + app.id}\n key={app.id}>\n \n \n \n \n );\n });\n\n const placeholderItems = [\n \n \n ,\n \n \n ,\n ];\n\n return (\n \n

\n setNavOpen(false)}>\n \n \n \n \n \n
{loggedIn ? userApps : placeholderItems}
\n \n \n {showRequestNotification ? (\n {\n requestPermission();\n this.setState({showRequestNotification: false});\n }}>\n Enable Notifications\n \n ) : null}\n \n \n );\n }\n}\n\nconst ResponsiveDrawer: React.FC<\n DrawerProps & {navOpen: boolean; setNavOpen: (open: boolean) => void}\n> = ({navOpen, setNavOpen, children, ...rest}) => {\n return (\n <>\n \n \n setNavOpen(false)}>\n \n \n {children}\n \n \n \n \n {children}\n \n \n \n );\n};\n\nexport default withStyles(styles, {withTheme: true})(inject('appStore')(Navigation));\n","import Fab from '@material-ui/core/Fab';\nimport KeyboardArrowUp from '@material-ui/icons/KeyboardArrowUp';\nimport React, {Component} from 'react';\n\nclass ScrollUpButton extends Component {\n public render() {\n return (\n \n \n \n );\n }\n\n private scrollUp = () => window.scrollTo(0, 0);\n}\n\nexport default ScrollUpButton;\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\nimport {observable} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\n\ninterface IProps {\n fClose: VoidFunction;\n}\n\n@observer\nclass SettingsDialog extends Component> {\n @observable\n private pass = '';\n\n public render() {\n const {pass} = this;\n const {fClose, currentUser} = this.props;\n const submitAndClose = () => {\n currentUser.changePassword(pass);\n fClose();\n };\n return (\n \n Change Password\n \n (this.pass = e.target.value)}\n fullWidth\n />\n \n \n \n \n
\n \n Change\n \n
\n
\n
\n \n );\n }\n}\n\nexport default inject('currentUser')(SettingsDialog);\n","import IconButton from '@material-ui/core/IconButton';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport Close from '@material-ui/icons/Close';\nimport React, {Component} from 'react';\nimport {observable, reaction} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\n\n@observer\nclass SnackBarHandler extends Component> {\n private static MAX_VISIBLE_SNACK_TIME_IN_MS = 6000;\n private static MIN_VISIBLE_SNACK_TIME_IN_MS = 1000;\n\n @observable\n private open = false;\n @observable\n private openWhen = 0;\n\n private dispose: () => void = () => {};\n\n public componentDidMount = () =>\n (this.dispose = reaction(() => this.props.snackManager.counter, this.onNewSnack));\n\n public componentWillUnmount = () => this.dispose();\n\n public render() {\n const {message: current, hasNext} = this.props.snackManager;\n const duration = hasNext()\n ? SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS\n : SnackBarHandler.MAX_VISIBLE_SNACK_TIME_IN_MS;\n\n return (\n {current}}\n action={\n \n \n \n }\n />\n );\n }\n\n private onNewSnack = () => {\n const {open, openWhen} = this;\n\n if (!open) {\n this.openNextSnack();\n return;\n }\n\n const snackOpenSince = Date.now() - openWhen;\n if (snackOpenSince > SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS) {\n this.closeCurrentSnack();\n } else {\n setTimeout(\n this.closeCurrentSnack,\n SnackBarHandler.MIN_VISIBLE_SNACK_TIME_IN_MS - snackOpenSince\n );\n }\n };\n\n private openNextSnack = () => {\n if (this.props.snackManager.hasNext()) {\n this.open = true;\n this.openWhen = Date.now();\n this.props.snackManager.next();\n }\n };\n\n private closeCurrentSnack = () => (this.open = false);\n}\n\nexport default inject('snackManager')(SnackBarHandler);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport React from 'react';\n\ninterface IProps {\n title: string;\n text: string;\n fClose: VoidFunction;\n fOnSubmit: VoidFunction;\n}\n\nexport default function ConfirmDialog({title, text, fClose, fOnSubmit}: IProps) {\n const submitAndClose = () => {\n fOnSubmit();\n fClose();\n };\n return (\n \n {title}\n \n {text}\n \n \n \n \n Yes\n \n \n \n );\n}\n","import {IMessageExtras} from '../types';\n\nexport enum RenderMode {\n Markdown = 'text/markdown',\n Plain = 'text/plain',\n}\n\nexport const contentType = (extras?: IMessageExtras): RenderMode => {\n const type = extract(extras, 'client::display', 'contentType');\n const valid = Object.keys(RenderMode)\n .map((k) => RenderMode[k])\n .some((mode) => mode === type);\n return valid ? type : RenderMode.Plain;\n};\n\n// tslint:disable-next-line:no-any\nconst extract = (extras: IMessageExtras | undefined, key: string, path: string): any => {\n if (!extras) {\n return null;\n }\n\n if (!extras[key]) {\n return null;\n }\n\n if (!extras[key][path]) {\n return null;\n }\n\n return extras[key][path];\n};\n","import IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport Visibility from '@material-ui/icons/Visibility';\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\nimport React, {Component} from 'react';\n\ninterface IProps {\n value: string;\n style?: object;\n}\n\ninterface IState {\n visible: boolean;\n}\n\nclass ToggleVisibility extends Component {\n public state = {visible: false};\n\n public render() {\n const {value, style} = this.props;\n const text = this.state.visible ? value : '•••••••••••••••';\n return (\n
\n \n {this.state.visible ? : }\n \n {text}\n
\n );\n }\n\n private toggleVisibility = () => this.setState({visible: !this.state.visible});\n}\n\nexport default ToggleVisibility;\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string, description: string) => void;\n}\n\ninterface IState {\n name: string;\n description: string;\n}\n\nexport default class AddDialog extends Component {\n public state = {name: '', description: ''};\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name, description} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name, description);\n fClose();\n };\n return (\n \n Create an application\n \n \n An application is allowed to send messages.\n \n \n \n \n \n \n \n
\n \n Create\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string, description: string) => void;\n initialName: string;\n initialDescription: string;\n}\n\ninterface IState {\n name: string;\n description: string;\n}\n\nexport default class UpdateDialog extends Component {\n public state = {name: '', description: ''};\n\n public componentWillMount() {\n this.setState({name: this.props.initialName, description: this.props.initialDescription});\n }\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name, description} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name, description);\n fClose();\n };\n return (\n \n Update an application\n \n \n An application is allowed to send messages.\n \n \n \n \n \n \n \n
\n \n Update\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Avatar from '@material-ui/core/Avatar';\nimport Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport CloudUpload from '@material-ui/icons/CloudUpload';\nimport React, {ChangeEvent, Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport ToggleVisibility from '../common/ToggleVisibility';\nimport AddApplicationDialog from './AddApplicationDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport * as config from '../config';\nimport UpdateDialog from './UpdateApplicationDialog';\nimport {IApplication} from '../types';\n\n@observer\nclass Applications extends Component> {\n @observable\n private deleteId: number | false = false;\n @observable\n private updateId: number | false = false;\n @observable\n private createDialog = false;\n\n private uploadId = -1;\n private upload: HTMLInputElement | null = null;\n\n public componentDidMount = () => this.props.appStore.refresh();\n\n public render() {\n const {\n createDialog,\n deleteId,\n updateId,\n props: {appStore},\n } = this;\n const apps = appStore.getItems();\n return (\n (this.createDialog = true)}>\n Create Application\n \n }\n maxWidth={1000}>\n \n \n \n \n \n \n Name\n Token\n Description\n \n \n \n \n \n {apps.map((app: IApplication) => {\n return (\n this.uploadImage(app.id)}\n fDelete={() => (this.deleteId = app.id)}\n fEdit={() => (this.updateId = app.id)}\n noDelete={app.internal}\n />\n );\n })}\n \n
\n (this.upload = upload)}\n type=\"file\"\n style={{display: 'none'}}\n onChange={this.onUploadImage}\n />\n
\n
\n {createDialog && (\n (this.createDialog = false)}\n fOnSubmit={appStore.create}\n />\n )}\n {updateId !== false && (\n (this.updateId = false)}\n fOnSubmit={(name, description) =>\n appStore.update(updateId, name, description)\n }\n initialDescription={appStore.getByID(updateId).description}\n initialName={appStore.getByID(updateId).name}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => appStore.remove(deleteId)}\n />\n )}\n \n );\n }\n\n private uploadImage = (id: number) => {\n this.uploadId = id;\n if (this.upload) {\n this.upload.click();\n }\n };\n\n private onUploadImage = (e: ChangeEvent) => {\n const file = e.target.files && e.target.files[0];\n if (!file) {\n return;\n }\n if (['image/png', 'image/jpeg', 'image/gif'].indexOf(file.type) !== -1) {\n this.props.appStore.uploadImage(this.uploadId, file);\n } else {\n alert('Uploaded file must be of type png, jpeg or gif.');\n }\n };\n}\n\ninterface IRowProps {\n name: string;\n value: string;\n noDelete: boolean;\n description: string;\n fUpload: VoidFunction;\n image: string;\n fDelete: VoidFunction;\n fEdit: VoidFunction;\n}\n\nconst Row: SFC = observer(\n ({name, value, noDelete, description, fDelete, fUpload, image, fEdit}) => (\n \n \n
\n \n \n \n \n
\n
\n {name}\n \n \n \n {description}\n \n \n \n \n \n \n \n \n \n \n
\n )\n);\n\nexport default inject('appStore')(Applications);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string) => void;\n}\n\nexport default class AddDialog extends Component {\n public state = {name: ''};\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name);\n fClose();\n };\n return (\n \n Create a client\n \n \n \n \n \n \n
\n \n Create\n \n
\n \n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {Component} from 'react';\n\ninterface IProps {\n fClose: VoidFunction;\n fOnSubmit: (name: string) => void;\n initialName: string;\n}\n\ninterface IState {\n name: string;\n}\n\nexport default class UpdateDialog extends Component {\n public state = {name: ''};\n\n public componentWillMount() {\n this.setState({name: this.props.initialName});\n }\n\n public render() {\n const {fClose, fOnSubmit} = this.props;\n const {name} = this.state;\n const submitEnabled = this.state.name.length !== 0;\n const submitAndClose = () => {\n fOnSubmit(name);\n fClose();\n };\n return (\n \n Update a Client\n \n \n A client manages messages, clients, applications and users (with admin\n permissions).\n \n \n \n \n \n \n
\n \n Update\n \n
\n
\n
\n \n );\n }\n\n private handleChange(propertyName: string, event: React.ChangeEvent) {\n const state = {};\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n}\n","import Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport React, {Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport ToggleVisibility from '../common/ToggleVisibility';\nimport AddClientDialog from './AddClientDialog';\nimport UpdateDialog from './UpdateClientDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {IClient} from '../types';\n\n@observer\nclass Clients extends Component> {\n @observable\n private showDialog = false;\n @observable\n private deleteId: false | number = false;\n @observable\n private updateId: false | number = false;\n\n public componentDidMount = () => this.props.clientStore.refresh();\n\n public render() {\n const {\n deleteId,\n updateId,\n showDialog,\n props: {clientStore},\n } = this;\n const clients = clientStore.getItems();\n\n return (\n (this.showDialog = true)}>\n Create Client\n \n }>\n \n \n \n \n \n Name\n token\n \n \n \n \n \n {clients.map((client: IClient) => {\n return (\n (this.updateId = client.id)}\n fDelete={() => (this.deleteId = client.id)}\n />\n );\n })}\n \n
\n
\n
\n {showDialog && (\n (this.showDialog = false)}\n fOnSubmit={clientStore.create}\n />\n )}\n {updateId !== false && (\n (this.updateId = false)}\n fOnSubmit={(name) => clientStore.update(updateId, name)}\n initialName={clientStore.getByID(updateId).name}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => clientStore.remove(deleteId)}\n />\n )}\n \n );\n }\n}\n\ninterface IRowProps {\n name: string;\n value: string;\n fEdit: VoidFunction;\n fDelete: VoidFunction;\n}\n\nconst Row: SFC = ({name, value, fEdit, fDelete}) => (\n \n {name}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default inject('clientStore')(Clients);\n","import React, {Component, SFC} from 'react';\nimport {Link} from 'react-router-dom';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Settings from '@material-ui/icons/Settings';\nimport {Switch, Button} from '@material-ui/core';\nimport DefaultPage from '../common/DefaultPage';\nimport ToggleVisibility from '../common/ToggleVisibility';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {IPlugin} from '../types';\n\n@observer\nclass Plugins extends Component> {\n public componentDidMount = () => this.props.pluginStore.refresh();\n\n public render() {\n const {\n props: {pluginStore},\n } = this;\n const plugins = pluginStore.getItems();\n return (\n \n \n \n \n \n \n ID\n Enabled\n Name\n Token\n Details\n \n \n \n {plugins.map((plugin: IPlugin) => {\n return (\n \n this.props.pluginStore.changeEnabledState(\n plugin.id,\n !plugin.enabled\n )\n }\n />\n );\n })}\n \n
\n
\n
\n
\n );\n }\n}\n\ninterface IRowProps {\n id: number;\n name: string;\n token: string;\n enabled: boolean;\n fToggleStatus: VoidFunction;\n}\n\nconst Row: SFC = observer(({name, id, token, enabled, fToggleStatus}) => (\n \n {id}\n \n \n \n {name}\n \n \n \n \n \n \n \n \n \n));\n\nexport default inject('pluginStore')(Plugins);\n","import Paper from '@material-ui/core/Paper';\nimport {withStyles, WithStyles} from '@material-ui/core/styles';\nimport * as React from 'react';\n\nconst styles = () => ({\n paper: {\n padding: 16,\n },\n});\n\ninterface IProps extends WithStyles<'paper'> {\n style?: object;\n}\n\nconst Container: React.SFC = ({classes, children, style}) => {\n return (\n \n {children}\n \n );\n};\n\nexport default withStyles(styles)(Container);\n","import React, {Component} from 'react';\nimport {RouteComponentProps} from 'react-router';\nimport ReactMarkDown from 'react-markdown';\nimport {UnControlled as CodeMirror} from 'react-codemirror2';\nimport 'codemirror/lib/codemirror.css';\nimport 'codemirror/theme/material.css';\nimport 'codemirror/mode/yaml/yaml';\nimport Info from '@material-ui/icons/Info';\nimport Build from '@material-ui/icons/Build';\nimport Subject from '@material-ui/icons/Subject';\nimport Refresh from '@material-ui/icons/Refresh';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport DefaultPage from '../common/DefaultPage';\nimport * as config from '../config';\nimport Container from '../common/Container';\nimport {inject, Stores} from '../inject';\nimport {IPlugin} from '../types';\n\ninterface IProps extends RouteComponentProps<{id: string}> {}\n\ninterface IState {\n displayText: string | null;\n currentConfig: string | null;\n}\n\nclass PluginDetailView extends Component, IState> {\n private pluginID: number = parseInt(this.props.match.params.id, 10);\n private pluginInfo = () => this.props.pluginStore.getByID(this.pluginID);\n\n public state: IState = {\n displayText: null,\n currentConfig: null,\n };\n\n public componentWillMount() {\n this.refreshFeatures();\n }\n\n public componentWillReceiveProps(nextProps: IProps & Stores<'pluginStore'>) {\n this.pluginID = parseInt(nextProps.match.params.id, 10);\n this.refreshFeatures();\n }\n\n private refreshFeatures() {\n return Promise.all([this.refreshConfigurer(), this.refreshDisplayer()]);\n }\n\n private async refreshConfigurer() {\n const {\n props: {pluginStore},\n } = this;\n if (this.pluginInfo().capabilities.indexOf('configurer') !== -1) {\n const response = await pluginStore.requestConfig(this.pluginID);\n this.setState({currentConfig: response});\n }\n }\n\n private async refreshDisplayer() {\n const {\n props: {pluginStore},\n } = this;\n if (this.pluginInfo().capabilities.indexOf('displayer') !== -1) {\n const response = await pluginStore.requestDisplay(this.pluginID);\n this.setState({displayText: response});\n }\n }\n\n public render() {\n const pluginInfo = this.pluginInfo();\n const {name, capabilities} = pluginInfo;\n return (\n \n \n \n \n {capabilities.indexOf('configurer') !== -1 ? (\n \n {\n await this.props.pluginStore.changeConfig(this.pluginID, newConfig);\n await this.refreshFeatures();\n }}\n />\n \n ) : null}{' '}\n {capabilities.indexOf('displayer') !== -1 ? (\n \n \n \n ) : null}\n \n );\n }\n}\n\ninterface IPanelWrapperProps {\n name: string;\n description?: string;\n refresh?: () => Promise;\n icon?: React.ComponentType;\n}\n\nconst PanelWrapper: React.SFC = ({\n name,\n description,\n refresh,\n icon,\n children,\n}) => {\n const Icon = icon;\n return (\n \n \n {Icon ? (\n \n \n  \n \n ) : null}\n {name}\n {refresh ? (\n {\n refresh();\n }}>\n \n \n ) : null}\n \n {description ? {description} : null}\n
\n
{children}
\n
\n );\n};\n\ninterface IConfigurerPanelProps {\n pluginInfo: IPlugin;\n initialConfig: string;\n save: (newConfig: string) => Promise;\n}\nclass ConfigurerPanel extends Component {\n public state = {unsavedChanges: null};\n\n public render() {\n return (\n
\n {\n let newConf: string | null = value;\n if (value === this.props.initialConfig) {\n newConf = null;\n }\n this.setState({unsavedChanges: newConf});\n }}\n />\n
\n {\n const newConfig = this.state.unsavedChanges;\n this.props.save(newConfig!).then(() => {\n this.setState({unsavedChanges: null});\n });\n }}>\n Save\n \n
\n );\n }\n}\n\ninterface IDisplayerPanelProps {\n pluginInfo: IPlugin;\n displayText: string;\n}\nconst DisplayerPanel: React.SFC = ({pluginInfo, displayText}) => (\n \n \n \n);\n\nclass PluginInfo extends Component<{pluginInfo: IPlugin}> {\n public render() {\n const {\n props: {\n pluginInfo: {name, author, modulePath, website, license, capabilities, id, token},\n },\n } = this;\n return (\n
\n {name ? (\n \n Name: {name}\n \n ) : null}\n {author ? (\n \n Author: {author}\n \n ) : null}\n \n Module Path: {modulePath}\n \n {website ? (\n \n Website: {website}\n \n ) : null}\n {license ? (\n \n License: {license}\n \n ) : null}\n \n Capabilities: {capabilities.join(', ')}\n \n {capabilities.indexOf('webhooker') !== -1 ? (\n \n Custom Route Prefix:{' '}\n {((url) => (\n \n {url}\n \n ))(`${config.get('url')}plugin/${id}/custom/${token}/`)}\n \n ) : null}\n
\n );\n }\n}\n\nexport default inject('pluginStore')(PluginDetailView);\n","import Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport TextField from '@material-ui/core/TextField';\nimport React, {Component, FormEvent} from 'react';\nimport Container from '../common/Container';\nimport DefaultPage from '../common/DefaultPage';\nimport {observable} from 'mobx';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\n\n@observer\nclass Login extends Component> {\n @observable\n private username = '';\n @observable\n private password = '';\n\n public render() {\n const {username, password} = this;\n return (\n \n \n \n
\n (this.username = e.target.value)}\n />\n (this.password = e.target.value)}\n />\n \n Login\n \n \n
\n
\n
\n );\n }\n\n private login = (e: React.MouseEvent) => {\n e.preventDefault();\n this.props.currentUser.login(this.username, this.password);\n };\n\n private preventDefault = (e: FormEvent) => e.preventDefault();\n}\n\nexport default inject('currentUser')(Login);\n","import IconButton from '@material-ui/core/IconButton';\nimport {createStyles, Theme, withStyles, WithStyles} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Delete from '@material-ui/icons/Delete';\nimport React from 'react';\nimport TimeAgo from 'react-timeago';\nimport Container from '../common/Container';\nimport * as config from '../config';\nimport ReactMarkdown from 'react-markdown';\nimport {RenderMode, contentType} from './extras';\nimport {IMessageExtras} from '../types';\n\nconst styles = (theme: Theme) =>\n createStyles({\n header: {\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: 0,\n },\n headerTitle: {\n flex: 1,\n },\n trash: {\n marginTop: -15,\n marginRight: -15,\n },\n wrapperPadding: {\n padding: 12,\n },\n messageContentWrapper: {\n width: '100%',\n maxWidth: 585,\n },\n image: {\n marginRight: 15,\n [theme.breakpoints.down('sm')]: {\n width: 32,\n height: 32,\n },\n },\n date: {\n [theme.breakpoints.down('sm')]: {\n order: 1,\n flexBasis: '100%',\n opacity: 0.7,\n },\n },\n imageWrapper: {\n display: 'flex',\n },\n content: {\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-all',\n '& p': {\n margin: 0,\n },\n '& a': {\n color: '#ff7f50',\n },\n '& pre': {\n overflow: 'auto',\n },\n },\n });\n\ninterface IProps {\n title: string;\n image?: string;\n date: string;\n content: string;\n fDelete: VoidFunction;\n extras?: IMessageExtras;\n height: (height: number) => void;\n}\n\nclass Message extends React.PureComponent> {\n private node: HTMLDivElement | null = null;\n\n public componentDidMount = () =>\n this.props.height(this.node ? this.node.getBoundingClientRect().height : 0);\n\n private renderContent = () => {\n const content = this.props.content;\n switch (contentType(this.props.extras)) {\n case RenderMode.Markdown:\n return ;\n case RenderMode.Plain:\n default:\n return content;\n }\n };\n\n public render(): React.ReactNode {\n const {fDelete, classes, title, date, image} = this.props;\n\n return (\n
(this.node = ref)}>\n \n
\n {image !== null ? (\n \n ) : null}\n
\n
\n
\n \n {title}\n \n \n \n \n \n \n \n
\n \n {this.renderContent()}\n \n
\n
\n
\n );\n }\n}\n\nexport default withStyles(styles, {withTheme: true})(Message);\n","import CircularProgress from '@material-ui/core/CircularProgress';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, {Component} from 'react';\nimport {RouteComponentProps} from 'react-router';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport Message from './Message';\nimport {observer} from 'mobx-react';\nimport {inject, Stores} from '../inject';\nimport {observable} from 'mobx';\nimport ReactInfinite from 'react-infinite';\nimport {IMessage} from '../types';\n\ninterface IProps extends RouteComponentProps<{id: string}> {}\n\ninterface IState {\n appId: number;\n}\n\n@observer\nclass Messages extends Component, IState> {\n @observable\n private heights: Record = {};\n\n private static appId(props: IProps) {\n if (props === undefined) {\n return -1;\n }\n const {match} = props;\n return match.params.id !== undefined ? parseInt(match.params.id, 10) : -1;\n }\n\n public state = {appId: -1};\n\n private isLoadingMore = false;\n\n public componentWillReceiveProps(nextProps: IProps & Stores<'messagesStore' | 'appStore'>) {\n this.updateAllWithProps(nextProps);\n }\n\n public componentWillMount() {\n window.onscroll = () => {\n if (\n window.innerHeight + window.pageYOffset >=\n document.body.offsetHeight - window.innerHeight * 2\n ) {\n this.checkIfLoadMore();\n }\n };\n this.updateAll();\n }\n\n public render() {\n const {appId} = this.state;\n const {messagesStore, appStore} = this.props;\n const messages = messagesStore.get(appId);\n const hasMore = messagesStore.canLoadMore(appId);\n const name = appStore.getName(appId);\n const hasMessages = messages.length !== 0;\n\n return (\n \n messagesStore.refreshByApp(appId)}\n style={{marginRight: 5}}>\n Refresh\n \n messagesStore.removeByApp(appId)}>\n Delete All\n \n
\n }>\n {hasMessages ? (\n
\n this.heights[m.id] || 1)}>\n {messages.map(this.renderMessage)}\n \n\n {hasMore ? (\n \n \n \n ) : (\n this.label(\"You've reached the end\")\n )}\n
\n ) : (\n this.label('No messages')\n )}\n \n );\n }\n\n private updateAllWithProps = (props: IProps & Stores<'messagesStore'>) => {\n const appId = Messages.appId(props);\n this.setState({appId});\n if (!props.messagesStore.exists(appId)) {\n props.messagesStore.loadMore(appId);\n }\n };\n\n private updateAll = () => this.updateAllWithProps(this.props);\n\n private deleteMessage = (message: IMessage) => () =>\n this.props.messagesStore.removeSingle(message);\n\n private renderMessage = (message: IMessage) => {\n return (\n {\n if (!this.heights[message.id]) {\n this.heights[message.id] = height;\n }\n }}\n fDelete={this.deleteMessage(message)}\n title={message.title}\n date={message.date}\n content={message.message}\n image={message.image}\n extras={message.extras}\n />\n );\n };\n\n private checkIfLoadMore() {\n const {appId} = this.state;\n if (!this.isLoadingMore && this.props.messagesStore.canLoadMore(appId)) {\n this.isLoadingMore = true;\n this.props.messagesStore.loadMore(appId).then(() => (this.isLoadingMore = false));\n }\n }\n\n private label = (text: string) => (\n \n \n {text}\n \n \n );\n}\n\nexport default inject('messagesStore', 'appStore')(Messages);\n","import Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport React, {ChangeEvent, Component} from 'react';\n\ninterface IProps {\n name?: string;\n admin?: boolean;\n fClose: VoidFunction;\n fOnSubmit: (name: string, pass: string, admin: boolean) => void;\n isEdit?: boolean;\n}\n\ninterface IState {\n name: string;\n pass: string;\n admin: boolean;\n}\n\nexport default class AddEditDialog extends Component {\n public state = {\n name: '',\n pass: '',\n admin: false,\n };\n\n public render() {\n const {fClose, fOnSubmit, isEdit} = this.props;\n const {name, pass, admin} = this.state;\n const namePresent = this.state.name.length !== 0;\n const passPresent = this.state.pass.length !== 0 || isEdit;\n const submitAndClose = () => {\n fOnSubmit(name, pass, admin);\n fClose();\n };\n return (\n \n \n {isEdit ? 'Edit ' + this.props.name : 'Add a user'}\n \n \n \n \n \n }\n label=\"has administrator rights\"\n />\n \n \n \n \n
\n \n {isEdit ? 'Save' : 'Create'}\n \n
\n \n
\n \n );\n }\n\n public componentWillMount() {\n const {name, admin} = this.props;\n this.setState({...this.state, name: name || '', admin: admin || false});\n }\n\n private handleChange(propertyName: string, event: ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.value;\n this.setState(state);\n }\n\n private handleChecked(propertyName: string, event: ChangeEvent) {\n const state = this.state;\n state[propertyName] = event.target.checked;\n this.setState(state);\n }\n}\n","import Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport {withStyles, WithStyles} from '@material-ui/core/styles';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Delete from '@material-ui/icons/Delete';\nimport Edit from '@material-ui/icons/Edit';\nimport React, {Component, SFC} from 'react';\nimport ConfirmDialog from '../common/ConfirmDialog';\nimport DefaultPage from '../common/DefaultPage';\nimport Button from '@material-ui/core/Button';\nimport AddEditDialog from './AddEditUserDialog';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {IUser} from '../types';\n\nconst styles = () => ({\n wrapper: {\n margin: '0 auto',\n maxWidth: 700,\n },\n});\n\ninterface IRowProps {\n name: string;\n admin: boolean;\n fDelete: VoidFunction;\n fEdit: VoidFunction;\n}\n\nconst UserRow: SFC = ({name, admin, fDelete, fEdit}) => (\n \n {name}\n {admin ? 'Yes' : 'No'}\n \n \n \n \n \n \n \n \n \n);\n\n@observer\nclass Users extends Component & Stores<'userStore'>> {\n @observable\n private createDialog = false;\n @observable\n private deleteId: number | false = false;\n @observable\n private editId: number | false = false;\n\n public componentDidMount = () => this.props.userStore.refresh();\n\n public render() {\n const {\n deleteId,\n editId,\n createDialog,\n props: {userStore},\n } = this;\n const users = userStore.getItems();\n return (\n (this.createDialog = true)}>\n Create User\n \n }>\n \n \n \n \n \n Name\n Admin\n \n \n \n \n {users.map((user: IUser) => {\n return (\n (this.deleteId = user.id)}\n fEdit={() => (this.editId = user.id)}\n />\n );\n })}\n \n
\n
\n
\n {createDialog && (\n (this.createDialog = false)}\n fOnSubmit={userStore.create}\n />\n )}\n {editId !== false && (\n (this.editId = false)}\n fOnSubmit={userStore.update.bind(this, editId)}\n name={userStore.getByID(editId).name}\n admin={userStore.getByID(editId).admin}\n isEdit={true}\n />\n )}\n {deleteId !== false && (\n (this.deleteId = false)}\n fOnSubmit={() => userStore.remove(deleteId)}\n />\n )}\n \n );\n }\n}\n\nexport default withStyles(styles)(inject('userStore')(Users));\n","import React from 'react';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\n\ninterface ConnectionErrorBannerProps {\n height: number;\n retry: () => void;\n message: string;\n}\n\nexport const ConnectionErrorBanner = ({height, retry, message}: ConnectionErrorBannerProps) => {\n return (\n \n \n {message}{' '}\n \n \n \n );\n};\n","import {createMuiTheme, MuiThemeProvider, Theme, WithStyles, withStyles} from '@material-ui/core';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport axios, {AxiosResponse} from 'axios';\nimport * as React from 'react';\nimport {HashRouter, Redirect, Route, Switch} from 'react-router-dom';\nimport Header from './Header';\nimport LoadingSpinner from '../common/LoadingSpinner';\nimport Navigation from './Navigation';\nimport ScrollUpButton from '../common/ScrollUpButton';\nimport SettingsDialog from '../common/SettingsDialog';\nimport SnackBarHandler from '../snack/SnackBarHandler';\nimport * as config from '../config';\nimport Applications from '../application/Applications';\nimport Clients from '../client/Clients';\nimport Plugins from '../plugin/Plugins';\nimport PluginDetailView from '../plugin/PluginDetailView';\nimport Login from '../user/Login';\nimport Messages from '../message/Messages';\nimport Users from '../user/Users';\nimport {observer} from 'mobx-react';\nimport {observable} from 'mobx';\nimport {inject, Stores} from '../inject';\nimport {ConnectionErrorBanner} from '../common/ConnectionErrorBanner';\nimport {IVersion} from '../types';\n\nconst styles = (theme: Theme) => ({\n content: {\n margin: '0 auto',\n marginTop: 64,\n padding: theme.spacing(4),\n width: '100%',\n [theme.breakpoints.down('xs')]: {\n marginTop: 0,\n },\n },\n});\n\nconst localStorageThemeKey = 'gotify-theme';\ntype ThemeKey = 'dark' | 'light';\nconst themeMap: Record = {\n light: createMuiTheme({\n palette: {\n type: 'light',\n },\n }),\n dark: createMuiTheme({\n palette: {\n type: 'dark',\n },\n }),\n};\n\nconst isThemeKey = (value: string | null): value is ThemeKey => {\n return value === 'light' || value === 'dark';\n};\n\n@observer\nclass Layout extends React.Component<\n WithStyles<'content'> & Stores<'currentUser' | 'snackManager'>\n> {\n private static defaultVersion = '0.0.0';\n\n @observable\n private currentTheme: ThemeKey = 'dark';\n @observable\n private showSettings = false;\n @observable\n private version = Layout.defaultVersion;\n @observable\n private navOpen = false;\n\n private setNavOpen(open: boolean) {\n this.navOpen = open;\n }\n\n public componentDidMount() {\n if (this.version === Layout.defaultVersion) {\n axios.get(config.get('url') + 'version').then((resp: AxiosResponse) => {\n this.version = resp.data.version;\n });\n }\n\n const localStorageTheme = window.localStorage.getItem(localStorageThemeKey);\n if (isThemeKey(localStorageTheme)) {\n this.currentTheme = localStorageTheme;\n } else {\n window.localStorage.setItem(localStorageThemeKey, this.currentTheme);\n }\n }\n\n public render() {\n const {version, showSettings, currentTheme} = this;\n const {\n classes,\n currentUser: {\n loggedIn,\n authenticating,\n user: {name, admin},\n logout,\n tryReconnect,\n connectionErrorMessage,\n },\n } = this.props;\n const theme = themeMap[currentTheme];\n const loginRoute = () => (loggedIn ? : );\n return (\n \n \n
\n {!connectionErrorMessage ? null : (\n tryReconnect()}\n message={connectionErrorMessage}\n />\n )}\n
\n \n (this.showSettings = true)}\n logout={logout}\n setNavOpen={this.setNavOpen.bind(this)}\n />\n
\n \n
\n \n {authenticating ? (\n \n \n \n ) : null}\n \n {loggedIn ? null : }\n \n \n \n \n \n \n \n \n
\n
\n {showSettings && (\n (this.showSettings = false)} />\n )}\n \n \n
\n
\n
\n
\n );\n }\n\n private toggleTheme() {\n this.currentTheme = this.currentTheme === 'dark' ? 'light' : 'dark';\n localStorage.setItem(localStorageThemeKey, this.currentTheme);\n }\n}\n\nexport default withStyles(styles, {withTheme: true})(inject('currentUser', 'snackManager')(Layout));\n","// tslint:disable\n// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the 'N+1' visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL!, window.location.toString());\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://goo.gl/SC7cgQ'\n );\n });\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string) {\n if (!window.location.href.match('^([^/]*\\\\/)(.*\\\\.js|.*.html|static\\\\/.*|)$')) {\n return;\n }\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker) {\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a 'New content is\n // available; please refresh.' message in your web app.\n console.log('New content is available; please refresh.');\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // 'Content is cached for offline use.' message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n }\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type')!.indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl);\n }\n })\n .catch(() => {\n console.log('No internet connection found. App is running in offline mode.');\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister();\n });\n }\n}\n","import axios, {AxiosError, AxiosResponse} from 'axios';\nimport * as config from './config';\nimport {Base64} from 'js-base64';\nimport {detect} from 'detect-browser';\nimport {SnackReporter} from './snack/SnackManager';\nimport {observable} from 'mobx';\nimport {IClient, IUser} from './types';\n\nconst tokenKey = 'gotify-login-key';\n\nexport class CurrentUser {\n private tokenCache: string | null = null;\n private reconnectTimeoutId: number | null = null;\n private reconnectTime = 7500;\n @observable\n public loggedIn = false;\n @observable\n public authenticating = false;\n @observable\n public user: IUser = {name: 'unknown', admin: false, id: -1};\n @observable\n public connectionErrorMessage: string | null = null;\n\n public constructor(private readonly snack: SnackReporter) {}\n\n public token = (): string => {\n if (this.tokenCache !== null) {\n return this.tokenCache;\n }\n\n const localStorageToken = window.localStorage.getItem(tokenKey);\n if (localStorageToken) {\n this.tokenCache = localStorageToken;\n return localStorageToken;\n }\n\n return '';\n };\n\n private setToken = (token: string) => {\n this.tokenCache = token;\n window.localStorage.setItem(tokenKey, token);\n };\n\n public login = async (username: string, password: string) => {\n this.loggedIn = false;\n this.authenticating = true;\n const browser = detect();\n const name = (browser && browser.name + ' ' + browser.version) || 'unknown browser';\n axios\n .create()\n .request({\n url: config.get('url') + 'client',\n method: 'POST',\n data: {name},\n headers: {Authorization: 'Basic ' + Base64.encode(username + ':' + password)},\n })\n .then((resp: AxiosResponse) => {\n this.snack(`A client named '${name}' was created for your session.`);\n this.setToken(resp.data.token);\n this.tryAuthenticate()\n .then(() => {\n this.authenticating = false;\n this.loggedIn = true;\n })\n .catch(() => {\n this.authenticating = false;\n console.log(\n 'create client succeeded, but authenticated with given token failed'\n );\n });\n })\n .catch(() => {\n this.authenticating = false;\n return this.snack('Login failed');\n });\n };\n\n public tryAuthenticate = async (): Promise> => {\n if (this.token() === '') {\n return Promise.reject();\n }\n\n return axios\n .create()\n .get(config.get('url') + 'current/user', {headers: {'X-Gotify-Key': this.token()}})\n .then((passThrough) => {\n this.user = passThrough.data;\n this.loggedIn = true;\n this.connectionErrorMessage = null;\n this.reconnectTime = 7500;\n return passThrough;\n })\n .catch((error: AxiosError) => {\n if (!error || !error.response) {\n this.connectionError('No network connection or server unavailable.');\n return Promise.reject(error);\n }\n\n if (error.response.status >= 500) {\n this.connectionError(\n `${error.response.statusText} (code: ${error.response.status}).`\n );\n return Promise.reject(error);\n }\n\n this.connectionErrorMessage = null;\n\n if (error.response.status >= 400 && error.response.status < 500) {\n this.logout();\n }\n return Promise.reject(error);\n });\n };\n\n public logout = async () => {\n await axios\n .get(config.get('url') + 'client')\n .then((resp: AxiosResponse) => {\n resp.data\n .filter((client) => client.token === this.tokenCache)\n .forEach((client) => {\n return axios.delete(config.get('url') + 'client/' + client.id);\n });\n })\n .catch(() => Promise.resolve());\n window.localStorage.removeItem(tokenKey);\n this.tokenCache = null;\n this.loggedIn = false;\n };\n\n public changePassword = (pass: string) => {\n axios\n .post(config.get('url') + 'current/user/password', {pass})\n .then(() => this.snack('Password changed'));\n };\n\n public tryReconnect = (quiet = false) => {\n this.tryAuthenticate().catch(() => {\n if (!quiet) {\n this.snack('Reconnect failed');\n }\n });\n };\n\n private connectionError = (message: string) => {\n this.connectionErrorMessage = message;\n if (this.reconnectTimeoutId !== null) {\n window.clearTimeout(this.reconnectTimeoutId);\n }\n this.reconnectTimeoutId = window.setTimeout(\n () => this.tryReconnect(true),\n this.reconnectTime\n );\n this.reconnectTime = Math.min(this.reconnectTime * 2, 120000);\n };\n}\n","import {action, observable} from 'mobx';\n\ninterface HasID {\n id: number;\n}\n\nexport interface IClearable {\n clear(): void;\n}\n\n/**\n * Base implementation for handling items with ids.\n */\nexport abstract class BaseStore implements IClearable {\n @observable\n protected items: T[] = [];\n\n protected abstract requestItems(): Promise;\n\n protected abstract requestDelete(id: number): Promise;\n\n @action\n public remove = async (id: number): Promise => {\n await this.requestDelete(id);\n await this.refresh();\n };\n\n @action\n public refresh = async (): Promise => {\n this.items = await this.requestItems().then((items) => items || []);\n };\n\n public getByID = (id: number): T => {\n const item = this.getByIDOrUndefined(id);\n if (item === undefined) {\n throw new Error('cannot find item with id ' + id);\n }\n return item;\n };\n\n public getByIDOrUndefined = (id: number): T | undefined => {\n return this.items.find((hasId: HasID) => hasId.id === id);\n };\n\n public getItems = (): T[] => this.items;\n\n @action\n public clear = (): void => {\n this.items = [];\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IApplication} from '../types';\n\nexport class AppStore extends BaseStore {\n public onDelete: () => void = () => {};\n\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise => {\n return axios\n .get(`${config.get('url')}application`)\n .then((response) => response.data);\n };\n\n protected requestDelete = (id: number): Promise => {\n return axios.delete(`${config.get('url')}application/${id}`).then(() => {\n this.onDelete();\n return this.snack('Application deleted');\n });\n };\n\n @action\n public uploadImage = async (id: number, file: Blob): Promise => {\n const formData = new FormData();\n formData.append('file', file);\n await axios.post(`${config.get('url')}application/${id}/image`, formData, {\n headers: {'content-type': 'multipart/form-data'},\n });\n await this.refresh();\n this.snack('Application image updated');\n };\n\n @action\n public update = async (id: number, name: string, description: string): Promise => {\n await axios.put(`${config.get('url')}application/${id}`, {name, description});\n await this.refresh();\n this.snack('Application updated');\n };\n\n @action\n public create = async (name: string, description: string): Promise => {\n await axios.post(`${config.get('url')}application`, {name, description});\n await this.refresh();\n this.snack('Application created');\n };\n\n public getName = (id: number): string => {\n const app = this.getByIDOrUndefined(id);\n return id === -1 ? 'All Messages' : app !== undefined ? app.name : 'unknown';\n };\n}\n","import {SnackReporter} from '../snack/SnackManager';\nimport {CurrentUser} from '../CurrentUser';\nimport * as config from '../config';\nimport {AxiosError} from 'axios';\nimport {IMessage} from '../types';\n\nexport class WebSocketStore {\n private wsActive = false;\n private ws: WebSocket | null = null;\n\n public constructor(\n private readonly snack: SnackReporter,\n private readonly currentUser: CurrentUser\n ) {}\n\n public listen = (callback: (msg: IMessage) => void) => {\n if (!this.currentUser.token() || this.wsActive) {\n return;\n }\n this.wsActive = true;\n\n const wsUrl = config.get('url').replace('http', 'ws').replace('https', 'wss');\n const ws = new WebSocket(wsUrl + 'stream?token=' + this.currentUser.token());\n\n ws.onerror = (e) => {\n this.wsActive = false;\n console.log('WebSocket connection errored', e);\n };\n\n ws.onmessage = (data) => callback(JSON.parse(data.data));\n\n ws.onclose = () => {\n this.wsActive = false;\n this.currentUser\n .tryAuthenticate()\n .then(() => {\n this.snack('WebSocket connection closed, trying again in 30 seconds.');\n setTimeout(() => this.listen(callback), 30000);\n })\n .catch((error: AxiosError) => {\n if (error && error.response && error.response.status === 401) {\n this.snack('Could not authenticate with client token, logging out.');\n }\n });\n };\n\n this.ws = ws;\n };\n\n public close = () => this.ws && this.ws.close(1000, 'WebSocketStore#close');\n}\n","import {action, observable} from 'mobx';\n\nexport interface SnackReporter {\n (message: string): void;\n}\n\nexport class SnackManager {\n @observable\n private messages: string[] = [];\n @observable\n public message: string | null = null;\n @observable\n public counter = 0;\n\n @action\n public next = (): void => {\n if (!this.hasNext()) {\n throw new Error('There is nothing here :(');\n }\n this.message = this.messages.shift() as string;\n };\n\n public hasNext = () => this.messages.length > 0;\n\n @action\n public snack: SnackReporter = (message: string): void => {\n this.messages.push(message);\n this.counter++;\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IUser} from '../types';\n\nexport class UserStore extends BaseStore {\n constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise => {\n return axios.get(`${config.get('url')}user`).then((response) => response.data);\n };\n\n protected requestDelete(id: number): Promise {\n return axios\n .delete(`${config.get('url')}user/${id}`)\n .then(() => this.snack('User deleted'));\n }\n\n @action\n public create = async (name: string, pass: string, admin: boolean) => {\n await axios.post(`${config.get('url')}user`, {name, pass, admin});\n await this.refresh();\n this.snack('User created');\n };\n\n @action\n public update = async (id: number, name: string, pass: string | null, admin: boolean) => {\n await axios.post(config.get('url') + 'user/' + id, {name, pass, admin});\n await this.refresh();\n this.snack('User updated');\n };\n}\n","import {BaseStore} from '../common/BaseStore';\nimport {action, IObservableArray, observable, reaction} from 'mobx';\nimport axios, {AxiosResponse} from 'axios';\nimport * as config from '../config';\nimport {createTransformer} from 'mobx-utils';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IApplication, IMessage, IPagedMessages} from '../types';\n\nconst AllMessages = -1;\n\ninterface MessagesState {\n messages: IObservableArray;\n hasMore: boolean;\n nextSince: number;\n loaded: boolean;\n}\n\nexport class MessagesStore {\n @observable\n private state: Record = {};\n\n private loading = false;\n\n public constructor(\n private readonly appStore: BaseStore,\n private readonly snack: SnackReporter\n ) {\n reaction(() => appStore.getItems(), this.createEmptyStatesForApps);\n }\n\n private stateOf = (appId: number, create = true) => {\n if (!this.state[appId] && create) {\n this.state[appId] = this.emptyState();\n }\n return this.state[appId] || this.emptyState();\n };\n\n public canLoadMore = (appId: number) => this.stateOf(appId, /*create*/ false).hasMore;\n\n @action\n public loadMore = async (appId: number) => {\n const state = this.stateOf(appId);\n if (!state.hasMore || this.loading) {\n return Promise.resolve();\n }\n this.loading = true;\n\n const pagedResult = await this.fetchMessages(appId, state.nextSince).then(\n (resp) => resp.data\n );\n\n state.messages.replace([...state.messages, ...pagedResult.messages]);\n state.nextSince = pagedResult.paging.since || 0;\n state.hasMore = 'next' in pagedResult.paging;\n state.loaded = true;\n this.loading = false;\n return Promise.resolve();\n };\n\n @action\n public publishSingleMessage = (message: IMessage) => {\n if (this.exists(AllMessages)) {\n this.stateOf(AllMessages).messages.unshift(message);\n }\n if (this.exists(message.appid)) {\n this.stateOf(message.appid).messages.unshift(message);\n }\n };\n\n @action\n public removeByApp = async (appId: number) => {\n if (appId === AllMessages) {\n await axios.delete(config.get('url') + 'message');\n this.snack('Deleted all messages');\n this.clearAll();\n } else {\n await axios.delete(config.get('url') + 'application/' + appId + '/message');\n this.snack(`Deleted all messages from ${this.appStore.getByID(appId).name}`);\n this.clear(AllMessages);\n this.clear(appId);\n }\n await this.loadMore(appId);\n };\n\n @action\n public removeSingle = async (message: IMessage) => {\n await axios.delete(config.get('url') + 'message/' + message.id);\n if (this.exists(AllMessages)) {\n this.removeFromList(this.state[AllMessages].messages, message);\n }\n if (this.exists(message.appid)) {\n this.removeFromList(this.state[message.appid].messages, message);\n }\n this.snack('Message deleted');\n };\n\n @action\n public clearAll = () => {\n this.state = {};\n this.createEmptyStatesForApps(this.appStore.getItems());\n };\n\n @action\n public refreshByApp = async (appId: number) => {\n this.clearAll();\n this.loadMore(appId);\n };\n\n public exists = (id: number) => this.stateOf(id).loaded;\n\n private removeFromList(messages: IMessage[], messageToDelete: IMessage): false | number {\n if (messages) {\n const index = messages.findIndex((message) => message.id === messageToDelete.id);\n if (index !== -1) {\n messages.splice(index, 1);\n return index;\n }\n }\n return false;\n }\n\n private clear = (appId: number) => (this.state[appId] = this.emptyState());\n\n private fetchMessages = (\n appId: number,\n since: number\n ): Promise> => {\n if (appId === AllMessages) {\n return axios.get(config.get('url') + 'message?since=' + since);\n } else {\n return axios.get(\n config.get('url') + 'application/' + appId + '/message?since=' + since\n );\n }\n };\n\n private getUnCached = (appId: number): Array => {\n const appToImage = this.appStore\n .getItems()\n .reduce((all, app) => ({...all, [app.id]: app.image}), {});\n\n return this.stateOf(appId, false).messages.map((message: IMessage) => {\n return {\n ...message,\n image: appToImage[message.appid] || null,\n };\n });\n };\n\n public get = createTransformer(this.getUnCached);\n\n private clearCache = () => (this.get = createTransformer(this.getUnCached));\n\n private createEmptyStatesForApps = (apps: IApplication[]) => {\n apps.map((app) => app.id).forEach((id) => this.stateOf(id, /*create*/ true));\n this.clearCache();\n };\n\n private emptyState = (): MessagesState => ({\n messages: observable.array(),\n hasMore: true,\n nextSince: 0,\n loaded: false,\n });\n}\n","import {BaseStore} from '../common/BaseStore';\nimport axios from 'axios';\nimport * as config from '../config';\nimport {action} from 'mobx';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IClient} from '../types';\n\nexport class ClientStore extends BaseStore {\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n protected requestItems = (): Promise => {\n return axios.get(`${config.get('url')}client`).then((response) => response.data);\n };\n\n protected requestDelete(id: number): Promise {\n return axios\n .delete(`${config.get('url')}client/${id}`)\n .then(() => this.snack('Client deleted'));\n }\n\n @action\n public update = async (id: number, name: string): Promise => {\n await axios.put(`${config.get('url')}client/${id}`, {name});\n await this.refresh();\n this.snack('Client updated');\n };\n\n @action\n public createNoNotifcation = async (name: string): Promise => {\n const client = await axios.post(`${config.get('url')}client`, {name});\n await this.refresh();\n return client.data;\n };\n\n @action\n public create = async (name: string): Promise => {\n await this.createNoNotifcation(name);\n this.snack('Client added');\n };\n}\n","import axios from 'axios';\nimport {action} from 'mobx';\nimport {BaseStore} from '../common/BaseStore';\nimport * as config from '../config';\nimport {SnackReporter} from '../snack/SnackManager';\nimport {IPlugin} from '../types';\n\nexport class PluginStore extends BaseStore {\n public onDelete: () => void = () => {};\n\n public constructor(private readonly snack: SnackReporter) {\n super();\n }\n\n public requestConfig = (id: number): Promise => {\n return axios\n .get(`${config.get('url')}plugin/${id}/config`)\n .then((response) => response.data);\n };\n\n public requestDisplay = (id: number): Promise => {\n return axios\n .get(`${config.get('url')}plugin/${id}/display`)\n .then((response) => response.data);\n };\n\n protected requestItems = (): Promise => {\n return axios.get(`${config.get('url')}plugin`).then((response) => response.data);\n };\n\n protected requestDelete = (id: number): Promise => {\n this.snack('Cannot delete plugin');\n throw new Error('Cannot delete plugin');\n };\n\n public getName = (id: number): string => {\n const plugin = this.getByIDOrUndefined(id);\n return id === -1 ? 'All Plugins' : plugin !== undefined ? plugin.name : 'unknown';\n };\n\n @action\n public changeConfig = async (id: number, newConfig: string): Promise => {\n await axios.post(`${config.get('url')}plugin/${id}/config`, newConfig, {\n headers: {'content-type': 'application/x-yaml'},\n });\n this.snack(`Plugin config updated`);\n await this.refresh();\n };\n\n @action\n public changeEnabledState = async (id: number, enabled: boolean): Promise => {\n await axios.post(`${config.get('url')}plugin/${id}/${enabled ? 'enable' : 'disable'}`);\n this.snack(`Plugin ${enabled ? 'enabled' : 'disabled'}`);\n await this.refresh();\n };\n}\n","import {StoreMapping} from './inject';\nimport {reaction} from 'mobx';\nimport * as Notifications from './snack/browserNotification';\n\nexport const registerReactions = (stores: StoreMapping) => {\n const clearAll = () => {\n stores.messagesStore.clearAll();\n stores.appStore.clear();\n stores.clientStore.clear();\n stores.userStore.clear();\n stores.wsStore.close();\n };\n const loadAll = () => {\n stores.wsStore.listen((message) => {\n stores.messagesStore.publishSingleMessage(message);\n Notifications.notifyNewMessage(message);\n if (message.priority >= 4) {\n const src = 'static/notification.ogg';\n const audio = new Audio(src);\n audio.play();\n }\n });\n stores.appStore.refresh();\n };\n\n reaction(\n () => stores.currentUser.loggedIn,\n (loggedIn) => {\n if (loggedIn) {\n loadAll();\n } else {\n clearAll();\n }\n }\n );\n\n reaction(\n () => stores.currentUser.connectionErrorMessage,\n (connectionErrorMessage) => {\n if (!connectionErrorMessage) {\n clearAll();\n loadAll();\n }\n }\n );\n};\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport 'typeface-roboto';\nimport {initAxios} from './apiAuth';\nimport * as config from './config';\nimport Layout from './layout/Layout';\nimport registerServiceWorker from './registerServiceWorker';\nimport {CurrentUser} from './CurrentUser';\nimport {AppStore} from './application/AppStore';\nimport {WebSocketStore} from './message/WebSocketStore';\nimport {SnackManager} from './snack/SnackManager';\nimport {InjectProvider, StoreMapping} from './inject';\nimport {UserStore} from './user/UserStore';\nimport {MessagesStore} from './message/MessagesStore';\nimport {ClientStore} from './client/ClientStore';\nimport {PluginStore} from './plugin/PluginStore';\nimport {registerReactions} from './reactions';\n\nconst defaultDevConfig = {\n url: 'http://localhost:3000/',\n};\n\nconst {port, hostname, protocol, pathname} = window.location;\nconst slashes = protocol.concat('//');\nconst path = pathname.endsWith('/') ? pathname : pathname.substring(0, pathname.lastIndexOf('/'));\nconst url = slashes.concat(port ? hostname.concat(':', port) : hostname) + path;\nconst urlWithSlash = url.endsWith('/') ? url : url.concat('/');\n\nconst defaultProdConfig = {\n url: urlWithSlash,\n};\n\ndeclare global {\n // tslint:disable-next-line\n interface Window {\n config: config.IConfig;\n }\n}\n\nconst initStores = (): StoreMapping => {\n const snackManager = new SnackManager();\n const appStore = new AppStore(snackManager.snack);\n const userStore = new UserStore(snackManager.snack);\n const messagesStore = new MessagesStore(appStore, snackManager.snack);\n const currentUser = new CurrentUser(snackManager.snack);\n const clientStore = new ClientStore(snackManager.snack);\n const wsStore = new WebSocketStore(snackManager.snack, currentUser);\n const pluginStore = new PluginStore(snackManager.snack);\n appStore.onDelete = () => messagesStore.clearAll();\n\n return {\n appStore,\n snackManager,\n userStore,\n messagesStore,\n currentUser,\n clientStore,\n wsStore,\n pluginStore,\n };\n};\n\n(function clientJS() {\n if (process.env.NODE_ENV === 'production') {\n config.set(window.config || defaultProdConfig);\n } else {\n config.set(window.config || defaultDevConfig);\n }\n const stores = initStores();\n initAxios(stores.currentUser, stores.snackManager.snack);\n\n registerReactions(stores);\n\n stores.currentUser.tryAuthenticate().catch(() => {});\n\n window.onbeforeunload = () => {\n stores.wsStore.close();\n };\n\n ReactDOM.render(\n \n \n ,\n document.getElementById('root')\n );\n registerServiceWorker();\n})();\n","import axios from 'axios';\nimport {CurrentUser} from './CurrentUser';\nimport {SnackReporter} from './snack/SnackManager';\n\nexport const initAxios = (currentUser: CurrentUser, snack: SnackReporter) => {\n axios.interceptors.request.use((config) => {\n config.headers['X-Gotify-Key'] = currentUser.token();\n return config;\n });\n\n axios.interceptors.response.use(undefined, (error) => {\n if (!error.response) {\n snack('Gotify server is not reachable, try refreshing the page.');\n return Promise.reject(error);\n }\n\n const status = error.response.status;\n\n if (status === 401) {\n currentUser.tryAuthenticate().then(() => snack('Could not complete request.'));\n }\n\n if (status === 400 || status === 403 || status === 500) {\n snack(error.response.data.error + ': ' + error.response.data.errorDescription);\n }\n\n return Promise.reject(error);\n });\n};\n"],"sourceRoot":""}