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

One 5.2 #179

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions src/sunstone/public/app/tabs/settings-tab/panels/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2016, OpenNebula Project, OpenNebula Systems */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */

define(function(require) {
/*
DEPENDENCIES
*/

var BasePanel = require('tabs/users-tab/panels/auth-common');

/*
CONSTANTS
*/

var TAB_ID = require('../tabId');
var PANEL_ID = require('./auth/panelId');

/*
CONSTRUCTOR
*/

function Panel(info) {
this.tabId = TAB_ID;
info.tabId = this.tabId;
return BasePanel.call(this, info);
};

Panel.PANEL_ID = PANEL_ID;
Panel.prototype = Object.create(BasePanel.prototype);
Panel.prototype.constructor = Panel;

return Panel;
});
91 changes: 91 additions & 0 deletions src/sunstone/public/app/tabs/settings-tab/panels/auth/html.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems }}
{{! }}
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
{{! not use this file except in compliance with the License. You may obtain }}
{{! a copy of the License at }}
{{! }}
{{! http://www.apache.org/licenses/LICENSE-2.0 }}
{{! }}
{{! Unless required by applicable law or agreed to in writing, software }}
{{! distributed under the License is distributed on an "AS IS" BASIS, }}
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
{{! See the License for the specific language governing permissions and }}
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}

<div class="row">
<div class="large-12 columns">
<div class="row">
<div class="large-12 columns">
<table class="dataTable">
<thead>
<tr>
<th colspan="2">{{tr "Authentication"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="key_td">{{tr "Authentication driver"}}</td>
<td class="value_td" id="change_auth_driver" colspan="2" hidden = "true">{{{userCreationHTML}}}</td>
<td class="value_td" colspan="2" id="show_auth_driver">{{element.AUTH_DRIVER}}</td>
<td><a id="div_edit_auth_driver_link" class="edit_e" href="#"> <i class="fa fa-pencil-square-o right"/></a></td>
</tr>
<tr class="passsword_edit">
<td class="key_td">{{tr "Password"}}</td>
<td class="value_td" colspan="2" id ="show_btn_password">
<button id="view_password" type="button" class="button small radius secondary" style="min-width:80%">
{{tr "View"}}
</button>
</td>
<td>
{{#isTabActionEnabled tabId "Settings.change_password"}}
<a id="update_password" class="edit_e" href="#"> <i class="fa fa-pencil-square-o right"/></a>
{{/isTabActionEnabled}}
</td>
</tr>
{{#isTabActionEnabled tabId "Settings.login_token"}}
<tr class="login_token">
<td class="key_td">{{tr "Login token"}}</td>
<td class="value_td" colspan="2">
<button id="login_token" type="button" class="button small radius secondary" style="min-width:80%">
{{tr "Manage login tokens"}}
</button>
</td>
<td/>
</tr>
{{/isTabActionEnabled}}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<table class="dataTable" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th>{{tr "Public SSH Key"}}</th>
{{#isTabActionEnabled tabId "Settings.ssh_key"}}
<th>
<a class="user_ssh_public_key_edit right" href="#"><i class="fa fa-pencil-square-o"></i></a>
</th>
{{/isTabActionEnabled}}
</tr>
</thead>
</table>
<td>
<textarea rows="6" type="text" id="user_ssh_public_key_textarea" name="ssh_public_key" hidden>
{{~element.TEMPLATE.SSH_PUBLIC_KEY~}}
</textarea>
<p id="user_ssh_public_key_text" class="ellipsis" name="ssh_public_key">
{{#if element.TEMPLATE.SSH_PUBLIC_KEY}}
{{element.TEMPLATE.SSH_PUBLIC_KEY}}
{{else}}
{{tr "You can provide a SSH Key for this User clicking on the edit button"}}
{{/if}}
</p>
</td>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/sunstone/public/app/tabs/settings-tab/panels/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define(function(require) {

function Panel(info) {
this.tabId = TAB_ID;

info.tabId = this.tabId;
return BasePanel.call(this, info);
};

Expand Down
75 changes: 75 additions & 0 deletions src/sunstone/public/app/tabs/settings-tab/panels/info/html.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems }}
{{! }}
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }}
{{! not use this file except in compliance with the License. You may obtain }}
{{! a copy of the License at }}
{{! }}
{{! http://www.apache.org/licenses/LICENSE-2.0 }}
{{! }}
{{! Unless required by applicable law or agreed to in writing, software }}
{{! distributed under the License is distributed on an "AS IS" BASIS, }}
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }}
{{! See the License for the specific language governing permissions and }}
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}

<div class="row">
<div class="large-12 columns">
<table class="dataTable" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th colspan="3">{{tr "Information"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="key_td">{{tr "ID"}}</td>
<td class="value_td">{{element.ID}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Name"}}</td>
<td class="value_td">{{element.NAME}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Table Order"}}</td>
<td class="value_td_table_order">{{valOrDefault sunstone_template.TABLE_ORDER "-"}}</td>
<td>
<div id="div_edit_table_order">
<a id="div_edit_table_order_link" class="edit_e" href="#"> <i class="fa fa-pencil-square-o right"/></a>
</div>
</td>
</tr>
<tr>
<td class="key_td">{{tr "Language"}}</td>
<td class="value_td_language">{{valOrDefault sunstone_template.LANG "-"}}</td>
<td>
{{#isTabActionEnabled tabId "Settings.change_language"}}
<div id="div_edit_language">
<a id="div_edit_language_link" class="edit_e" href="#"> <i class="fa fa-pencil-square-o right"/></a>
</div>
{{/isTabActionEnabled}}
</td>
</tr>
<tr>
<td class="key_td">{{tr "View"}}</td>
<td class="value_td_view">{{valOrDefault sunstone_template.DEFAULT_VIEW "-"}}</td>
<td>
{{#isTabActionEnabled tabId "Settings.change_view"}}
<div id="div_edit_view">
<a id="div_edit_view_link" class="edit_e" href="#"> <i class="fa fa-pencil-square-o right"/></a>
</div>
{{/isTabActionEnabled}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="large-9 columns">
{{{templateTableHTML}}}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ define(function(require) {
$("#provision_add_ssh_key_form").submit(function() {
var keypair = $('#provision_ssh_key', this).val();

if (!keypair.length) {
Notifier.notifyError(Locale.tr("You have to provide an SSH key"));
return false;
}

var template_str = 'SSH_PUBLIC_KEY = "'+TemplateUtils.escapeDoubleQuotes(keypair)+'"';

Sunstone.runAction("User.append_template", "-1", template_str);
Expand Down
Loading