📄 editdbtemplate.tmpl
字号:
<td>#for $line in $entry $line <br />#end for </td>#end if#end for <td> </td> ## last column is end gfx (fix) </tr>#end for </table> $actionBar($list)#if $list.isBulkList#for $name,$value in $list.hiddenData <input type="hidden" name="$name" value="$value" />#end for#end if </form>#end def## This function displays the bar with add/edit/delete buttons#def actionBar($list) <p> <table> <tr>#if not ($list.isDeleteList or $list.isBulkList) <td><input type="submit" name="$list.cnameAdd" value="$list.textAdd" /></td> <td><input type="submit" name="$list.cnameEdit" value="$list.textEdit" /></td> <td><input type="submit" name="$list.cnameDelete" value="$list.textDelete" /></td>#elif $list.isDeleteList <td><input type="submit" name="$list.cnameDeleteConfirm" value="$list.textDeleteConfirm" /></td>#elif $list.isBulkList <td><input type="submit" name="$list.cnameBulkConfirm" value="$list.textBulkConfirm" /></td>#end if </tr> </table> </p>#end def## Function for displaying a form for adding or editing#def showForm($form) <h3>$form.title</h3>#if $form.status <p class="status">#for $message in $form.status.messages $message<br />#end for </p> <p class="error">#for $error in $form.status.errors $error<br />#end for </p>#end if <form method="$form.method" action="$form.action" enctype="$form.enctype">#for $editbox in $form.editboxes <input type="hidden" name="$editbox.boxName" value="$editbox.boxId" /> <p>#if $editbox.page == 'room' $room($editbox)#elif $editbox.page == 'container' $container($editbox)#elif $editbox.page == 'location' $location($editbox)#elif $editbox.page == 'org' $org($editbox)#elif $editbox.page == 'type' $typebox($editbox)#elif $editbox.page == 'vendor' $vendor($editbox)#elif $editbox.page == 'netbox' $netbox($editbox)#elif $editbox.page == 'netboxserial' $netboxserial($editbox)#elif $editbox.page == 'netboxcategory' $netboxcategory($editbox)#elif $editbox.page == 'netboxproduct' $netboxproduct($editbox)#elif $editbox.page == 'bulk' $bulk($editbox)#elif $editbox.page == 'usage' $usage($editbox)#elif $editbox.page == 'service' $service($editbox)#elif $editbox.page == 'product' $product($editbox)#elif $editbox.page == 'prefix' $prefix($editbox)#elif $editbox.page == 'ric' $ric($editbox)#elif $editbox.page == 'vlan' $vlan($editbox)#elif $editbox.page == 'subcat' $subcat($editbox)#elif $editbox.page == 'snmpoid' $snmpoid($editbox)#elif $editbox.page == 'hiddenormessage' $hiddenormessage($editbox)#elif $editbox.page == 'cabling' $cabling($editbox)#elif $editbox.page == 'patch' $patch($editbox)#end if </p>#end for#if $form.showConfirm <table> <tr> <td><input type="submit" name="$form.cnameConfirm" value="$form.textConfirm" /></td>#if $form.showCancel <td><input type="submit" name="$form.cnameCancel" value="$form.textCancel" /></td>#end if #if $form.showDelete and $editbox.page == 'netbox' and $form.action != 'add' <td><input type="submit" name="$form.cnameDelete" value="$form.textDelete" /></td>#end if </tr> </table> </form>#end if#end def#### Forms for adding and editing#### For for editing patches#def patch($editbox)#set $fields = $editbox.fields <p> $editbox.help </p> <div style="border: 1px solid #666; background-image:url('/images/form/fill-active.gif'); background-color:#ccf; font-size: 13px; padding-top: 1em; padding-bottom: 1em; padding-left: 1em;"> <p> $input($fields['box1']) </p> <p> <h3>$heading($fields['split'])</h3> $input($fields['split']) </p> <p> $input($fields['box2']) </p> </div>#end def## Form for editing cabling#def cabling($editbox)#set $fields = $editbox.fields <p> <table class="header-active"> <tr> <th colspan="2">$heading($fields['roomid'])</th> <th>$heading($fields['jack'])</th> </tr> <tr> <td colspan="2">$input($fields['roomid'])</td> <td>$input($fields['jack'])</td> </tr> <tr> <th>$heading($fields['building'])</th> <th>$heading($fields['targetroom'])</th> <th>$heading($fields['category'])</th> </tr> <tr> <td>$input($fields['building'],'width: 100%;')</td> <td align="center">$input($fields['targetroom'])</td> <td>$input($fields['category'])</td> </tr> <tr> <th colspan="3">$heading($fields['descr'])</th> </tr> <tr> <td colspan="3">$input($fields['descr'],'width: 100%;')</td> </tr> </table> </p>#end def## Form for entering a serialnumber#def netboxserial($editbox)#set $fields = $editbox.fields <p> <table class="header-active"> <tr> <td>Sysname</td> <td>$editbox.sysname</td> </tr> <tr> <td>Type</td> <td>$editbox.typename</td> </tr> <tr> <td>SNMP version</td> <td>$editbox.snmpversion</td> </tr> </table> </p> <p>$editbox.help</p> <p> <table class="header-active"> <tr> <th>$heading($fields['serial'])</th> </tr> <tr> <td>$input($fields['serial'])</td> </tr> </table> </p><!-- def netboxserial -->$hiddenfields($editbox.hiddenFields)#end def## Form for server subcat and function#def netboxcategory($editbox)#set $fields = $editbox.fields <p>$editbox.help</p> <p> <table class="header-active">#if $fields.has_key('subcat') <tr> <th>$heading($fields['subcat'])</th> </tr> <tr> <td>$input($fields['subcat'],'width: 100%;')</td> </tr>#end if <tr> <th>$heading($fields['function'])</th> </tr> <tr> <td>$input($fields['function'])</td> </tr> </table> </p>#end def## Form for adding or editing a netbox#def netbox($editbox)#set $fields = $editbox.fields#if $editbox.editId <h3>$editbox.sysname</h3>#end if <table class="header-active"> <tr> <th>$heading($fields['ip'])</th> <th>$heading($fields['catid'])</th> </tr> <tr> <td>$input($fields['ip'])</td> <td>$input($fields['catid'],style='width: 100%;')</td> </tr> <tr> <th>$heading($fields['ro'])</th> <th>$heading($fields['roomid'])</th> </tr> <tr> <td>$input($fields['ro'])</td> <td>$input($fields['roomid'],style='width: 100%;')</td> </tr> <tr> <th>$heading($fields['rw'])</th> <th>$heading($fields['orgid'])</th> </tr> <tr> <td>$input($fields['rw'])</td> <td>$input($fields['orgid'])</td> </tr> </table><!-- def netbox -->$hiddenfields($editbox.hiddenFields)#end def## Form for adding or editing an snmpoid#def snmpoid($editbox)#set $fields = $editbox.fields <table class="header-active"> <tr> <th>$heading($fields['oidkey'])</th> <th>$heading($fields['snmpoid'])</th> <th>$heading($fields['oidsource'])</th> <th>$heading($fields['match_regex'])</th> </tr> <tr> <td>$input($fields['oidkey'])</td> <td>$input($fields['snmpoid'])</td> <td>$input($fields['oidsource'])</td> <td>$input($fields['match_regex'])</td> </tr> <tr> <th colspan="2">$heading($fields['oidname'])</th> <th colspan="2">$heading($fields['mib'])</th> </tr> <tr> <td colspan="2">$input($fields['oidname'],'width: 100%;')</td> <td colspan="2">$input($fields['mib'],'width: 100%;')</td> </tr> <tr> <th colspan="4">$heading($fields['descr'])</th> </tr> <tr> <td colspan="4">$input($fields['descr'],'width: 100%;')</td> </tr> </table>$hiddenfields($editbox.hiddenFields)#end def## Form for adding or editing a room#def room($editbox)#set $fields = $editbox.fields <table class="header-active"> <tr> <th>$heading($fields['roomid'])</th> <th>$heading($fields['locationid'])</th> <th colspan="2">$heading($fields['descr'])</th> </tr> <tr> <td>$input($fields['roomid'])</td> <td>$input($fields['locationid'])</td> <td colspan="2">$input($fields['descr'],'width: 100%;')</td> </tr> <tr> <th>$heading($fields['opt1'])</th> <th>$heading($fields['opt2'])</th> <th>$heading($fields['opt3'])</th> <th>$heading($fields['opt4'])</th> </tr> <tr> <td>$input($fields['opt1'])</td> <td>$input($fields['opt2'],'width: 100%;')</td> <td>$input($fields['opt3'])</td> <td>$input($fields['opt4'])</td> </tr> </table>$hiddenfields($editbox.hiddenFields)#end def## Form for adding or editing a location#def location($editbox)#set $fields = $editbox.fields <table class="header-active" width="50%"> <tr> <th width="30%">$heading($fields['locationid'])</th> <th width="70%">$heading($fields['descr'])</th> </tr> <tr> <td>$input($fields['locationid'],'width: 100%;')</td> <td>$input($fields['descr'],'width: 100%;')</td> </tr> </table>$hiddenfields($editbox.hiddenFields)#end def## Form for adding or editing an org#def org($editbox)#set $fields = $editbox.fields <table class="header-active"> <tr> <th>$heading($fields['orgid'])</th> <th colspan="2">$heading($fields['parent'])</th> </tr> <tr> <td>$input($fields['orgid'])</td> <td colspan="2">$input($fields['parent'])</td> </tr> <tr> <th colspan="3">$heading($fields['descr'])</th> </tr> <tr> <td colspan="3">$input($fields['descr'],'width: 100%;')</td> </tr> <tr> <th>$heading($fields['opt1'])</th>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -