Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.debug("Defining NOC.sa.INTERNET.Application");
- Ext.define("NOC.sa.INTERNET.Application", {
- extend: "NOC.core.Application",
- requires: ["NOC.sa.managedobject.LookupField", "Ext.ux.form.UCField"],
- layout: { type: 'vbox', align: 'stretch' },
- border: 0,
- items : [{
- xtype: "container",
- items: [{
- xtype: 'form',
- border: 0,
- url: "/sa/INTERNET/",
- padding: 0,
- bodyPadding: 0,
- waitMsgTarget : true,
- defaults: {
- enableKeyEvents: true,
- listeners: {
- specialkey: function(field, key) {
- if (field.xtype != "textfield")
- return;
- var get_button = function(scope, name) {
- return scope.ownerCt.down("toolbar").getComponent(name);
- }
- switch(key.getKey()) {
- case Ext.EventObject.ENTER:
- var b = get_button(field, "prepare");
- key.stopEvent();
- b.handler.call(b);
- break;
- }
- }
- },
- xtype: "textfield",
- msgTarget : "side",
- size: 30
- },
- items: [
- {
- xtype: 'textfield',
- width: 400,
- margin: '10 0 4 20',
- fieldLabel: 'Customer',
- name: 'customer',
- emptyText: "Client name or any other info",
- regex: /^[ 0-9a-zA-Z_\-]*$/,
- invalidText: "Customer name must contains only 0-9,a-z,A-Z,'-','_'"
- },
- {
- xtype: 'textfield',
- name: 'project',
- width: 400,
- margin: '0 0 4 20',
- emptyText: "Project number, ex. 123456",
- regex: /^[0-9]*$/,
- fieldLabel: 'Project'
- },
- {
- xtype: 'fieldset',
- title: 'Billing',
- margin: '0 0 4 10',
- width: 450,
- items: [
- {
- xtype: 'textfield',
- name: 'bid',
- width: 400,
- margin: '0 0 4 0',
- regex: /^[0-9]*$/,
- emptyText: "Billing/Channel ID nubmer, ex. 123456",
- fieldLabel: 'Billing ID'
- },
- {
- xtype: 'textfield',
- name: 'login',
- width: 400,
- margin: '0 0 8 0',
- emptyText: "Login",
- regex: /^[0-9a-zA-Z]*$/,
- fieldLabel: 'Login'
- }
- ]
- },
- {
- xtype: 'textfield',
- name: 'speed',
- width: 400,
- margin: '0 0 4 20',
- fieldLabel: 'Speed'
- },
- {
- xtype: 'sa.managedobject.LookupField',
- name: 'managedobject',
- allowBlank: 1,
- margin: '0 0 4 20',
- fieldLabel: 'Managed object'
- },
- {
- xtype: 'button',
- text: 'GO',
- itemId: 'prepare',
- margin: '10 3 0 20',
- handler : function() {
- var form = this.up("form").getForm();
- form.submit({
- method: "POST",
- submitEmptyText : false,
- params : { __format: "ext" },
- waitMsg: "Wait",
- success: function(form, action) {
- form.owner.up("panel").down("textarea").setValue(action.result.config);
- }
- });
- }
- }]},
- {
- xtype: "textarea",
- name: 'config',
- margin: '10 0 4 20',
- fieldStyle: {"padding-left": "7px"},
- flex: 1
- }
- ]
- }]
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement