diff --git a/lib/roles/app.js b/lib/roles/app.js index 1bbbb246..43c72684 100644 --- a/lib/roles/app.js +++ b/lib/roles/app.js @@ -39,13 +39,13 @@ module.exports = function(options) { if (options.disableWatch) { app.use(compression()) - app.use('/static/build/entry', + app.use('/static/app/build/entry', serveStatic(pathutil.resource('build/entry'))) app.use('/static/build', serveStatic(pathutil.resource('build'), { maxAge: '10d' })) } else { - app.use('/static/build', webpack({ + app.use('/static/app/build', webpack({ debug: true , devtool: 'eval' , stats: { @@ -64,11 +64,11 @@ module.exports = function(options) { serveStatic(pathutil.resource('bower_components/stf-site/manual/advanced'))) app.use('/v2-features', serveStatic(pathutil.resource('bower_components/stf-site/v2-features'))) - app.use('/static/data', serveStatic(pathutil.resource('data'))) - app.use('/static/status', serveStatic(pathutil.resource('common/status'))) - app.use('/static/browsers', browserIconMiddleware()) - app.use('/static/devices', deviceIconMiddleware()) - app.use('/static', serveStatic(pathutil.resource('app'))) + app.use('/static/app/data', serveStatic(pathutil.resource('data'))) + app.use('/static/app/status', serveStatic(pathutil.resource('common/status'))) + app.use('/static/app/browsers', browserIconMiddleware()) + app.use('/static/app/devices', deviceIconMiddleware()) + app.use('/static/app', serveStatic(pathutil.resource('app'))) app.use(serveFavicon(pathutil.resource( 'bower_components/stf-graphics/logo/exports/STF-128.png'))) @@ -119,14 +119,14 @@ module.exports = function(options) { }) }) - app.get('/api/v1/user', function(req, res) { + app.get('/api/v1/app/user', function(req, res) { res.json({ success: true , user: req.user }) }) - app.get('/api/v1/group', function(req, res) { + app.get('/api/v1/app/group', function(req, res) { dbapi.loadGroup(req.user.email) .then(function(cursor) { return Promise.promisify(cursor.toArray, cursor)() @@ -148,7 +148,7 @@ module.exports = function(options) { }) }) - app.get('/api/v1/devices', function(req, res) { + app.get('/api/v1/app/devices', function(req, res) { dbapi.loadDevices() .then(function(cursor) { return Promise.promisify(cursor.toArray, cursor)() @@ -171,7 +171,7 @@ module.exports = function(options) { }) }) - app.get('/api/v1/devices/:serial', function(req, res) { + app.get('/api/v1/app/devices/:serial', function(req, res) { dbapi.loadDevice(req.params.serial) .then(function(device) { if (device) { diff --git a/lib/roles/auth/ldap.js b/lib/roles/auth/ldap.js index 2acab04d..29509427 100644 --- a/lib/roles/auth/ldap.js +++ b/lib/roles/auth/ldap.js @@ -30,7 +30,7 @@ module.exports = function(options) { }) app.set('view engine', 'jade') - app.set('views', pathutil.resource('auth-ldap/views')) + app.set('views', pathutil.resource('auth/ldap/views')) app.set('strict routing', true) app.set('case sensitive routing', true) @@ -43,7 +43,7 @@ module.exports = function(options) { app.use(validator()) app.use('/static/bower_components', serveStatic(pathutil.resource('bower_components'))) - app.use('/static', serveStatic(pathutil.resource('auth-ldap'))) + app.use('/static/auth/ldap', serveStatic(pathutil.resource('auth/ldap'))) app.use(function(req, res, next) { res.cookie('XSRF-TOKEN', req.csrfToken()); diff --git a/lib/roles/auth/mock.js b/lib/roles/auth/mock.js index bc9974b4..56eade24 100644 --- a/lib/roles/auth/mock.js +++ b/lib/roles/auth/mock.js @@ -29,7 +29,7 @@ module.exports = function(options) { }) app.set('view engine', 'jade') - app.set('views', pathutil.resource('auth-mock/views')) + app.set('views', pathutil.resource('auth/mock/views')) app.set('strict routing', true) app.set('case sensitive routing', true) @@ -42,7 +42,7 @@ module.exports = function(options) { app.use(validator()) app.use('/static/bower_components', serveStatic(pathutil.resource('bower_components'))) - app.use('/static', serveStatic(pathutil.resource('auth-mock'))) + app.use('/static/auth/mock', serveStatic(pathutil.resource('auth/mock'))) app.use(function(req, res, next) { res.cookie('XSRF-TOKEN', req.csrfToken()); diff --git a/res/app/components/stf/device/device-service.js b/res/app/components/stf/device/device-service.js index fa8503eb..7d8816c5 100644 --- a/res/app/components/stf/device/device-service.js +++ b/res/app/components/stf/device/device-service.js @@ -164,7 +164,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi , digest: false }) - oboe('/api/v1/devices') + oboe('/api/v1/app/devices') .node('devices[*]', function (device) { tracker.add(device) }) @@ -180,7 +180,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi , digest: true }) - oboe('/api/v1/group') + oboe('/api/v1/app/group') .node('devices[*]', function (device) { tracker.add(device) }) @@ -189,7 +189,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi } deviceService.load = function(serial) { - return $http.get('/api/v1/devices/' + serial) + return $http.get('/api/app/v1/devices/' + serial) .then(function (response) { return response.data.device }) diff --git a/res/app/control-panes/dashboard/navigation/navigation.jade b/res/app/control-panes/dashboard/navigation/navigation.jade index 06edd0f1..7620fef7 100644 --- a/res/app/control-panes/dashboard/navigation/navigation.jade +++ b/res/app/control-panes/dashboard/navigation/navigation.jade @@ -31,4 +31,4 @@ .btn-group label.btn.btn-default-outline(ng-repeat='b in device.browser.apps', ng-model='$root.browser', btn-radio='b', tooltip='{{b.name}} ({{b.developer}})') - img(ng-src='/static/browsers/icon/24x24/{{b.type}}.png', ng-show='b.type').browser-icon.pointer + img(ng-src='/static/app/browsers/icon/24x24/{{b.type}}.png', ng-show='b.type').browser-icon.pointer diff --git a/res/app/control-panes/device-control/device-control.jade b/res/app/control-panes/device-control/device-control.jade index fb7dab83..5b7e9f98 100644 --- a/res/app/control-panes/device-control/device-control.jade +++ b/res/app/control-panes/device-control/device-control.jade @@ -20,7 +20,7 @@ a.stf-vnc-device-name.pointer.unselectable.dropdown-toggle p .device-small-image - img(ng-src='/static/devices/icon/x24/{{ device.image || "E30HT.jpg" }}') + img(ng-src='/static/app/devices/icon/x24/{{ device.image || "E30HT.jpg" }}') span.device-name-text {{ device.name }} span.caret(ng-show='groupDevices.length > 0') //span(ng-show='device && !device.present', translate) (Absent) @@ -29,7 +29,7 @@ li(ng-repeat='groupDevice in groupDevices') a(ng-click='controlDevice(groupDevice); $event.stopPropagation()') .device-small-image - img(ng-src='/static/devices/icon/x24/{{ groupDevice.image || "E30HT.jpg" }}') + img(ng-src='/static/app/devices/icon/x24/{{ groupDevice.image || "E30HT.jpg" }}') span(ng-class='{"current-device": groupDevice.serial === device.serial }') {{ groupDevice.name }} span.pull-right(ng-click='kickDevice(groupDevice); $event.stopPropagation()').kick-device diff --git a/res/app/control-panes/info/info-controller.js b/res/app/control-panes/info/info-controller.js index cc9eb996..17e16ceb 100644 --- a/res/app/control-panes/info/info-controller.js +++ b/res/app/control-panes/info/info-controller.js @@ -1,7 +1,7 @@ module.exports = function InfoCtrl($scope, LightboxImageService) { $scope.openDevicePhoto = function (device) { var title = device.name - var enhancedPhoto800 = '/static/devices/photo/x800/' + device.image + var enhancedPhoto800 = '/static/app/devices/photo/x800/' + device.image LightboxImageService.open(title, enhancedPhoto800) } } diff --git a/res/app/device-list/device-column-service.js b/res/app/device-list/device-column-service.js index 5edc7295..8e334884 100644 --- a/res/app/device-list/device-column-service.js +++ b/res/app/device-list/device-column-service.js @@ -396,7 +396,8 @@ function DeviceModelCell(options) { , image = span.firstChild , a = span.nextSibling , t = a.firstChild - , src = '/static/devices/icon/x24/' + (device.image || '_default.jpg') + , src = '/static/app/devices/icon/x24/' + + (device.image || '_default.jpg') // Only change if necessary so that we don't trigger a download if (image.getAttribute('src') !== src) { image.setAttribute('src', src) diff --git a/res/app/views/index.jade b/res/app/views/index.jade index c7ea6281..248c2a40 100644 --- a/res/app/views/index.jade +++ b/res/app/views/index.jade @@ -23,6 +23,6 @@ html div(ng-view).fill-height script(src='data:application/javascript;base64,#{new Buffer("var APPSTATE=" + JSON.stringify(APPSTATE)).toString("base64")}') - script(src='/static/build/entry/commons.entry.js') - script(src='/static/build/entry/app.entry.js') + script(src='/static/app/build/entry/commons.entry.js') + script(src='/static/app/build/entry/app.entry.js') script(src='/static/bower_components/stf-analytics/analytics.js') diff --git a/res/auth-ldap/scripts/app.js b/res/auth/ldap/scripts/app.js similarity index 100% rename from res/auth-ldap/scripts/app.js rename to res/auth/ldap/scripts/app.js diff --git a/res/auth-ldap/scripts/bootstrap.js b/res/auth/ldap/scripts/bootstrap.js similarity index 100% rename from res/auth-ldap/scripts/bootstrap.js rename to res/auth/ldap/scripts/bootstrap.js diff --git a/res/auth-ldap/scripts/controllers/SignInCtrl.js b/res/auth/ldap/scripts/controllers/SignInCtrl.js similarity index 100% rename from res/auth-ldap/scripts/controllers/SignInCtrl.js rename to res/auth/ldap/scripts/controllers/SignInCtrl.js diff --git a/res/auth-ldap/scripts/controllers/index.js b/res/auth/ldap/scripts/controllers/index.js similarity index 100% rename from res/auth-ldap/scripts/controllers/index.js rename to res/auth/ldap/scripts/controllers/index.js diff --git a/res/auth-ldap/scripts/controllers/module.js b/res/auth/ldap/scripts/controllers/module.js similarity index 100% rename from res/auth-ldap/scripts/controllers/module.js rename to res/auth/ldap/scripts/controllers/module.js diff --git a/res/auth-ldap/scripts/entry.js b/res/auth/ldap/scripts/entry.js similarity index 100% rename from res/auth-ldap/scripts/entry.js rename to res/auth/ldap/scripts/entry.js diff --git a/res/auth-ldap/scripts/main.js b/res/auth/ldap/scripts/main.js similarity index 59% rename from res/auth-ldap/scripts/main.js rename to res/auth/ldap/scripts/main.js index f7a538f2..de7d5472 100644 --- a/res/auth-ldap/scripts/main.js +++ b/res/auth/ldap/scripts/main.js @@ -1,7 +1,7 @@ require.config({ paths: { - 'angular': '../bower_components/angular/angular' - , 'angular-route': '../bower_components/angular-route/angular-route' + 'angular': '../../../bower_components/angular/angular' + , 'angular-route': '../../../bower_components/angular-route/angular-route' } , shim: { 'angular': { diff --git a/res/auth-ldap/scripts/routes.js b/res/auth/ldap/scripts/routes.js similarity index 100% rename from res/auth-ldap/scripts/routes.js rename to res/auth/ldap/scripts/routes.js diff --git a/res/auth-ldap/styles/login.css b/res/auth/ldap/styles/login.css similarity index 100% rename from res/auth-ldap/styles/login.css rename to res/auth/ldap/styles/login.css diff --git a/res/auth-mock/views/index.jade b/res/auth/ldap/views/index.jade similarity index 89% rename from res/auth-mock/views/index.jade rename to res/auth/ldap/views/index.jade index a3f65fcb..bfc2f2b5 100644 --- a/res/auth-mock/views/index.jade +++ b/res/auth/ldap/views/index.jade @@ -7,5 +7,5 @@ html include partials/styles body(ng-cloak) div(ng-view) - script(src='/static/bower_components/requirejs/require.js', data-main='static/scripts/main.js') + script(src='/static/bower_components/requirejs/require.js', data-main='static/auth/ldap/scripts/main.js') script(src='/static/bower_components/stf-analytics/analytics.js') diff --git a/res/auth-ldap/views/partials/signin.jade b/res/auth/ldap/views/partials/signin.jade similarity index 100% rename from res/auth-ldap/views/partials/signin.jade rename to res/auth/ldap/views/partials/signin.jade diff --git a/res/auth-mock/views/partials/styles.jade b/res/auth/ldap/views/partials/styles.jade similarity index 89% rename from res/auth-mock/views/partials/styles.jade rename to res/auth/ldap/views/partials/styles.jade index c4e23d82..7eddb29b 100644 --- a/res/auth-mock/views/partials/styles.jade +++ b/res/auth/ldap/views/partials/styles.jade @@ -3,4 +3,4 @@ link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/st link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/se7en-font.css') link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/style.css') link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/font-awesome.min.css') -link(rel='stylesheet', href='/static/styles/login.css') +link(rel='stylesheet', href='/static/auth/ldap/styles/login.css') diff --git a/res/auth-mock/scripts/app.js b/res/auth/mock/scripts/app.js similarity index 100% rename from res/auth-mock/scripts/app.js rename to res/auth/mock/scripts/app.js diff --git a/res/auth-mock/scripts/bootstrap.js b/res/auth/mock/scripts/bootstrap.js similarity index 100% rename from res/auth-mock/scripts/bootstrap.js rename to res/auth/mock/scripts/bootstrap.js diff --git a/res/auth-mock/scripts/controllers/SignInCtrl.js b/res/auth/mock/scripts/controllers/SignInCtrl.js similarity index 100% rename from res/auth-mock/scripts/controllers/SignInCtrl.js rename to res/auth/mock/scripts/controllers/SignInCtrl.js diff --git a/res/auth-mock/scripts/controllers/index.js b/res/auth/mock/scripts/controllers/index.js similarity index 100% rename from res/auth-mock/scripts/controllers/index.js rename to res/auth/mock/scripts/controllers/index.js diff --git a/res/auth-mock/scripts/controllers/module.js b/res/auth/mock/scripts/controllers/module.js similarity index 100% rename from res/auth-mock/scripts/controllers/module.js rename to res/auth/mock/scripts/controllers/module.js diff --git a/res/auth-mock/scripts/entry.js b/res/auth/mock/scripts/entry.js similarity index 100% rename from res/auth-mock/scripts/entry.js rename to res/auth/mock/scripts/entry.js diff --git a/res/auth-mock/scripts/main.js b/res/auth/mock/scripts/main.js similarity index 59% rename from res/auth-mock/scripts/main.js rename to res/auth/mock/scripts/main.js index f7a538f2..de7d5472 100644 --- a/res/auth-mock/scripts/main.js +++ b/res/auth/mock/scripts/main.js @@ -1,7 +1,7 @@ require.config({ paths: { - 'angular': '../bower_components/angular/angular' - , 'angular-route': '../bower_components/angular-route/angular-route' + 'angular': '../../../bower_components/angular/angular' + , 'angular-route': '../../../bower_components/angular-route/angular-route' } , shim: { 'angular': { diff --git a/res/auth-mock/scripts/routes.js b/res/auth/mock/scripts/routes.js similarity index 100% rename from res/auth-mock/scripts/routes.js rename to res/auth/mock/scripts/routes.js diff --git a/res/auth-mock/styles/login.css b/res/auth/mock/styles/login.css similarity index 100% rename from res/auth-mock/styles/login.css rename to res/auth/mock/styles/login.css diff --git a/res/auth-ldap/views/index.jade b/res/auth/mock/views/index.jade similarity index 89% rename from res/auth-ldap/views/index.jade rename to res/auth/mock/views/index.jade index a3f65fcb..6b6d8a0c 100644 --- a/res/auth-ldap/views/index.jade +++ b/res/auth/mock/views/index.jade @@ -7,5 +7,5 @@ html include partials/styles body(ng-cloak) div(ng-view) - script(src='/static/bower_components/requirejs/require.js', data-main='static/scripts/main.js') + script(src='/static/bower_components/requirejs/require.js', data-main='static/auth/mock/scripts/main.js') script(src='/static/bower_components/stf-analytics/analytics.js') diff --git a/res/auth-mock/views/partials/signin.jade b/res/auth/mock/views/partials/signin.jade similarity index 100% rename from res/auth-mock/views/partials/signin.jade rename to res/auth/mock/views/partials/signin.jade diff --git a/res/auth-ldap/views/partials/styles.jade b/res/auth/mock/views/partials/styles.jade similarity index 89% rename from res/auth-ldap/views/partials/styles.jade rename to res/auth/mock/views/partials/styles.jade index c4e23d82..38a52433 100644 --- a/res/auth-ldap/views/partials/styles.jade +++ b/res/auth/mock/views/partials/styles.jade @@ -3,4 +3,4 @@ link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/st link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/se7en-font.css') link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/style.css') link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/font-awesome.min.css') -link(rel='stylesheet', href='/static/styles/login.css') +link(rel='stylesheet', href='/static/auth/mock/styles/login.css') diff --git a/webpack.config.js b/webpack.config.js index b6e869a6..ec12a635 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,12 +6,12 @@ module.exports = { cache: true , entry: { app: pathutil.resource('app/app.js') - , authldap: pathutil.resource('auth-ldap/scripts/entry.js') - , authmock: pathutil.resource('auth-mock/scripts/entry.js') + , authldap: pathutil.resource('auth/ldap/scripts/entry.js') + , authmock: pathutil.resource('auth/mock/scripts/entry.js') } , output: { path: pathutil.resource('build') - , publicPath: '/static/build/' + , publicPath: '/static/app/build/' , filename: 'entry/[name].entry.js' , chunkFilename: '[id].[hash].chunk.js' }