Compare commits
3 Commits
6a626282cd
...
baa32c62c2
Author | SHA1 | Date |
---|---|---|
King Kévin | baa32c62c2 | |
King Kévin | 0ba7bead13 | |
King Kévin | 7fd3570bc5 |
|
@ -7,10 +7,6 @@ Once the service is installed, there is a single page to search, add, delete, or
|
|||
The only aspect not handled by the web frontend is the attachments.
|
||||
Just add the files directly on the server under `public/attachments/<part_name>/`.
|
||||
|
||||
Distributors also need to be managed directly in the database.
|
||||
Since this does change very often, it isn't too much of a hassle.
|
||||
An example is in `populate.sql`, also with some other entries.
|
||||
|
||||
To import an LCSC part, simply go to the `/import/lcsc/Cxxxx` page and the part will be added to the database.
|
||||
|
||||
goals
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</table>
|
||||
<div class="hscroll" id="attachments"></div>
|
||||
<table>
|
||||
<thead><tr><th>component</th><th>quantity</th></tr></thead>
|
||||
<thead><tr><th>component</th><th>quantity</th><th>description</th></tr></thead>
|
||||
<tbody id="components"></tbody>
|
||||
</table>
|
||||
<button type="button" onclick="delete_part()">delete part (including children)</button>
|
||||
|
|
|
@ -152,6 +152,11 @@ function select_part()
|
|||
td.appendChild(input);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (row.description) {
|
||||
td = document.createElement('td');
|
||||
td.innerText = row.description;
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (row.url) {
|
||||
td = document.createElement('td');
|
||||
td.innerHTML = "<a href='" + row.url + "'>link</a>";
|
||||
|
@ -238,7 +243,7 @@ function update_part()
|
|||
part.components.push({name: nam, quantity: parseInt(q)});
|
||||
}
|
||||
}
|
||||
console.log(part);
|
||||
//console.log(part);
|
||||
|
||||
var post = new XMLHttpRequest();
|
||||
post.open("POST", "part");
|
||||
|
|
|
@ -125,7 +125,7 @@ def get_part_by_id(id)
|
|||
part["attachments"] += parent["attachments"] if parent
|
||||
# add components for assembly
|
||||
part["components"] = []
|
||||
statement = @db.prepare("SELECT part.name AS name, assembly.quantity AS quantity FROM assembly JOIN part ON part.id = assembly.component WHERE assembly.assembled = ?")
|
||||
statement = @db.prepare("SELECT part.name AS name, part.description AS description, assembly.quantity AS quantity FROM assembly JOIN part ON part.id = assembly.component WHERE assembly.assembled = ?")
|
||||
statement.execute(id).each do |row|
|
||||
part["components"] << row
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue