Commit 267dfdb0 authored by Thomas Lechauve's avatar Thomas Lechauve

Update desktop and tablet views

parent 6852c1d9
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
NAME = build NAME = build
TARBALL = vifib.tar.gz TARBALL = slapos.tar.gz
DEVDIR = ${NAME}_dev DEVDIR = ${NAME}_dev
RELDIR = ${NAME} RELDIR = ${NAME}
JSDIR = js JSDIR = js
DEVJS = vifib.js DEVJS = slapos.js
DEVCSS = vifib.css DEVCSS = slapos.css
FINALJS = vifib.js FINALJS = slapos.js
FINALCSS = vifib.css FINALCSS = slapos.css
all: dev release all: dev release
...@@ -132,7 +132,7 @@ ${DEVDIR}/tests/%_test.html.ok: ${DEVDIR}/tests/%_test.html ${DEVDIR}/tests/%_te ...@@ -132,7 +132,7 @@ ${DEVDIR}/tests/%_test.html.ok: ${DEVDIR}/tests/%_test.html ${DEVDIR}/tests/%_te
######################################### #########################################
clean: clean:
@echo soft cleaning @echo soft cleaning
rm -rf ${DEVDIR}/index.html ${DEVDIR}/vifib.* ${DEVDIR}/js rm -rf ${DEVDIR}/index.html ${DEVDIR}/slapos.* ${DEVDIR}/js
cleanall: cleanall:
@echo cleaning @echo cleaning
rm -rf ${DEVDIR} ${RELDIR} $(TARBALL) rm -rf ${DEVDIR} ${RELDIR} $(TARBALL)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="vifib.js"></script> <script src="slapos.js"></script>
<style> <style>
.ui-content{ .ui-content{
padding: 0px; padding: 0px;
......
...@@ -13,6 +13,13 @@ $(document).bind("mobileinit", function () { ...@@ -13,6 +13,13 @@ $(document).bind("mobileinit", function () {
'ggappid': '380290002359.apps.googleusercontent.com' 'ggappid': '380290002359.apps.googleusercontent.com'
}); });
// show loading during ajax request
$(document).ajaxStart(function () {
$("#loading").spin(spinOptions);
}).ajaxStop(function () {
$("#loading").spin(false);
});
//$(document).slapos('store', 'host', '/fake'); //$(document).slapos('store', 'host', '/fake');
$.mobile.ajaxEnabled = false; $.mobile.ajaxEnabled = false;
......
'use strict'; 'use strict';
var getDevice = function (w) { var getDevice = function (w) {
return 'mobile';
if (w < 500) { if (w < 500) {
return 'mobile'; return 'mobile';
} }
...@@ -24,7 +23,7 @@ $.vifib.devices = { ...@@ -24,7 +23,7 @@ $.vifib.devices = {
$('body') $('body')
.route('add', '/login/google') .route('add', '/login/google')
.done($.vifib.login.google); .done($.vifib.login.google);
// when oogle send back the token, it reset hashtag from url // when Google send back the token, it reset hashtag from url
$('body') $('body')
.route('add', 'access_token=<path:path>') .route('add', 'access_token=<path:path>')
.done($.vifib.login.googleRedirect); .done($.vifib.login.googleRedirect);
...@@ -42,6 +41,16 @@ $.vifib.devices = { ...@@ -42,6 +41,16 @@ $.vifib.devices = {
$('body') $('body')
.route('add', '') .route('add', '')
.done($.vifib.tablet.overview); .done($.vifib.tablet.overview);
$('body')
.route('add', '/login/facebook')
.done($.vifib.login.facebook);
$('body')
.route('add', '/login/google')
.done($.vifib.login.google);
// when Google send back the token, it reset hashtag from url
$('body')
.route('add', 'access_token=<path:path>')
.done($.vifib.login.googleRedirect);
$('body') $('body')
.route('add', '/overview') .route('add', '/overview')
.done($.vifib.tablet.overview); .done($.vifib.tablet.overview);
......
...@@ -14,7 +14,7 @@ $.vifib.desktop = { ...@@ -14,7 +14,7 @@ $.vifib.desktop = {
]} ]}
]); ]);
// header // header
page.prepend(Mustache.render($.vifib.header.default, {title: 'Vifib'})); page.prepend(Mustache.render($.vifib.header.default, {title: 'SlapOs'}));
// rendering // rendering
$.vifib.changepage($(page)); $.vifib.changepage($(page));
$('#panel-1') $('#panel-1')
...@@ -26,6 +26,16 @@ $.vifib.desktop = { ...@@ -26,6 +26,16 @@ $.vifib.desktop = {
$('#panel-1') $('#panel-1')
.route('add', '/dashboard<path:url>', 1) .route('add', '/dashboard<path:url>', 1)
.done($.vifib.desktop.dashboard.dispatch); .done($.vifib.desktop.dashboard.dispatch);
$('#panel-1')
.route('add', '/login/facebook', 1)
.done($.vifib.login.facebook);
$('#panel-1')
.route('add', '/login/google', 1)
.done($.vifib.login.google);
// when Google send back the token, it reset hashtag from url
$('#panel-1')
.route('add', 'access_token=<path:path>', 1)
.done($.vifib.login.googleRedirect);
$('#panel-1') $('#panel-1')
.route('go', $.url.getPath(), 1) .route('go', $.url.getPath(), 1)
.fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)}); .fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)});
...@@ -69,10 +79,10 @@ $.vifib.desktop = { ...@@ -69,10 +79,10 @@ $.vifib.desktop = {
overview: function (route) { overview: function (route) {
$.vifib.replacepanel($(this), $.vifib.panel.library, { $.vifib.replacepanel($(this), $.vifib.panel.library, {
most: [ most: [
{url: '#/library/software/id/fake/software_info/kvm', name: 'Kvm'}, {url: '#/library/software/id/fake/software_info/Kvm', name: 'Kvm'},
], ],
newest: [ newest: [
{url: '#/library/software/id/fake/software_info/html5', name: 'html5 AS'} {url: '#/library/software/id/fake/software_info/Html5as', name: 'html5 AS'}
] ]
}); });
}, },
...@@ -93,7 +103,6 @@ $.vifib.desktop = { ...@@ -93,7 +103,6 @@ $.vifib.desktop = {
$.vifib.replacepanel($(this), $.vifib.panel.simplelist, { $.vifib.replacepanel($(this), $.vifib.panel.simplelist, {
links: [ links: [
{url: '#/dashboard/instance/list', name: 'Instances'}, {url: '#/dashboard/instance/list', name: 'Instances'},
{url: '#/dashboard/computer/list', name: 'Computers'}
] ]
}); });
$('#panel-2') $('#panel-2')
...@@ -103,39 +112,91 @@ $.vifib.desktop = { ...@@ -103,39 +112,91 @@ $.vifib.desktop = {
.route('add', '/dashboard/instance/list', 2) .route('add', '/dashboard/instance/list', 2)
.done($.vifib.desktop.dashboard.instancelist); .done($.vifib.desktop.dashboard.instancelist);
$('#panel-2') $('#panel-2')
.route('add', '/dashboard/instance/id/<instid>', 2) .route('add', '/dashboard/instance/request', 2)
.done($.vifib.desktop.dashboard.instancerequest);
$('#panel-2')
.route('add', '/dashboard/instance/id<path:instid>', 2)
.done($.vifib.desktop.dashboard.instance); .done($.vifib.desktop.dashboard.instance);
$('#panel-2') $('#panel-2')
.route('add', '/dashboard/computer/list', 2) .route('add', '/dashboard/instance/start<path:instid>', 2)
.done($.vifib.desktop.dashboard.computerlist); .done($.vifib.desktop.dashboard.instancestart);
$('#panel-2')
.route('add', '/dashboard/instance/stop<path:instid>', 2)
.done($.vifib.desktop.dashboard.instancestop);
$('#panel-2') $('#panel-2')
.route('add', '/dashboard/computer/id/<compid>', 2) .route('add', '/dashboard/instance/destroy<path:instid>', 2)
.done($.vifib.desktop.dashboard.computer); .done($.vifib.desktop.dashboard.instancedestroy);
$('#panel-2') $('#panel-2')
.route('go', $.url.getPath(), 2) .route('go', $.url.getPath(), 2)
.fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)}); .fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)});
}, },
instancelist: function (route) { instancelist: function (route) {
$.vifib.replacepanel($(this), $.vifib.panel.allinstance); $.vifib.replacepanel($(this), $.vifib.panel.instancelist);
$.vifib.instanceList($(this)); $.vifib.instanceList($(this));
}, },
instancerequest: function (route) {
$.vifib.replacepanel($(this), $.vifib.panel.instancerequest);
$("#instancerequest").submit(function () {
var data = {
"status": "start_requested",
"slave": false,
"software_type": "type_provided_by_the_software",
};
$.extend(data, $(this).serializeObject());
$(this).slapos('instanceRequest', {
data: data,
success: function (response) {
$.url.redirect('/dashboard/instance/list');
},
statusCode: $.extend(false, $.vifib.statuscode, {})
});
return false;
});
},
instance: function (instid) { instance: function (instid) {
$(this).slapos('instanceInfo', instid, { $(this).slapos('instanceInfo', instid, {
success: function (response) { success: function (response) {
response[response.status] = true;
response.stop_url = '#/dashboard/instance/stop' + instid;
response.start_url = '#/dashboard/instance/start' + instid;
response.destroy_url = '#/dashboard/instance/destroy' + instid;
$.vifib.replacepanel($(this), $.vifib.panel.instance, response); $.vifib.replacepanel($(this), $.vifib.panel.instance, response);
} }
}); });
}, },
computerlist: function (route) { instancestop: function (instid) {
$.vifib.replacepanel($(this), $.vifib.panel.allcomputer); $(this).slapos('instanceInfo', instid, {
$.vifib.computerList($(this));
},
computer: function (compid) {
$(this).slapos('computerInfo', compid, {
success: function (response) { success: function (response) {
$.vifib.replacepanel($(this), $.vifib.panel.computer, response); if (response.status === 'start_requested') {
response.status = 'stop_requested';
$(this).slapos('instanceRequest', {
data: response,
success: function (response) {
$.url.redirect('/dashboard/instance/id' + instid);
},
statusCode: $.extend(false, $.vifib.statuscode, {})
})
} }
},
statusCode: $.extend(false, $.vifib.statuscode, {})
}); });
},
instancestart: function (instid) {
$(this).slapos('instanceInfo', instid, {
success: function (response) {
if (response.status === 'stop_requested') {
response.status = 'start_requested';
$(this).slapos('instanceRequest', {
data: response,
success: function (response) {
$.url.redirect('/dashboard/instance/id' + instid);
},
statusCode: $.extend(false, $.vifib.statuscode, {})
})
} }
},
statusCode: $.extend(false, $.vifib.statuscode, {})
});
},
} }
}; };
...@@ -33,19 +33,51 @@ $.vifib.login = { ...@@ -33,19 +33,51 @@ $.vifib.login = {
} }
$.vifib.statuscode = { $.vifib.statuscode = {
400: function (jqxhr, textstatus) { 400: function (jqxhr, textstatus) {
var page;
if(device === 'mobile') {
page = $.vifib.onepanel($.vifib.panel.badrequest);
page.prepend(Mustache.render($.vifib.header.default, {title: 'An error as occured'}));
page.append($.vifib.footer.overview);
$.vifib.changepage($(page));
} else {
$.vifib.replacepanel($(this), $.vifib.panel.badrequest); $.vifib.replacepanel($(this), $.vifib.panel.badrequest);
}
}, },
401: function (jqxhr, textstatus) { 401: function (jqxhr, textstatus) {
$.url.redirect('/login'); $.url.redirect('/overview');
}, },
402: function (jqxhr, textstatus) { 402: function (jqxhr, textstatus) {
var page;
if(device === 'mobile') {
page = $.vifib.onepanel($.vifib.panel.payment);
page.prepend(Mustache.render($.vifib.header.default, {title: 'An error as occured'}));
page.append($.vifib.footer.overview);
$.vifib.changepage($(page));
} else {
$.vifib.replacepanel($(this), $.vifib.panel.payment); $.vifib.replacepanel($(this), $.vifib.panel.payment);
}
}, },
404: function (jqxhr, textstatus) { 404: function (jqxhr, textstatus) {
var page;
if(device === 'mobile') {
page = $.vifib.onepanel($.vifib.panel.notfound);
page.prepend(Mustache.render($.vifib.header.default, {title: 'An error as occured'}));
page.append($.vifib.footer.overview);
$.vifib.changepage($(page));
} else {
$.vifib.replacepanel($(this), $.vifib.panel.notfound); $.vifib.replacepanel($(this), $.vifib.panel.notfound);
}
}, },
500: function (jqxhr, textstatus) { 500: function (jqxhr, textstatus) {
var page;
if(device === 'mobile') {
page = $.vifib.onepanel($.vifib.panel.internalerror);
page.prepend(Mustache.render($.vifib.header.default, {title: 'An error as occured'}));
page.append($.vifib.footer.overview);
$.vifib.changepage($(page));
} else {
$.vifib.replacepanel($(this), $.vifib.panel.internalerror); $.vifib.replacepanel($(this), $.vifib.panel.internalerror);
}
}, },
} }
$.vifib.softwareList = function (context) { $.vifib.softwareList = function (context) {
......
...@@ -9,7 +9,7 @@ $.vifib.mobile = { ...@@ -9,7 +9,7 @@ $.vifib.mobile = {
// rendering // rendering
page = $.vifib.onepanel($.vifib.panel.login); page = $.vifib.onepanel($.vifib.panel.login);
// header // header
page.prepend(Mustache.render($.vifib.header.default, {title: 'Vifib'})); page.prepend(Mustache.render($.vifib.header.default, {title: 'SlapOs'}));
// footer navbar // footer navbar
page.append($.vifib.footer.overview); page.append($.vifib.footer.overview);
// rendering // rendering
...@@ -33,10 +33,10 @@ $.vifib.mobile = { ...@@ -33,10 +33,10 @@ $.vifib.mobile = {
overview: function () { overview: function () {
page = $.vifib.onepanel($.vifib.panel.library, { page = $.vifib.onepanel($.vifib.panel.library, {
most: [ most: [
{url: '#/library/software/id/fake/software_info/kvm', name: 'Kvm'}, {url: '#/library/software/id/fake/software_info/Kvm', name: 'Kvm'},
], ],
newest: [ newest: [
{url: '#/library/software/id/fake/software_info/html5', name: 'html5 AS'} {url: '#/library/software/id/fake/software_info/Html5', name: 'Html5as'}
] ]
}); });
// header // header
...@@ -63,7 +63,8 @@ $.vifib.mobile = { ...@@ -63,7 +63,8 @@ $.vifib.mobile = {
page.append($.vifib.footer.overview); page.append($.vifib.footer.overview);
// rendering // rendering
$.vifib.changepage($(page)); $.vifib.changepage($(page));
} },
statusCode: $.extend(false, $.vifib.statuscode, {})
}); });
}, },
all: function () { all: function () {
...@@ -97,12 +98,6 @@ $.vifib.mobile = { ...@@ -97,12 +98,6 @@ $.vifib.mobile = {
$('body') $('body')
.route('add', '/dashboard/instance/destroy<path:instid>', 1) .route('add', '/dashboard/instance/destroy<path:instid>', 1)
.done($.vifib.mobile.dashboard.instancedestroy); .done($.vifib.mobile.dashboard.instancedestroy);
$('body')
.route('add', '/dashboard/computer/list', 1)
.done($.vifib.mobile.dashboard.computerlist);
$('body')
.route('add', '/dashboard/computer/id/<compid>', 1)
.done($.vifib.mobile.dashboard.computer);
$('body') $('body')
.route('go', $.url.getPath(), 1) .route('go', $.url.getPath(), 1)
.fail($.vifib.mobile.nopage); .fail($.vifib.mobile.nopage);
...@@ -162,7 +157,7 @@ $.vifib.mobile = { ...@@ -162,7 +157,7 @@ $.vifib.mobile = {
$(this).slapos('instanceInfo', instid, { $(this).slapos('instanceInfo', instid, {
success: function (response) { success: function (response) {
if (response.status === 'stop_requested') { if (response.status === 'stop_requested') {
response.status = 'started'; response.status = 'start_requested';
$(this).slapos('instanceRequest', { $(this).slapos('instanceRequest', {
data: response, data: response,
success: function (response) { success: function (response) {
...@@ -179,7 +174,7 @@ $.vifib.mobile = { ...@@ -179,7 +174,7 @@ $.vifib.mobile = {
$(this).slapos('instanceInfo', instid, { $(this).slapos('instanceInfo', instid, {
success: function (response) { success: function (response) {
if (response.status === 'start_requested') { if (response.status === 'start_requested') {
response.status = 'stopped'; response.status = 'stop_requested';
$(this).slapos('instanceRequest', { $(this).slapos('instanceRequest', {
data: response, data: response,
success: function (response) { success: function (response) {
......
...@@ -10,7 +10,7 @@ $.vifib.tablet = { ...@@ -10,7 +10,7 @@ $.vifib.tablet = {
]} ]}
]); ]);
// header // header
page.prepend(Mustache.render($.vifib.header.default, {title: 'Vifib'})); page.prepend(Mustache.render($.vifib.header.default, {title: 'SlapOs'}));
// rendering // rendering
$.vifib.changepage($(page)); $.vifib.changepage($(page));
}, },
...@@ -47,8 +47,8 @@ $.vifib.tablet = { ...@@ -47,8 +47,8 @@ $.vifib.tablet = {
}, },
overview: function () { overview: function () {
$.vifib.replacepanel($(this), $.vifib.panel.library, { $.vifib.replacepanel($(this), $.vifib.panel.library, {
most: [{url: '#/library/software/id/fake/software_info/kvm', name: 'Kvm'},], most: [{url: '#/library/software/id/fake/software_info/Kvm', name: 'Kvm'},],
newest: [{url: '#/library/software/id/fake/software_info/html5', name: 'html5 AS'}] newest: [{url: '#/library/software/id/fake/software_info/Html5as', name: 'html5 AS'}]
}); });
}, },
software: function (softid) { software: function (softid) {
...@@ -78,7 +78,6 @@ $.vifib.tablet = { ...@@ -78,7 +78,6 @@ $.vifib.tablet = {
{url: '#/library/', name: 'Library'}, {url: '#/library/', name: 'Library'},
{url: 'http://packages.python.org/slapos.core/', name: 'Documentation'}, {url: 'http://packages.python.org/slapos.core/', name: 'Documentation'},
{url: '#/dashboard/instance/list', name: 'Instances'}, {url: '#/dashboard/instance/list', name: 'Instances'},
{url: '#/dashboard/computer/list', name: 'Computers'}
]} ]}
]); ]);
page.prepend(Mustache.render($.vifib.header.default, {title: 'Dashboard'})); page.prepend(Mustache.render($.vifib.header.default, {title: 'Dashboard'}));
...@@ -90,25 +89,35 @@ $.vifib.tablet = { ...@@ -90,25 +89,35 @@ $.vifib.tablet = {
.route('add', '/dashboard/instance/list', 1) .route('add', '/dashboard/instance/list', 1)
.done($.vifib.tablet.dashboard.instancelist); .done($.vifib.tablet.dashboard.instancelist);
$('#panel-1') $('#panel-1')
.route('add', '/dashboard/instance/id/<instid>', 1) .route('add', '/dashboard/instance/request', 1)
.done($.vifib.tablet.dashboard.instancerequest);
$('#panel-1')
.route('add', '/dashboard/instance/id<path:instid>', 1)
.done($.vifib.tablet.dashboard.instance); .done($.vifib.tablet.dashboard.instance);
$('#panel-1') $('#panel-1')
.route('add', '/dashboard/computer/list', 1) .route('add', '/dashboard/instance/start<path:instid>', 1)
.done($.vifib.tablet.dashboard.computerlist); .done($.vifib.tablet.dashboard.instancestart);
$('#panel-1')
.route('add', '/dashboard/instance/stop<path:instid>', 1)
.done($.vifib.tablet.dashboard.instancestop);
$('#panel-1') $('#panel-1')
.route('add', '/dashboard/computer/id/<compid>', 1) .route('add', '/dashboard/instance/destroy<path:instid>', 1)
.done($.vifib.tablet.dashboard.computer); .done($.vifib.tablet.dashboard.instancedestroy);
$('#panel-1') $('#panel-1')
.route('go', $.url.getPath(), 1) .route('go', $.url.getPath(), 1)
.fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)}); .fail(function () { $.vifib.replacepanel($(this), $.vifib.panel.failed)});
}, },
instancelist: function (route) { instancelist: function (route) {
$.vifib.replacepanel($(this), $.vifib.panel.allinstance); $.vifib.replacepanel($(this), $.vifib.panel.instancelist);
$.vifib.instanceList($(this)); $.vifib.instanceList($(this));
}, },
instance: function (instid) { instance: function (instid) {
$(this).slapos('instanceInfo', instid, { $(this).slapos('instanceInfo', instid, {
success: function (response) { success: function (response) {
response[response.status] = true;
response.stop_url = '#/dashboard/instance/stop' + instid;
response.start_url = '#/dashboard/instance/start' + instid;
response.destroy_url = '#/dashboard/instance/destroy' + instid;
$.vifib.replacepanel($(this), $.vifib.panel.instance, response); $.vifib.replacepanel($(this), $.vifib.panel.instance, response);
}, },
statusCode: $.extend(false, $.vifib.statuscode, { statusCode: $.extend(false, $.vifib.statuscode, {
...@@ -118,21 +127,58 @@ $.vifib.tablet = { ...@@ -118,21 +127,58 @@ $.vifib.tablet = {
}) })
}); });
}, },
computerlist: function (route) { instancerequest: function (route) {
$.vifib.replacepanel($(this), $.vifib.panel.allcomputer); $.vifib.replacepanel($(this), $.vifib.panel.instancerequest);
$.vifib.computerList($(this)); $("#instancerequest").submit(function () {
var data = {
"status": "start_requested",
"slave": false,
"software_type": "type_provided_by_the_software",
};
$.extend(data, $(this).serializeObject());
$(this).slapos('instanceRequest', {
data: data,
success: function (response) {
$.url.redirect('/dashboard/instance/list');
},
statusCode: $.extend(false, $.vifib.statuscode, {})
});
return false;
});
}, },
computer: function (compid) { instancestop: function (instid) {
$(this).slapos('computerInfo', compid, { $(this).slapos('instanceInfo', instid, {
success: function (response) {
if (response.status === 'start_requested') {
response.status = 'stop_requested';
$(this).slapos('instanceRequest', {
data: response,
success: function (response) { success: function (response) {
$.vifib.replacepanel($(this), $.vifib.panel.computer, response); $.url.redirect('/dashboard/instance/id' + instid);
}, },
statusCode: $.extend(false, $.vifib.statuscode, { statusCode: $.extend(false, $.vifib.statuscode, {})
404: function (jqxhr, textstatus) {
$.vifib.replacepanel($(this), $.vifib.panel.nocomputer, {name: compid});
}
}) })
}
},
statusCode: $.extend(false, $.vifib.statuscode, {})
}); });
},
instancestart: function (instid) {
$(this).slapos('instanceInfo', instid, {
success: function (response) {
if (response.status === 'stop_requested') {
response.status = 'start_requested';
$(this).slapos('instanceRequest', {
data: response,
success: function (response) {
$.url.redirect('/dashboard/instance/id' + instid);
},
statusCode: $.extend(false, $.vifib.statuscode, {})
})
} }
},
statusCode: $.extend(false, $.vifib.statuscode, {})
});
},
} }
}; };
...@@ -207,7 +207,7 @@ $.vifib.panel = { ...@@ -207,7 +207,7 @@ $.vifib.panel = {
} }
$.vifib.header = { $.vifib.header = {
default: '<header data-role="header"><a href="#" data-icon="home" data-iconpos="notext"></a><h2>{{ title }}</h2><div id="loading" style="h"></div></header>' default: '<header data-role="header"><a href="#" data-icon="home" data-iconpos="notext"></a><h2>{{ title }}</h2></div></header><div id="loading" style="position: absolute; top: 20px; right: 20px;"></div>'
} }
$.vifib.footer = { $.vifib.footer = {
......
...@@ -103,10 +103,8 @@ fakeserver.respondWith("POST", '/fake/instance', function (xhr) { ...@@ -103,10 +103,8 @@ fakeserver.respondWith("POST", '/fake/instance', function (xhr) {
inst = JSON.parse(xhr.requestBody), inst = JSON.parse(xhr.requestBody),
iadd = {}, iadd = {},
ilist = instance_list(); ilist = instance_list();
if (instances.hasOwnProperty(inst.title) === false) {
iadd[inst.title] = inst; iadd[inst.title] = inst;
storejs.extend('instances', iadd); storejs.extend('instances', iadd);
}
xhr.respond(201, {'Content-Type': 'application/json'}, JSON.stringify({ xhr.respond(201, {'Content-Type': 'application/json'}, JSON.stringify({
title: inst.title, title: inst.title,
status: inst.status status: inst.status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment