diff --git a/src/sunstone/public/.eslintrc.json b/src/sunstone/public/.eslintrc.json new file mode 100644 index 0000000000..2a25e88313 --- /dev/null +++ b/src/sunstone/public/.eslintrc.json @@ -0,0 +1,27 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ], + "eqeqeq": 2, + "no-trailing-spaces": [ + "error" + ] + } +} \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/oneflow-templates-tab/actions.js b/src/sunstone/public/app/tabs/oneflow-templates-tab/actions.js index d4df7fe2ec..38d9e04df9 100644 --- a/src/sunstone/public/app/tabs/oneflow-templates-tab/actions.js +++ b/src/sunstone/public/app/tabs/oneflow-templates-tab/actions.js @@ -15,18 +15,18 @@ /* -------------------------------------------------------------------------- */ define(function(require) { - var Sunstone = require('sunstone'); - var Notifier = require('utils/notifier'); - var Locale = require('utils/locale'); - var OpenNebulaResource = require('opennebula/servicetemplate'); - var CommonActions = require('utils/common-actions'); - var OpenNebulaAction = require('opennebula/action'); - var Navigation = require('utils/navigation'); + var Sunstone = require("sunstone"); + var Notifier = require("utils/notifier"); + var Locale = require("utils/locale"); + var OpenNebulaResource = require("opennebula/servicetemplate"); + var CommonActions = require("utils/common-actions"); + var OpenNebulaAction = require("opennebula/action"); + var Navigation = require("utils/navigation"); - var TAB_ID = require('./tabId'); - var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId'); - var INSTANTIATE_DIALOG_ID = require('./form-panels/instantiate/formPanelId'); - var CLONE_DIALOG_ID = require('./dialogs/clone/dialogId'); + var TAB_ID = require("./tabId"); + var CREATE_DIALOG_ID = require("./form-panels/create/formPanelId"); + var INSTANTIATE_DIALOG_ID = require("./form-panels/instantiate/formPanelId"); + var CLONE_DIALOG_ID = require("./dialogs/clone/dialogId"); var XML_ROOT = "DOCUMENT"; var RESOURCE = "ServiceTemplate"; @@ -39,10 +39,10 @@ define(function(require) { "ServiceTemplate.show" : _commonActions.show(), "ServiceTemplate.refresh" : _commonActions.refresh(), "ServiceTemplate.delete" : _commonActions.del(), - "ServiceTemplate.chown": _commonActions.multipleAction('chown'), - "ServiceTemplate.chgrp": _commonActions.multipleAction('chgrp'), - "ServiceTemplate.chmod": _commonActions.singleAction('chmod'), - "ServiceTemplate.rename": _commonActions.singleAction('rename'), + "ServiceTemplate.chown": _commonActions.multipleAction("chown"), + "ServiceTemplate.chgrp": _commonActions.multipleAction("chgrp"), + "ServiceTemplate.chmod": _commonActions.singleAction("chmod"), + "ServiceTemplate.rename": _commonActions.singleAction("rename"), "ServiceTemplate.update" : _commonActions.update(), "ServiceTemplate.update_dialog" : _commonActions.checkAndShowUpdate(), "ServiceTemplate.show_to_update" : _commonActions.showUpdate(CREATE_DIALOG_ID), @@ -85,7 +85,7 @@ define(function(require) { type: "custom", call: function() { var selected_nodes = Sunstone.getDataTable(TAB_ID).elements(); - if (selected_nodes.length != 1) { + if (selected_nodes.length !== 1) { Notifier.notifyMessage("Please select one (and just one) template to instantiate."); return false; } @@ -106,7 +106,7 @@ define(function(require) { Sunstone.getDialog(CLONE_DIALOG_ID).show(); } }, - + "ServiceTemplate.clone" : { type: "single", call: OpenNebulaResource.clone, diff --git a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js index a528e04cb5..dd1ac8197b 100644 --- a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js +++ b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js @@ -19,31 +19,31 @@ define(function(require) { DEPENDENCIES */ -// require('foundation.tab'); - var BaseFormPanel = require('utils/form-panels/form-panel'); - var Sunstone = require('sunstone'); - var Locale = require('utils/locale'); - var Tips = require('utils/tips'); - var OpenNebulaServiceTemplate = require('opennebula/servicetemplate'); - var OpenNebulaTemplate = require('opennebula/template'); - var Notifier = require('utils/notifier'); - var WizardFields = require('utils/wizard-fields'); - var UserInputs = require('utils/user-inputs'); - var Config = require('sunstone-config'); - var TemplateUtils = require('utils/template-utils'); +// require("foundation.tab"); + var BaseFormPanel = require("utils/form-panels/form-panel"); + var Sunstone = require("sunstone"); + var Locale = require("utils/locale"); + var Tips = require("utils/tips"); + var OpenNebulaServiceTemplate = require("opennebula/servicetemplate"); + var OpenNebulaTemplate = require("opennebula/template"); + var Notifier = require("utils/notifier"); + var WizardFields = require("utils/wizard-fields"); + var UserInputs = require("utils/user-inputs"); + var Config = require("sunstone-config"); + var TemplateUtils = require("utils/template-utils"); /* TEMPLATES */ - var TemplateHTML = require('hbs!./instantiate/html'); + var TemplateHTML = require("hbs!./instantiate/html"); /* CONSTANTS */ - var FORM_PANEL_ID = require('./instantiate/formPanelId'); - var TAB_ID = require('../tabId'); + var FORM_PANEL_ID = require("./instantiate/formPanelId"); + var TAB_ID = require("../tabId"); /* CONSTRUCTOR @@ -53,10 +53,10 @@ define(function(require) { this.formPanelId = FORM_PANEL_ID; this.tabId = TAB_ID; this.actions = { - 'instantiate': { - 'title': Locale.tr("Instantiate Service Template"), - 'buttonText': Locale.tr("Instantiate"), - 'resetButton': false + "instantiate": { + "title": Locale.tr("Instantiate Service Template"), + "buttonText": Locale.tr("Instantiate"), + "resetButton": false } }; @@ -80,7 +80,7 @@ define(function(require) { function _html() { return TemplateHTML({ - 'formPanelId': this.formPanelId + "formPanelId": this.formPanelId }); } @@ -127,8 +127,8 @@ define(function(require) { var div_id = "user_input_role_"+index; $("#instantiate_service_role_user_inputs", context).append( - '