Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin-LTE overhaul #346

Merged
merged 40 commits into from
Nov 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2a2f53c
Initial commit
stefanoborini Nov 11, 2016
690938f
Cleaned up irrelevant entries
stefanoborini Nov 11, 2016
dfa7bc5
Removed the distinction between running and available
stefanoborini Nov 11, 2016
df0c0fe
Generic, empty page template
stefanoborini Nov 11, 2016
0a74a23
Porting functionality to new style
stefanoborini Nov 14, 2016
5df1c9f
Starts the application
stefanoborini Nov 14, 2016
c1fec5b
Changed ResolutionModel view for new visual aspect
stefanoborini Nov 14, 2016
576f77e
Current spawning working with iframe. Incorrect size
stefanoborini Nov 14, 2016
b96994a
Added max_iframe_size
stefanoborini Nov 14, 2016
14b66f8
Returning appropriate config dict
stefanoborini Nov 14, 2016
64f934b
Committed current partial status
stefanoborini Nov 15, 2016
f208673
Fixed missing comma
stefanoborini Nov 15, 2016
8a0f3ce
Streamlined ApplicationListView.
stefanoborini Nov 15, 2016
8de9151
Stable UI without stop
stefanoborini Nov 15, 2016
92fb121
Merge branch 'master' into adminlte-integration
stefanoborini Nov 15, 2016
322ea38
Added delayed to redirect to spinner. Temporary fix.
stefanoborini Nov 15, 2016
24eb1bc
Started app badge
stefanoborini Nov 15, 2016
7acd82e
Starting up icon and disabling form.
stefanoborini Nov 16, 2016
1f5b6a4
Stopping implemented (although needs styling)
stefanoborini Nov 16, 2016
95a3e84
Stopping interface.
stefanoborini Nov 16, 2016
8928270
Added Status and updating of status on Model
stefanoborini Nov 16, 2016
0abddf9
Adapted Views for Status object
stefanoborini Nov 16, 2016
c344f4a
Cleanup of application_list_view
stefanoborini Nov 16, 2016
883964e
added stop pulse
stefanoborini Nov 16, 2016
a279b6d
Fixed dialog error message
stefanoborini Nov 16, 2016
53f165e
Fixed incorrect reset at error
stefanoborini Nov 16, 2016
6dbf226
ellipsis overflow of long appnames
stefanoborini Nov 16, 2016
717a00b
Removed update method
stefanoborini Nov 16, 2016
b54cac6
Added back policy
stefanoborini Nov 16, 2016
121ac5f
Fixed tests
stefanoborini Nov 16, 2016
2600590
Fixed selenium tests
stefanoborini Nov 16, 2016
491f64d
Initialized handlebars and readapted test
stefanoborini Nov 16, 2016
02944fd
Added recording to see what happens
stefanoborini Nov 17, 2016
07b3a27
Fixed incorrect path for installed admin-lte
stefanoborini Nov 17, 2016
89fdd6f
Removed recording
stefanoborini Nov 17, 2016
0e0ca45
Initial port
stefanoborini Nov 17, 2016
fab10ae
Fixed incorrect behavior due to double inclusion of bootstrap
stefanoborini Nov 17, 2016
2ac6d99
Changed skin for admin interface
stefanoborini Nov 17, 2016
c0c85de
final cleanup of non-admin application style
stefanoborini Nov 17, 2016
fb5de96
Removed unused style
stefanoborini Nov 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"moment": "~2.7",
"requirejs": "~2.1",
"datatables.net": "~1.10.12",
"datatables.net-dt": "~1.10.12"
"datatables.net-dt": "~1.10.12",
"admin-lte": "~2.3.8",
"handlebars": "~4.0.5",
"underscore": "~1.8.3"
},
"devDependencies": {
"blanket": "^1.1.7"
Expand Down
9 changes: 3 additions & 6 deletions jstests/tests/home/test_views.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
define([
"home/models",
"home/views",
"home/views/application_list_view",
"jquery"
], function (models, views, $) {
], function (models, application_list_view, $) {
"use strict";
QUnit.module("home.views");
QUnit.test("rendering", function (assert) {
var model = new models.ApplicationListModel();
var view = new views.ApplicationListView(model);
var view = new application_list_view.ApplicationListView(model);
model.update()
.done(function() { view.render(); } )
.done(function() {
var applist = $("#applist");
assert.equal(applist.children().length, 2);
assert.equal($("#applist > div:nth-child(1) > div > h4").text(), "Application 1");
assert.equal($("#applist > div:nth-child(2) > div > h4").text(), "Application 2");
})
.done(function() {
model.app_data[0].image.ui_name = "Hello";
view.update_entry(0);
assert.equal($("#applist > div:nth-child(1) > div > h4").text(), "Hello");
});
});
});
9 changes: 7 additions & 2 deletions jstests/testsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
jquery: '../components/jquery/jquery.min',
bootstrap: '../components/bootstrap/js/bootstrap.min',
moment: "../components/moment/moment",
"jsapi/v1/resources": "../../../jstests/tests/home/mock_jsapi"
"jsapi/v1/resources": "../../../jstests/tests/home/mock_jsapi",
handlebars: "../components/handlebars/handlebars.amd.min",
underscore: "../components/underscore/underscore-min"
},
shim: {
bootstrap: {
Expand All @@ -17,16 +19,19 @@
});

require([
"init",
"tests/home/test_configurables.js",
"tests/home/test_models.js",
"tests/home/test_views.js",
"tests/test_utils.js",
"tests/test_analytics.js"
], function() {
], function(init) {
window.apidata = {
base_url: "/",
prefix: "/"
};
init.handlebars();

QUnit.load();
QUnit.start();
});
Expand Down
5 changes: 2 additions & 3 deletions remoteappmanager/base_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from remoteappmanager.db.interfaces import ABCAccounting
from remoteappmanager.logging.logging_mixin import LoggingMixin
from remoteappmanager.docker.container_manager import ContainerManager
from remoteappmanager.jinja2_adapters import Jinja2LoaderAdapter
from remoteappmanager.webutils import is_link
from remoteappmanager.jinja2_adapters import Jinja2LoaderAdapter, gravatar_id
from remoteappmanager.user import User
from remoteappmanager.traitlets import as_dict
from remoteappmanager.services.hub import Hub
Expand Down Expand Up @@ -194,5 +193,5 @@ def _jinja_init(self, settings):
autoescape=True,
)

jinja_env.tests["link"] = is_link
jinja_env.filters["gravatar_id"] = gravatar_id
settings["template_loader"] = Jinja2LoaderAdapter(jinja_env)
8 changes: 8 additions & 0 deletions remoteappmanager/jinja2_adapters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import hashlib

from tornado.template import Template


Expand Down Expand Up @@ -71,3 +73,9 @@ def __init__(self, template):
def generate(self, **kwargs):
"""Generate this template with the given arguments."""
return self._template.render(**kwargs)


def gravatar_id(value):
"""Computes the gravatar identifier for a given value (normally email)
Used for jinja filter."""
return hashlib.md5(str(value).strip().lower().encode("utf-8")).hexdigest()
146 changes: 140 additions & 6 deletions remoteappmanager/static/css/remoteappmanager.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,150 @@ body {
font-weight: 600;
}

/* Used in the admin page as a central element */
.adminslab {
#applist > li > a > div {
float: left;
}

#applist img.app-icon {
position: relative;
width: 32px;
height: 32px;
border-radius: 50%;
border-color: black;
border-width: 1px;
border-style: solid;
margin-right: 5px;
margin-top: -2px;
background-color: white;
border-radius: 10px;
margin-top: 40px;
padding-bottom: 10px;
box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.5);
}

.createnew {
margin-top: 20px;
margin-bottom: 10px;
}

#application {
width: 100%;
height: 100%;
}

.running-badge {
display: block;
position: absolute;
top: 24px;
left: 8px;
z-index: 100;
width: 4px;
height: 4px;
border: 1px solid darkcyan;
background-color: cyan;
border-radius: 50%;
box-shadow: 0px 0px 8px rgba(0, 255, 255, 1.0)
}

.stopped-badge {
display: block;
position: absolute;
top: 24px;
left: 8px;
z-index: 100;
width: 4px;
height: 4px;
border: 1px solid transparent;
background-color: transparent;
border-radius: 50%;
box-shadow: 0px 0px 8px rgba(0, 0, 0, 1.0);

}

.starting-badge {
display: block;
position: absolute;
top: 24px;
left: 8px;
z-index: 100;
width: 4px;
height: 4px;
border: 1px solid yellow;
background-color: lightyellow;
border-radius: 50%;
box-shadow: 0px 0px 8px rgba(255, 255, 0, 1.0);
animation: starting-pulse 2s infinite;
}

.stopping-badge {
display: block;
position: absolute;
top: 24px;
left: 8px;
z-index: 100;
width: 4px;
height: 4px;
border: 1px solid darkred;
background-color: red;
border-radius: 50%;
box-shadow: 0px 0px 8px rgba(255, 0, 0, 1.0);
animation: stopping-pulse 2s infinite;
}


@keyframes starting-pulse {
0% {
background-color: lightyellow;
box-shadow: 0px 0px 8px rgba(255, 255, 0, 1.0);
border: 1px solid yellow;
}
50% {
background-color: #7F7F00;
box-shadow: 0px 0px 8px rgba(127, 127, 0, 1.0);
border: 1px solid #7F7F00;
}
0% {
background-color: lightyellow;
box-shadow: 0px 0px 8px rgba(255, 255, 0, 1.0);
border: 1px solid yellow;
}
}

@keyframes stopping-pulse {
0% {
background-color: red;
box-shadow: 0px 0px 8px rgba(255, 0, 0, 1.0);
border: 1px solid darkred;
}
50% {
background-color: #7F0000;
box-shadow: 0px 0px 8px rgba(127, 0, 0, 1.0);
border: 1px solid #7F0000;
}
0% {
background-color: red;
box-shadow: 0px 0px 8px rgba(255, 0, 0, 1.0);
border: 1px solid darkred;
}
}

.stop-button {
display: block;
position: absolute;
top: 10px;
left: 15px;
z-index: 100;
width: 32px;
height: 32px;
padding: 0px;
border: 1px solid rgba(0, 0, 0, 0.8);
background-color: rgba(0, 0, 0, 0.7);
border-radius: 50%;
font-size: 18px;
color: rgba(255, 255, 255, 0.7);
}

.truncate {
overflow: hidden;
text-overflow: ellipsis;
}

.no-padding {
padding: 0px;
}
3 changes: 1 addition & 2 deletions remoteappmanager/static/js/admin/accounting/controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
define([
"jquery",
"bootstrap", // needed for modal operations.
"dialogs",
"jsapi/v1/resources"
], function ($, bootstrap, dialogs, resources) {
], function ($, dialogs, resources) {
"use strict";

$('#create-new-policy-dialog').on('show.bs.modal', function () {
Expand Down
3 changes: 1 addition & 2 deletions remoteappmanager/static/js/admin/applications/controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
require([
"jquery",
"bootstrap", // needed for modal operations.
"dialogs",
"jsapi/v1/resources"
], function ($, bootstrap, dialogs, resources) {
], function ($, dialogs, resources) {
"use strict";

$('#create-new-dialog').on('show.bs.modal', function () {
Expand Down
3 changes: 1 addition & 2 deletions remoteappmanager/static/js/admin/containers/controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
require([
"jquery",
"bootstrap", // unused by module, but needed for binding modal dialog
"dialogs",
"jsapi/v1/resources"
], function ($, bootstrap, dialogs, resources) {
], function ($, dialogs, resources) {
"use strict";

$('#action-dialog').on('show.bs.modal', function (event) {
Expand Down
2 changes: 1 addition & 1 deletion remoteappmanager/static/js/admin/tabular/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define([
"jquery",
"datatables.net"
"datatables"
], function ($, dt) { // jshint ignore:line
"use strict";

Expand Down
3 changes: 1 addition & 2 deletions remoteappmanager/static/js/admin/users/controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
define([
"jquery",
"bootstrap", // needed for modal operations.
"dialogs",
"jsapi/v1/resources"
], function ($, bootstrap, dialogs, resources) {
], function ($, dialogs, resources) {
"use strict";

$('#create-new-dialog').on('show.bs.modal', function () {
Expand Down
4 changes: 2 additions & 2 deletions remoteappmanager/static/js/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ define([
// - message: user-readable message from the server via the
// response payload. may be undefined.

var msg = error.message;
var msg = error.status_text;
if (!msg) {
msg = "Unknown error";
}
var dialog = $("#error-dialog");
dialog.find(".error-msg").text(error.code + " - "+msg);
dialog.find(".error-msg").text(error.status + " - "+msg);
dialog.modal();
};

Expand Down
Loading