Ignore:
Timestamp:
Jul 8, 2013, 12:44:10 AM (11 years ago)
Author:
chronos
Message:
  • Opraveno: Negenerovat síťové fronty u služeb bez přiřazené rychlosti.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php

    r548 r554  
    5858while($Member = $DbResult->fetch_assoc())
    5959{
    60   $Member['Name'] = RouterOSIdent($Member['Name'].'-'.$Member['Id'] );
    61 
    6260  $ServiceIndex = 1;
    6361  echo('Zákazník '.$Member['Name']."\n");
    64   $DbResult4 = $System->Database->query('SELECT `Service`.*, `ServiceCustomerRel`.`Id` AS `RelId` FROM `ServiceCustomerRel` JOIN `Service` ON `Service`.`Id` = `ServiceCustomerRel`.`Service` '.
    65     'WHERE (`ServiceCustomerRel`.`Customer` = '.$Member['Id'].') AND (`ServiceCustomerRel`.`Action` IS NULL)');
     62  $DbResult4 = $System->Database->query('SELECT `Service`.*, `ServiceCustomerRel`.`Id` AS `RelId` FROM `ServiceCustomerRel` '.
     63    'JOIN `Service` ON `Service`.`Id` = `ServiceCustomerRel`.`Service` '.
     64    'WHERE (`ServiceCustomerRel`.`Customer` = '.$Member['Id'].') AND (`ServiceCustomerRel`.`Action` IS NULL) '.
     65    'AND (`Service`.`InternetSpeedMax` > 0) AND (`Service`.`InternetSpeedMin` > 0)');
    6666  while($Service = $DbResult4->fetch_assoc())
    6767  {
    6868    echo('Služba '.$Service['Name'].': ');
     69    $MemberName = RouterOSIdent($Member['Name'].'-'.$Member['Id'].'-'.$ServiceIndex);
    6970    $SpeedIn = round($Service['InternetSpeedMin'] / $InDivider) * 1000;
    7071    $SpeedOut = round($Service['InternetSpeedMin'] / $OutDivider) * 1000;
     
    7374    if($ServiceIndex == 1)
    7475    {
    75       $ItemsQueue[] = array('name' => $Member['Name'].'-out', 'limit-at' => $SpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => 'main-out');
    76       $ItemsQueue[] = array('name' => $Member['Name'].'-in', 'limit-at' => $SpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => 'main-in');
     76      $ItemsQueue[] = array('name' => $MemberName.'-out', 'limit-at' => $SpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => 'main-out');
     77      $ItemsQueue[] = array('name' => $MemberName.'-in', 'limit-at' => $SpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => 'main-in');
    7778    }
    7879
     
    104105        $Subnet = $IPParts[2];
    105106        $PacketMark = GetMarkByComment($Name.'-out');
    106         $ItemsQueue[] = array('name' => $Name.'-out', 'limit-at' => $HostSpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => $Member['Name'].'-out', 'packet-mark' => $PacketMark);
     107        $ItemsQueue[] = array('name' => $Name.'-out', 'limit-at' => $HostSpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => $MemberName.'-out', 'packet-mark' => $PacketMark);
    107108        $PacketMark = GetMarkByComment($Name.'-in');
    108         $ItemsQueue[] = array('name' => $Name.'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $Member['Name'].'-in', 'packet-mark' => $PacketMark);
     109        $ItemsQueue[] = array('name' => $Name.'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $MemberName.'-in', 'packet-mark' => $PacketMark);
    109110      }
    110111    }
     
    118119      $SubnetNumber = $IPParts[2];
    119120      $PacketMark = GetMarkByComment($Subnet['Name'].'-out');
    120       $ItemsQueue[] = array('name' => $Subnet['Name'].'-out', 'limit-at' => $HostSpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => $Member['Name'].'-out', 'packet-mark' => $PacketMark);
     121      $ItemsQueue[] = array('name' => $Subnet['Name'].'-out', 'limit-at' => $HostSpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => $MemberName.'-out', 'packet-mark' => $PacketMark);
    121122      $PacketMark = GetMarkByComment($Subnet['Name'].'-in');
    122       $ItemsQueue[] = array('name' => $Subnet['Name'].'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $Member['Name'].'-in', 'packet-mark' => $PacketMark);
     123      $ItemsQueue[] = array('name' => $Subnet['Name'].'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $MemberName.'-in', 'packet-mark' => $PacketMark);
    123124    }
    124125    echo("\n");
Note: See TracChangeset for help on using the changeset viewer.