Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.package
Commits
22433a00
Commit
22433a00
authored
Sep 17, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix netreport trial bugs
parent
e37ab642
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
windows/netreport/netreport.py
windows/netreport/netreport.py
+2
-2
windows/netreport/src/netuse.c
windows/netreport/src/netuse.c
+18
-16
windows/scripts/slapos-configure.sh
windows/scripts/slapos-configure.sh
+3
-3
No files found.
windows/netreport/netreport.py
View file @
22433a00
...
@@ -141,11 +141,11 @@ class NetDriveUsageReporter(object):
...
@@ -141,11 +141,11 @@ class NetDriveUsageReporter(object):
def
insertUsageReport
(
self
,
monitor
,
start
,
duration
):
def
insertUsageReport
(
self
,
monitor
,
start
,
duration
):
q
=
self
.
_db
.
execute
q
=
self
.
_db
.
execute
for
r
in
monitor
.
usageReport
(
):
for
r
in
eval
(
monitor
.
netdrive_usage
()
):
q
(
"INSERT INTO net_drive_usage "
q
(
"INSERT INTO net_drive_usage "
"(config_id, domain_user, drive_letter, remote_folder, "
"(config_id, domain_user, drive_letter, remote_folder, "
" start, duration, usage_bytes )"
" start, duration, usage_bytes )"
" VALUES (?, ?, ?, ?, ?, ?)"
,
" VALUES (?, ?, ?, ?, ?, ?
, ?
)"
,
(
self
.
_config_id
,
r
[
0
],
r
[
1
],
r
[
2
],
start
,
duration
,
r
[
4
]
-
r
[
3
]))
(
self
.
_config_id
,
r
[
0
],
r
[
1
],
r
[
2
],
start
,
duration
,
r
[
4
]
-
r
[
3
]))
def
sendAllReport
(
self
):
def
sendAllReport
(
self
):
...
...
windows/netreport/src/netuse.c
View file @
22433a00
...
@@ -228,7 +228,7 @@ netuse_list_drive(PyObject *self, PyObject *args)
...
@@ -228,7 +228,7 @@ netuse_list_drive(PyObject *self, PyObject *args)
char
szRemoteName
[
MAX_PATH
];
char
szRemoteName
[
MAX_PATH
];
DWORD
dwResult
;
DWORD
dwResult
;
DWORD
cchBuff
=
MAX_PATH
;
DWORD
cchBuff
=
MAX_PATH
;
char
szUserName
[
MAX_PATH
];
char
szUserName
[
MAX_PATH
]
=
{
0
}
;
if
(
!
PyArg_ParseTuple
(
args
,
"|s"
,
&
servername
))
{
if
(
!
PyArg_ParseTuple
(
args
,
"|s"
,
&
servername
))
{
return
NULL
;
return
NULL
;
...
@@ -247,9 +247,11 @@ netuse_list_drive(PyObject *self, PyObject *args)
...
@@ -247,9 +247,11 @@ netuse_list_drive(PyObject *self, PyObject *args)
&
cchBuff
&
cchBuff
);
);
if
(
dwResult
==
NO_ERROR
)
{
if
(
dwResult
==
NO_ERROR
)
{
dwResult
=
WNetGetUser
(
"z:"
,
dwResult
=
WNetGetUser
(
drivename
,
(
LPSTR
)
szUserName
,
(
LPSTR
)
szUserName
,
&
cchBuff
);
&
cchBuff
);
if
(
dwResult
!=
NO_ERROR
)
snprintf
(
szUserName
,
MAX_PATH
,
"%s"
,
"Unknown User"
);
pobj
=
Py_BuildValue
(
"ssss"
,
pobj
=
Py_BuildValue
(
"ssss"
,
drivename
,
drivename
,
szRemoteName
,
szRemoteName
,
...
@@ -670,7 +672,7 @@ static PyMethodDef NetUseMethods[] = {
...
@@ -670,7 +672,7 @@ static PyMethodDef NetUseMethods[] = {
"When drive is an empty string, the system will automatically
\n
"
"When drive is an empty string, the system will automatically
\n
"
"assigns network drive letters, letters are assigned beginning
\n
"
"assigns network drive letters, letters are assigned beginning
\n
"
"with Z:, then Y:, and ending with C:
\n
."
"with Z:, then Y:, and ending with C:
\n
."
"For examples,"
"For examples,
\n
"
" mapNetDrive(r'
\\\\
server
\\
data')
\n
"
" mapNetDrive(r'
\\\\
server
\\
data')
\n
"
" mapNetDrive(r'
\\\\
server
\\
data', 'T:')
\n
"
" mapNetDrive(r'
\\\\
server
\\
data', 'T:')
\n
"
" mapNetDrive(r'
\\\\
server
\\
data', 'T:', r'
\\\\
server
\\
jack', 'abc')
\n
"
" mapNetDrive(r'
\\\\
server
\\
data', 'T:', r'
\\\\
server
\\
jack', 'abc')
\n
"
...
@@ -711,7 +713,7 @@ static PyMethodDef NetUseMethods[] = {
...
@@ -711,7 +713,7 @@ static PyMethodDef NetUseMethods[] = {
(
(
"userInfo()
\n\n
"
"userInfo()
\n\n
"
"Get the logon user information, return a tuple:
\n
"
"Get the logon user information, return a tuple:
\n
"
"(server, domain, user).
\n
"
"
(server, domain, user).
\n
"
)
)
},
},
{
NULL
,
NULL
,
0
,
NULL
}
{
NULL
,
NULL
,
0
,
NULL
}
...
...
windows/scripts/slapos-configure.sh
View file @
22433a00
...
@@ -218,7 +218,7 @@ function configure_section_re6stnet()
...
@@ -218,7 +218,7 @@ function configure_section_re6stnet()
csih_inform
" ovpnlog"
csih_inform
" ovpnlog"
csih_inform
" main-interface
${
slapos_ifname
}
"
csih_inform
" main-interface
${
slapos_ifname
}
"
csih_inform
" interface
${
slapos_ifname
}
"
csih_inform
" interface
${
slapos_ifname
}
"
echo
-e
"#
$subnet
\n
table 0
\n
log
${
_log_path
}
\n
ovpnlog"
\
echo
-e
"#
$subnet
\n
table 0
\n
ovpnlog"
\
"
\n
main-interface
${
slapos_ifname
}
\n
interface
${
slapos_ifname
}
"
\
"
\n
main-interface
${
slapos_ifname
}
\n
interface
${
slapos_ifname
}
"
\
>>
${
re6stnet_configure_file
}
>>
${
re6stnet_configure_file
}
fi
fi
...
...
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