mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
Added files
This commit is contained in:
22
mongoui/mongoui-master/ui/connectionAlert/index.html
Normal file
22
mongoui/mongoui-master/ui/connectionAlert/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<connectionAlert:>
|
||||
<div class="connection">
|
||||
<!--
|
||||
connected and canConnect are built-in properties of model. If a variable
|
||||
is not defined in the current context, it will be looked up in the model
|
||||
data and the model properties
|
||||
-->
|
||||
{#unless connected}
|
||||
<p class="alert">
|
||||
{#if canConnect}
|
||||
<!-- Leading space is removed, and trailing space is maintained -->
|
||||
Offline
|
||||
<!-- a :self path alias is automatically created per component -->
|
||||
{#unless :self.hideReconnect}
|
||||
– <a x-bind="click:connect">Reconnect</a>
|
||||
{/}
|
||||
{else}
|
||||
Unable to reconnect – <a x-bind="click:reload">Reload</a>
|
||||
{/}
|
||||
</p>
|
||||
{/}
|
||||
</div>
|
||||
13
mongoui/mongoui-master/ui/connectionAlert/index.js
Normal file
13
mongoui/mongoui-master/ui/connectionAlert/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
exports.connect = function() {
|
||||
model = this.model
|
||||
// Hide the reconnect link for a second after clicking it
|
||||
model.set('hideReconnect', true)
|
||||
setTimeout(function() {
|
||||
model.set('hideReconnect', false)
|
||||
}, 1000)
|
||||
model.socket.socket.connect()
|
||||
}
|
||||
|
||||
exports.reload = function() {
|
||||
window.location.reload()
|
||||
}
|
||||
14
mongoui/mongoui-master/ui/index.js
Normal file
14
mongoui/mongoui-master/ui/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var config = {
|
||||
filename: __filename
|
||||
, styles: '../styles/ui'
|
||||
, scripts: {
|
||||
connectionAlert: require('./connectionAlert')
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ui
|
||||
ui.decorate = 'derby'
|
||||
|
||||
function ui(derby, options) {
|
||||
derby.createLibrary(config, options)
|
||||
}
|
||||
Reference in New Issue
Block a user