guanglindu / ipams Goto Github PK
View Code? Open in Web Editor NEWIPv4 Address Management System
License: MIT License
IPv4 Address Management System
License: MIT License
In-place editing based on Bootstrap X-Editable is enabled across all the views. Some views are across multiple tables, it's necessary to update a single row with AJAX after some specific in-place editing is done.
The model uniqueness validation fails with Chinese characters. But it succeeds using ASCII. Highly possible that this is caused by the char encoding. One case is the name attribute of model User.
When running the functional and integration tests against search_controller.rb with some actual searching strings , this error occurs: "LoadError: Unable to autoload constant PaginatedCollectionPolicy, expected .../ipams/app/policies/paginated_collection_policy.rb to define it". However, this policy file was already created long before. The buggy testing code was commented out for the time being and labelled with FIXME.
Solution 1 (The best and most responsive)
Solution 2 (Slow when there're many rows to fold/unfold)
Implemented the prefix-matching search according to . When maxGramSize was 10, nothing would be found to search for IP address 192.168.1.1 or the alike in the Addresses view:
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="10" side="front"/>
After setting it 15, the problem was solved.
This bug was found on Sep. 7, 2017. Before a user is removed, his associated IP addresses, if any, should be automatically recycled instead of being eliminated from the DB.
The memory usage keeps going up after every refresh of the pages. It can reach as high as 15G Bytes and then my PC will respond very slowly. Have to kill it and restart the app. Do not know why at present.
To enable pagination after search, I implement like this in action index (see Will_Paginate with Sunspot โ Ruby on Rails):
def index
keywords = params[:search]
keywords = keywords.strip if keywords
# No keywords, no search
@posts = nil
if keywords && keywords != ""
search = Post.search do
fulltext keywords
# See http://www.whatibroke.com/?p=235
paginate :page => params[:page] || 1, :per_page => 30
end
# Type Sunspot::Search::PaginatedCollection < Array
@posts = search.results
else
# paginate returns object os type User::ActiveRecord_Relation
@posts = Post.paginate(page: params[:page], per_page: 100)
end
authorize @posts
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.