This commit is contained in:
fbsanchez 2021-11-26 18:11:34 +01:00
parent ba8087f49b
commit 9c17625c77
6 changed files with 51 additions and 6 deletions

View File

@ -17,6 +17,16 @@ CREATE TABLE IF NOT EXISTS `tncm_snippet` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_firmware` (
`id` SERIAL,
`name` text,
`shortname` text,
`vendor` bigint(20) unsigned,
`models` text,
`path` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `talert_calendar` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',

View File

@ -4221,6 +4221,19 @@ CREATE TABLE IF NOT EXISTS `tncm_snippet` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_firmware`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_firmware` (
`id` SERIAL,
`name` varchar(255),
`shortname` varchar(255) unique,
`vendor` bigint(20) unsigned,
`models` text,
`path` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
@ -4246,9 +4259,9 @@ INSERT INTO `tncm_script` VALUES
(2,1,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show running-config
exit
'),
(3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'),
(4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'),
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'),
(6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
_DESTINATION_FILE_NAME_
show flash
reload
expect:confirm
y
config terminal
boot system _DESTINATION_FILE_NAME_');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6);
-- ----------------------------------------------------------------------
-- Table `talert_calendar`

View File

@ -4046,6 +4046,10 @@ function html_print_input_file($name, $return=false, $options=false)
if (isset($options['required'])) {
$output .= ' required';
}
if (isset($options['onchange'])) {
$output .= ' onchange="'.$options['onchange'].'"';
}
}
$output .= ' />';

View File

@ -568,7 +568,10 @@ function generalShowMsg(data, idMsg) {
failed = failed || data.error;
}
if (failed) text = data.error;
if (failed) {
title = "Error";
text = data.error;
}
if (idMsg == null) {
idMsg = uniqId();
@ -595,6 +598,7 @@ function generalShowMsg(data, idMsg) {
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "OK",
id: "general_message_ok",
click: function(e) {
if (!failed) {
$(".ui-dialog-content").dialog("close");

View File

@ -4170,3 +4170,16 @@ CREATE TABLE IF NOT EXISTS `tncm_snippet` (
`content` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_firmware`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_firmware` (
`id` SERIAL,
`name` text,
`shortname` text,
`vendor` bigint(20) unsigned,
`models` text,
`path` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -2774,8 +2774,9 @@ INSERT INTO `tncm_script` VALUES
(2,1,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show running-config
exit
'),
(3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'),
(4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'),
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
');
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'),
(6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
_DESTINATION_FILE_NAME_
show flash
reload
expect:confirm
y
config terminal
boot system _DESTINATION_FILE_NAME_');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6);
INSERT INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');