Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e83c88b8
Commit
e83c88b8
authored
Mar 09, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add extra javascript file for user interface functions
parent
20369b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
opnsense_ui.js
src/opnsense/www/js/opnsense_ui.js
+37
-0
No files found.
src/opnsense/www/js/opnsense_ui.js
0 → 100644
View file @
e83c88b8
/**
* User interface shared components, requires opnsense.js for supporting functions.
*/
/**
* save form to server
* @param url endpoint url
* @param formid parent id to grep input data from
*/
function
saveFormToEndpoint
(
url
,
formid
)
{
data
=
getFormData
(
formid
);
ajaxCall
(
url
=
url
,
sendData
=
data
,
callback
=
function
(
data
,
status
){
if
(
status
==
"
success
"
)
{
// if there are validation issues, update our screen and show a dialog.
if
(
data
[
'
validations
'
]
!=
undefined
)
{
// update field validation
handleFormValidation
(
formid
,
data
[
'
validations
'
]);
BootstrapDialog
.
show
({
type
:
BootstrapDialog
.
TYPE_WARNING
,
title
:
'
Input validation
'
,
message
:
'
Please correct validation errors in form
'
});
}
}
else
{
// error handling, show internal errors
// Normally the form should only return validation issues, if other things go wrong throw an error.
BootstrapDialog
.
show
({
type
:
BootstrapDialog
.
TYPE_ERROR
,
title
:
'
save
'
,
message
:
'
Unable to save data, an internal error occurred.<br>
'
+
'
Response from server was: <br> <small>
'
+
JSON
.
stringify
(
data
)
+
'
</small>
'
});
}
});
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment